Skip to content

Instantly share code, notes, and snippets.

@Drofseh
Drofseh / init.sqf
Last active January 11, 2024 06:47
Random Arty Barrages
supportFire_numberOfBatteries = 1;
supportFire_numberOfGunsPerBattery = 5;
supportFire_shotsPerBatteryPerBarrage = 10;
supportFire_timeBetweenBarrages = 30;
supportFire_shellsHE_Type = "Sh_155mm_AMOS";
supportFire_shellDispersion = 100;
supportFire_randomPositions = [
getMarkerPos "marker_randomArty_1",
getMarkerPos "marker_randomArty_2",
@Drofseh
Drofseh / dro_FNC_Bleedout_Prevention.sqf
Last active September 5, 2023 01:00
Prevent a Unit from Bleeding Out in Ace Medical
dro_FNC_Bleedout_Prevention = {
params ["_unit", ["_wakeup", false, [true]]];
if (!alive _unit || {_unit getVariable ["dro_endBleedoutPrevention", false]}) exitWith {false};
if (_unit getVariable ["ACE_isUnconscious",false]) then {
private _bloodVolume = _unit getVariable ["ace_medical_bloodVolume", 6];
if (_bloodVolume < 3.5) then {
[_unit, false] call ace_medical_fnc_setUnconscious;
_unit setVariable ["ace_medical_bloodVolume", ([3.5, 5.2] select _wakeup)];
@Drofseh
Drofseh / add ace medical action to draw blood.sqf
Last active September 5, 2023 01:05
Draw 250 mL of blood from a target and place a 250 mL bag of blood in the player's inventory.
//Put this code in the unit's init box in the editor, you will have to remove the comments
private _statementDrawBlood = {
if (!alive this) exitWith {
[
["You can't draw blood from a corpse."],
true
] call CBA_fnc_notify;
};
@Drofseh
Drofseh / Normalize Arma3 headless client positionsqf
Last active September 5, 2023 01:25
Normalize Arma3 headless client position
/*
* Author: Mark Ruffner (AACO)
* Shamelessly stolen from Bourbon Warfare
* https://github.com/BourbonWarfare/POTATO/blob/master/addons/miscFixes/XEH_serverPostInit.sqf#L13-L73
*
* Recursive function to normalize the position of the HC modules in a mission.
* This improved the performace of the AI, as the farther away the modules are from the players the fewer updates they get about the players.
* missionNamespace setVariable ["dro_updateHCPosition", true] to stop the function from continuing to run
*
@Drofseh
Drofseh / init.sqf
Last active February 28, 2022 01:50
Add ARCOMM chat commands to briefing
player createDiarySubject ["Chat Commands","Chat Commands"];
private _ARCOMM_Chat_Commands = ["Chat Commands", ["ARCOMM Default Commands","
<br/><font color='#70db70' size='16'>#loadout</font>
<br/>Syntax 1
<br/><font color='#FF8C00'>#loadout &lt;role&gt;</font>
<br/>
<br/>Applies the given role loadout to the local player. Roles are the names of loadouts in the player's faction's loadout file. Eg. #loadout aar for assistant automatic rifleman.
<br/>
<br/>Syntax 2
@Drofseh
Drofseh / dro_FNC_respawnVehicle.sqf
Last active September 5, 2023 01:32
Vehicle Respawn function to replace BI Vehicle Respawn Module
/*
* Author: Drofseh & Karel Moricky
*
* Description:
* Set vehicle respawn, compatible both with SP and MP.
* Rewrite of buggy BI Vehicle Respawn Module
*
* Parameter(s):
* 0: OBJECT - vehicle
* 1: NUMBER - respawn delay in seconds (default is 0)
@Drofseh
Drofseh / dro_FNC_checkVehicleAmmo.sqf
Last active September 5, 2023 01:39
Add action to check remaining ammunition in vehicle
/*
Function is listed first here, adding the action to all vehicles is at the bottom.
This can all just go in init.sqf
*/
/*
* Author: Drofseh
*
* Description:
* Add an ACE action to check the amount of ammo in a vehicle's magazines.
@Drofseh
Drofseh / config.cpp
Last active December 6, 2020 21:24
Make Briefing UI Wider
/*
Licence: Do whatever you want with this, no credit required
*/
class CfgPatches {
class makeBriefingWider {
author = "Drofseh";
name = "makeBriefingWider";
requiredAddons[] = {
"A3_Ui_F"
@Drofseh
Drofseh / init.sqf
Created May 24, 2020 09:17
Give Gaz cars a random colour, based on Ford and Lincoln paint colours of the 1930's
//put this in the init field of the attributes of a Gaz car
if (local this) then {
[
{
params ["_car","_colour"];
_colour = selectRandomWeighted carColours;
[_car,[0, _colour]] remoteExec ["setObjectTexture",0,true];
},
this,
1
@Drofseh
Drofseh / workshop mod warning.sqf
Last active September 5, 2023 01:42
Check if player is loading mod from steam workshop and warn them.
/*
Check if the player is loading mods from Steam Workshop and warn them if they are.
Can be placed in init.sqf
*/
if (hasInterface) then {
[
{
private _classes = "true" configClasses (configFile >> "CfgPatches");
private _modlist = [];