multiple spawn areas
Post Reply
Quote
Re: multiple spawn areas
Posted by Liberal.Nyulism on Mon Feb 21st at 6:40pm 2005


Is there a way to have mutiple sets of spawns?

For example, 10% of the time, I'd like to have an alternate set of spawn points for the CT's. I just can't see how to enable or disable spawn points.





Quote
Re: multiple spawn areas
Posted by Rof on Mon Feb 21st at 7:38pm 2005


I believe, though I haven't actually tested, that info_player_* entites can take "Enable" and "Disable" inputs. However the .fgd files don't contain these commands, so you'll have to enter them manually on the output tab. Also, you'll have to enter a name for the spawnpoint manually (turn off smartedit).

If you run a map after entering "developer 2" in the console, you'll see all the entity i/o messages and it'll tell you if there's an unhandled input.

So make an info_player_counterterrorist
Turn off smartedit, and add a property: targetname ctspawn

Make a func_button or something and add an output:
Output: OnPressed
target: ctspawn
Input: Disable (you'll have to type this in manually, and it'll probably show up red)

Compile that.

Now turn on developer 2, load the map, spawn and try pressing the button. If it doesn't work, you should see an error printed at the top of the screen or in the console.

If that seems to work, kill yourself and see if you can respawn at the CT spawnpoint.

You can also try adding another spawnpoint that you can enable with the press of a button, and see if that works also.
[addsig]




Quote
Re: multiple spawn areas
Posted by French Toast on Mon Feb 21st at 8:53pm 2005


Or if you say, make more spawn points then players on a team, then you will cycle through the various points, thus a small amount of the time you will end up in said area. [addsig]



Quote
Re: multiple spawn areas
Posted by Rof on Tue Feb 22nd at 4:34am 2005


OK, forget what I said above. I tried it and it doesn't work at all.

Instead, have a look at this example:
www.gci-net.com/users/k/knot/misc/spawn.zip

The map has two CT spawn points, one at the bookcase and one at the painting. When you press the orange button at the far end, it toggles on and off orange boxes (just func_brushes) over the spawnpoints.

You can kill yourself by jumping into the hazard-striped marked area. Note that, as a CT, you'll never spawn at whichever spawnpoint has the orange box on it (because the box blocks the spawnpoint).

So, all you have to do is make it more subtle (just have the blocker func_brush look like a piece of raised ground that appears over the spawnpoints), and use some other logic to turn on and off the func_brushes, and you can have alternate spawn areas.

Of course you can have one box covering a bunch of spawnpoints to enable/disable multiple spawnpoints at a time.
[addsig]




Quote
Re: multiple spawn areas
Posted by Joe-Bob on Tue Feb 22nd at 4:48am 2005


Look at the Team Deathmatch tutorial.
If I wanted to do this with my CT team, for example, I would do something like that tutorial. However, don't do any filtering. Also, one of those teleport triggers should start deactivated.
Whenever I want to switch the spawn point, I would trigger all of the old teleports to deactivate, and all of the new ones to activate.




Quote
Re: multiple spawn areas
Posted by Liberal.Nyulism on Tue Feb 22nd at 5:15am 2005


Wow. Thanks. Two really good ideas.

I'll give them a try. Thanks again.

This board is great. I couldn't have done my map without it.






Post Reply