Jump to content
kibaBG

[SOLVED] Paradropped tank goes under the map

Recommended Posts

Hi, I am using attachTo to paradrop a tank. The idea is the player is driving the tank on a "special" helipad in base and then the tank and the player got paradropped on the map. Its working fine until the tank touches the ground and the parachute detaches, the tank goes under the map and disappears! The player can eject and its fine but no more tank for him. Here is the code used in the trigger of the helipad: 

 

openMap true;  
onMapSingleClick "  
openMap false; 
_veh = (vehicle player); 
[_veh,150,_pos] call BIS_fnc_setHeight;
_posNew = getPosATL _veh;
_para = createVehicle ['B_Parachute_02_F', _posNew, [], 0, ''];
_para attachTo [_veh,[0,0,0]];
onMapSingleClick '';";

Funny thing is if I do the script without the parachute the tanks got paradropped fine from 150m without breaking anything. 🤣  

Share this post


Link to post
Share on other sites

Ok, I made it so the tank is landing safe and is drivable, but I cannot detach the parachute. 

openMap true;  
onMapSingleClick "  
openMap false; 
_veh = (vehicle player); 
[_veh,150,_pos] call BIS_fnc_setHeight;
_posNew = getPosATL _veh;
_para = createVehicle ['B_Parachute_02_F', _posNew, [], 0, ''];
_para attachTo [_veh,[0,0,0]];
if (isTouchingGround (vehicle player)) then {
(vehicle player) SetVelocity [0,0,0];
detach _para;
};
onMapSingleClick '';";

Any leads?

  • Like 1

Share this post


Link to post
Share on other sites

Ok, I have found the solution in the forum. You just have to change the attaching point. 

_veh attachTo [_para,[0,0,3]];

And you have to attach the vehicle to the parachute, not the opposite, so it can detach normally. Here is the working code. 

openMap true;  
onMapSingleClick "  
openMap false; 
_veh = (vehicle player); 
[_veh,150,_pos] call BIS_fnc_setHeight;
_posNew = getPosATL _veh;
_para = createVehicle ['B_Parachute_02_F', _posNew, [], 0, 'CAN_COLLIDE'];
_veh attachTo [_para,[0,0,3]];
onMapSingleClick '';";

 

  • Like 3

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

×