Execute Function Before Match Begin

Discussions about Coding and Scripting
1337GameDev
Experienced
Posts: 85
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Execute Function Before Match Begin

Post by 1337GameDev » Thu Nov 05, 2020 11:20 pm

I am curious if there is a function that can be overridden in actor / another trick to run code before players spawn but the map / game is ready for players to begin.

This would be for a Mutator and Actor class, and if possible be independent of gametype.

Is this possible?

User avatar
sektor2111
Godlike
Posts: 5209
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Execute Function Before Match Begin

Post by sektor2111 » Fri Nov 06, 2020 5:34 am

Only DeathMatchPlus has "StartMatch" Coop SinglePlayer are not using this.

But in a map or a mod you can deploy some needs in PostBeginPlay or after a few ticks, or in whatever "auto state" after 0.1 seconds or... other conditions.

1337GameDev
Experienced
Posts: 85
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Execute Function Before Match Begin

Post by 1337GameDev » Fri Nov 06, 2020 5:58 am

Hmm, this seems to describe the chain of events, and their order:

https://wiki.beyondunreal.com/Legacy:Ch ... el_Startup

Looks like Actor.PreBeginPlay or GameInfo.InitGame is what I want.

User avatar
sektor2111
Godlike
Posts: 5209
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Execute Function Before Match Begin

Post by sektor2111 » Fri Nov 06, 2020 6:02 am

You are not having InitGame in Mutator.

PostBeginPlay or BeginPlay or PrebeginPlay - all of them might help here because they are happening before starting game.