United States Intelligence
Would you like to react to this message? Create an account in a few clicks or log in to continue.

attachto command

Go down

attachto command Empty attachto command

Post  DirTyDeeDs Wed Nov 18, 2009 1:15 pm

attachto command
placing info here for reference

Code:
player attachTo [car,[0,0,1]];

substitute classname for player/car ?
DirTyDeeDs
DirTyDeeDs
Uber Spammer Jedi
Uber Spammer Jedi

Posts : 802
Join date : 2008-07-25
Age : 52
Location : Live Free Or Die

http://usi-team.xippy.org/

Back to top Go down

attachto command Empty Re: attachto command

Post  DirTyDeeDs Wed Nov 18, 2009 1:15 pm

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.
DirTyDeeDs
DirTyDeeDs
Uber Spammer Jedi
Uber Spammer Jedi

Posts : 802
Join date : 2008-07-25
Age : 52
Location : Live Free Or Die

http://usi-team.xippy.org/

Back to top Go down

attachto command Empty Re: attachto command

Post  DirTyDeeDs Wed Nov 18, 2009 1:25 pm

example scripts that use attachto, by Norrin.

too many to paste here, view the thread at BIS:

http://forums.bistudio.com/showthread.php?t=73630&highlight=attachto

attachto command MountedBike
attachto command AttahTo
DirTyDeeDs
DirTyDeeDs
Uber Spammer Jedi
Uber Spammer Jedi

Posts : 802
Join date : 2008-07-25
Age : 52
Location : Live Free Or Die

http://usi-team.xippy.org/

Back to top Go down

attachto command Empty Re: attachto command

Post  DirTyDeeDs Wed Nov 18, 2009 1:49 pm

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.

attachto command Towgun

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.
DirTyDeeDs
DirTyDeeDs
Uber Spammer Jedi
Uber Spammer Jedi

Posts : 802
Join date : 2008-07-25
Age : 52
Location : Live Free Or Die

http://usi-team.xippy.org/

Back to top Go down

attachto command Empty Re: attachto command

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum