Actually, nearesbuilding is exactly the command that I've used, and same for the creation of a gamelogic : to make it short, the arty script sometimes calls another script to set buildings on fire, the parameter of which simply being [_pos], where _pos designates the position where the shell has exploded.
Then, this script goes like this :
_pos=_this select 0
_lifeTime = random 120
_delay = 0.3
_lifeTicks = _lifeTime / _delay
_lifeTick = _lifeTicks
_invisible="logic" camcreate _pos
_building=nearestbuilding _invisible
_x=getpos _building select 0
_y=getpos _building select 1
_z=getpos _building select 2
_feu="fire" camcreate [_x,_y,_z-0.5] (I like this idea of creating a fire because you've got the sound too...
)
_feu inflame true
#Begin
?(random _lifeTicks) < _lifeTick : drop ["cl_fire", "", "Billboard", 1, random 5, getpos _building, [ random 1, random 1, 1 + random 1], 1, 0.005, 0.0042, 0.2, [random 0.05], [[1,1,1,1],[0,0,0,0]], [0,1,0], 0.5, 0.5, "", "", ""] (that's for spark creation, everybody should check cutscene x10WhenFightEnds.Noe in the resistance campaign
)
drop ["cl_basic", "", "Billboard", 1, 10, getpos _building, [0,0,1], 1, 0.005, 0.0042, 0.5, [0.2,10], [[0,0,0,0], [0.3,0.3,0.3,1 * _lifeTick/_lifeTicks], [0.8,0.8,0.8,0.1 * _lifeTick/_lifeTicks], [0.8,0.8,0.8,0]], [0,1,0,1,0,1], 0.2, 0.2, "", "", ""]
drop ["cl_fire", "", "Billboard", 1, 1.5, getpos _building, [random 0.3, random 0.3, random 0.3], 1, 0.004, 0.004, 0.1, [5*(0.1 + 0.2 * _lifeTick/_lifeTicks), 5*(0.1 + 0.5 * _lifeTick/_lifeTicks), 5*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [1,1,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
~_delay
_lifeTick = _lifeTick - 1
?_lifeTick > 0 : goto "Begin"
?_lifeTick<=0:_feu inflame false;deletevehicle _feu;exit
Now, my problem is that I want those fires to BURN (i.e setdammage !
) FOR REAL.
And I thought that creating triggers with axis a=5, axis b= 5, activated by "anybody present" and activating a "classic" burn script would be cool.
Still racking my brains...