Useful sample files for making a good Arma 3 mission.
Some very useful Arma 3 scripting samples to make great missions.
Some very useful Arma 3 scripting samples to make great missions.
Arma Reforger / Arma 4 is due to release sometime tomorrow I hope. There are quite a few resources around concerning the DayZ Enscript scripting language that is used by the Enfusiontm Engine. Here is the scripting guide for Dayz. https://community.bistudio.com/wiki/DayZ:Enforce_Script_Syntax. The syntax is rather like C# or C++, but it should not be too … Read more
This is a very useful Perl code sample, this will filter out any bad words that are entered into the array. 1 2 3 4 5 6 7 8 9 10 11 12 my @forbidden = ("very","bad","words","go","in","this","array"); foreach my $forbidden (@forbidden) { # If a naughty word is typed… if ($comments =~ /$forbidden/) { … Read more
This is a very simple Hello World program in C. int main() { write(1, "Hello World\n", 14); }int main() { write(1, "Hello World\n", 14); } Counting how long a text string is. #include <stdio.h> #include <string.h> #define MSG "Hello Doctor, let’s get back to the TARDIS!" int main() { int g; g = strlen(MSG); if … Read more
To set the arsenal action on all crates in your base, use this code. This will give the Arsenal action to the Cargo Net Box item. Put this in the initPlayerLocal.sqf file. { [_x, "Open the Arsenal", "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa", "a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa", "(_this distance _target < 6) && (isNull (findDisplay 162))", "isNull (findDisplay 162)", {}, BIS_holdActionProgress, {["Open",true] call … Read more
This simple code will start a mortar strike on an enemy position when a vehicle is destroyed. car1 addEventHandler [ ‘Killed’, { _bombardment = [BIS_Mortar,getMarkerPos "mk2","8Rnd_82mm_Mo_shells",100,24,10] execVM "a3\missions_f_exp\showcases\showcase_endgame.tanoa\scripts\firesupport.sqf"; }];car1 addEventHandler [ ‘Killed’, { _bombardment = [BIS_Mortar,getMarkerPos "mk2","8Rnd_82mm_Mo_shells",100,24,10] execVM "a3\missions_f_exp\showcases\showcase_endgame.tanoa\scripts\firesupport.sqf"; }]; Name the mortar BIS_Mortar, then place a marker on the location to be shelled, named … Read more
Detect if a player has the APEX DLC. if (395180 in getDLCs 1) then { (_this select 0) ctrlsettext ‘\a3\Ui_f\Data\Logos\arma3apex_white_ca.paa’; };if (395180 in getDLCs 1) then { (_this select 0) ctrlsettext ‘\a3\Ui_f\Data\Logos\arma3apex_white_ca.paa’; }; Remove all NVG goggles and weapons from enemies. { if (side _x == east) then { _x unassignItem "NVGoggles"; _x removeItem "NVGoggles"; … Read more
A code sample that creates a weapon box with some ammo. Just change the class names to add a weapon of your choice to this box. class cfgVehicles { class Thing; class ThingX; class ReammoBox; class Strategic; class EAST_Box_Base; class NATO_Box_Base; class Railgun_Transport_Box: EAST_Box_Base { scope = 2; vehicleClass = "Ammo"; displayName = "Railgun Box"; … Read more
Arma 3 scripting samples for creating MP missions This code sample inserted into the initServer.sqf will protect buildings 900m around your base from destruction by retards with a grudge against your server. { _x allowdamage false; } foreach (nearestTerrainObjects [crat99,["house"],900]);{ _x allowdamage false; } foreach (nearestTerrainObjects [crat99,["house"],900]); Name an object crat99 and then place this … Read more
Some very useful code samples for any C programmer. These might give you some new ideas. Print the time and date with C. #include <time.h> // For time function (random seed). #include <stdio.h> // For extra functions. printf(). #include <stdlib.h> // For getenv(); #define format "The time and date is: %A %d %B %Y. … Read more
Some very good Arma 3 scripting samples Put this code into the init of a crate to create an Arsenal crate. this addaction ["Open Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }];this addaction ["Open Virtual Arsenal", { ["Open",true] call BIS_fnc_arsenal; }]; This code in the initPlayerLocal.sqf and onPlayerRespawn.sqf files will remove stamina and weapon sway. player … Read more
This perl script is an old piece of code that will create a Windows version text string. I am sure someone might find this useful. #!/usr/bin/perl use warnings; @t = localtime(time()); $yr = ($t[5] + 1900) -1; $sr = int(( $t [4]/4) + 1); $v = int("$t[7]$t[2]$t[1]$t[0]"*((rand(rand(10) + 1 )))); print … Read more
Very useful Arma 3 code samples to make better missions.
Sample Iptables configurations A sample iptables output that I am using on an OpenVPN server to allow Internet traffic to be passed through it. ubuntu ~ $ sudo iptables-save # Generated by iptables-save v1.4.21 on Wed Aug 2 22:19:48 2017 *filter :INPUT ACCEPT [2654934:1228315333] :FORWARD ACCEPT [31023:17433690] :OUTPUT ACCEPT [2475842:555885003] COMMIT # Completed on Wed … Read more
How to define a string and print it out with the printf() function. #include <stdio.h> /* Defining a global string. */ #define hi "Hello Sire." int main(void) { /* Printing out the string. */ printf("%s\n", hi); return 0; }#include <stdio.h> /* Defining a global string. */ #define hi "Hello Sire." int … Read more
This function will allow your computer to speak. function shellspeak() { mplayer "http://translate.google.com/translate_tts?tl=en&q=$(echo $@ | sed ‘s/\s/+/’)" > /dev/null 2>&1; }function shellspeak() { mplayer "http://translate.google.com/translate_tts?tl=en&q=$(echo $@ | sed ‘s/\s/+/’)" > /dev/null 2>&1; } A script that will change all files in a directory to lowercase filenames. function lowercase() # move filenames to lowercase. { for … Read more
This code sample shows how we are wrapping a printf() statement onto multiple lines using backslashes. #include "stdio.h" #define hello "Hello World." int main(int argc, char* argv[]) { printf("This is a very long sentence we are handing down\n"\ "Mr smith, do you have anything to say for yourself"\ "?"); printf("%s\n", hello); … Read more
Opening a folder and listing the contents, and not listing certain files. This is the Perl code I was using on my very old Tripod.com website. opendir(DNAME, "$folder") || die "I cannot open the requested directory $folder \n $!"; @dirfiles2 = readdir (DNAME); @dirfiles2 = sort(@dirfiles2); foreach $x2 (@dirfiles2) { if ($x2 eq ".") { … Read more