Home   Help Search Login Register  

Advertisement

Author Topic: Practical uses of the attachTo command (ACCEPTED)  (Read 7001 times)

0 Members and 1 Guest are viewing this topic.

Offline norrin

  • Tutorial Writer
  • **
Practical uses of the attachTo command (ACCEPTED)
« on: 08 Jun 2009, 11:12:25 »
Scripted ride on top of APC
Practical uses of the attachTo command Part 1
© JUNE 2009 - norrin

Description
Suite of scripts that allows up to 4 players to ride on the top of an APC.  From there they can stand, crouch, turn around, shoot reload and disembark

Download
http://norrin.org/downloads/ArmA2/attachTo/onTop2.utes.rar (Version 2)
OFPEC ED

To implement in your own missions
1. Copy the sitOnTopVcl folder from the test mission into your mission file.
2. Create an AAV in the editor, name it (eg. AAV1), then in the APC's init box put:
Code: [Select]
nul = [this] execVM "sitOnTopVcl\mount_vcl_init.sqf";3. Create playable units and name them in the editor.

To use
1. Run up to the AAV and you will get the option to ride on top.
2. Once you are on top and attached you can:
a/ turn around using the "delete" and "end" keys
b/ disembark using the insert key - this will unattach you from the vehicle and you can just walk off using the "W" key.
c/ reload using the "R" key
d/ aim and target within a limited arc, bring up the iron sites, the use the "alt" key to move your aim around - for gross changes in direction use the turn around keys listed above.

Tested
On a dedicated server but without multiple players

Hopefully something similar will be applicable to choppers and I'll start work on that next week



Put Bike in pick-up
Practical uses of the attachTo command Part 2
revision 1 (080609)

Description
A script that allows you to put a bike on the back of a pick-up, drive it round then unmount the bike.

Download
http://norrin.org/downloads/ArmA2/attachTo/loadOnTruck01.utes.rar
OFPEC ED

To implement in your own missions
1. Copy the mountOnVcl folder from the test mission into your mission file.
2. Create a pick-up in the editor and name it, , then in the trucks init box put:
Code: [Select]
nul = [this,"bicycle"] execVM "mountOnVcl\mount_vcl_init.sqf";3. Create a player in the editor and name it.
4. Create a bike in the editor.

To use:
1. Move close to vehicle make sure a bicycle is close at hand and the use the action: "Mount on Vehicle"
2. You can then drive around - note the bikes pedals go around as you drive the car. :)
3. Get out of the car and "Dismount bike from car".

Tested
Dedicated server by myself



Put car in C-130
Practical uses of the AttachTo command Part 3

Description
A script that allows you to put a car or hummer etc in the cargo section of a C-130, fly it round then unmount the vehicle. 

Download
http://norrin.org/downloads/ArmA2/attachTo/Hercules01.utes.rar
OFPEC ED

To implement in your own missions
1. Copy the mountOnC130 folder from the test mission into your mission file.
2. Create a pick-up in the editor and name it, , then in the C130's init box put:
Code: [Select]
nul = [this,"car"] execVM "mountOnC130\mount_vcl_init.sqf";3. Create a player in the editor and name it.
4. Create a car of some sort in the editor.

To use:
1. Move close to the rear of the C130 make sure a car is close at hand and then use the action: "Load vehicle on C-130"
2. You can then fly around.
3. Get out of the plane then "Unload Vehicle".

Tested
Dedicated server by myself

Other Notes
You can probably put just about anything into the C-130, just makes sure you put the correct class in the C130's init box line, you may also need to change this line
Code: [Select]
_mountVcl attachTo [_vcl,[0,0,-2]]; in the mount_vcl.sqf which you can find in the mountOnC130 folder.



Move to helicopter door and fire (Updated 19th August 2009, Version 0.2)
Practical uses of the AttachTo command Part 4

Description
A script that allows you to move from the seat position within a UH-1 or UH-60S to the door way so that you can fire outside while the chopper is moving. 

Download
http://norrin.org/downloads/ArmA2/attachTo/heliDoor02.utes.rar
OFPEC ED

To implement in your own missions
1. Copy the heliDoor folder from the test mission into your mission file.
2. Create a UH-1 in the editor and name it, , then in the chopper's init box put:
Code: [Select]
nul = [this] execVM "heliDoor\heliDoor_init.sqf";3. Create a player in the editor and name it.

