How to make the script start when the game begins not in WU


(-SSF-Sage) #1

I’m sorry to post this as I’m sure this has been posted a few times. However my searching results came with absolutely nothing useful. So here is the thing. I want a part of a script to start when the round begins and not while warmup. How does this happen? Forgive my stupidity. :?


(nUllSkillZ) #2

In Chruker’s Scripting Reference I’ve found:
abortifwarmup

Not sure how it works though.


(-SSF-Sage) #3

Thx for the reply. I wonder why I didn’t came up with checking out the scripting reference. It didn’t work when I set it at the start of the specific script. Btw. stock maps didn’t use this.


(Flippy) #4

Hmm I just saw I didn’t have that in my scripting reference in ETScript! Good to know :stuck_out_tongue:


(Miki) #5

in my map, he doensnt say that i have to destroy the objectives in the warmup (he does say it in the game). i never tried to destroy an objective in warmup, since its longer then 30 sec to run to the first objective, and then you need dynamite so… maby i should put warmup-time on 10 min and check it out :wink:


(-SSF-Sage) #6

Hmm. In goldrush the sounds doesn’t start at the warmup. (Steal the tank, construct the command post…) I checked at the script, it didn’t have any extra things that I possibly find, it was simply set on game_manager’s spawn. I also search from the goldrush.sound if it sets some values to it. However I tried similar stuff in my script, still couldn’t get it work. :frowning:


(Loffy) #7

Here is a cool thing you can do in ET scripting with the g_gametype command (from the map "Dom_Loffys_Madness_b3):



game_manager // Start game_manager-section
{
	spawn // Start spawn section in game_manager
	{
		// Set game type:
		cvar g_gametype trigger_if_equal 2 game_manager gtype2 // Game-type 2 initiated: Single map.
		cvar g_gametype trigger_if_equal 3 game_manager gtype3 // Game-type 3 initiated: Stop-Watch.
		cvar g_gametype trigger_if_equal 4 game_manager gtype4 // Game-type 4 initiated: Campaign.
	} // End spawn section in game_manager


	trigger gtype2
	{
		wm_announce   "^3Console: Game-type 2 initiated: Single map."
		wm_announce   "^3Console: Straight into battle on a single map, instead of playing a number of maps in a campaign."
	}

	trigger gtype3
	{
		wm_announce   "^3Console: Game-type 3 initiated: Stop-Watch."
		wm_announce   "^3Console: Complete the map's mission objectives against the clock. The teams then swap sides."
	}

	trigger gtype4
	{
		wm_announce   "^3Console: Game-type 4 initiated: Campaign."
		wm_announce   "^3Console: Both teams battle across a series of maps. Rewards awarded will persist from map to map."
	}

} // End game_manager-section

And I am pretty sure these scripts are only run when the round begins (and not while warmup).

//Loffy


(-SSF-Sage) #8

Cool! Thank you very much! Looks promising! Didn’t know that there is stuff like this, I’ll try it as soon as I get home. Still I’m wondering why it doesn’t voiceannounce these things on warmup mode, since I couldn’t figure out what does the trick in grush.


(nUllSkillZ) #9

May be it’s coded.


(Flippy) #10

Does ET play voiceovers at all in warmup? Are you sure it’s only in goldrush? I can’t remember hearing them… but I haven’t played for a few months so :stuck_out_tongue:


(-SSF-Sage) #11

That is possible and I thought that too. I haven’t played much for a long time either. Haven’t even tj for a while. //ot


(-SSF-Sage) #12

I see that sounds aren’t played while warmup (voiceannounce). But normal announce is. I tried that script but no matter what it did execute at the warmup too.
Here is the part of the script.


game_manager
{
	spawn
	{
	cvar g_gametype trigger_if_equal 2 game_manager gtype2
    
	}
	
	
	trigger gtype2
	{
	wait 2000
    	wm_teamvoiceannounce 0 "sound/vo/general/axis/hq_objlost.wav"
	wm_teamvoiceannounce 1 "sound/vo/general/allies/hq_objsec.wav"
	wm_announce "aaaadddsd!"
	}
}

Announce was seen when warmup and round. THe sound did only when the round began.


(Flippy) #13

You’re still not using ‘abortifwarmup’?

Try this:

game_manager
{
   spawn
   {
        //Usual spawn stuff

        // At the end:
        abortifwarmup
        trigger announce
   
   }
   
   
   trigger announce
   {
   wait 2000
       wm_teamvoiceannounce 0 "sound/vo/general/axis/hq_objlost.wav"
   wm_teamvoiceannounce 1 "sound/vo/general/allies/hq_objsec.wav"
   wm_announce "aaaadddsd!"
   }
}

(-SSF-Sage) #14

I did try it and I tried it now. I got it work thanks. I found the problem! In my game_managers spawn:


trigger game_manager bla1
trigger game_manager bla2

now bla1 will get executed but bla 2 doesn’t! :S why is that?

If it’s like this:


trigger game_manager bla2
trigger game_manager bla1

now bla2 will get exed but bla1 won’t!!! Dammit. Why In the heck this goes like this???

Now when I had when testing:


abortifwarmup
trigger game_manager bla1
trigger game_manager bla2

or


trigger game_manager bla1
abortifwarmup
trigger game_manager bla2

Let’s pretend bla1 is something random stuff, and bla2 is the one I wanted to test for. In any situation bla2 didn’t get executed at all. :S When I remove that line for executing bla1, all worked as it should. Wierd. Thank you again for help! That’s why I didn’t find it working!


(murka) #15

it has happened to me too, many bugs with ET lol :stuck_out_tongue:


(C) #16

now bla1 will get executed but bla 2 doesn’t! :S why is that?

There are 2 routines bla1 & bla2… both triggered from another routine.
If the first routine to be called contains a wait statement, the second routine will not be executed.

This also happens when using a resetscript statement (which is basicly a wait 50 statement)

To demonstrate this behavior, take the following code:

game_manager
{
	spawn
	{
		trigger self routine1
		trigger self routine2
	}

	trigger routine1
	{
		wm_announce "ROUTINE 1"
		wait 50
	}

	trigger routine2
	{
		wm_announce "ROUTINE 2"
		wait 50
	}
}

The output will only be:
ROUTINE 1

Just take in mind, that a wait-statement breaks the “gosub” program-flow.

You should work-around this “feature” by packing all wait statements into 1 trigger-routine:

game_manager
{
	spawn
	{
		trigger self routine1
		wait 50
		trigger self routine2
		wait 50
	}

	trigger routine1
	{
		wm_announce "ROUTINE 1"
	}

	trigger routine2
	{
		wm_announce "ROUTINE 2"
	}
}

The output will be what You expect:
ROUTINE1
ROUTINE2

If You create complicated scripts, it may be more difficult to work-around this problem. It’s just the way ET works…

http://www.splashdamage.com/forums/viewtopic.php?t=16892&postdays=0&postorder=asc&start=15


(-SSF-Sage) #17

Hmm… Right thank you! Too bad it is already very very complicated while it’s not ready and the parts are “broken” to a many prefabs. I will have to excecute many triggers with a complicated long script in it.