Home   Help Search Login Register  

Author Topic: Help with script syntax.  (Read 530 times)

0 Members and 1 Guest are viewing this topic.

Ace Productions

  • Guest
Help with script syntax.
« 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

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re:Help with script syntax.
« Reply #1 on: 10 Nov 2003, 17:27:57 »
Hey !

There's a lot of debugging to do here.

First, it shouldn't be :

Quote
GetDir _vehicle=_alpha
GetDir _crewman=_theta

;Calculate the new angle.
(_theta + 84.28940686)-_alpha=_newangle

;Obtain new coordinates.
cos _newangle*1.004987562=_nY

But :

Code: [Select]
;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 :

Code: [Select]
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.



« Last Edit: 10 Nov 2003, 17:28:43 by Igor Drukov »

Ace Productions

  • Guest
Re:Help with script syntax.
« Reply #2 on: 11 Nov 2003, 22:04:59 »
Igor my friend you are perfectly right and thanks a lot!