Jump to content
marki980908

Speed Boost . Speed break

Recommended Posts

I am having problems with these 2 scripts

_this addAction ["<t color='#FFF800'>Gravity Boost","_this setvelocity [140 * (sin (getdir _this )), 140 * (cos (getdir _this )), 0]",
[], 7, true, true, "", "_this == driver _target"];

and

_this addAction ["<t color='#FF0000'>Greavity break","_this setvelocity [0 * (sin (getdir _this )), 0 * (cos (getdir _this )), 0]",
[], 7, true, true, "", "_this == driver _target"];

This script should give a scroll action to vehicle driver to either make vehicle go 500km/h or 0 km/h instantly.
However I am getting an error saying that "getdir: got array expected object"
I am executing this inside vehicle init

  • Thanks 1

Share this post


Link to post
Share on other sites

_this , as variable in inner addAction script is an array with all addAction parameters. What you want here is:  vehicle (_this #0) instead of _this

and... I bet the code is written in an init field of a vehicle, so the first _this must be this (keep first _this if I'm wrong):

 

If I'm right:

this addAction ["<t color='#FFF800'>Gravity Boost","_veh = _this #0; _veh setvelocity [140 * (sin (getdir _veh )), 140 * (cos (getdir _veh )), 0]", [], 7, true, true, "", "_this == driver _target"];

 

NB: you can use also setVelocityModelSpace  : _veh setVelocityModelSpace [0,140,0]  as well.

Have a look at setVelocityTransformation (not very handy in your case).

 

  • Like 1
  • Thanks 1

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

×