Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 03-03-2008, 02:53 AM   #41
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Oops. Add this at the top:
Code:
playerStateTable = {}
Knew I was gonna forget it, and I did.

Edited the other post with this change.
__________________
#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
squeek. is offline   Reply With Quote


Old 03-03-2008, 07:20 PM   #42
DD`
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Great work on the auto restock squeek, love it. Can see it being used it alot of future skills maps.
DD` is offline   Reply With Quote


Old 03-03-2008, 09:48 PM   #43
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
any luck with the gas for rock2?
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 03-03-2008, 09:53 PM   #44
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Quote:
Originally Posted by GambiT
any luck with the gas for rock2?
Will try it out now. What exactly do you want to happen? It's been so long since I was gassed in rock2.

How much damage per second? Length? Etc?
__________________
#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
squeek. is offline   Reply With Quote


Old 03-03-2008, 10:15 PM   #45
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
um...i dont want it to be instant, once capped count down from 10(with visual countdown on screen), then the gas comes and once it starts i want it to start hurting ppl, then after 2/3 seconds i want them dead. so you can set the damage how ever you want over the period of 2/3 seconds. then i want the gas to fade out.

this is assuming that it is possible.
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 03-03-2008, 10:19 PM   #46
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Quote:
Originally Posted by GambiT
um...i dont want it to be instant, once capped count down from 10(with visual countdown on screen), then the gas comes and once it starts i want it to start hurting ppl, then after 2/3 seconds i want them dead. so you can set the damage how ever you want over the period of 2/3 seconds. then i want the gas to fade out.

this is assuming that it is possible.
Yeah, it's possible. Give me a bit. I'll edit this post when I get it ready.
__________________
#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
squeek. is offline   Reply With Quote


Old 03-05-2008, 08:44 AM   #47
Lt Llama
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Dear LUD's!

I got 2 problems I can't seem to figure out with the quad lua:
1. How do I know when a player goes spectator?
function player_spawn( player_entity ) doesnt work for that as you don't "spawn" as spectator. Is there a forward to see when someone changes to spectator? I need it to remove the custom quad hud icon for specs.

2. The hud icon use a vtf and a vmt file but I can't get them to upload to the clients. The res file looks like this:

Code:
"resources"
{
    "maps/conc_adam.bsp"	"file"
    "maps/conc_adam.txt"	"file"
    "maps/conc_adam.lua"	"file"
    "materials/vgui/hud_quad.vtf"	"file"
    "materials/vgui/hud_quad.vmt"	"file"
}
I can't find any lua that uploads custom icons, so there is no examples.
I know, maybe I should pick another folder than materials/vgui as thats the main mod folder. I will change that. How do you precache custom content like this?

base_quad.lua

Code:
-- base_quad.lua

----------------------------------------------------------------------
-- Quad icon
----------------------------------------------------------------------

hudicon = "hud_quad"
hudx = 5
hudy = 110
hudw = 48
hudh = 48
huda = 1
hudstatusicon = "hud_quad.vtf"

----------------------------------------------------------------------
-- Set hud icon at spawn
----------------------------------------------------------------------

function player_spawn( player_entity )
	local player = CastToPlayer( player_entity )
	local class = player:GetClass()
    	if class == Player.kSoldier or class == Player.kDemoman then
	    if player:GetTeamId() ~= Team.kRed then
		RemoveHudItem( player, hudstatusicon )
	    else
		AddHudIcon(player, hudicon, hudstatusicon, hudx, hudy, hudw, hudh, huda)
	    end
	else
	    RemoveHudItem( player, hudstatusicon )
	end
end

----------------------------------------------------------------------
-- Set quad and invul when damage is taken by soldier and demoman
-- on red team
----------------------------------------------------------------------

