Does anyone know how the objectives in a TOW map are disabled until at least 2 players, each on different teams have joined? The tutorial_tow file has the bombs disabled, but a player can go through and flip the switches before another player is in.
In the all of the actually TOW maps, the objectives are disabled until both teams have players. If you try to flip a switch before an opponent is in, nothing happens. I've gone through the level scripts, but I didn't see anything. I know how to disable stuff until the round starts, using level waittill roundstart, but that doesn't help if a single player has joined and started the round.
Anyone have any ideas?
Thanks a lot!
Sysquik
Disable objectives until 2 players have joined?
Moderator: Moderators
test
Here is a little test script you can run to find out.
main:
level waittill prespawn
iprintln "Prespawn check........"
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr mohdm1
level waittill spawn
iprintln "Spawn check........"
level waittill roundstart
iprintln "Roundstart check........"
end
//The text should show up on the left side of the screen.
main:
level waittill prespawn
iprintln "Prespawn check........"
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/ambient.scr mohdm1
level waittill spawn
iprintln "Spawn check........"
level waittill roundstart
iprintln "Roundstart check........"
end
//The text should show up on the left side of the screen.
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
level waittill spawn can be used in infinite threads, but not after a level waittill spawn, as you've already spawned
level waittill prespawn
thread 1
thread 2
thread 3
end
1:
level waittill spawn
//do stuff
end
2:
level waittill spawn
//do more stuff
end
3:
//do stuff before spawning
end
level waittill prespawn
thread 1
thread 2
thread 3
end
1:
level waittill spawn
//do stuff
end
2:
level waittill spawn
//do more stuff
end
3:
//do stuff before spawning
end
hope this helps, prob not cos it's all foreign 2 me :-/
-
nuggets
- General
- Posts: 1006
- Joined: Fri Feb 28, 2003 2:57 am
- Location: U-england-K (england in the UK) :P
- Contact:
you could create a loop to see if a person of a specific team is in there or a person of both teams are in,
thread player_count
end
player_count:
if ($player.size > 1) //if more than 1 player
{
level.allies = 0 //reset counters
level.axis = 0
for (local.i=1;local.<=$player.size;local.i++)
{
if ($player[local.i].dmteam == "allies") //if players team is allied
{level.allies++}
if ($player[local.i].dmteam == "axis") //if players team is axis
{level.axis}
}
}
//if (level.allies > 0) //if at least 1 ally
// if (level.axis > 0) //if at least 1 axis
if ((level.allies > 0) && (level.axis > 0) //if at least 1 ally AND 1 axis
// if ((level.allies > 0) || (level.axis > 0) //if at least 1 ally OR 1 axis
// just take out the slashes of the one you need and comment out the red line by inserting //
{
thread the_setup
end
}
else
{
wait 1
goto player_count
}
the_setup:
//do what you want here
end
thread player_count
end
player_count:
if ($player.size > 1) //if more than 1 player
{
level.allies = 0 //reset counters
level.axis = 0
for (local.i=1;local.<=$player.size;local.i++)
{
if ($player[local.i].dmteam == "allies") //if players team is allied
{level.allies++}
if ($player[local.i].dmteam == "axis") //if players team is axis
{level.axis}
}
}
//if (level.allies > 0) //if at least 1 ally
// if (level.axis > 0) //if at least 1 axis
if ((level.allies > 0) && (level.axis > 0) //if at least 1 ally AND 1 axis
// if ((level.allies > 0) || (level.axis > 0) //if at least 1 ally OR 1 axis
// just take out the slashes of the one you need and comment out the red line by inserting //
{
thread the_setup
end
}
else
{
wait 1
goto player_count
}
the_setup:
//do what you want here
end
hope this helps, prob not cos it's all foreign 2 me :-/

