Hello people! After not posting on this site since '07, I have finally returned, and felt like contributing something to the community! After soo much Half-Life 2 playing, I wanted to try to replicate the explosive barrels found in Hl2 that catch on fire when damaged and explode. As an extra, the entity using this script can also catch on fire just by touching a fire decal!
;Artificial Intelligence Script
;Header
desc = Explosive Barrel. Can catch on fire after being damaged and if it touches fire. Written by Mike F.
;Triggers
:state=0:settargetname=Fire
:state=0,reachtarget:timerstart,state=1
:state=0,shotdamage=1:timerstart,state=1
:state=1,shotdamage=1:stopsound,subhealth=50
:state=1,timergreater=2000:stopsound,subhealth=50
:state=1:rundecal=0,loopsound=audiobank\atmos\firehum.wav
;End of Script
The line with "settargetname=Fire" is basically telling us that the entity will react when touching an entity or decal named "Fire". Placing an object in the scene (preferably a fire decal) and giving it the name "Fire" can now cause your entity to light up when placed in it!
Anyway, this script isn't perfect. This whole effect only works up close. The fire decals start to flicker and disappear the further you move from the entity. If any of you expert FPSC scripters out there find a solution to this problem, I would appreciate any help!
And not to forget, you must include these lines in your entity's .fpe:
;decals
decalmax = 1
decal0 = firemedium