function player_ondamage( player, damageinfo )
    if player:GetTeamId() ~= Team.kRed then return end
    local class = player:GetClass()
    if class == Player.kSoldier or class == Player.kDemoman then
	local damageforce = damageinfo:GetDamageForce()
	damageinfo:SetDamageForce(Vector( damageforce.x * 4, damageforce.y * 4, damageforce.z * 4))
	damageinfo:SetDamage( 0 )
    end
end
__________________
http://www.signaturebar.com/uploads/images/50033.png
Lt Llama is offline   Reply With Quote


Old 03-07-2008, 12:28 AM   #48
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
1. try function player_switchteam (player_entity, curteam, newteam)

You'll have to find out which value stands for spectator (my guess would be 4) and test newteam for that value. There might be problems if the player tries to change to spectator but can't (like if the server won't allow it), so look out for that.

2. Have you tried using bspzip instead?
Crazycarl is offline   Reply With Quote


Old 03-07-2008, 06:34 AM   #49
Lt Llama
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Thx Crazycarl. I'll test player_switchteam.

The problem with precaching was simple: Just add the damn files you want to upload to the server . I was so sure they where there, but I had them on a test server, not the main pub server. Ok, Muleh, time for a comment I think :P

Last edited by Lt Llama; 03-07-2008 at 07:39 AM.
Lt Llama is offline   Reply With Quote


Old 12-31-2009, 06:35 AM   #50
GenghisTron
AKA LittleAndroidMan
D&A Member
Beta Tester
 
GenghisTron's Avatar
 
Join Date: Sep 2007
Location: Dystopia
Class/Position: Demo/Medic
Gametype: CTF
Affiliations: [TALOS] [SR]
Posts Rated Helpful 11 Times
I need a way to instantly return the flag after it hits an ff_trigger. Brownies to whoever can help, this is the last thing I need to release my map!
__________________
GenghisTron is offline   Reply With Quote


Old 12-31-2009, 06:40 AM   #51
GenghisTron
AKA LittleAndroidMan
D&A Member
Beta Tester
 
GenghisTron's Avatar
 
Join Date: Sep 2007
Location: Dystopia
Class/Position: Demo/Medic
Gametype: CTF
Affiliations: [TALOS] [SR]
Posts Rated Helpful 11 Times
And yea, I necro'd a nearly 2 year old thread. Whatcha gonna do?

__________________
GenghisTron is offline   Reply With Quote


Old 12-31-2009, 07:32 AM   #52
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Quote:
Originally Posted by GenghisTron View Post
I need a way to instantly return the flag after it hits an ff_trigger. Brownies to whoever can help, this is the last thing I need to release my map!
Good news! It's not possible (it was actually bad news).

Having info_ff_scripts trigger triggers is something that has always been planned but never actually done. Not really sure of its status now.

If you're really crazy, you can do something like check the flag's origin every x seconds to see if it is in some specific bounds, but, yeah, triggers will just ignore the flag.
__________________
#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.; 12-31-2009 at 07:33 AM.
squeek. is offline   Reply With Quote


Old 12-31-2009, 07:34 AM   #53
GenghisTron
AKA LittleAndroidMan
D&A Member
Beta Tester
 
GenghisTron's Avatar
 
Join Date: Sep 2007
Location: Dystopia
Class/Position: Demo/Medic
Gametype: CTF
Affiliations: [TALOS] [SR]
Posts Rated Helpful 11 Times
Damn
__________________
GenghisTron is offline   Reply With Quote


Old 12-31-2009, 07:42 AM   #54
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
Quote:
Originally Posted by squeek. View Post
Good news! It's not possible (it was actually bad news).
lmfao!!
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:
Dr.Satan is offline   Reply With Quote


Old 12-31-2009, 07:44 AM   #55
GenghisTron
AKA LittleAndroidMan
D&A Member
Beta Tester
 
GenghisTron's Avatar
 
Join Date: Sep 2007
Location: Dystopia
Class/Position: Demo/Medic
Gametype: CTF
Affiliations: [TALOS] [SR]
Posts Rated Helpful 11 Times
Ok, well now I have another problem.

I added the remove_projectile lua from this thread to my lua, and it breaks my lua for some reason. It allows me to select a team, but now there's 4 teams instead of 2, and all the class choices are blacked out. Just like when you load up a map with no game type in the lua. All I have in there is base_ctf lua, and then the SetVelocity lua you gave me for my ramps.

Code:
IncludeScript("base_ctf");

------------------------------------------
-- jump triggers
------------------------------------------
base_jump = trigger_ff_script:new({ pushx = 0, pushy = 0, pushz = 0 })

-- push people when they touch the trigger
function base_jump:ontouch( trigger_entity )
	if IsPlayer( trigger_entity ) then
		local player = CastToPlayer( trigger_entity )
		
		player:SetVelocity( Vector( self.pushx, self.pushy, self.pushz ) )
	end
end

-- blueside red ramp
rredjump = base_jump:new({ pushx = -1500, pushy = -1500, pushz = 0  })

--blueside blue ramp
rbluejump = base_jump:new({ pushx = 1500, pushy = 1500, pushz = 0  })

--redside red ramp
lbluejump = base_jump:new({ pushx = -1500, pushy = 1500, pushz = 0  })


--redside blue ramp
lredjump = base_jump:new({ pushx = 1500, pushy = -1500, pushz = 0  })

------------------------------------------
-- remove projectiles (Thanks squeek)
-- http://forums.fortress-forever.com/showthread.php?t=19904
------------------------------------------

remove_projectiles = trigger_ff_script:new({ })

function remove_projectiles:allowed(allowed_entity)
	if IsNotProjectile(allowed_entity) then
		return false
	end
	return true
end

function IsNotProjectile( allowed_entity )
	return IsPlayer(allowed_entity) || IsGrenade(allowed_entity) || IsTurret(allowed_entity) || IsDispenser(allowed_entity) || IsSentrygun(allowed_entity) || IsDetpack(allowed_entity)
end
I tested my map by taking out the remove projectiles lua, and it worked fine. Once I put it back in, it screwed up. Same compile, same everything.
__________________
GenghisTron is offline   Reply With Quote


Old 12-31-2009, 07:46 AM   #56
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
"||" is not an operator in lua. It's "or".

Code:
function IsNotProjectile( allowed_entity )
	return IsPlayer(allowed_entity) or IsGrenade(allowed_entity) or IsTurret(allowed_entity) or IsDispenser(allowed_entity) or IsSentrygun(allowed_entity) or IsDetpack(allowed_entity)
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
squeek. is offline   Reply With Quote


Old 12-31-2009, 07:48 AM   #57
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Also, the console will report lua errors (if you're on a local server). If the 4-teams-of-death show up, the console will almost always have some sort of lua error near where it loads the lua files.
__________________
#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.; 12-31-2009 at 07:48 AM.
squeek. is offline   Reply With Quote


Old 12-31-2009, 07:51 AM   #58
GenghisTron
AKA LittleAndroidMan
D&A Member
Beta Tester
 
GenghisTron's Avatar
 
Join Date: Sep 2007
Location: Dystopia
Class/Position: Demo/Medic
Gametype: CTF
Affiliations: [TALOS] [SR]
Posts Rated Helpful 11 Times
Works perfectly, thanks!
__________________
GenghisTron is offline   Reply With Quote


Old 03-29-2010, 07: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 07:33 PM.
VEXEMP is offline   Reply With Quote


Old 03-30-2010, 01:06 AM   #60
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
Quote:
Originally Posted by VEXEMP View Post


-- 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 })

--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

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 = # })

-- 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
Just moved the spawn1...spawn4 declarations below the validspawn stuff. They needs to be declared last so they can inherit that function.

Also, instead of
Quote:
local num = spawnnumber
local nextnum = num + 1
spawnnumber = nextnum
You could just do
Quote:
spawnnumber = spawnnumber + 1
Crazycarl is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:37 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.