![]() |
|
|
|||||||
| ArmA 2 & OA - MISSION EDITING & SCRIPTING For discussing the technical aspects of creating custom ArmA 2 & the standalone expansion Operation Arrowhead missions as well as scripting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
First Sergeant
Join Date: Aug 2006
Location: Melbourne, Australia
Posts: 936
|
Example scripts that use the attachTo command
Scripted Ride On 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/at...nTop2.utes.rar (Updated 080609) 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:
nul = [this] execVM "sitOnTopVcl\mount_vcl_init.sqf"; 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/at...uck01.utes.rar 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:
nul = [this,"bicycle"] execVM "mountOnVcl\mount_vcl_init.sqf"; 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/at...les01.utes.rar 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:
nul = [this,"car"] execVM "mountOnC130\mount_vcl_init.sqf"; 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:
_mountVcl attachTo [_vcl,[0,0,-2]]; ![]() Move to helicopter door and fire Practical uses of the AttachTo command Part 4 Description A script that allows you to move from the seat position within a UH-1 to the door way so that you can fire outside while the chopper is moving. Download http://norrin.org/downloads/ArmA2/at...iDoor.utes.rar 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:
nul = [this] execVM "heliDoor\heliDoor_init.sqf"; 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 edited by norrin; 06-08-2009 at 12:23 PM. Reason: New and updated scripts available |
|
|
|
|
|
#2 |
|
Chief Warrant Officer
Join Date: Mar 2007
Location: Norway
Posts: 3,280
|
Do we have possibility to change the direction of the attached vehicle? Could allow some interresting towing effects.
__________________
Regards Carl Gustaffa |
|
|
|
|
|
#3 |
|
First Sergeant
Join Date: Aug 2006
Location: Melbourne, Australia
Posts: 936
|
That shouldn't be too hard to include mate, but its going to be a little while before I can do more with these scripts as the scripting jobs are already starting to pile up for ArmA2 - this script was more a proof of concept to show that it can be done, adding different vehicles/carrying possibilities and tightening up the code will take a little longer, the APC script on the otherhand is hopefully a bit more advanced.
|
|
|
|
|
|
#4 |
|
Staff Sergeant
Join Date: Jun 2009
Location: SE UK
Posts: 211
|
|
|
|
|
|
|
#5 |
|
Second Lieutenant
Join Date: May 2005
Location: Netherlands
Posts: 4,846
|
Awesome, Norrin! Thanks for sharing.
__________________
Good night. |
|
|
|
|
|
#6 |
|
Sergeant
Join Date: Feb 2007
Posts: 124
|
Yeeeeeeeehaaaaaaah! Great, thank you very much!
|
|
|
|
|
|
#7 |
|
Second Lieutenant
Join Date: May 2007
Location: In the lab cooking up some serious s#%t!
Posts: 4,317
|
Excellent!
|
|
|
|
|
|
#8 |
|
Gunnery Sergeant
Join Date: Jun 2008
Posts: 475
|
Mission possibilities are endless!
|
|
|
|
|
|
#9 |
|
Chief Warrant Officer
Join Date: May 2003
Location: Sweden
Posts: 3,734
|
btw have any one tried with a ammo crate in a pick up? or a ural truck?
__________________
|
|
|
|
|
|
#10 | |
|
Lance Corporal
Join Date: Apr 2004
Posts: 48
|
Quote:
Use setDir to change the direction of the vehicle. If you're using this in multiplayer, add another line "myObj setPos getPos myObj" to sync with every client, otherwise setDir will be local and not do anything (useful). setDir is linked to the vehicle you're going to attach it to. So if you use setDir 180, it won't actually point south, but point towards the rear of the vehicle (which is excellent). Last edited by IceShade; 06-04-2009 at 02:18 PM. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|