Modme Forums

[HELP] Delay The Round Start

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: MJPW

Hi I was looking to see if there is a certain part of the scripts where I could put in a "wait" for a few seconds to play a audio quote.


ModmeBot:

Reply By: natesmithzombies

This one is not very intuitive and its untested so you'll have to let me know if it works out:

1) Add this to the bottom of your mapname.gsc:

function delay_round_start()
{
	sound_ent = spawn( "script_origin", (0,0,0) ); 
	sound_ent PlaySound( "2d_sound_alias_here" ); // change to your 2D sound alias
	
	wait(10); // change this to whatever the length of your sound alias is
	sound_ent delete(); 
	
	if( !IS_TRUE( level.sndMusicSpecialRound ) )
			{
				if( IS_TRUE(level.sndGotoRoundOccurred))
					level.sndGotoRoundOccurred = false;
				else if( level.round_number == 1 )
					level thread zm_audio::sndMusicSystem_PlayState( "round_start_first" );
				else if( level.round_number <= 5 )
					level thread zm_audio::sndMusicSystem_PlayState( "round_start" );
				else
					level thread zm_audio::sndMusicSystem_PlayState( "round_start_short" );
			}
	zm::round_one_up();
level.zombie_round_change_custom = undefined; 
}



2) Then in your function main add this line:

level.zombie_round_change_custom = &delay_round_start;


ModmeBot:

Reply By: MJPW

Tried it out and it DOES work but its working for every round. Forgive me I might need to clarify that it only needs to happen at the start of the game.


ModmeBot:

Reply By: natesmithzombies

MJPW

Tried it out and it DOES work but its working for every round. Forgive me I might need to clarify that it only needs to happen at the start of the game.

I added a line in the code, let me know if it works the way you want now.


ModmeBot:

Reply By: MJPW

That did it! You are a genius :D


ModmeBot:

Reply By: natesmithzombies

MJPW

That did it! You are a genius :D

I wouldn't go that far lol. Glad to see its working :)


ModmeBot:

Reply By: MinePro14

natesmithzombies
MJPW

That did it! You are a genius :D

I wouldn't go that far lol. Glad to see its working :)

where you learned all these scripting??


ModmeBot:

Reply By: TCM
Didn't mean to bring a thread from the dead just wanted to help as I found and added this to mine the other day

To add a delay just add this

zombie_utility::set_zombie_var( "game_start_delay", 				60,		false,	column );


Just replace the 60 with whatever you would like the game should do the rest.


ModmeBot:

Reply By: Harry Bo21

TCM
Didn't mean to bring a thread from the dead just wanted to help as I found and added this to mine the other day To add a delay just add this zombie_utility::set_zombie_var( "game_start_delay", 60, false, column ); Just replace the 60 with whatever you would like the game should do the rest.

make sure to add 'under' zm_usermaps::main(); in mapname gsc, if you do it above, itll get changed back

also

#using scripts\shared\ai\zombie_utility;


ModmeBot:

Reply By: TCM

Harry Bo21
TCM Didn't mean to bring a thread from the dead just wanted to help as I found and added this to mine the other day To add a delay just add this zombie_utility::set_zombie_var( "game_start_delay", 60, false, column ); Just replace the 60 with whatever you would like the game should do the rest. make sure to add 'under' zm_usermaps::main(); in mapname gsc, if you do it above, itll get changed back also #using scripts\shared\ai\zombie_utility;

Yes sorry forgot to add that +1