Respawn scripting


(morphdoc) #1

Dear all,

Is it possible, through scripting, to set respawn at exactly the same point for both Allies and Axis, i.e. the both respawn at 20/40/00 seconds?


(RayBan) #2

i think so… ive done wierd things with the spawns… and im shure it can be done… or maybe im wrong… =P


(Mateos) #3

Simple: make the spawn time change to 1 second then to the desired time. Synced!


(morphdoc) #4

I mean, I dont want to have it exactly 20/40/00

I just want allies and axis spawn at the same time :stuck_out_tongue: but must be every 20 seconds


(Mateos) #5

Well if you wanted to have exactly 20/40/00 it would involve more maths; What I suggested will sync the spawn times when executed.


(ailmanki) #6

Isn’t that a simple server setting? Useralliedrespawntime or something? Kinda a mapconfig?


(ETJump-Zero) #7

No. It only sets the spawn time to the same value but the teams might still spawn at different times. Example: allies spawn at 25/45/05 axis spawn at 15/35/55.


(morphdoc) #8

Yea, I want them to spawn exactly at the SAME time…


(ailmanki) #9

But how does that work out? After warmup both teams have same time, they still spawn randomly the first time - and after always same delay?


(ETJump-Zero) #10

Yeah, figured. I don’t think it’s possible unless some mods (Silent?) have added it as a feature.

After warmup the next spawn might be in 5 seconds for allies and in 19 for axis.


(Micha) #11

I don’t think it’s possible because it get set in the mod itself.
The commands you need to look at are g_redlimbotime and g_bluelimbotime

/*
===================
G_ScriptAction_AxisRespawntime

  syntax: wm_axis_respawntime <seconds>
===================
*/
qboolean G_ScriptAction_AxisRespawntime( gentity_t *ent, char *params )
{
	char *pString, *token;

	if(level.testEndRound)
		return qtrue;
	pString = params;
	token = COM_Parse(&pString);
	if (!token[0]) {
		G_Error( "G_ScriptAction_AxisRespawntime: time parameter required
" );
	}

	if ( g_userAxisRespawnTime.integer )
		trap_Cvar_Set( "g_redlimbotime", va( "%i", g_userAxisRespawnTime.integer * 1000 ) );
	else
		trap_Cvar_Set( "g_redlimbotime", va( "%s000", token ) );

	return qtrue;
}

/*
===================
G_ScriptAction_AlliedRespawntime

  syntax: wm_allied_respawntime <seconds>
===================
*/
qboolean G_ScriptAction_AlliedRespawntime( gentity_t *ent, char *params )
{
	char *pString, *token;

	if(level.testEndRound)
		return qtrue;
	pString = params;
	token = COM_Parse(&pString);
	if (!token[0]) {
		G_Error( "G_ScriptAction_AlliedRespawntime: time parameter required
" );
	}

	if ( g_userAlliedRespawnTime.integer )
		trap_Cvar_Set( "g_bluelimbotime", va( "%i", g_userAlliedRespawnTime.integer * 1000 ) );
	else
		trap_Cvar_Set( "g_bluelimbotime", va( "%s000", token ) );

	return qtrue;
}

(Loffy) #12

On a sidenote: to maximize the probability of teams leaving the spawn area at a specific interval (for example, both axis and allied forces leave their spawns at the same time), you could work with mechanical solutions. Large doors that block the exit and open at a specific interval/time. It sucks to have to wait, I know. It was just an idea. We’re brainstorming :slight_smile:


(morphdoc) #13

Ok, I abandoned this idea, it is not worth it…

Also, what is the command in the script TO STOP OTHER RUNNING TRIGGER?

For example, I have a button that counts down 30 seconds and then ends the round. I want to have another button that stops this countdown.

Please, help!!


(stealth6) #14

[QUOTE=morphdoc;513674]Ok, I abandoned this idea, it is not worth it…

Also, what is the command in the script TO STOP OTHER RUNNING TRIGGER?

For example, I have a button that counts down 30 seconds and then ends the round. I want to have another button that stops this countdown.

Please, help!![/QUOTE]

Just check a variable every second?

When you press the other button change the variable & restart counter.


(morphdoc) #15

[QUOTE=stealth6;513677]Just check a variable every second?

When you press the other button change the variable & restart counter.[/QUOTE]

Wow…this sounds like the right answer, but I still don’t know what you mean :stuck_out_tongue:

Do you have an example script? I use previous scripts as an example.