Arma 3 Guide

EllmansWorld's "Script" list for Arma 3

EllmansWorld’s “Script” list

Overview

Information:This guide contains scripts & commands that I actively use when mission editing and Zeusing.I have a previously created guide called Useful Arma 3 Scripts that were posted back in 2019, this is more of a updated version of that and hopefully easier to read.ArmaOps:While taking my time to create this Guide I might as well be cheeky and tell you about the community I run.ArmaOps is a Arma 3 community where anyone is welcome to come and play on our servers & take part in our Zeus missions we host twice a week: Wednesday: (1800 UTC, 2000 CEST, 1900 BST, 1400 EST, 1100 PST) Saturday: (1900 UTC, 2100 CEST, 2000 BST, 1500 EST, 1200 PST) There’s no registration, ranks, trainings or attendance requirements.Our Discord: https://discord.gg/aHjQJ8RHopefully you’ll find my guide useful and if not maybe you’ll pass it on to someone who will.If it is helpful then I a Like would be super appreciated, since it will help others with finding the guide.

Script Execution

I activate my sqf files containing scripts two different ways:
1. Local Execution:

nul=execVM “scriptstest.sqf”;

2. Global Execution:

[] remoteExec [“scriptstest.sqf”, 0, false];

The scripts can generally be executed both in a SQF file and from the debug console/Zeus execute code.

How to create an sqf file:

Make sure to turn on show “known file extensions” as shown below: (Win10)
Create a text file:
Name it what you want and end the extension with .sqf:

Text Scripts

Local Hint:
This will give a hint in the top right of the screen but only to the person who triggers the script.

Hint “Write here”;

Global Hint:
Will trigger for everyone, should be executed in a script/sqf file.

_textOne = “<t color=’#E22020′>I am a script, everyone can see me.</t>”; hint parseText (_textOne);

Screen fading with Text:
Can be done in the following ways: “BLACK OUT”, “BLACK IN”, “BLACK FADED”, “BLACK”, “WHITE OUT”, “WHITE IN”.

titleCut [“I like text”,”BLACK IN”,2.5];

Display text in the middle of the screen:

[“TASK-NAME”, [“TEXT”, “PLAIN”]] remoteExec [“cutText”];

Image Hint:
This shows a image in a hint, I would advise a paa image.

hint parseText “<img image=’imagesimage.paa’ <img size=’20’ /> “;

AI writing in chat:
(Place a HQ Entity and name it)
(globalChat, sideChat, vehicleChat, groupChat, commandChat, systemChat)

Rahmah globalchat “Rahmah Elder: Salam”;

Map/Marker Scripts

Delete a Map Marker:
This deleted a map marker via it’s variable name.

deleteMarker “NameOfMarker”;

Create markers on the map via a script:
Creates a marker on the map, the name used in the beginning “bob” does not actually matter.
Icon Marker:

bob = createMarker [“nameofmarker”, [5150,5031]]; bob setMarkerShape “ICON”; “nameofmarker” setMarkerType “mil_objective”; “nameofmarker” setMarkerColor “ColorRed”; “nameofmarker” setMarkerDir 90; “nameofmarker” setMarkerText “ThisIsTheMarkersName”;

Area Marker:

bob = createMarker [“nameofmarker”, [5098,5071]]; bob setMarkerShape “ELLIPSE”; “nameofmarker” setMarkerColor “ColorBlack”; “nameofmarker” setMarkerSize [100, 100]; “nameofmarker” setMarkerBrush “SOLID”;

Hide & show Map markers:
(Should not be executed in init.sqf, makes it fire over and over again)
Hidden:

“markerName1” setMarkerAlpha 0;

Show:

“markerName1” setMarkerAlpha 1;

Object Scripts

Delete a Object:
Can be used to delete objects place, variable name defines the name of the object.
One Object:

deleteVehicle obj1;

Multiple Objects:

{deleteVehicle _x} ForEach [obj1,obj2,obj3];

Hide/Unhide a Object:
Hides and unhides a already placed object. (true = hides it, false = unhides it)

objectname hideObject false;

Change texture on a flag:
This can be done in both jpg or paa. (1024×512 generally works)

this SetFlagTexture “imagesimagename.jpg”;

AI Scripts

Disable AI Functions:
If placed directly on ai then use “this” otherwise use the variable name, prevents a Ai from doing the defined action.
Use “_this” if applied in Zeus.

this disableAI “PutActionHere”;

