Jump to content
Sign in to follow this  
sfc.itzhak

white smoke from a tank script

Recommended Posts

hey..

i searched but didnt understood how to do it..

i want by a script that there sill be a big whit smoke from the right side of the tank and to keep it runing until an deactivation.

is it possibale and how...

thanks

Share this post


Link to post
Share on other sites

I don't know if it can help you, but in one of my missions i made a simple tank smoke script (not a tank smoke launcher, but a tank smoke generator) that created smoke from behind :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tank = _this select 0

ENDTANKSMOKE = false

_i=0

_tank sidechat "Smoke generator started"

_sizst = 3

_sizen = 15

_timelive = 40

_charge = 1500

#loopsmoke

~0.03

_tdir = getdir _tank

drop ["cl_basic","","Billboard",0.1,_timelive,[(getpos _tank select 0)-4.5*sin _tdir, (getpos _tank select 1)-4.5*cos _tdir, (getpos _tank select 2)+1.5],[0,0,0],0,1,0.785,0,[_sizst,_sizen],[[0.7,0.7,0.7,0.2],[0.8,0.8,0.8,1],[0.9,0.9,0.9,1],[0.9,0.9,0.9,0.2], [0.9,0.9,0.9,0.01]],[0,0.03,0,0.03],0,0.03,"","",_pos]

? _i >= _charge : _tank sidechat "Smoke charge depleted";goto "end"

? (ENDTANKSMOKE): _tank sidechat "Smoke generator stopped";goto "end"

_i=_i+1

goto "loopsmoke"

#end

exit

In a radio alpha trigger i had On Activation

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[tankname] exec "tanksmoke.sqs"

that started the script

And in a radio bravo trigger i had

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ENDTANKSMOKE=true

that stopped the script

I added a second way to stop the script by simulating the fact that the smoke generator would be totally discharged after a specific amount of time (change the _charge line with higher number, i remember the current 1500 would mean +/- 1 minute and a half)

Very usefull if used for an AI tank that was destroyed without having to add an extra check in the script to see if the vehicle was alive or not.

the _timelive variable meant how many seconds one each of the smoke particles had before it was deleted. the higher this number the longer the smoke stay (too high can lead into performance problem)

the _sizst and_sizen variables meant the size of the particle at its creation and at its final state.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×