Arma 2 how to use 3D editor tools

The ARMA 2 & 3 Editor

(Use Ctrl + F to search for keywords)

Set unit / object height

This can be used as a condition, initialization or activation. It will immediately place the unit at the desired height. In any of the fields described above, type: this setPos [(getpos this select 0), (getpos this select 1), 20]; The height is declared by the last number, in meters. If this is typed into a units Initialization ’field, can Bob’ can be substituted with ‘this’.

Set flying height

To set the flying height of an aircraft at each waypoint, just type the code plane1 flyinheight 60; into the "On Activation" field of the waypoint. 60 is in meters.

Change an objects angle

To angle an object on any axis, use this code: car1 setVectorUp [0,0,0]; or car1 setVectorDir [0,0,0]; The numbers represent x, y, z axis.

Set fuel capacity

“Setfuel” has a value from 0 to 1 with 1 being 100% fuel. Upon waypoint activation: in waypoints 'On activation' field type car1 setfuel 0.5; Upon trigger activation: in trigger’s On activation ’field type car1 setfuel 0.5;

Set unit damage

“Setdammage” is purposely spelled wrong. It has a value from 0 to 1 with 1 being 100% damage. Upon waypoint activation: in waypoints 'On activation' field type Bob setdammage 0.5; Upon trigger activation: in trigger’s On activation ’field type Bob setdammage 0.5;

Light / put out campfire on command

Use this code in the "On Activation" field to light a campfire: fire1 inFlame true; Switch to false to put it out.

Units teleport into vehicle

For each unit use Bob moveincargo car1; This can be used in the "Initialization" field of a unit from the beginning or used in the "On Activation" field of a trigger or waypoint. The word "cargo" can be swapped with "gunner", "driver", "commander", and "turret" to force these positions. If trying to place more than one unit as gunner, use Bob moveinturret [heli, [0]]; where # 0 is gun position 1, # 1 is position 2, etc.

Do not allow fleeing of a unit

When a unit feels it is at a disadvantage it may flee. To disable this, the code may be used as an Activation ’or Initialization’. Type: Bob allowfleeing 0; To allow change 0 to 1.

Spawn an object at another object’s location

This code, if put into the 'On Activation' field of a trigger will create a purple smoke grenade 50 meters above Bob's head: Bobsmoke = “SMOKESHELLPURPLE” createVehicle [(getPos Bob select 0), (getPos Bob select 1), 50] ; You must use the correct object ID “SMOKESHELLPURPLE” or the trigger won't work. Change to RED, YELLOW, BLUE, ORANGE for different colors or use classnames for other objects like grenades, vehicles, etc.

Change speed of a unit

To change the speed of a unit or limit it there are several codes: Bob setSpeedMode “Full”; is available in Auto, Limited, Normal, Full. Bob forceSpeed ​​120; forces the unit to move at a certain speed up to the max speed for the unit. Bob limitSpeed ​​60; limits the units speed to 60kph; Bob setSpeed ​​getSpeed ​​Nick; Bob matches speed of Nick;

Remove all weapons and add weapons to unit

Use this to remove all of the units weapons, not counting accessories. It can be used as an "Activation" or "Initialization". Type: removeAllWeapons Bob;

Use this to add specific weapons to a unit. Used the same way as the removal code, type Bob addWeapon “NVGoggles”; It only works with weapon codes that are present in the version of the game that is installed. For instance, any weapon code starting with ACE will only be available if ace is installed. First use addweapon and addmagazine to add the desired weapons. Now it is necessary to remove the old unwanted items. AT THE END of the add codes type Bob removeweapon ‘ACE_M9 ″; or Bob removemagazine “12rnd_9mm_m9”; once for each unwanted gun or mag that the item normally spawns with. EXAMPLE: If a unit normally respawns with an M4A1, six mags and two grenades, and you just want to add an M16A2, and have a total of eight mags, add two mags and the M16A2 and only remove the M4A1 at the end of the code. Refer to the weapon code list for specific weapon codes.

To preset custom loadouts for a unit, create an ARMAEdit Custom Unit script and save it as player1.sqs ’. for example. Use [player1] exec “player1.sqs”; in a triggers On Activation ’field to activate it. Be sure the Condition ’says alive player1;

Adding or removing weapons and ammo from an ammo box

To remove weapons and ammo from an ammo box, this code can be used in the "Initialization" field of the ammo box or the "On Activation" fields of a trigger or waypoint. Type: clearweaponcargo box1; and clearmagazinecargo box1;

To add weapons and ammo to a box use this code instead: box1 addweaponcargo [“AKS_GOLD”, 5]; box1 addmagazinecargo [“30rnd_762x39_ak47”, 120]; The last number in each set of brackets refers to the quantity of items added to the box. Refer to the weapon code list for specific weapons and magazines. Remember, some codes don't work.

Not allow unit to enter vehicle

To block a unit from entering a certain vehicle use this code in the "Initialization" field of the vehicle: [Bob, Nick] allowGetIn false; Change false to true to allow access. Add as many units as needed to the brackets.

Attach / detach an object to another

To attach an object to another object / unit use this code in either the 'Initialization' field or 'On Activation' field: box1 attachTo [Bob, [0, 0, 0]]; The first 0 is fore-aft, the second is right-left, the third is up-down. Use a negative sign to declare aft, left or down. Now to detach the object on command use the detach command by typing this into the ‘On Activation’ field of a trigger: detach box1; Be aware, ammo boxes will detach and remain exactly where they are detached even if they are in mid air.

