Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Gunnykat

Here is a good one.

Recommended Posts

Ok I can lift one of my moble HQ's but I can not lift the other one. Good head scratcher.

// mount_vcl_init.sqf
// © JUNE 2009 - norrin ([email protected])
/*
Name playable units and vehicle in the editor
Put this in the init line of the vehicle in the editor: nul = [this] execVM "mountOnC130\mount_vcl_init.sqf";
*/

_vcl 		= _this select 0;
_typeOfVcl	= _this select 1;
_c 			= 0;
_load = _vcl addAction ["Lift", "mountOnC130\mount_vcl.sqf", _typeOfVcl, 0, false, true];
_unload = _vcl addAction ["Drop", "mountOnC130\dismount_vcl.sqf",-1,100000, false, true];
_toAttach 	= objNull;
_vcl removeAction _load;
_vcl removeAction _unload;

if (isServer) then
{
_vcl setVariable ["NORRN_mountOn_vcl_pos0", [false, _toAttach], true];
sleep 2;
};
while {alive _vcl} do
{ 
if (!((_vcl getVariable "NORRN_mountOn_vcl_pos0") select 0) && _c == 0 && count (nearestObjects [_vcl, ["LandVehicle","Air"], 30]) > 0 && count (nearestObjects [_vcl, [_typeOfVcl], 30]) > 0) then
{	
	_load = _vcl addAction ["Lift", "mountOnC130\mount_vcl.sqf", _typeOfVcl, 0, false, true];
	_vcl removeAction _unload;
	_c = 1;
};

if (((_vcl getVariable "NORRN_mountOn_vcl_pos0") select 0) && _c == 1) then
{	
	_unload = _vcl addAction ["Drop", "mountOnC130\dismount_vcl.sqf",-1,100000, false, true];
	_vcl removeAction _load;
	_c = 0;
};
if (count (nearestObjects [_vcl, ["LandVehicle","Air"], 30]) == 0 || count (nearestObjects [_vcl, [_typeOfVcl], 30]) == 0) then
{
	_vcl removeAction _load;
	_vcl removeAction _unload;
	if (!((_vcl getVariable "NORRN_mountOn_vcl_pos0") select 0)) then {_c = 0};
	if ((_vcl getVariable "NORRN_mountOn_vcl_pos0") select 0) then {_c = 1};
};	
//hint format ["%1", (_vcl getVariable "NORRN_mountOn_vcl_pos0")];
sleep 2;
};
if (!alive _vcl) exitWith {};



// mount_vcl.sqf
// © JUNE 2009 - norrin ([email protected])

_vcl 			= _this select 0;
_caller			= _this select 1;
_typeOfVcl		= _this select 3;
_dir			= getdir _vcl;
_mountVcl 		= objNull; 
_blogs			= 0; 
_c				= 0;

if (count nearestObjects [player, [_typeOfVcl], 30] > 0) then
{
_mountVcl = nearestObjects [player, [_typeOfVcl], 30] select 0;
}; 

if (vehicle _caller != _caller) then {_caller action ["", vehicle _caller]; sleep 1};

if (!((_vcl getVariable "NORRN_mountOn_vcl_pos0") select 0)) then
{	
_mountVcl attachTo [_vcl,[0,0,-8]]; 
sleep 0.1;
_vcl setVariable ["NORRN_mountOn_vcl_pos0", [true, _mountVcl], true];
};

if (true) exitWith {};

// dismount_vcl.sqf
// © JUNE 2009 - norrin ([email protected])

_vcl 			= _this select 0;
_caller			= _this select 1;
_mountVcl		= (_vcl getVariable "NORRN_mountOn_vcl_pos0") select 1;
_vclDir			= getDir _vcl;


if (vehicle player == vehicle player) then 
{	
detach _mountVcl;
_mountVcl setPos [(getPos _vcl select 0), (getPos _vcl select 1), 0];
_vcl setVariable ["NORRN_mountOn_vcl_pos0", [false, objNull], true];
};

if (true) exitWith {};

I use this activation in there inits

Vehicle name Moble_HQ_1

veh = [this, 15, 18000, 0,FALSE, FALSE, "this setPos [this setPosASL [position this select 0, position this select 1, 15.9]getPos this select 0, getPos this select 1, 12]"] execVM "vehicle.sqf"; this setPosASL [position this select 0, position this select 1, 15.9];

Vehicle Name Moble_HQ_2

veh = [this, 15, 18000, 0, FALSE, FALSE, "this setPos [this setPosASL [position this select 0, position this select 1, 15.9]getPos this select 0, getPos this select 1, 12]"] execVM "vehicle.sqf"; this setPosASL [position this select 0, position this select 1, 15.9];

And this on the Chopper

veh = [this, 15, 18000, 0, FALSE, FALSE, "nul = [this,'car'] execVM 'mountOnC130\mount_vcl_init.sqf'; this setPosASL [position this select 0, position this select 1, 15.9]"] execVM "vehicle.sqf"; this setPosASL [position this select 0, position this select 1, 15.9]; nul = [this,"car"] execVM "mountOnC130\mount_vcl_init.sqf";

Edited by Gunnykat
left out chopper init

Share this post


Link to post
Share on other sites

Umm... those init strings look wrong, like you have a setPos with too many arguments (using position this and getPos both) also I don't see the mount_init stuff norrin's needs to work.

Share this post


Link to post
Share on other sites

Kylania where are you talking about. In the script or on the vehicles. I am using a respawn code here too.

Edited by Gunnykat

Share this post


Link to post
Share on other sites

So what do I need to do exactly to correct this.

Wait I think I see what you mean.

Edited by Gunnykat

Share this post


Link to post
Share on other sites

I remember the value for the aircraft carrier :)

The command line is :

this setPosASL [(getPosASL this select 0), (getPosASL this select 1), 15.9];

Donc combine position with posASL etc... it's not the same thing ;) Position is in 2D format where as posASL is in 3D format (xyz) relative to the sea.

Share this post


Link to post
Share on other sites

I have done what both of you have sugjested to do. But I have the same problem. I found that on the LHD I can only pick up one of the HQ's And on land neather one will pick up. The commands show up and change from lift to drop but nothing happens.

I use this activation in there inits

Vehicle name Moble_HQ_1

veh = [this, 15, 18000, 0,FALSE, FALSE, "this setPosASL [(getPosASL this select 0), (getPosASL this select 1), 15.9];"] execVM "vehicle.sqf"; this setPosASL [(getPosASL this select 0), (getPosASL this select 1), 15.9];

Vehicle Name Moble_HQ_2

veh = [this, 15, 18000, 0, FALSE, FALSE, "this setPosASL [(getPosASL this select 0), (getPosASL this select 1), 15.9];"] execVM "vehicle.sqf"; this setPosASL [(getPosASL this select 0), (getPosASL this select 1), 15.9];

And this on the Chopper

veh = [this, 15, 18000, 0, FALSE, FALSE, "nul = [this,'car'] execVM 'mountOnC130\mount_vcl_init.sqf'; this setPosASL [position this select 0, position this select 1, 15.9]"] execVM "vehicle.sqf"; this setPosASL [position this select 0, position this select 1, 15.9]; nul = [this,"car"] execVM "mountOnC130\mount_vcl_init.sqf";

Share this post


Link to post
Share on other sites

I still cant get this to work right it picks up only one of the hqs on my LHD. And if i put the hq on the ground and leave it. When I go back to get it I can not lift it anymore. Oh and I also noticed if I start them out on the ground. I can not lift eather of them. Anyone know a good lift script. I know there is one in the domination map but I do not know what all I need to take from domination script to get it to work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×