View Single Post
Old 03-29-2010, 06:26 PM   #59
VEXEMP
 
Join Date: Sep 2007
Posts Rated Helpful 2 Times
Hello.

This is for K_thehame, Classic TFC escape style map.

Ive been testing the map.By my self.As i fiinish the map.All the respawns have worked perfect.

But when i uploaded the map on to the public server.And tested with a few players.The respawns went random.

So i changed a few things.But the outcome is the same.

When 1 player joins.The respawns work fine.If more then 2 players join the respawns go random.

It seems the initialspawn spawn.Is the one causing the problems.

When players join the map.They respawn in a room.Where theres an interigation.For about 62 seconds.Then all players automaticly respawn to the next room.Wich is dungen/holdingroom.Where the game begins.

TRIGGERS: In the interrogation room,I have The ff_script trigger called waypoint.Which is set as disabled.And a Trigger _once.

When a player joins.They trigger the Trigger_once.Which triggers the logic_timmer1.Once the logic_timmer kicks in.It plays the sounds/lights and Enables The ff_script called waypoint.And enables logic_timmer2.

Once logic_timmer2 kickes in.It plays the next effects sounds/lights.
Then All players should respawn to the dungen.Where the respawns are called spawn1.

In the interrogation room.The respawns are called initialspawn.

LOGIC_TIMMER: In the interrogation room I have 2 logic_timmers.
loggic_timmer1 and logic_timmer2.

Also In the interrogation room.I have a playerclip brush.Holding the players from moving.


Again when 1 player joins.Everything works fine.Only when 2 or more players join.Do the respawns go random.

Heres the lua.file


-- ff_k_thegameb2.lua

-----------------------------------------------------------------------------
-- includes
-----------------------------------------------------------------------------
IncludeScript("base_teamplay");
IncludeScript("base_location");
IncludeScript("base_respawnturret")
-----------------------------------------------------------------------------
-- global overrides
-----------------------------------------------------------------------------

function startup()

--62 seconds in the interrogation room!
AddSchedule("breakout", 62, setBreakoutSpawn)


-- set up team names
SetTeamName( Team.kBlue, "NONE" )
SetTeamName( Team.kRed, "NONE" )
SetTeamName( Team.kYellow, "NONE" )
SetTeamName( Team.kGreen, "SPYS" )

-- set up team limits
SetPlayerLimit( Team.kBlue, -1 ) -- NONE.
SetPlayerLimit( Team.kRed, -1 ) -- NONE.
SetPlayerLimit( Team.kYellow, -1 ) -- NONE.
SetPlayerLimit( Team.kGreen, 0 ) -- THE SPYS HAVE TO ESCAPE.

team = GetTeam( Team.kGreen )
team:SetClassLimit( Player.kScout, -1 )
team:SetClassLimit( Player.kSniper, -1 )
team:SetClassLimit( Player.kSoldier, -1 )
team:SetClassLimit( Player.kDemoman, -1 )
team:SetClassLimit( Player.kMedic, -1 )
team:SetClassLimit( Player.kHwguy, -1 )
team:SetClassLimit( Player.kPyro, -1 )
team:SetClassLimit( Player.kSpy, -1 )
team:SetClassLimit( Player.kEngineer, -1 )
team:SetClassLimit( Player.kCivilian, 0 )

end

-- first we need a global variable
spawnnumber = 0

--then you create a type of spawn point.
--The entity must have the same name in Hammer.
initialspawn = info_ff_teamspawn:new({ num = 0 })
spawn1 = initialspawn:new({ num = 1 })
spawn2 = initialspawn:new({ num = 2 })
spawn3 = initialspawn:new({ num = 3 })
spawn4 = initialspawn:new({ num = 4 })
-- keep going sequencially
--spawn# = initialspawn:new({ num = # })

--then create the logic to decide who can spawn there
function initialspawn:validspawn(spawn, player)
local num = self.num
if spawnnumber == num then
return true
else return false
end
end

-- finally we need a trigger to change the global
--Make SURE players can't touch any waypoint they've passed before.
waypoint = trigger_ff_script:new ({})
function waypointntouch( touch_entity )
if IsPlayer( touch_entity ) then
-- change the global spawnnumber
local num = spawnnumber
local nextnum = num + 1
spawnnumber = nextnum
ApplyToAll({AT.kRespawnPlayers})
end
end

-- finally we need a trigger to change the global
--Make SURE players can't touch any waypoint they've passed before.
waypoint2 = trigger_ff_script:new ({})
function waypoint2ntouch( touch_entity )
if IsPlayer( touch_entity ) then
-- change the global spawnnumber
local num = spawnnumber
local nextnum = num + 1
spawnnumber = nextnum
end
end

-- finally we need a trigger to change the global
--Make SURE players can't touch any waypoint they've passed before.
waypoint3 = trigger_ff_script:new ({})
function waypoint3ntouch( touch_entity )
if IsPlayer( touch_entity ) then
-- change the global spawnnumber
local num = spawnnumber
local nextnum = num + 1
spawnnumber = nextnum
end
end

-- finally we need a trigger to change the global
--Make SURE players can't touch any waypoint they've passed before.
waypoint4 = trigger_ff_script:new ({})
function waypoint4ntouch( touch_entity )
if IsPlayer( touch_entity ) then
-- change the global spawnnumber
local num = spawnnumber
local nextnum = num + 1
spawnnumber = nextnum
ApplyToAll({AT.kRespawnPlayers})
end
end


The map is 99% done. Just need to fix this respawn issue.

Thanks.

Last edited by VEXEMP; 03-29-2010 at 06:33 PM.
VEXEMP is offline   Reply With Quote