To use:
1. Get in the chopper once inside you should get an action that allows you to move to the left or right door
2. To aim: bring up the iron sights and hold the alt key to move your aim point around
3. Press "R" to reload
4  Press "INSERT" to move back to your seat - NB you will need to do this to disembark the chopper

Limitations
If the chopper is accelrating or decelerating hard you may bob around a bit inside while at the doors and may not be able to shoot - unfortunately this is a limitation of the

attachTo command. When in level flight it seems to work really nicely.

Test Mission
Get in the back of the chopper and then move to the door (you can also do this while in flight).  Order the pilot to move to a position on the map.  Try moving to each door and

back again.

Tested
On a dedicated server by myself

« Last Edit: 19 Aug 2009, 10:21:34 by norrin »

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Practical uses of the attachTo command
« Reply #1 on: 08 Jun 2009, 14:59:37 »
Thats awesome Norrin.
Xbox Rocks

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Practical uses of the attachTo command
« Reply #2 on: 08 Jun 2009, 16:30:56 »
Very nice indeed! This command gives us so many opportunities, it will never stop!

How about putting a push-bike on the back-bumper of a car as they are done in real world (we can assume the car has an invisible bike rack!).
« Last Edit: 08 Jun 2009, 16:33:00 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Re: Practical uses of the attachTo command
« Reply #3 on: 08 Jun 2009, 17:48:44 »
Yes excellent contribution, Norrin!!
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Practical uses of the attachTo command
« Reply #4 on: 10 Jun 2009, 00:59:46 »
Nice! Thanks Norrin!

The funny thing is: now that we finally have the glue BIS takes away all those walls. :)
try { return true; } finally { return false; }

Offline norrin

  • Tutorial Writer
  • **
Re: Practical uses of the attachTo command (ACCEPTED)
« Reply #5 on: 13 Aug 2009, 08:46:33 »
Here's another one.

Tow aircraft script

AUGUST 2009
by norrin
based on an idea from David Campagna
tested on ArmA v1.03 on dedicated server  

Description
Script allows you to tow aircraft around using the US towing tractor

How it works
Jump in the tow tractor and back up towards the front of an aircraft - make sure you are facing almost the same direction and you will get an action to tow the aircraft.  This attaches the plane to the tractor.  While attached you get an action to unattach the aircraft.

To implement in your own missions
1. Copy the c130tow directory to your mission file.
2. In the init line of the tractor put:

Code: [Select]
nul = [this]execVm "c130Tow\c130Tow_init.sqf";
OFPEC DOWNLOAD
« Last Edit: 19 Aug 2009, 21:20:32 by hoz »

Offline norrin

  • Tutorial Writer
  • **
Re: Practical uses of the attachTo command (ACCEPTED)
« Reply #6 on: 19 Aug 2009, 10:11:17 »
Helidoor Script Update (Version 0.2)

This script is hopefully fully multiplayer compatible now, also added firing positions for the UH-60S.

Download
http://norrin.org/downloads/ArmA2/attachTo/heliDoor02.utes.rar
OFPEC Download

Fixes
*Multiple actions for moving to the chopper doors when more than one player was on board.

See readMe in download for more details
« Last Edit: 19 Aug 2009, 23:25:56 by hoz »

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Practical uses of the attachTo command (ACCEPTED)
« Reply #7 on: 19 Aug 2009, 11:00:50 »
I havent been able to test your attachTo scripts as much as I would have liked to. But my own meddling with the attachTo command produced an irritating effect. Namely this:

When an attached unit is moved away from it's initial position by the vehicle it's attached to, the unit's graphics deteriorates as if the unit was still standing in the orginal (editor placed) position. It looks as if I view the unit from a very long distance. It doesn't happen to the playable unit I'm playing at the moment, but to all other attached units. Thus my squadmates (sitting next to me on top of a tank for example) will gradually be turned into amusing polygon shapes with blurry textures (even though they are sitting less than one meter away).

How did you resolve that issue? Could you point me in the right direction? I have your scripts on my hdd but couldn't find a solution to the aforementioned problem.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline norrin

  • Tutorial Writer
  • **
Re: Practical uses of the attachTo command (ACCEPTED)
« Reply #8 on: 19 Aug 2009, 13:27:08 »
I must admit I've never encountered that problem mate.  The only thing I can suggest is that you make sure you attach your object to the one that's going to be moving eg. _man attachTo [_vehicle,[-0.5,0.8,-2]];

If you're still having camera problems and you want me to take a look email or PM me a link to your test mission as I'm happy to help.