03-07-2010, 03:48 AM | #1 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
Teamspawns won't work.
I have a collection which I will store players names in as the game progresses. I have two spawns for each team. One spawn is a regular spawn and the other is a special spawn. They work so that if you're in the collection, you spawn in the special spawn. If you're not in the collection, you default to the regular spawn. Here's the code:
Code:
acollection = Collection() regularspawn = info_ff_teamspawn:New({}) specialspawn = info_ff_teamspawn:New({}) function regularspawn:validspawn(spawn, player) if(acollection:HasItem(player)) then return false end return true end function specialspawn:validspawn(spawn, player) if(acollection:HasItem(player)) then return true end return false end |
|
03-07-2010, 04:41 AM | #2 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
1) new({}) might need to be lowercase.
2) You need to add the functions as "members" of the spawns. 3) Name the variable that holds the function "validspawn" I forget exactly how to reference a function, but it might be something like this: Code:
specialspawn = info_ff_teamspawn:new({ validspawn = specialspawn:validspawn }) Code:
spawn_thing = info_ff_teamspawn:new({ validspawn = function(self,player) if condition then return true end return false end })
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington Last edited by squeek.; 03-07-2010 at 04:43 AM. |
|
03-07-2010, 04:05 PM | #3 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
I tried both referencing (it requires parenthesizes) and the following. The spawns are correctly named in Valve Hammer, yet the game completely ignores the coding for spawns and places the player at random. I don't get any ConsoleToAll returns.
Code:
SpecialSpawn = info_ff_teamspawn:new({ validspawn = function(self, player) ConsoleToAll('SpecialSpawn call') if(acollection:HasItem(player)) then return true end return false end }) |
|
03-07-2010, 08:47 PM | #4 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Try moving it up to the top of the lua or something. Sometimes certain lua errors don't report in the console but will nullify any code below them.
__________________
#FF.Pickup ¤ Fortress-Forever pickups My Non-official Maps Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic Beta FF_Myth - FF_Redlight_Greenlight Sick of the people on the internet, always moanin'. They just moan. - Karl Pilkington |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|