Difference between revisions of "Map Template:Security"
From Fortress Forever Wiki
Jump to navigationJump to search (New page: {{Infobox manual/Header}} =Introduction= This is how to set up security doors and lasers in a map. The doors, lasers, trigger_hurt's, lights and sounds are all controlled by two logic rela...) |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 8: | Line 8: | ||
*<b>red_secup_relay</b> (logic_relay): This relay gets fired when security reactivates. | *<b>red_secup_relay</b> (logic_relay): This relay gets fired when security reactivates. | ||
=Lua Script= | =Lua Script= | ||
| − | <pre>IncludeScript("base"); | + | <pre>-- security_test.lua |
| + | IncludeScript("base"); | ||
| + | IncludeScript("base_ctf"); | ||
-- security is active to start | -- security is active to start | ||
| − | + | redsecurity = true | |
red_sec = trigger_ff_script:new() | red_sec = trigger_ff_script:new() | ||
| Line 47: | Line 49: | ||
-- Give a 10 second warning that security will reactivate | -- Give a 10 second warning that security will reactivate | ||
BroadCastMessage("Red Security Online in 10 Seconds") | BroadCastMessage("Red Security Online in 10 Seconds") | ||
| − | end | + | end</pre> |
| − | </pre> | ||
| | ||
[[Category:Map Templates]] [[Category:Mapping]] | [[Category:Map Templates]] [[Category:Mapping]] | ||
{{Infobox manual/Footer}} | {{Infobox manual/Footer}} | ||
Latest revision as of 05:22, 30 August 2009
|
IntroductionThis is how to set up security doors and lasers in a map. The doors, lasers, trigger_hurt's, lights and sounds are all controlled by two logic relays. The relays are triggered by the lua. Entities
Lua Script-- security_test.lua
IncludeScript("base");
IncludeScript("base_ctf");
-- security is active to start
redsecurity = true
red_sec = trigger_ff_script:new()
function red_sec:ontouch( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
-- can only be deactivated by blue players
if player:GetTeamId() == Team.kBlue then
if redsecurity then
redsecurity = false
AddSchedule("secup10red",50,secup10red)
AddSchedule("secupred",60,secupred)
OutputEvent("red_secdown_relay", "Trigger" )
BroadCastMessage("Red Security Deactivated for 60 Seconds")
SpeakAll( "SD_REDDOWN" )
RemoveHudItemFromAll( "red-sec-up" )
AddHudIconToAll( "hud_secdown.vtf", "red-sec-down", 60, 25, 16, 16, 3 )
end
end
end
end
function secupred()
-- This function reactivates security
redsecurity = true
OutputEvent("red_secup_relay", "Trigger" )
BroadCastMessage("Red Security Online")
SpeakAll( "SD_REDUP" )
RemoveHudItemFromAll( "red-sec-down" )
AddHudIconToAll( "hud_secup_red.vtf", "red-sec-up", 60, 25, 16, 16, 3 )
end
function secup10red()
-- Give a 10 second warning that security will reactivate
BroadCastMessage("Red Security Online in 10 Seconds")
end
|