All Functions:

  • “TARGET” – stop the unit to watch the assigned target / group commander may not assign targets.
  • “AUTOTARGET” – prevent the unit from assigning a target independently and watching unknown objects.
  • “MOVE” – disable the AI’s movement. (Allows it to still move it’s head & body but not move)
  • “ANIM” – disable ability of AI to change animation.
  • “TEAMSWITCH” – AI disabled because of Team Switch.
  • “WEAPONAIM” – no weapon aiming.
  • “AIMINGERROR” – prevents AI’s aiming from being distracted by its shooting, moving, turning, reloading, hit, injury, fatigue, etc.
  • “SUPPRESSION” – prevents AI from being suppressed.
  • “CHECKVISIBLE” – disables visibility raycasts.
  • “COVER” – disables usage of cover positions by the AI.
  • “AUTOCOMBAT” – disables autonomous switching to COMBAT when in danger.
  • “PATH” – stops the AI’s movement but not the target alignment.
  • “MINEDETECTION” – disable Ai mine detection.
  • “ALL” – all of the above. (At this point you might as well turn off Simulation in Eden)

Trigger related

Automatic Bar Gate Opener:
Put a trigger over the bar gate, pref 3×7 square, set the the trigger to activate repeatedly and who you want to trigger it. (“GateName” is the variable name)
On Activation:

GateName animate [“Door_1_rot”, 1]

On Deactivation:

GateName animate [“Door_1_rot”, 0]

Trigger only activating if object/AI is alive:
This is set as a trigger condition, and the trigger will only fire once x object(s) are not longer existing/dead.
One Object:

!alive “object name”

Multiple Objects:

!(alive obj1) && !(alive obj2)

Arsenal (BIS & ACE3)

BIS/Vanilla Arsenal:

0 = [“AmmoboxInit”,[this,true]] spawn BIS_fnc_arsenal;

AC3 scroll wheel arsenal:
(Can’t be blacklisted/whitelisted as far as I know)

this addAction[“Open Arsenal”, {[_this select 0, player, true] call ace_arsenal_fnc_openBox},[this]];

AddAction Scripts

Best AddAction:
(object title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition,)

this addAction [“Call Artillery”,”scriptsarty.sqf”,nil,1.5,false,true,””,””,3,false,””,””];

Add item to gear or person:
(addGoggles, addVest, addBackpack, addWeapon, addHeadgear, forceAddUniform)

this addAction[“<t color=’#FF0000′>Gas Mask: M17</t>”, {player addGoggles “classname”;}];

AddAction only available to specifc player/variable:
(You change “targetPlayer” to a player slot with a variable name)

this addAction [ “Action name here”, “scriptfile.sqf”, nil, 1.5, false, true, “”, “_this isEqualTo targetPlayer”, 3, false, “”, “” ];

Teleport Script:
(Object is where you will end up. Can be a flag pole, vehicle, bottle etc)

this addAction [“Teleport”, {player setPos (getPos object)}]

Misc Scripts

3D Audio:
Plays 3D audio on the given object, this one can be tricky sometimes when it comes to volume. (smallRadio = the object)

soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; soundToPlay = soundPath + “soundsradio_1.ogg”; playSound3D [soundToPlay, smallRadio, false, getPosASL smallRadio, 8, 1, 60];

Set Damage:
1 = destroyed/dead

this setdammage 0.5;

Disable/Enable Damage:
Can be done easily in Eden, but you never know when you need this.

this allowdamage true/false;

Unlimited Ammo:
Gives a vehicle or player unlimted ammo.

this addEventHandler [“Fired”,{(_this select 0) setVehicleAmmo 1}];

Unlimted Ammo with delay:
40 in this case is how often it triggers the rearm. (Seconds)

nul = this spawn { while {alive _this} do { _this setVehicleAmmo 1; sleep 40 } };

Create a big explosion on a map marker.
This spawns said explosive and detonates it on the marker. Should technically work with anything from
CfgMagazines[community.bistudio.com].

scriptedCharge = “Bo_Mk82_MI08” createVehicle (getMarkerPos “bombmrk”);

ACE3 Specifc (Zeus)

Increase ACE cargo space in Zeus:
(3 stands for the size of the Cargo space, useful when it comes to re-spawned vehicles)

[_this, 3] call ace_cargo_fnc_setSize

Singleplayer

Spawn a dog next to the player:
(Submitted by reader, not tested)

“Fin_blackwhite_F” createUnit [position player, group player];
SteamSolo.com