Ulysses

General => Developers Corner => Topic started by: Doomed on February 16, 2017, 06:50:55 PM

Title: Team Spawning
Post by: Doomed on February 16, 2017, 06:50:55 PM
How would I go about adding a check to make sure an info_player_red or info_player blue exists on a given map? The gamemode can have 2 to 4 (red, blue, green or yellow) teams depending on the map and the way it is currently somebody may spawn on the green team although that team may not exist on that map.
Title: Re: Team Spawning
Post by: JamminR on February 17, 2017, 05:18:00 PM

From my understanding, spawn points are a 'class' of a map entity.
One way...
local red_spawns = ents.FindByClass( "info_player_red" )
local blue_spawns = ents.FindByClass( "info_player_blue" )
.. green ..
.. yellow ..

Then check if tables are empty.
Title: Re: Team Spawning
Post by: Doomed on February 17, 2017, 07:25:55 PM
thanks for reply, ya all i had to do was loop through the info_player_* ents.