Display the speed of a unit

To display a unit’s speed as a hint, use this code: hint format [“Your Speed:% 1”, speed car1]; where% 1 is where the speed will input itself. You may change "Your Speed" to any text.

Make a unit prisoner

To make a unit a prisoner of the enemy and not get shot by the enemy type this in an ‘On Activation’ field: Bob set Captive true; Change true to false to disable.

Name a group

To name a group to be used later in the mission, it is necessary to declare this in the group leaders ‘Initialization’ field: police = group this;

Unit joins group

Used in an On Activation ’field, this will make a unit join a pre-declared group as explained above: [Bob] join police;

Teleport a unit or object to any position

First place a marker at the location you wish to move the unit / object to. Be sure to give it a name like “putBobHere”. Next type this into any On Activation ’field: Bob setPos [(getMarkerPos“ putBobHere ”) select 0, (getMarkerPos“ putBobHere ”) select 1, 0]; Upon activation of the trigger or waypoint, Bob will teleport to the marker “putBobHere”. Keep in mind, if Bob has waypoints before this, he will continue to walk to his next waypoint.

Set a unit’s stance

To make a unit stand, crouch or lay down on command, use this code in any ‘On Activation’ field. Bob setUnitPos “Up”; This will make him stand. You may also use Middle, Down, and Auto to make him crouch, lay down and reset to auto.

Create a name for nearest building

To name a building nearest an object or unit, use this code: House_1 = nearestbuilding Bob; House_1 is the name the user can give to the building and can be anything. This is useful for destroying particular buildings on command. One needs only to type House_1 setdammage 1; into an "On activation" field to destroy the selected building.

Set vehicle lock

To enable / disable locks on vehicles use this simple code in a 'On Activation' field: car1 lock true; to lock the vehicle. Change to false to unlock a vehicle.

Randomize units / object start location

To do this, you need to utilize multiple markers. Place the unit and multiple markers to act as starting points. Group these markers to the unit / object. When the game starts, the unit / object will randomly pick a marker to start at. You can also double click the unit and set its ‘Placement Radius’ to further randomize its location.

Move marker to another marker

To teleport a marker to another one, name both markers and use this code in any ‘On Activation’ field: “mark1” setMarkerPos getMarkerPos “mark2”; This moves mark1 from its current position to mark2.

Make a unit move to any object / marker

There are several codes to use. These should be inserted into ‘On Activation’ fields:

Using objects: Bob doMove getPos Nick;

Using IDs: Bob doMove getPos (Object ID);

Using coordinates: Bob doMove [X, Y, Z];

Using markers: Bob doMove getMarkerPos “MarkerName”;

Moving objects, triggers or markers

Use these codes in the "On Activation" field:

Using an object: Bob setPos getPos Nick;

In front, behind, beside an object: Bob setpos Nick modelToWorld [0,3,0];

Using an ID: Bob setPos getPos (Object ID);

Using coordinates: Bob setPos [X, Y, Z];

Using markers: Bob setPos getMarkerPos “Marker1”;

From marker to marker: “Marker1” setMarkerPos getMarkerPos “Marker2”;

From marker to object: “Marker1” setMarkerPos getPos Bob;

Using a vehicle: Bob setPos getPos vehicle car1;

Using a vehicle II: “Marker1” setMarkerPos getPos vehicle car1;

Moving a trigger to object vehicle name of trigger setPos getPos Bob

Change player skin in-game (single player only)

To change a players skin or uniform in-game create two units, the starting one and the one you want to become. We name them myOriginalUnit and myNewUnit respectively for this example. In the "On Activation" field of a trigger write myNewUnit setpos getpos myOriginalUnit; selectPlayer myNewUnit; myOriginalUnit setdammage 1; Create another trigger to delete the old unit. NOTE: DO NOT DELETE UNIT IN FIRST TRIGGER. Game will crash.) In the new trigger set the Condition ’as:! Alive myOriginalUnit; In the "On Activation" field simply type deletevehicle myOriginalUnit; and set a "Countdown" of 1 second. You may want to have the new unit include the same weapon load-out as the original unit as it won’t cross over.

Make object invisible

To make an existing object or unit invisible on command for singleplayer, type car1 hideobject TRUE; into any 'On Activation' or 'Initialization' field. To reverse it, use FALSE.

To make an object invisible to all players use _nic = [nil, _plane, “per”, rHideobject, false] call RE; in the script. "_Plane" is the name of the object being made invisible. 'False' is off while 'true' is on.

Affect all units in a given parameter

To cause something to happen to all units near an object use: {_x setdammage 1} forEach nearestObjects [GBUTarget, [“man”], 20]; "Man" is the type of unit and 20 is the radius of effect. The format is: {_ x DosomeAction} forEach UnderWhatCondition; Use {_x setdammage 1} forEach units group Bob; to kill every member of Bob’s group. Use {_x setcaptive TRUE; RemoveAllWeapons _x;} forEach units group Bob; for multiple commands.

Show class name of unit / object

To display a hint showing the class name of a unit or object type: hint format [“% 1”, type of this]; in the unit’s initialization field.

Like this: