Jump to content
Sign in to follow this  
alexboy

Need help with script a Attachto / animate script

Recommended Posts

so im trying to animate a ramp that has a vehicle on it... i have a piece called "ramp" (its the name of the bone ramp) and im trying to attach the vehicle to it, then animate the ramp to close

this gives an error.... could anyone please help me...

i dont think the script sees the bone "ramp", and this script is inside the addon it self when its binarized...

attachto.sqf

_plane = _this select 0;

_veh = _this select 1;

_player = _this select 2;

_d = direction _plane;

_dv = direction _veh;

_dv = _dv - _d;

_difx = (cos(_d))*((getpos _veh select 0) - (getpos _plane select 0)) - (sin(_d))*((getpos _veh select 1) - (getpos _plane select 1));

_dify = (cos(_d))*((getpos _veh select 1) - (getpos _plane select 1)) + (sin(_d))*((getpos _veh select 0) - (getpos _plane select 0));

if (ABS(_difx)>4) then

{

hint (localize "STR_GALAXY_C5_OP");

if (true) exitWith {};

}

else

{

_player setfuel 0;

_player action ["GetOut", vehicle _player];

player disableAI "ANIM";

_veh disableAI "ANIM";

_veh disableAI "MOVE";

_veh setfuel 0;

sleep 0.01;

_difz = (getpos _plane select 2) - (getpos _veh select 2) + 6.0;

_veh allowDamage false;

hint format ["X1: %1 Y1: %2 Z1: %3", _difx, _dify, _difz];

_veh attachTo [_plane,"ramp"]; //[_difx,_dify,_difz]]; //changed

_veh setfuel 0;

[_plane] execvm "\dropship\scr\back_rampclose.sqf";//added

sleep 0.01;

sleep 1; // added

//_difz = (getpos _plane select 2) - (getpos _veh select 2) + 6.0;

//_veh allowDamage false;

//hint format ["X2: %1 Y2: %2 Z2: %3", _difx, _dify, _difz];

//_veh attachTo [_plane,[_difx,_dify,_difz]];

_veh setDir _dv;

//_veh setfuel 0;

sleep 5;

_veh enableSimulation false;

if (true) exitWith {};

};

any help is appreciated

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  

×