07-17-2009, 01:16 AM | #1 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
Multiple Respawns help
Hello;
I'm working on a remake of K_thegame an escape style map. I'm having trouble with creating triggerd respawns. In the original tfc k_thegame,When you join the game you respawn.In a dark room while being inerigated.For about 30 seconds,Then you automaticly respawn into another room.Where the game starts.As you get to another level in the map.Theres a trigger that triggers a new respawn at that point. I've tryed looking at the LUA file for dustbowl.And used some of the codes.But I just can't figure it out. Im 90% done with the constrution of the map.But this respawn issue is important. Any help would be great Last edited by VEXEMP; 07-17-2009 at 01:21 AM. Reason: new title |
|
07-17-2009, 02:00 AM | #2 |
G9-
D&A Member
Join Date: Sep 2007
Location: Florida
Class/Position: D Solly,Engy Gametype: ALL Posts Rated Helpful 0 Times
|
woohoo K-TheGame 12pack you rock man
Last edited by EquilibriuM; 07-17-2009 at 02:00 AM. |
|
07-17-2009, 06:18 AM | #3 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
So, should every player who enters the server spawn in the interrigation room, or does this only happen in the first 30 seconds?
Code:
--First you create a type of spawn point. --The entity must have the same name in Hammer. initialspawn = info_ff_teamspawn.new({}) --then create the logic to decide who can spawn there function initialspawn:validspawn(spawn, player) --return true here to make the spawn available. --or... --return false here to make it off-limits. end If you want the spawn to enable for the whole server, make a global variable, such as spawn_number = 1. Then test it inside the validspawn() function. If you want to set valid spawn points for individual players, you will have to make a list of all players who are allowed to spawn there. Then, when a player wants to spawn, cycle through the list to see if they are there. |
|
07-17-2009, 05:52 PM | #4 |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
are you meaning that you want to spawn at one location first...and then IF you pass a certain point they spawn somewhere else or WHEN they pass a certain point?
If it's when then you can just do it with teleports...and logic_case(s) for multiple resups. If you need an example of that lemme know and I'll whip something up for you If you mean like IF they pass x point then IF they die or something they spawn somewhere new then I think you would need something like this(click) * you'll need to make a new brush based trigger at each objective point and name it resup_# starting with 0 and going sequentially up * then name your trigger_ff_teamspawns spawn_# starting with 0 and going sequentially up * I pretty much pulled that code outta my ass though so it's untested, but should work. Carl can you check that out and see if it's right? *
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
07-17-2009, 07:06 PM | #5 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
So, should every player who enters the server spawn in the interrigation room, or does this only happen in the first 30 seconds?
This only happens in the first 30 seconds.After that the interrigation room respawn is disabled. In this escape style map theres only 1 team and 1 class. {team yellow} {class civillian}. Basicly when 2 player join the map as it starts they automaticly spawn in the interrigation room,Where they cant move.And are interrigated for 30 seconds. Then a voice says lets get out of here.Then every one automaticly spawns into the dungen room,Where the game starts.Now say a third player joins the game they will now respawn in to the dungen room. So if a player dies,they will respawn in the dungen room. As the players get to the next level/cargo bay room,They trigger the next respawns.In the cargo bay room. And the dungen room respwans gets disabled,Now say a forth player joins the game they will respawn in the cargo bay room.And when a player dies they will now respawn in the cargo bay room. I believe the spawns would be global.Once a triggerd, at a level there will only be 1 respawns that will work for the hole team.Until the next level respawns are activated. To break it down the first respawn would use the logic entity with a timmer. The other respwans would use a trigger. Heres what the LUA file looks like now. -- ff_k_thegameb1.lua ----------------------------------------------------------------------------- -- includes ----------------------------------------------------------------------------- IncludeScript("base_teamplay"); IncludeScript("base_location"); IncludeScript("base"); ----------------------------------------------------------------------------- -- global overrides ----------------------------------------------------------------------------- function startup() -- set up team names SetTeamName( Team.kBlue, "NONE" ) SetTeamName( Team.kRed, "NONE" ) SetTeamName( Team.kYellow, "NONE" ) SetTeamName( Team.kGreen, "WORKERS" ) -- set up team limits SetPlayerLimit( Team.kBlue, -1 ) -- NONE. SetPlayerLimit( Team.kRed, -1 ) -- NONE. SetPlayerLimit( Team.kYellow, -1 ) -- NONE. SetPlayerLimit( Team.kGreen, 0 ) -- THE WORKERS 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 I just need to know where the code goes. Thanks for the quick replay Crazycarl and Dr.Satan [are you meaning that you want to spawn at one location first...and then IF you pass a certain point they spawn somewhere else or WHEN they pass a certain point?] The respawns are for the hole team Like in dustbowl whe a team captures the flag both teams respwan to the next level. Inthis map the team respawns in the location where it was triggerd. Teleport will not work because of the many player would just fuse together. I believe the original Auther made it this way because of the large area that a player would have to go through every time they died. To have to start at the beging of the map every time they died would get boreing after a few attempts. 80% of the classis TFC escape maps use the multiple respawns. Last edited by VEXEMP; 07-17-2009 at 07:20 PM. Reason: spelling |
|
07-17-2009, 08:09 PM | #6 | |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
Quote:
For what you want, this should work(click) * just make a brush based trigger named waypoint anywhere you want to change the spawn points * name your spawns initialspawn for your first and spawn# going up sequentially, and starting with 1, for all the rest. Sooo all together your .lua should look like this(click) again I could be wrong, I tend to miss little shit sometimes on my .lua's, but test it out and see...or wait til Carl jumps back on and I'm sure he'll tell you if I messed up * also when copying from privatepaste, make sure you click the copy content button FIRST or you'll get wierd shit going on there.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard Last edited by Dr.Satan; 07-17-2009 at 08:12 PM. Reason: adding in the full script |
|
|
07-18-2009, 04:11 AM | #7 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Only found a few bugs in your code this time, Dr.S. I added a schedule for the initial 30 seconds as well as the code to respawn all players. http://privatepaste.com/691PNQIyOc
|
|
07-18-2009, 03:42 PM | #8 |
Wiki Team
Fortress Forever Staff Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly Gametype: PAYLOAD Affiliations: DET- Posts Rated Helpful 19 Times
|
lol thanks Carl!
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf (Beta) alchimy_b1 (Lua) base_payload_2015 (Models) props_trainyard |
|
07-20-2009, 08:07 AM | #9 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
Thanks again for the help.
Ok i tryed all the codes,And they did'nt work. when i join the map It shows all 4 teams and i cant join any of them.So theres some conflict.This is what happend to me when i first started with the lua file. About 100 times before i finnaly got it to work lol. I tryed tweeking the codes.With no luck, I tryed some of the code from the base.lua file,And was able to join the map.But the respawn set up dosent work. Im still trying to get the hang of this so bare with me. I created 2 respawns 1 in the intergation room and 1 in the dungen. I called the first 1 spawn0 and the other spawn1. Then i created a trigger_ff_script brush over the ff_info_teamspawn.And called it waypoint.And gave it the output to enable the logic_case Then i added a logic_case entity and added in the first line spawn0.Im not sure if thats how its done.Considdering theres no output settings for ff_info_teamspawn entity. I havent played k_thegame in years.So i got the bsp and tryed it.I was wrong about the triggers activateing the respawns.Buttons are what activate the new respawns. Except for the first respawn'When you join the game.That works with some trigger and timmer multi_mannager.In the interigation room.The rest are button triggered. Any way im standing by if youall can come up with a solution.Im stuck until i can figure this out. Thanks. |
|
07-21-2009, 06:37 AM | #10 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
When you get the "all 4 teams and you can't spawn" problem, it means there's a lua error. Go into the console. You will have an error message with a line number and everything. Post that here so we can find the problem.
Actually, I just found an error in the Lua I posted. Here's a new version. http://privatepaste.com/9a0BU4YpyB Don't put the waypoint on top of the spawns, put it at the end of the stage. Don't let any players touch the old waypoint after that stage has been beaten. Going from a trigger to a button is easy. Where you have Code:
waypoint = trigger_ff_script:new ({}) function waypoint:ontouch( 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 Code:
waypoint = func_button:new ({}) function waypoint:onIn( ) -- change the global spawnnumber local num = spawnnumber local nextnum = num + 1 spawnnumber = nextnum ApplyToAll({AT.kRespawnPlayers}) end |
|
08-06-2009, 03:22 AM | #11 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
The code worked.
Thanks again. Now i can finnish this map |
|
03-29-2010, 07:20 PM | #12 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
Hello.
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 07:22 PM. |
|
03-30-2010, 01:19 AM | #13 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
As I posted in the LAD thread, move the spawn1...spawn4 declarations down, below the validspawn function. I can't understand why it would work by yourself, but not on the server.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|