attachto command
United States Intelligence :: Games :: ArmA 2 :: Editing
Page 1 of 1
attachto command
attachto command
placing info here for reference
substitute classname for player/car ?
placing info here for reference
- Code:
player attachTo [car,[0,0,1]];
substitute classname for player/car ?
Re: attachto command
Celery wrote:The way I'd do it is attach the static weapon for looks and use addMagazine and addWeapon on the car so it can fire the weapon without any tricks.
Re: attachto command
blakeace wrote:Ok I must admit I love Norrins little attachto scripts. I have altered and played around with the bike on the pickup one to acomplish all sorts of things like carrying ammo crates, mortars, adding searchlights to the back of trucks the list goes on!
Here is one thing that I am sure some people will love. I have always wanted to be able to tow the M119 around before a truck. Now this doesn't do anything fancy it just attaches the gun to the back of the truck, so the wheels don't rotate and the base plate is still present, though partially hidden most of the time. At least it gives me the ability to add this to the missions if I need to relocate etc.
- Code:
// mount_vcl.sqf
// © JUNE 2009 - norrin (norrin@iinet.net.au)
_vcl = _this select 0;
_caller = _this select 1;
_typeOfVcl = _this select 3;
_dir = getdir _vcl;
_mountVcl = objNull;
_blogs = 0;
_c = 0;
_dir1 = 0;
if (count nearestObjects [player, [_typeOfVcl], 20] > 0) then
{
_mountVcl = nearestObjects [player, [_typeOfVcl], 20] select 0;
};
if (vehicle _caller != _caller) then {_caller action ["GetOut", vehicle _caller]; sleep 1};
if (!((_vcl getVariable "NORRN_mountOn_vcl_pos1") select 0)) then
{
_dir1 = getdir _vcl;
_vcl setdir 0;
_mountVcl attachTo [_vcl,[0,-6.4,-1.2]];
_mountVcl setDir 180;
_mountVcl setVectorup [0,-0.15,1];
_vcl setdir _dir1;
sleep 0.1;
_vcl setVariable ["NORRN_mountOn_vcl_pos1", [true, _mountVcl], true];
};
if (true) exitWith {};
So all I have done is added bits to the mount_vcl.sqf script. Then in the init line of the truck assigned the type of object to be attached to M119
nul = [this,"M119"] execVM "mountOnVcl\mount_vcl_init.sqf";
The rest of the scripts are as per Norrins Put bike in Pickup scripts.
As always love your work Norrin!
This has not been tested in MP, just been playing around, and their is probably a better way of doing it, but it may just give a little enjoyment to others like it has to me.
United States Intelligence :: Games :: ArmA 2 :: Editing
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum