04-03-2010, 09:00 PM | #61 |
Join Date: Sep 2007
Posts Rated Helpful 2 Times
|
Thanks for reply.
I took the advice.And code.It dident work. The problem was the first waypoint. Seems when theres 2 players touching the waypoint.The lua.file.reads next respawn. Was ready to trash the map.Then looked at. http://www.fortress-forever.com/wiki...tegory:Mapping. So i removed the ff_scripts brush,From the holding sell.Where players spawnd. And used it onthe turret.Meaning the turret triggerrs the way point. And it worked. And changing the if IsPlayer( touch_entity ). To if IsTurret( touch_entity ). Thanks again for the input! If any one needs help with escapemaps let me know. Last edited by VEXEMP; 04-03-2010 at 09:02 PM. |
|
10-24-2010, 06:55 PM | #62 |
Jay|mOfO|Mills
Beta Tester
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches Posts Rated Helpful 8 Times
|
Bonus Point Triggers that disable after touch for 10 sec
Hello, I have a concmap I would like to release. I have some skill points that are trigger_ff_scripts. I would like it when any player passes through the trigger they get the points, then the trigger deactivates for say 10 seconds then reactivates....
Here is the code Bri was helping me with. basescoretrigger = info_ff_script:new({ canscore = true, score = 0, }) function basescoretrigger:reallowscoring() self.canscore = true end function basescoretriggerntouch(touch_entity) if IsPlayer(touch_entity) then local player = CastToPlayer(touch_entity) if self.canscore then player:AddFortPoints(self.score, "You have been awarded some points.") BroadCastMessageToPlayer(player, "Nice Conc! You've been awarded some bonus points.") self.canscore = false AddSchedule("Reenable Scoring", 1, reallowscoring) end end return true end beg_points = basescoretrigger:new({ score = 1 }) med_points = basescoretrigger:new({ score = 2 }) adv_points = basescoretrigger:new({ score = 3 }) crow_points = basescoretrigger:new({ score = 10 }) Any assistance would be awesome. Thanks, m0f0 |
|
10-24-2010, 09:21 PM | #63 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
What's wrong with it?
This line determines how long the trigger is disabled for: Code:
AddSchedule("Reenable Scoring", 1, reallowscoring) Code:
AddSchedule("reenablescoring", self.disabletime, self.reallowscoring) And then change Code:
basescoretrigger = info_ff_script:new({ canscore = true, score = 0, }) Code:
basescoretrigger = trigger_ff_script:new({ canscore = true, score = 0, disabletime = 10 })
__________________
#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.; 10-24-2010 at 09:22 PM. |
|
10-25-2010, 10:18 PM | #64 |
Jay|mOfO|Mills
Beta Tester
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches Posts Rated Helpful 8 Times
|
Bonuse Point Triggers
Tried the new code and it still has the same problem.
In map, when you run through the trigger the first time it acts properly and adds points and disables the scoring. Problem is that it never re-enables. There are no errors when the .lua runs at startup. |
|
10-27-2010, 01:28 PM | #65 |
Banned
Join Date: Sep 2008
Class/Position: Soldier Gametype: AVD Affiliations: TALOS Posts Rated Helpful 5 Times
|
You're using something similar to this?
Code:
base_score_trigger = info_ff_script:new({ can_score = true, disable_time = 30, score = 0, }) function base_score_trigger:reset_scoring() self.can_score = true end function base_score_trigger:ontouch(touch_entity) if IsPlayer(touch_entity) then local player = CastToPlayer(touch_entity) if self.can_score then player:AddFortPoints(self.score, "Nice Conc!") BroadCastMessageToPlayer(player, "Blah blah") self.can_score = false AddSchedule("Re-Enable Scoring", self.disable_time, self.reset_scoring) end end return true end beg_points = base_score_trigger({ score = 1 }) med_points = base_score_trigger({ score = 2 }) adv_points = base_score_trigger({ score = 3 }) crow_points = base_score_trigger({ score = 10 }) Last edited by Bridget; 10-27-2010 at 01:31 PM. |
|
10-27-2010, 08:19 PM | #66 |
Jay|mOfO|Mills
Beta Tester
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches Posts Rated Helpful 8 Times
|
This is the exact code I just tried out below. Still does not re-enable. I don't really know shit about .lua but could it be because disable_time is not called as some kind of function of the trigger? It gives me points the first time I run through the trigger, it displays the messages, just never reactivates the trigger.
I have tried using the base_score_trigger as both info_ff_script and trigger_ff_script with the same result. base_score_trigger = trigger_ff_script:new({ can_score = true, disable_time = 5, score = 0, }) function base_score_trigger:reset_scoring() self.can_score = true end function base_score_triggerntouch(touch_entity) if IsPlayer(touch_entity) then local player = CastToPlayer(touch_entity) if self.can_score then player:AddFortPoints(self.score, "Nice Conc!") BroadCastMessageToPlayer(player, "You've been awarded bonus points!") self.can_score = false AddSchedule("Re-Enable Scoring", self.disable_time, self.reset_scoring) end end return true end beg_points = base_score_trigger:new({ score = 1 }) med_points = base_score_trigger:new({ score = 2 }) adv_points = base_score_trigger:new({ score = 3 }) crow_points = base_score_trigger:new({ score = 10 }) |
|
10-28-2010, 12:37 AM | #67 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Use base_score_trigger: ontrigger. Take out all the enable/disable code. Go into hammer and look at your trigger. Set the "Delay Before Reset" key to ten seconds or whatever.
|
|
10-28-2010, 01:12 AM | #68 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
It might have to do with the space in the schedule name ("Re-Enable Scoring"). Never tried that, so I'm not sure if it works. Try taking it out and testing it again.
Personally, I'd stay away from Hammer input/output stuff when doing Lua-based things (or just in general). Strangely, the times don't match up (a 10 second Lua schedule will end differently than a 10 second trigger delay; see the dustbowl start gates for annoying proof).
__________________
#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.; 10-28-2010 at 01:16 AM. |
|
08-19-2012, 05:09 AM | #69 |
Beta Tester
Join Date: Nov 2011
Gametype: Capture the Flag Posts Rated Helpful 293 Times
|
I just finished texturing up a jump map. I have no clue how any of this lua stuff works, but what I want to achieve is a constant clip refill, and no damage from weapons, if that's at all possible.
|
|
08-19-2012, 05:56 AM | #70 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Everytime someone asks for a continuous resupply script I come up with a different way to do it. Here's what I came up with this time. It's completely untested:
Code:
resupply_settings = { resupply_interval = 1, -- in seconds reload_clips = true, health = 0, armor = 0, grenades = 0, -- blue/green pipes shells = 0, nails = 0, rockets = 0, cells = 0, detpacks = 0, mancannons = 0, gren1 = 0, gren2 = 0 } -- utility function to return a list of all players in the server function resupply_getallplayers() local players = {} for index=1,22 do local player = GetPlayerByID(index) if (player ~= nil) then table.insert( players, player ); end end return players end -- so we don't overwrite startup local resupply_savedfuncs = {} resupply_savedfuncs.startup = startup function startup() -- check to make sure the saved function is actually a function if type(resupply_savedfuncs.startup) == "function" then -- call the saved function resupply_savedfuncs.startup() end -- start resupply schedule AddScheduleRepeating( "resupply_schedule", resupply_settings.resupply_interval, resupply_scheduled ); end function resupply_scheduled() local players = resupply_getallplayers(); for i,player in pairs(players) do resupply( player ) end end function resupply( player ) if IsPlayer( player ) then -- reload clips if resupply_settings.reload_clips == true then player:ReloadClips() end -- give player health and armor if resupply_settings.health ~= nil then player:AddHealth( self.health ) end if resupply_settings.armor ~= nil then player:AddArmor( self.armor ) end -- give player ammo if resupply_settings.nails ~= nil then player:AddAmmo(Ammo.kNails, self.nails) end if resupply_settings.shells ~= nil then player:AddAmmo(Ammo.kShells, self.shells) end if resupply_settings.rockets ~= nil then player:AddAmmo(Ammo.kRockets, self.rockets) end if resupply_settings.cells ~= nil then player:AddAmmo(Ammo.kCells, self.cells) end if resupply_settings.detpacks ~= nil then player:AddAmmo(Ammo.kDetpack, self.detpacks) end if resupply_settings.mancannons ~= nil then player:AddAmmo(Ammo.kManCannon, self.mancannons) end if resupply_settings.gren1 ~= nil then player:AddAmmo(Ammo.kGren1, self.gren1) end if resupply_settings.gren2 ~= nil then player:AddAmmo(Ammo.kGren2, self.gren2) end end end Code:
-- so we don't overwrite the function local nodamage_savedfuncs = {} nodamage_savedfuncs.player_ondamage = player_ondamage function player_ondamage( player, damageinfo ) -- check to make sure the saved function is actually a function if type(nodamage_savedfuncs.player_ondamage) == "function" then -- call the saved function nodamage_savedfuncs.player_ondamage( player, damageinfo ) end -- if no damageinfo do nothing if not damageinfo then return end -- set damage to zero damageinfo:SetDamage(0) 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.; 08-19-2012 at 05:57 AM. |
|
08-19-2012, 08:00 PM | #71 |
Beta Tester
Join Date: Nov 2011
Gametype: Capture the Flag Posts Rated Helpful 293 Times
|
Thank you squeek. But I have no idea what else is supposed to go into the lua. I've tried picking apart other luas, but no go. Also I can't figure out how to save a file as lua. If I try renaming it as .lua it just turns into an .rtf.
|
|
08-19-2012, 08:49 PM | #72 |
Nade Whore
Server Owner
Beta Tester Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier Gametype: CTF/TDM Affiliations: blunt. Moto Posts Rated Helpful 128 Times
|
Use a text editor like notepad/wordpad or editpad to edit the lua file, and to save it as .lua instead of .txt, just choose All File Types and put .lua at the end of the file name.
Last edited by KubeDawg; 08-19-2012 at 08:57 PM. |
|
08-19-2012, 09:02 PM | #73 |
WhenNailGrenWillOut?
Beta Tester
Join Date: May 2009
Gametype: mp_prematch Affiliations: [:)] - Frag Happy, babe| Posts Rated Helpful 29 Times
|
Team names, class limits, bags, LOCATIONS <----!!!. (Very important for ctf;avd;ivd maps, not as important but definitely useful (in djump maps especially, "WHAT STAGE ARE YOU ON?! I'M ON STAGE 23456 YOU?") in skill maps.
__________________
[[ ff_hotfudge - bhop_theonlyone ]] "As the the new year approaches I await for it like an case of explosive fecalomania otherwise know as diareha or the massive shits. I am gripping the sides of the toilet as my stomach produces the first hollow thud out of the anus of the year to come." DarkeN_HellspawN Last edited by moosh; 08-19-2012 at 09:03 PM. |
|
08-19-2012, 09:49 PM | #74 | |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
Quote:
I'd suggest using http://notepad-plus-plus.org/. It has syntax highlighting for Lua and is just a good text editor in general. Also, some stuff on the wiki might be worth looking at: http://www.fortress-forever.com/wiki...etting_Started (more for CTF, but might still be useful) http://www.fortress-forever.com/wiki...e:BaseTeamplay http://www.fortress-forever.com/wiki...ocation_System
__________________
#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 |
|
|
08-19-2012, 10:50 PM | #75 |
Beta Tester
Join Date: Nov 2011
Gametype: Capture the Flag Posts Rated Helpful 293 Times
|
Really, other than what I requested I only need people to spawn. I have a entity player info start, do i need to change it to info ff team spawn? Also if I use a lua is it going to overide any of the maps trigger events? There are a ton of jump pads around, that already work without a lua.
But there are no bags, or specific "stages". Really all I need is for the player to spawn, any class, and get to jumping. I tried looking through other luas and the base and basectf, but I guess I don't really understand it. |
|
08-19-2012, 11:13 PM | #76 |
D&A Member
Wiki Team Fortress Forever Staff Join Date: Apr 2007
Posts Rated Helpful 31 Times
|
Just put
Code:
IncludeScript("base_teamplay"); Then you need to set team limits: Code:
SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) This page: http://www.fortress-forever.com/wiki...e:BaseTeamplay tells you what entities to use and what to name them. You will want multiple info_ff_teamspawn entities to ensure that there is always a clear spawn point for a player to use. |
|
08-20-2012, 12:44 AM | #77 |
Beta Tester
Join Date: Nov 2011
Gametype: Capture the Flag Posts Rated Helpful 293 Times
|
Ok, thanks guys, I should be able to get it from here.
|
|
08-20-2012, 04:50 AM | #78 |
Beta Tester
Join Date: Nov 2011
Gametype: Capture the Flag Posts Rated Helpful 293 Times
|
Code:
IncludeScript("base_teamplay"); SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) resupply_settings = { resupply_interval = 1, -- in seconds reload_clips = true, health = 0, armor = 0, grenades = 0, -- blue/green pipes shells = 0, nails = 0, rockets = 0, cells = 0, detpacks = 0, mancannons = 0, gren1 = 0, gren2 = 0 } -- utility function to return a list of all players in the server function resupply_getallplayers() local players = {} for index=1,22 do local player = GetPlayerByID(index) if (player ~= nil) then table.insert( players, player ); end end return players end -- so we don't overwrite startup local resupply_savedfuncs = {} resupply_savedfuncs.startup = startup function startup() -- check to make sure the saved function is actually a function if type(resupply_savedfuncs.startup) == "function" then -- call the saved function resupply_savedfuncs.startup() end -- start resupply schedule AddScheduleRepeating( "resupply_schedule", resupply_settings.resupply_interval, resupply_scheduled ); end function resupply_scheduled() local players = resupply_getallplayers(); for i,player in pairs(players) do resupply( player ) end end function resupply( player ) if IsPlayer( player ) then -- reload clips if resupply_settings.reload_clips == true then player:ReloadClips() end -- give player health and armor if resupply_settings.health ~= nil then player:AddHealth( self.health ) end if resupply_settings.armor ~= nil then player:AddArmor( self.armor ) end -- give player ammo if resupply_settings.nails ~= nil then player:AddAmmo(Ammo.kNails, self.nails) end if resupply_settings.shells ~= nil then player:AddAmmo(Ammo.kShells, self.shells) end if resupply_settings.rockets ~= nil then player:AddAmmo(Ammo.kRockets, self.rockets) end if resupply_settings.cells ~= nil then player:AddAmmo(Ammo.kCells, self.cells) end if resupply_settings.detpacks ~= nil then player:AddAmmo(Ammo.kDetpack, self.detpacks) end if resupply_settings.mancannons ~= nil then player:AddAmmo(Ammo.kManCannon, self.mancannons) end if resupply_settings.gren1 ~= nil then player:AddAmmo(Ammo.kGren1, self.gren1) end if resupply_settings.gren2 ~= nil then player:AddAmmo(Ammo.kGren2, self.gren2) end end end -- so we don't overwrite the function local nodamage_savedfuncs = {} nodamage_savedfuncs.player_ondamage = player_ondamage function player_ondamage( player, damageinfo ) -- check to make sure the saved function is actually a function if type(nodamage_savedfuncs.player_ondamage) == "function" then -- call the saved function nodamage_savedfuncs.player_ondamage( player, damageinfo ) end -- if no damageinfo do nothing if not damageinfo then return end -- set damage to zero damageinfo:SetDamage(0) end |
|
08-20-2012, 05:02 AM | #79 |
Nade Whore
Server Owner
Beta Tester Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier Gametype: CTF/TDM Affiliations: blunt. Moto Posts Rated Helpful 128 Times
|
-----------------------------------------------------------------------------
-- set class limits ----------------------------------------------------------------------------- function startup() SetGameDescription("Enter Description Here") -- set up team limits on each team SetPlayerLimit(Team.kBlue, 0) SetPlayerLimit(Team.kRed, 0) SetPlayerLimit(Team.kYellow, -1) SetPlayerLimit(Team.kGreen, -1) local team = GetTeam(Team.kBlue) team:SetClassLimit(Player.kCivilian, -1) team:SetClassLimit(Player.kSniper, SNIPER_LIMIT) team = GetTeam(Team.kRed) team:SetClassLimit(Player.kCivilian, -1) team:SetClassLimit(Player.kSniper, SNIPER_LIMIT) end |
|
08-20-2012, 05:10 AM | #80 |
Stuff Do-er
Lua Team
Wiki Team Fortress Forever Staff |
When you run a local server, Lua errors show up in the console. They are usually extremely helpful.
EDIT: Also, those team limits are already set in base_teamplay, you don't actually need that part (the four SetPlayerLimit()'s). If you did want custom team limits (like enabling the green team), though, you'd put those in the function startup() like Kube posted.
__________________
#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.; 08-20-2012 at 05:13 AM. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|