Scripting How To's - 7Cav/7Cav-Alive GitHub Wiki
Base Protection Trigger
Steps
- Place down a trigger with the variable name "no_opfor"
- Double click on the trigger.
- Inside the "Condition" box, copy and paste the following line:
{if (side _x == OPFOR) then {_x setPos [0,0,0];_x setdamage 1} } foreach thislist;
- Refer to the following image for the rest of the information: https://gyazo.com/79982072dac870f606d8135cc4b9dbbc
Infinite Ammo
Steps
- Double click on the unit/object.
- Inside the "Init" box, copy and paste the following line:
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}];
Add A Weapon to any vehicle in Arma 3
https://steamcommunity.com/app/107410/discussions/17/1319961868325198220
https://community.bistudio.com/wiki/addWeaponTurret
Steps
- Double click on the unit/object.
- Inside the "Init" box, copy and paste the following line:
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}];
Give Gau 19s to Anything With Pylons
https://community.bistudio.com/wiki/setPylonLoadout
Steps
- Place down a helicopter that you wanna make overpowered.
- Double click on the helicopter that you wanna make overpowered.
- Inside the "init" box, paste the following:
this setPylonLoadOut ["pylon1", "rhsusf_mag_gau19_melb_right", true];
this setPylonLoadOut ["pylon2", "rhsusf_mag_gau19_melb_left", true];
Slots
How to make a slot:
- Double click on the unit/object.
- Under "Special Options" select "Playable"
How to Organize the slots:
- On the left side of the screen, near the bottom of the list of units, you'll see a (+) button. Press that button to add a layer and name it "Slots/Players/Etc."
- Select that (+) button again and name it "Gunslinger/Saber/Etc.".
- Drag and drop that layer inside that "Slots/Players/Etc." layer.
- Your layers should look like the following: https://gyazo.com/68163cecacdd143382f36a59903bb63f
- Arma 3 automatically sorts layers in alphaNumerical order, so make sure you add the number in front, as displayed above.
Display A Hint In Zeus
https://community.bistudio.com/wiki/hint
https://community.bistudio.com/wiki/Structured_Text
Steps
- Press "ESC"
- Type the following line into the debug console:
hint parseText "<t color='#f60303'>Test</t>";
- This will display the following: https://gyazo.com/056c3630dc0363c4d2428d9104711063
Vehicle Respawn Scripts
Steps
- Double click on the vehicle.
- Inside the "Init" box, copy and paste one of the lines below that applies to the vehicle you're applying the script to.
- Start the game and test the respawn; a quick tip, do it all at once. What I mean is, since we need to test the abandon script, take one of each vehicle and move it somewhere random that has no blufor/players. To test the destruction script, simply press "END" on your keyboard and watch it respawn.
Ground Vehicles
HMMV and similar wheeled vehicles:
null = [this] execVM "scripts\vehicle\init\Base_WheeledArmed.sqf";
For all medical vehicles:
null = [this] execVM "scripts\vehicle\init\Base_Medical.sqf";
For all IFVs:
null = [this] execVM "scripts\vehicle\init\Base_Bradley.sqf";
For all MBTs:
null = [this] execVM "scripts\vehicle\init\Base_Saber.sqf";
Rotor Wing
For all Rotor Wing transports:
null = [this] execVM "scripts\vehicle\init\Base_BlackHawk.sqf";
Specifically for the Sparrow Attack Littlebird:
null = [this] execVM "scripts\vehicle\init\Base_Sparrow.sqf";
Specifically for the transport Littlebird:
null = [this] execVM "scripts\vehicle\init\Base_Raven.sqf";
Specifically for the Apache Attack Helicopter:
null = [this] execVM "scripts\vehicle\init\Base_Apache.sqf";
Fixed Wing
For all Fixed Wing transports:
null = [this] execVM "scripts\vehicle\init\Base_C130.sqf";
For All Fixed Wing CAP Aircraft:
null = [this] execVM "scripts\vehicle\init\Base_fixedWing.sqf";
Specifically for the A-10 Warthog, regardless of the mod/variant:
null = [this] execVM "scripts\vehicle\init\Base_A10.sqf";
Combat Engineers and Logistics
For all FOB building vehicles:
null = [this] execVM "scripts\vehicle\init\Base_FOB.sqf";
Specifically for the SOCOM SOV and M1239 AUV:
null = [this] execVM "scripts\vehicle\init\Base_SOV.sqf";
For all SPGs and Artillery:
null = [this] execVM "scripts\vehicle\init\Base_SPG.sqf";