Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09-14-2011, 05:31 AM   #1
Jay Mofo Mills
Jay|mOfO|Mills
Beta Tester
 
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches
Posts Rated Helpful 8 Times
Gonna need lots of lua help

I have a new map I'm working on ff_castle_island. It's going to be objective based with command points and flag captures....... Ideally. MY problem atm is this, I borrowed and modified code from ff_dropdown.

So far I can get the generator up and running, the light bridge working etc. I would like it so that a Red team members detpack destroys the generator again so the doorhack closes and needs repaired again. Here is the modified borrowed code I'm using. Note I changed the 1 and 0 for a few functions bluefire/bluegenup in certain places attempting to get it to work. Any help would be great.

---------------------------------------------------------------------------- Ideally this destroys the generator when it's running
--------------------------------------------------------------------------

blue_gen_trigger = trigger_ff_script:new({ team = Team.kBlue })
bluefire = 0

function blue_gen_triggernexplode( trigger_entity )
if IsDetpack( trigger_entity ) then
local detpacka = CastToDetpack( trigger_entity )
if detpacka:GetTeamId() == defenders then
if bluegenup == 1 then
if bluefire == 1 then
OutputEvent( "blue_doorhack", "Close" )
BroadCastMessage("Generator Destroyed - Light Bridge Deactivated!")
bluefire = 0
bluegenup = 0
end
end
end

end
return EVENT_ALLOWED
end

function blue_gen_trigger:allowed( trigger_entity ) return EVENT_DISALLOWED
end


--------------------------------------------------------------------------
-- This basically says if you're in the trigger brush w/a spanner then bluescannerclang==1
--------------------------------------------------------------------------

blue_gen_repair_trigger = func_button:new({ team = Team.kBlue })
blue_gen_repair_trigger_script = trigger_ff_script:new()
bluespannerclang = 0
bluegenup = 0
blueclangcntr = 0


function blue_gen_repair_trigger_scriptntouch( touch_entity )
if IsPlayer( touch_entity ) then
local player = CastToPlayer( touch_entity )
if player:GetActiveWeaponName() == "ff_weapon_spanner" then
bluespannerclang = 1
DisplayMessage( player, "You are repairing the Light Bridge" )
end
end
end

function blue_gen_repair_trigger_scriptnendtouch()
bluespannerclang = 0
end

-----------------------------------------------------------------------------
-- This basically says if bluescannerclang==1 aand the generator is down you can fix it
-- What does bluefire do?
-----------------------------------------------------------------------------

function blue_gen_repair_triggerndamage()
if bluespannerclang == 1 then
if bluegenup == 0 then
if bluefire == 0 then
OutputEvent( "bluespannerhit", "PlaySound" )
blueclangcntr = blueclangcntr + 1
if blueclangcntr == 10 then
BroadCastMessage("The Generator is halfway fixed")
end
if blueclangcntr > 20 then
blueclangcntr = 0
BroadCastMessage("The generator is fixed. Light Bridge Activated!")
OpenDoor("blue_doorhack")
bluespannerclang = 0
bluegenup = 1
bluefire = 1
end
end
end
end
return EVENT_DISALLOWED
end
Jay Mofo Mills is offline   Reply With Quote


 


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 09:14 PM.


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