Jump to content
Sign in to follow this  
dr death jm

sqs help, 1 error left (vtol/stol)

Recommended Posts


_vcl = _this select 0

_aID = _this Select 2

_vcl RemoveAction _aID

_vtolOnID = _this Select 2

_vtolOffID = _this select 0

_vcl removeAction _vtolOnID

_helpmsg = Format["HOW TO USE vtol\nIn options the keyboard keys which control the following moves will control vtol.\nMOVEUP - THRUST +\nMOVEDOWN- THRUST -\nMOVELEFT - ROTATE L\nMOVERIGHT - ROTATE R\nMOVEBACK - STOL BRAKE\nMOVEFAST - STOL TURBO"]

_max = 15

karr_maxvtolSpeed = 200

;;#vtolInit

?karr_vtol : karr_vtol = FALSE; PSOn = 0; _vtolOnID = _vcl addAction ["ACTIVATE VTOL","karr-vtol-On.sqs"]; _vtolOnID = _vtolOnID; exit

?!karr_vtol : karr_vtol = TRUE; PSOn = 1; hint _helpmsg; _vtolOffID = _vcl addAction ["DEACTIVATE VTOL","karr-vtol-On.sqs"]

;;#Waitforvtol

~0.1

?IsNull Driver _vcl OR !Alive _vcl OR !Alive Driver _vcl : Goto "Finish"

;;hint "vtol on"

#vtolLoop

;;hint format [" ProSphere Controller Lite\n\n X-Axis %1\n Y-Axis %2\n Z-Axis %3\n A-Axis %4\n B-Axis %5\n C-Axis %6\n\nTurbo?: %7\n\nPSOn: %8", PS select 0, PS select 1, PS select 2, PS select 3, PS select 4, PS select 5,vtolturbo,PSOn]

~.001

_x = PS Select 0

_y = PS Select 1

_z = PS Select 2

_a = PS Select 3

_b = PS Select 4

_c = PS Select 5

_xThrust = (velocity _vcl select 0)

_yThrust = (velocity _vcl select 1)

_zThrust = _max * _z

#Lateral Thrust

?_x > 0 && _xThrust < +10 && _yThrust < +10 && Speed _vcl < +20 && Speed _vcl > -20 : _factor = _x*.1; _dir = GetDir _vcl; _xThrust = (_factor*(cos _dir))+(velocity _vcl select 0); _yThrust = (_factor*(sin _dir))+(velocity _vcl select 1);

?_x < 0 && _xThrust > -10 && _yThrust > -10 && Speed _vcl < +20 && Speed _vcl > -20 : _factor = _x*.1; _dir = GetDir _vcl; _xThrust = (_factor*(cos _dir))+(velocity _vcl select 0); _yThrust = (_factor*(sin _dir))+(velocity _vcl select 1);

;;hint Format["XThrust: %1\nYThrust: %2\nZThrust: %3",_xthrust,_ythrust,_zthrust]

#Vertical Thrust

?_zThrust == 0 : _zThrust = -.30

#Rotation

_rotation = 0

?_c > 0 : _rotation = .4

?_c < 0 : _rotation = -.4

_speed = [_xThrust,_yThrust,_zThrust]

#STOL Turbo Brake

?_y < 0 AND Speed _vcl > 0 : _xThrust = (-.2*(sin getDir _vcl))+(velocity _vcl select 0); _yThrust = (-.02*(cos getDir _vcl))+(velocity _vcl select 1); _speed = [_xThrust,_yThrust,_zThrust]

?_y < 0 AND Speed _vcl <= 0 : _speed = [0,0,Velocity _vcl Select 2]

?!karr_vtol OR !Alive _vcl OR IsNull Driver _vcl : goto "vtolOff"

?(speed _vcl) < karr_maxvtolspeed AND (Fuel _vcl) > 0 : _vcl SetVelocity _speed

?(speed _vcl) < 80 : _vcl SetDir (GetDir _vcl) + _rotation

?jm_vtolturbo AND (Fuel _vcl) > 0 : Goto "vtolTurbo"

Goto "vtolLoop"

#vtolTurbo

~.001

?(Fuel _vcl) > 0 AND (jm_vtolturbo) : _vcl SetVelocity _speed; _vcl SetFuel (Fuel _vcl) - .0003

?(Fuel _vcl) > 0 AND (_z > 0) AND (Getpos _vcl Select 2 < 1) AND Speed _vcl > 10 : _vcl setvelocity [(velocity _vcl select 0),(velocity _vcl select 1),(velocity _vcl select 2) + _height];_wait = 3; _vcl SetFuel (Fuel _vcl) - .1

?!jm_vtolturbo AND Alive _vcl AND !IsNull Driver _vcl : Goto "vtolLoop"

?!Alive _vcl || IsNull Driver _vcl || !Alive Driver _vcl || !karr_vtol : Goto "vtolOff"

_fuelfactor = 0

_factor = .11

?Speed _vcl > 300 : _factor = .35; _fuelfactor = .001

_xThrust = (_factor*(sin getDir _vcl))+(velocity _vcl select 0)

_yThrust = (_factor*(cos getDir _vcl))+(velocity _vcl select 1)

_zThrust = (Velocity _vcl Select 2) + .15

?(Getpos _vcl Select 2) < 2 : _zThrust = Velocity _vcl Select 2

hint format["%1",_factor]

_speed = [_xThrust,_yThrust,_zThrust]

?(Fuel _vcl > 0) : _vcl SetVelocity _speed; _vcl SetFuel (Fuel _vcl) - _fuelfactor

Goto "vtolTurbo"

#vtolOff

PSOn = 0

karr_vtol = FALSE

jm_vtolturbo = FALSE

?isNull _vcl || !Alive Driver _vcl : Goto "Finish"

Exit

#Finish

_vtolOnID = FALSE

_vtolOffID = FALSE

Exit

Share this post


Link to post
Share on other sites

Error position: <jm_vtolturbo AND (Fuel _vcl) > 0
Error Undefined variable in expression: jm_vtolturbo

Error in expression <jm_vtolturbo AND (Fuel _vcl) > 0

 

 

I'm pretty sure its this line

 

?jm_vtolturbo AND (Fuel _vcl) > 0 : Goto "vtolTurbo"

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  

×