Arma 3
100 ratings
EllmansWorld's "Script" list
By Ellman
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/aHjQJ8R

Hopefully 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.
2
3
   
Award
Favorite
Favorited
Unfavorite
Script Execution
I activate my sqf files containing scripts two different ways:
1. Local Execution:
nul=execVM "scripts\test.sqf";
2. Global Execution:
[] remoteExec ["scripts\test.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='images\image.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. (1024x512 generally works)
this SetFlagTexture "images\imagename.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 3x7 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","scripts\arty.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 + "sounds\radio_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];
18 Comments
Ogion 26 Dec, 2023 @ 8:40am 
I'm trying to pass an addAction to a scripted object, but since setVehicleInit was taken out of A3 I'm stupmed as how to go about it. This is my latest attempt, which generates no errors, but doesn't add the action... Maybe some pointer in the right direction?

_pos = getpos (_this select 0);
deleteVehicle (_this select 0);
sleep 0.2;

private _d = "B_Slingload_01_repair_F" createVehicle _pos;
private _scr = "this addAction ['<t color='#FF0000'>Pack up container</t>','s\deployContainer.sqf'];";

[[_d,_scr]] remoteExec ["setVehicleInit"];

hint "Container packed up";

It's been more than 10 years since I scripted last, so bear with me :)
Bailing_Out 26 Jul, 2023 @ 11:02pm 
To make it to where only the driver has the addaction and that it cannot be accessed outside of whatever vehicle it is, use this,,,,,,, this addAction ["set off bomb","carbomb12.sqf",nil,1,false, true, "true", "(driver vehicle _this isEqualTo _this) && (vehicle _this isKindOf 'car')", 9, false]; My car bomb setup works perfectly with it. I assume it will work well with other things as well. This is put in the vehicle init . No need for event handlers LOL. I can't make those work anyway.
Ellman  [author] 20 Apr, 2023 @ 1:17am 
@Av414nche
You can with 3den Enhanced
Av414nche 19 Apr, 2023 @ 6:23am 
How do I turn on headlights of a vehicle I placed. Need to see it with the light on within the Editor menu, so I can make placement adjustments.
Confirmer 24 Mar, 2023 @ 11:56am 
What do you mean server execute? I put the script in 'On Activation' and the trigger activator as Any Player. Is there something specific I need to put in the condition without having to have an sqf file? Or is that a must
Ellman  [author] 24 Mar, 2023 @ 12:39am 
@Confirmer Did you server execute the trigger?
You can also have the trigger execute an sqf which contains the hint
Confirmer 21 Mar, 2023 @ 6:59pm 
The local hint doesn't work, whenever I had someone activate the trigger, it showed the hint to everyone on the server.
Jon Of Arc 8 Dec, 2021 @ 3:23pm 
Thanks for this guide! Does anyone know where I can find the JAM zeus script (J wolf admin menu?) or any of his guides? It seems like everything has been deleted.
PantherPaw 27 Sep, 2021 @ 8:18am 
@EllmansWorld, Ok, thanks for reading anyway buddy, I'll keep trying to find out for now lol :OhSure:
Ellman  [author] 27 Sep, 2021 @ 7:34am 
@JaguarPaw
I'm definitely no script wizard but to have a inventory item added to a player you would use:
player addItemToUniform "Item_Classname";
(You can use either addItemToUniform, addItemToVest or addItemToBackpack)

Then being able to use said item I honestly don't know and I'm not sure how you would add it to all players.

I hope the little help I could provide helps you in the long run.
Have a great day