09-14-2011, 05:31 AM | #1 |
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 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|