ENABLE / DISABLE spaws

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

ENABLE / DISABLE spaws

Post by Alcoholic »

if i disable the spawns of the entire axis team, will the game just crash?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Na they will spawn at the info_player_start :?
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

aww crap...

can i disable that too? what would happen?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

They will spawn there regardless (unless you remove it with the remove command :))
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

then what happens to them?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think the game will crash with 'can't spawn player' but I'm not sure.
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

awwww crap. i wanted to know because i wanted to make it so that when this happens, axis cant spawn anymore. think of battlefield1942 when you have no more spawn flags. :D i guess ill just have to stick to making a "void" room in which they spawn into, then from there, i make a door that allows/denies them from re-entering the battle.
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Dude, real easy to do and you're on the right track. I've done it in the 'Gun Assault' map a mess of ways. In that one, spawners are turned on/off by switches in a particular sequence.

All you need is to have an event happen, blow up the truck, flip a switch, whatever...the typical 'spawner/bomber' stuff fixes that automatically for you via the game scripts. Outside of that you need to use these commands:
$targetname enablespawn or $targetname disablespawn (where $targetname is the entity name for EACH team spawner).

You have to have a trigger of some type, doesn't matter, and it is best to use a 'setthread' command to turn on/off the spawners.

Next, the game will not crash. . . nor will the team respawn at the player/info. If the Axis team is turned off, the dead players simply hang in limbo like in a ture OBJ map and wait until everyone dies. IF you are in DM mode, you will have to wait for the server to reset or for time to expire.

IF you want to do something like this, I suggest two things: first give each team a way to 'recapture' their spawner switch, or stick to making straight TOW or OBJ maps that have other 'win' options besides 'time/clock'. There's some other ways, but I'm keeping that to myself right now as I'm trying to pioneer this 'Dynamic TDM' style.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

Yeah... anyways I need it because the axis players spawn in a canyon pass, and they have to escape thru a checkpoint, and if the allies blow the pass, the axis can no longer respawn, so the remaining axis have to escape to win.
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Sounds like it would be best just to tie the spawners to the explosion and use the spawner/bomb setting like in stock maps, then end the map. If you're blocking the only escape route, you're gonna have to either open another, although difficult one or have a bunch of grenade chucking going on over the obstacle. Sorry, doesn't seem practical to me unless you can better explain it. Also, if you're NEVER going to reactivate the spawners, you could just use the 'remove' command.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

nonono theres a canyon pass and a checkpoint. axis spawn behind canyon pass and run thru it, and go to checkpoint. if allies bomb canyon pass, all dead axis cannot respawn, and the ones left alive must stay alive for timer to run out. all i need to know is if i disable all axis spawns, the dead axis cant respawn, but the allies still can?
Slyk
Lieutenant Colonel
Posts: 361
Joined: Sun Jul 14, 2002 12:42 am
Location: Elizabethtown, PA

Post by Slyk »

Right, when you 'disable' the spawns, they're off. Make sure that all of them share the same '$targetname' though.

Best way is to create one Axis spawn and name it something like:
key: $targetname
value: Axis_spawner

Copy it and paste as many as you need. Then in the thread that blows up the pass, add a line:
"$Axis_spawner disablespawn"
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

cool thanks.
Post Reply