OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Ace Productions on 10 Nov 2003, 16:51:55
-
Can someone please help me correct my script syntax. I'm getting an error for the position array in the drop command.
private ["_vehicle","_crewman","_alpha","_theta","_newangle","_nX","_nY","_nZ"];
_vehicle=_this select 0
_crewman=_this select 1
;Obtain the angles theta and alpha.
GetDir _vehicle=_alpha
GetDir _crewman=_theta
;Calculate the new angle.
(_theta + 84.28940686)-_alpha=_newangle
;Obtain new coordinates.
cos _newangle*1.004987562=_nY
_nX=_nY*10
_nZ=0.1
Drop ["cl_basic","","Billboard",0.9,0.8,[_nX,_nY,_nZ],[0,-0.1,0.2],0.9,1.3,1,0,[1.5,0.8,0.3],[[0,0,0,1],[0,0,0,0.2]],[0,0,0,0],0.1,0.1,"","",_vehicle]
~0.66
Exit
-
Hey !
There's a lot of debugging to do here.
First, it shouldn't be :
GetDir _vehicle=_alpha
GetDir _crewman=_theta
;Calculate the new angle.
(_theta + 84.28940686)-_alpha=_newangle
;Obtain new coordinates.
cos _newangle*1.004987562=_nY
But :
;Obtain the angles theta and alpha.
_alpha=GetDir _vehicle
_theta=GetDir _crewman
;Calculate the new angle.
_newangle=(_theta + 84.28940686)-_alpha
;Obtain new coordinates.
_nY=cos _newangle*1.004987562
Otherwise, neither "_alpha", nor "_theta", nor "_newangle", nor "_nY" will be considered as defined by the script.
Then, out of the 19 arguments the "drop" command requires, you use... 20 !!
It's your AnimationPhase and RandomDirectionPeriod that are wrong.
"[0,0,0,0.2]" corresponds to nothing, and "[0,0,0,0]" should be something like : "[0,1,0]".
Besides, if your particle is to have several sizes, as defined with "[1.5,0.8,0.3]", you should also define several colors : "[[0,0,0,1],[0,0,0,1]]" instead of "[0,0,0,1]".
There we go. I've just tested all I've said, and the afore-mentioned corrections MUST be made, or else it won't work.
Suggested line :
Drop ["cl_basic","","Billboard",0.9,0.8,[_nX,_nY,_nZ],[0,-0.1,0.2],0.9,1.3,1,0,[1.5,0.8,0.3],[[0,0,0,1],[0,0,1,0]],[0,1,0],0.1,0.1,"","",_vehicle]
(The particle is then blue... :P)
Ig.
-
Igor my friend you are perfectly right and thanks a lot!