PDA

View Full Version : How do you extinguish an ENV_FIRE?


Doughnut-4|4-
03-24-2009, 12:34 AM
I need some help on this one. I'm including the whole LUA but the command line that troubles me concerns ENV_FIRE entities. As you can see below I am triggering several entities after a flag capture. I want the "blue_cap_fire" to "StartFire" and then to "ExtinguishTemporary" one second after... I can't seem to get the fire to extinguish. Help is appreciated.


IncludeScript("base_ctf");
IncludeScript("base_location");
IncludeScript("base_respawnturret");

my_cap = basecap:new({})

function my_cap:oncapture(player, item)
if player:GetTeamId() == Team.kBlue then
OutputEvent( "blue_cap_sound", "PlaySound" )
OutputEvent( "blue_cap_shake", "StartShake" )
OutputEvent( "blue_cap_splash", "Splash" )
OutputEvent( "blue_cap_fire", "StartFire" )
OutputEvent( "blue_cap_fire", 1, "ExtinguishTemporary" )
elseif player:GetTeamId() == Team.kRed then
OutputEvent( "red_cap_sound", "PlaySound" )
OutputEvent( "red_cap_shake", "StartShake" )
OutputEvent( "red_cap_splash", "Splash" )
OutputEvent( "red_cap_fire", "StartFire", )
OutputEvent( "red_cap_fire", 1, "ExtinguishTemporary" )
end

-- let the teams know that a capture occured
SmartSound(player, "yourteam.flagcap", "yourteam.flagcap", "otherteam.flagcap")
SmartSpeak(player, "CTF_YOUCAP", "CTF_TEAMCAP", "CTF_THEYCAP")
SmartMessage(player, "#FF_YOUCAP", "#FF_TEAMCAP", "#FF_OTHERTEAMCAP")

end

my_cap_red = my_cap:new({team = Team.kRed,
item = {"blue_flag","yellow_flag","green_flag"}})

my_cap_blue = my_cap:new({team = Team.kBlue,
item = {"red_flag","yellow_flag","green_flag"}})

squeek.
03-24-2009, 12:44 AM
You can use:

OutputEvent( entity, input, parameter, delay )

OutputEvent( "blue_cap_fire", "ExtinguishTemporary", "", 1 )


or:

AddSchedule( schedule_id, duration, function, parameters, ... )

AddSchedule( "blue_cap_fire", 1, OutputEvent, "blue_cap_fire", "ExtinguishTemporary" )


If the first one doesn't work, the second on definitely will.

pF
03-24-2009, 02:19 AM
Beer.

/helpful

Doughnut-4|4-
03-24-2009, 03:09 AM
I am happy to say playing with your code and concluding that the "Extinguish" command is bugged...
I resolved to find a backdoor using disable and enable to extinguish it.

OutputEvent( "blue_cap_fire", "StartFire" )
OutputEvent( "blue_cap_fire", "disable", "", 1 )
OutputEvent( "blue_cap_fire", "enable", "", 2 )