sudo apt-get -y install salt-master ( or salt-minion)
#### Fun Stuff
##### All grains
salt '*' grains.items
##### All Stuff
salt '*' status.all_status
#### Updating a package on every machine
salt \* pkg.install lxc-docker refresh=true
#### Updating saltstack on all the minions
salt \* file.replace /etc/salt/minion pattern='master_type: str' repl='master_type: standard'
salt \* cmd.run 'apt-get update'
salt \* cmd.run 'apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y salt-minion'
#### Massive errors on highstate from minions after an upgrade?
/etc/init.d/salt-minion stop
cd /var/cache/salt/minion
rm -rf *
/etc/init.d/salt-minion start
## Gaming
### ArmA
#### Introduction
I have been playing Operation: Flashpoint and its Resistance expansion back in the day, started scripting things for it and made a ton of scenarios and a larger bunch of scripts. I've played the SP campaign of ArmA. I started playing ArmA 2 and its expansions mid-2010, after which I got the taste of scripting and making scenarios again. Safe to say I've spent many nights scripting SQF in the RV engine.
Over time I've collected a bunch of notes and scripts I've used to create my scenarios. It would be selfish to keep them for myself, so here are they. I've tried to sort them on version (ArmA 2 and ArmA 3) and mod (just ACE2).
#### General SQF
The following examples should work in both ArmA 2and ArmA 3.
#### Everything about groups
##### Create a new group
_grp = group this
##### Moving all units of a group into a vehicle
{_x moveincargo taxi} foreach units group this
##### Check if a group is inside a vehicle
({_x in taxi} count units grp1) == (count units grp1)
##### Check if a group is not inside a vehicle
{_x in taxi} count (units grp1) == 0
##### Check to see if all playable west units are in a trigger area
{alive _x && side _x == WEST && vehicle _x in thislist} count allunits == {alive _x && side _x == WEST} count allunits
#### Start a script that is part of a mod (requires CBA)
Put in `config.cpp`:
```
class CfgPatches {
class gfs {
units[] = {};
weapons[] = {};
requiredVersion = 1.00;
requiredAddons[] = {"CBA_MAIN"};
author[] = {"Sacha Ligthert"};
versionDesc = "This latest version";
version = "0.29";
};
};
class Extended_PreInit_EventHandlers {
class gfs {
init = "[] execVM 'folder\init.sqf';";
};
```
#### Mute in-game radio commands
0 fadeRadio 0; //mute in-game radio commands
#### Removing the Respawn Button
```
private["_display","_btnRespawn"];
disableSerialization;
waitUntil {
_display = findDisplay 49;
!isNull _display;
};
_btnRespawn = _display displayCtrl 1010;
_btnRespawn ctrlEnable false;
```
#### Detect a JIP
```
if (!(isNull player)) then //non-JIP player
{
};
if (!isServer && isNull player) then //JIP player
{
};
```
#### Count the building positions
```
x = 0;
while { format ["%1", house buildingPos x] != "[0,0,0]" } do {x = x + 1};
hint format ["%2: 0 - %1", x-1, "Available positions"];
ligthert [6:56 PM] @highhead: Do you happen to know something about the _getHash and _setHash functions?
highhead [6:57 PM] its a wrapper for the CBA fncs
highhead [6:57 PM] what do you need
highhead [6:58 PM] actually they set and get data to arrays that look like ["CBA_HASH",_key,_value,_defaultValue]
highhead [6:58 PM] HashGet allows you to return custom defaultvalues
ligthert [7:01 PM] The reason I am asking is because I found out that despite persistence's best efforts some vehicles and objects (and objectives) don't stay dead after loading the scenario again. I was thinking of putting all these objectives and objects in an array and have the stored in the database. Basically abusing _setHash and _getHash as a glorified database abstraction layer to counteract this problem. :simple_smile:
highhead [7:01 PM] so you can basically store ANY data easily by....
highhead [6:23 PM] then activate your zones with: [_pos,_radius,_CQB] spawn ALiVE_fnc_addCQBpositions.
highhead [6:24 PM]whereas _CQB are instances of CQB modules. So the missionmaker f.e. can give it a name in editor, f.e. "CQB_regular" or "CQB_strategic" and
highhead [6:24 PM]put it in like [_pos,_radius,[CQB_Regular]] spawn ALiVE_fnc_addCQBpositions. (edited)
highhead [6:42 PM] f.e. A mission maker wants to have CQB in all strategic positions over the map from the beginning of the mission. Regular CQB in a specific location should be activated by trigger.
- Add a CQB module on setting strategic and your other favorite settings (f.e. dominantFaction, density etc.).
- Add a CQB module on setting regular and your other favorite settings (f.e. dominantFaction, density etc.).
- Give the regular CQB module a name, f.e. myRegularCQBmodule
[1:47:13 PM] Manuel Pekelaer: Gents, Ik heb besloten me niet actief met de community meer te betrekken en niet meer mee te doen aan sessies for the time being
[1:47:26 PM] Sacha Ligthert: Noted.
[1:47:50 PM] * Sacha Ligthert kicked mpekelaer from the chat.
```
Hazey and I discuss our efforts:
```
[16:11:38] Sacha Ligthert: Haze, Am I the only one with the impression that our version of insurgency kickstarted groups into adopting alive?
[16:14:00] Haze: I have seen a few larger groups run alive because of it. Would be interesting to get a download stat from tup when he is around.