├── .gitattributes
├── .gitignore
├── Arma 2
├── ACRE Volume Addon
│ └── st_acre_volume
│ │ ├── $PREFIX$
│ │ ├── config.cpp
│ │ └── fn_clientInit.sqf
├── AproxPI
│ ├── Demo Missions
│ │ └── AproxPI_v1.utes
│ │ │ └── AproxPI_v1.utes
│ │ │ ├── description.ext
│ │ │ ├── init.sqf
│ │ │ ├── mission.sqm
│ │ │ └── scripts
│ │ │ └── aproxPI
│ │ │ ├── aproxPI.sqf
│ │ │ ├── init.sqf
│ │ │ ├── rsc
│ │ │ ├── def_custom.hpp
│ │ │ ├── def_standard.hpp
│ │ │ ├── diag_main.hpp
│ │ │ ├── disp_loadingScreen.hpp
│ │ │ └── load.hpp
│ │ │ └── x
│ │ │ ├── fnc_loadBench.sqf
│ │ │ ├── fnc_populateDialog.sqf
│ │ │ ├── md_montecarlo.sqf
│ │ │ ├── ref_pi.txt
│ │ │ └── x_defines.sqf
│ └── scripts
│ │ └── aproxPI
│ │ ├── aproxPI.sqf
│ │ ├── init.sqf
│ │ ├── rsc
│ │ ├── def_custom.hpp
│ │ ├── def_standard.hpp
│ │ ├── diag_main.hpp
│ │ ├── disp_loadingScreen.hpp
│ │ └── load.hpp
│ │ └── x
│ │ ├── fnc_loadBench.sqf
│ │ ├── fnc_populateDialog.sqf
│ │ ├── md_montecarlo.sqf
│ │ ├── ref_pi.txt
│ │ └── x_defines.sqf
├── Auto Map Brightness
│ └── scripts
│ │ └── ST_mapDimmer.sqf
├── Boomerang System Script
│ └── scripts
│ │ └── boomerang
│ │ ├── f
│ │ ├── fnc_addUnit.sqf
│ │ ├── fnc_dirTo.sqf
│ │ ├── fnc_getQuadrant.sqf
│ │ ├── fnc_interact.sqf
│ │ ├── fnc_setBoomerangStatus.sqf
│ │ ├── fnc_shotAlert.sqf
│ │ ├── fnc_shotFiredLocal.sqf
│ │ ├── fnc_shotFiredRemote.sqf
│ │ ├── fnc_simpDeg.sqf
│ │ └── x-macros.hpp
│ │ ├── init.sqf
│ │ └── rsc
│ │ ├── HUD
│ │ ├── images
│ │ │ ├── 10oclock.paa
│ │ │ ├── 11oclock.paa
│ │ │ ├── 12oclock.paa
│ │ │ ├── 1oclock.paa
│ │ │ ├── 2oclock.paa
│ │ │ ├── 3oclock.paa
│ │ │ ├── 4oclock.paa
│ │ │ ├── 5oclock.paa
│ │ │ ├── 6oclock.paa
│ │ │ ├── 7oclock.paa
│ │ │ ├── 8oclock.paa
│ │ │ └── 9oclock.paa
│ │ └── sf_GUI.hpp
│ │ ├── resources.hpp
│ │ └── sounds
│ │ ├── Beep.ogg
│ │ ├── sf_RadioDiag.hpp
│ │ ├── shot10oclock.ogg
│ │ ├── shot11oclock.ogg
│ │ ├── shot12oclock.ogg
│ │ ├── shot1oclock.ogg
│ │ ├── shot2oclock.ogg
│ │ ├── shot3oclock.ogg
│ │ ├── shot4oclock.ogg
│ │ ├── shot5oclock.ogg
│ │ ├── shot6oclock.ogg
│ │ ├── shot7oclock.ogg
│ │ ├── shot8oclock.ogg
│ │ └── shot9oclock.ogg
├── Crack Addons v1.1
│ ├── crack_main
│ │ ├── $PREFIX$
│ │ ├── XEH_preInit.sqf
│ │ ├── config.cpp
│ │ ├── f
│ │ │ ├── fnc_arrayToString.sqf
│ │ │ └── fnc_toUnicodeDecimal.sqf
│ │ ├── rsc
│ │ │ └── defines.hpp
│ │ ├── script_component.hpp
│ │ ├── script_macros.hpp
│ │ └── script_mod.hpp
│ └── crack_notepad
│ │ ├── $PREFIX$
│ │ ├── XEH_postClientInit.sqf
│ │ ├── XEH_postInit.sqf
│ │ ├── XEH_postServerInit.sqf
│ │ ├── XEH_preInit.sqf
│ │ ├── api
│ │ ├── fnc_canPlayerUseNotepad.sqf
│ │ ├── fnc_checkForByteLimit.sqf
│ │ ├── fnc_clearEntireLocalNotepad.sqf
│ │ ├── fnc_clearNotepadPage.sqf
│ │ ├── fnc_createNewReminder.sqf
│ │ ├── fnc_deleteReminder.sqf
│ │ ├── fnc_dialogsInUse.sqf
│ │ ├── fnc_enableModule.sqf
│ │ ├── fnc_getAllReminders.sqf
│ │ ├── fnc_getAllowedSides.sqf
│ │ ├── fnc_getAllowedUnits.sqf
│ │ ├── fnc_getByteLimit.sqf
│ │ ├── fnc_getNotepadContents.sqf
│ │ ├── fnc_getNotepadPageContents.sqf
│ │ ├── fnc_getReminderHandle.sqf
│ │ ├── fnc_moduleEnabled.sqf
│ │ ├── fnc_notepadExternalAccessEnabled.sqf
│ │ ├── fnc_reminderHintsEnabled.sqf
│ │ ├── fnc_setAllowedSides.sqf
│ │ ├── fnc_setAllowedUnits.sqf
│ │ ├── fnc_setByteLimit.sqf
│ │ ├── fnc_setCheckForByteLimit.sqf
│ │ ├── fnc_setNotepadPageContent.sqf
│ │ ├── fnc_setNumberOfPages.sqf
│ │ └── fnc_setReminderCheckFrequency.sqf
│ │ ├── config.cpp
│ │ ├── eventHandlerInit.sqf
│ │ ├── f
│ │ ├── fnc_aceInteractMenuDef.sqf
│ │ ├── fnc_aceSelfInteractMenuDef.sqf
│ │ ├── fnc_calculatorGUI.sqf
│ │ ├── fnc_createEmptyStrings.sqf
│ │ ├── fnc_filterDataByType.sqf
│ │ ├── fnc_limitTextSize.sqf
│ │ ├── fnc_notepadGUI.sqf
│ │ ├── fnc_onPlayerDeath.sqf
│ │ ├── fnc_recieveRemoteVariable.sqf
│ │ ├── fnc_reminderGUI.sqf
│ │ ├── fnc_requestRemoteVariable.sqf
│ │ ├── fnc_searchForFunc.sqf
│ │ └── fnc_sendLocalVariable.sqf
│ │ ├── rsc
│ │ └── diag.hpp
│ │ ├── script_component.hpp
│ │ └── test
│ │ └── fnc_transferTest.sqf
├── Extra Huey Slots
│ └── scripts
│ │ ├── CRACK_mountHuey.sqf
│ │ └── CRACK_selfInteractMenu.sqf
├── FPS Monitor
│ └── fpsmon.sqf
├── GM Functions
│ └── !GM
│ │ ├── README.txt
│ │ ├── functions
│ │ ├── fnc_cacheFile.sqf
│ │ ├── fnc_execOnPlayer.sqf
│ │ ├── fnc_execScratchpad.sqf
│ │ ├── fnc_fixEarplugs.sqf
│ │ ├── fnc_givePlayer.sqf
│ │ ├── fnc_loadACEDebug.sqf
│ │ ├── fnc_loadSixMenu.sqf
│ │ ├── fnc_loadUODebug.sqf
│ │ ├── fnc_log.sqf
│ │ ├── fnc_medical.sqf
│ │ ├── fnc_selfInteractMenu.sqf
│ │ └── fnc_spawnCrate.sqf
│ │ ├── init.sqf
│ │ ├── scratchpad.sqf
│ │ └── settings.sqf
├── Gear Functions
│ └── scripts
│ │ └── CRACK_gearFunctions
│ │ ├── README.txt
│ │ ├── f
│ │ ├── fnc_addEarProtection.sqf
│ │ ├── fnc_addMagArray.sqf
│ │ ├── fnc_addRuckMagArray.sqf
│ │ ├── fnc_addRuckWepArray.sqf
│ │ ├── fnc_rucksackOperations.sqf
│ │ ├── fnc_selectPrimaryWep.sqf
│ │ ├── fnc_setLoadout.sqf
│ │ └── script_macros.hpp
│ │ └── init.sqf
├── Get Local Machine State Script
│ └── fnc_getLocalMachineState.sqf
├── Handle Damage Script
│ ├── description.ext
│ ├── init.sqf
│ ├── scripts
│ │ └── naught
│ │ │ └── handleDamage
│ │ │ ├── defaults.sqf
│ │ │ ├── f
│ │ │ ├── fnc_aceInteract.sqf
│ │ │ ├── fnc_addHit.sqf
│ │ │ ├── fnc_handleDamage.sqf
│ │ │ ├── fnc_onDeath.sqf
│ │ │ └── fnc_onSpawn.sqf
│ │ │ ├── hds
│ │ │ ├── hintOnHit
│ │ │ │ ├── ace
│ │ │ │ │ ├── interact.sqf
│ │ │ │ │ ├── loadInteract.sqf
│ │ │ │ │ └── selfInteract.sqf
│ │ │ │ ├── diag_hintOnHit_setDamage.sqf
│ │ │ │ ├── fnc_checkEnabled.sqf
│ │ │ │ ├── fnc_enableHDS.sqf
│ │ │ │ ├── fnc_hint.sqf
│ │ │ │ ├── fnc_setPlayerDamage.sqf
│ │ │ │ └── load.sqf
│ │ │ └── load.sqf
│ │ │ ├── init.sqf
│ │ │ └── rsc
│ │ │ ├── defines.hpp
│ │ │ ├── diag_init.hpp
│ │ │ └── dialogs
│ │ │ └── diag_hintOnHit_setDamage.hpp
│ └── stringtable.csv
├── Headless Client
│ └── scripts
│ │ └── CRACK_HC.sqf
├── Helo Drop Smoke Script
│ └── heloDropSmoke
│ │ ├── f
│ │ ├── fnc_dropSmoke.sqf
│ │ ├── fnc_getSmokesLeft.sqf
│ │ └── fnc_selfInteract.sqf
│ │ └── init.sqf
├── No Weapons Script
│ └── noWeapons.sqf
├── ORBAT
│ └── CRACK_ORBAT
│ │ ├── ORBATS
│ │ ├── ORBAT_Syntax.txt
│ │ ├── custom
│ │ │ ├── ORBAT_CUSTOM_USMC_Woodland.rar
│ │ │ └── ORBAT_CUSTOM_US_Army_ACU.rar
│ │ ├── init.sqf
│ │ ├── script_component.hpp
│ │ ├── shacktac
│ │ │ ├── ORBAT_SHACKTAC_USMC_Desert.rar
│ │ │ └── ORBAT_SHACKTAC_USMC_Woodland.rar
│ │ ├── us_army
│ │ │ ├── ORBAT_US_Army_ACU.rar
│ │ │ ├── ORBAT_US_Army_DCU.rar
│ │ │ ├── ORBAT_US_Army_OCP.rar
│ │ │ └── ORBAT_US_Army_Woodland.rar
│ │ └── usmc
│ │ │ ├── ORBAT_USMC_Desert.rar
│ │ │ └── ORBAT_USMC_Woodland.rar
│ │ ├── README.txt
│ │ ├── f
│ │ ├── fnc_addEarProtection.sqf
│ │ ├── fnc_addMagArray.sqf
│ │ ├── fnc_addRuckMagArray.sqf
│ │ ├── fnc_addRuckWepArray.sqf
│ │ ├── fnc_rucksackOperations.sqf
│ │ ├── fnc_selectPrimaryWep.sqf
│ │ ├── fnc_setLoadout.sqf
│ │ └── script_macros.hpp
│ │ ├── init.sqf
│ │ ├── scripts
│ │ └── team_roster
│ │ │ ├── README.txt
│ │ │ └── team_roster.sqf
│ │ └── settings.sqf
├── Set Identity Script
│ └── set_identity.sqf
├── Surrender Script
│ └── scripts
│ │ └── surrender
│ │ ├── action.sqf
│ │ ├── f
│ │ ├── defines.hpp
│ │ ├── fnc_capture.sqf
│ │ ├── fnc_disableWeapons.sqf
│ │ ├── fnc_findInNestedArray.sqf
│ │ ├── fnc_getNearEnemies.sqf
│ │ ├── fnc_hintSurrender.sqf
│ │ ├── fnc_interact.sqf
│ │ ├── fnc_onPlayerDeath.sqf
│ │ ├── fnc_releaseUnit.sqf
│ │ ├── fnc_removeAllActions.sqf
│ │ ├── fnc_removeFromNestedArray.sqf
│ │ ├── fnc_removeWeaponsAndMagsToCache.sqf
│ │ ├── fnc_runAway.sqf
│ │ ├── fnc_selfInteract.sqf
│ │ ├── fnc_surrender.sqf
│ │ └── fnc_takeCyanide.sqf
│ │ └── init.sqf
├── Team Roster
│ ├── Team_Roster_1_4_dev.rar
│ └── scripts
│ │ └── teamRoster
│ │ ├── f
│ │ ├── defines.hpp
│ │ ├── fnc_abbreviateRank.sqf
│ │ └── fnc_getPlayerEntry.sqf
│ │ ├── init.sqf
│ │ ├── loop.sqf
│ │ └── parameters.sqf
├── Ticket System
│ └── scripts
│ │ └── CTSS.sqf
├── Tracking Script
│ └── tracking.sqf
└── Unit Caching
│ ├── description.ext
│ └── scripts
│ └── unitCaching
│ ├── config.sqf
│ ├── description.ext
│ ├── h
│ └── oop.h
│ ├── init.sqf
│ └── lib
│ ├── arrays.sqf
│ ├── caching.sqf
│ ├── distribution.sqf
│ ├── hashmaps.sqf
│ └── objects.sqf
└── Arma 3
├── Bullet Tracking
├── Demo Missions
│ └── Bullet_Tracking_Mission.rar
└── scripts
│ └── btToolbox.sqf
└── Debug Console Addon
└── debugger
├── $PREFIX$
├── XEH
├── XEH_postInit.sqf
└── XEH_preInit.sqf
├── config.cpp
├── functions
├── fnc_checkAllowed.sqf
└── fnc_keyHandler.sqf
├── manifests
├── functions.manifest
└── support.manifest
├── resources
├── RscDefaults.defines
└── RscDisplayDebugUO.dialog
├── script_component.hpp
├── script_macros.hpp
├── script_mod.hpp
├── scripts
├── RscDisplayDebugUO.sqf
└── initDisplay.sqf
└── support
├── adminList.sqf
├── changelog.sqf
├── credits.sqf
├── defaultSettings.sqf
├── documentation.sqf
└── functions.sqf
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/Arma 2/ACRE Volume Addon/st_acre_volume/$PREFIX$:
--------------------------------------------------------------------------------
1 | x\st\addons\st_acre_volume
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/description.ext:
--------------------------------------------------------------------------------
1 | #include "scripts\aproxPI\rsc\load.hpp"
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/init.sqf:
--------------------------------------------------------------------------------
1 |
2 | // DON'T EXECUTE IN MULTIPLAYER
3 | if (isMultiplayer) then {
4 | forceEnd;
5 | endMission "END1";
6 | };
7 |
8 | // Constants
9 | AproxPI_outputCtrlIDC = 99;
10 | AproxPI_camPos = (getMarkerPos "camPos");
11 | AproxPI_camAlt = 300;
12 | AproxPI_defaultBench = [100, 50000, AproxPI_outputCtrlIDC, "montecarlo", true, true, 4, 4];
13 | AproxPI_lightBench = [50, 25000, AproxPI_outputCtrlIDC, "montecarlo", true, true, 4, 4];
14 | AproxPI_medBench = [100, 50000, AproxPI_outputCtrlIDC, "montecarlo", true, true, 4, 4];
15 | AproxPI_heavyBench = [200, 100000, AproxPI_outputCtrlIDC, "montecarlo", true, true, 4, 4];
16 |
17 | // Load AproxPI
18 | call compile preProcessFileLineNumbers "scripts\aproxPI\init.sqf";
19 |
20 | waitUntil {!isNull player};
21 |
22 | // Black Screen with background blur
23 | private ["_cam"];
24 | AproxPI_camPos set [2, AproxPI_camAlt];
25 | _cam = "CAMERA" CamCreate AproxPI_camPos;
26 | _cam CameraEffect ["INTERNAL","BACK"];
27 | _cam CamSetTarget player;
28 | _cam CamSetPos AproxPI_camPos;
29 | _cam CamCommit 0;
30 |
31 | // Open Dialog
32 | sleep 1;
33 | createDialog "aproxpi_main";
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/mission.sqm:
--------------------------------------------------------------------------------
1 | version=11;
2 | class Mission
3 | {
4 | addOns[]=
5 | {
6 | "utes",
7 | "cacharacters2"
8 | };
9 | addOnsAuto[]=
10 | {
11 | "cacharacters2",
12 | "utes"
13 | };
14 | randomSeed=839530;
15 | class Intel
16 | {
17 | startWeather=0.40000001;
18 | forecastWeather=0.25;
19 | year=2008;
20 | month=10;
21 | day=11;
22 | hour=14;
23 | minute=20;
24 | };
25 | class Groups
26 | {
27 | items=1;
28 | class Item0
29 | {
30 | side="WEST";
31 | class Vehicles
32 | {
33 | items=1;
34 | class Item0
35 | {
36 | position[]={3681.7168,52.614613,3782.2854};
37 | special="NONE";
38 | id=0;
39 | side="WEST";
40 | vehicle="USMC_Soldier";
41 | player="PLAYER COMMANDER";
42 | leader=1;
43 | skill=0.2;
44 | init="removeAllWeapons this; removeAllItems this; this allowDamage false;";
45 | };
46 | };
47 | };
48 | };
49 | class Markers
50 | {
51 | items=1;
52 | class Item0
53 | {
54 | position[]={2915.9646,-99,3052.4634};
55 | name="camPos";
56 | type="Empty";
57 | };
58 | };
59 | };
60 | class Intro
61 | {
62 | addOns[]=
63 | {
64 | "utes"
65 | };
66 | addOnsAuto[]=
67 | {
68 | "utes"
69 | };
70 | randomSeed=8013977;
71 | class Intel
72 | {
73 | startWeather=0.40000001;
74 | forecastWeather=0.25;
75 | year=2008;
76 | month=10;
77 | day=11;
78 | hour=14;
79 | minute=20;
80 | };
81 | };
82 | class OutroWin
83 | {
84 | addOns[]=
85 | {
86 | "utes"
87 | };
88 | addOnsAuto[]=
89 | {
90 | "utes"
91 | };
92 | randomSeed=1703401;
93 | class Intel
94 | {
95 | startWeather=0.40000001;
96 | forecastWeather=0.25;
97 | year=2008;
98 | month=10;
99 | day=11;
100 | hour=14;
101 | minute=20;
102 | };
103 | };
104 | class OutroLoose
105 | {
106 | addOns[]=
107 | {
108 | "utes"
109 | };
110 | addOnsAuto[]=
111 | {
112 | "utes"
113 | };
114 | randomSeed=203223;
115 | class Intel
116 | {
117 | startWeather=0.40000001;
118 | forecastWeather=0.25;
119 | year=2008;
120 | month=10;
121 | day=11;
122 | hour=14;
123 | minute=20;
124 | };
125 | };
126 |
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/aproxPI.sqf:
--------------------------------------------------------------------------------
1 |
2 | /************************************************
3 | * AproxPI
4 | *
5 | * Author: Naught (dylanplecki@gmail.com)
6 | * Description: A simple benchmarking tool.
7 | * Parameters: 0 - Number of Iterations to run. (number)
8 | * 1 - Number of Sub-Iterations to run. (number)
9 | * 2 - Control for output. (number)
10 | * 3 - Method to use. (string)
11 | * 4 - Enable built-in reporting. (boolean)
12 | * 5 - Enable loading screen. (boolean)
13 | * 6 - Output Time Precision. (number)
14 | * 7 - Output PI Precision. (number)
15 | * Returns: Completion time in seconds. (number)
16 | * Notes: None.
17 | *
18 | ************************************************/
19 |
20 | #include "x\x_defines.sqf"
21 |
22 | private ["_i", "_subi", "_ctrl", "_method", "_load", "_ui", "_timePrec", "_piPrec", "_r"];
23 |
24 | IFSETARG( _i, 0, DFT_ITERATIONS );
25 | IFSETARG( _subi, 1, DFT_SUBITERATIONS );
26 | IFSETARG( _ctrl, 2, DFT_OUTPUTCTRL );
27 | IFSETARG( _method, 3, DFT_METHOD );
28 | IFSETARG( _ui, 4, DFT_REPORT );
29 | IFSETARG( _load, 5, DFT_LOAD );
30 | IFSETARG( _timePrec, 6, DFT_TIMEPRECISION );
31 | IFSETARG( _piPrec, 7, DFT_PIPRECISION );
32 |
33 | _r = [];
34 |
35 | _script = preProcessFileLineNumbers (QUOTE(SCRIPTPATH) + "\x\" + "md_" + _method + ".sqf");
36 |
37 | if (_script != "") then {
38 |
39 | private ["_results"];
40 |
41 | REPORT( _ui, _load, _ctrl, STARTTEXT );
42 |
43 | _results = _this call compile _script; // Must Return: [_totalTime, _aproxPI, _endText]
44 |
45 | if (_load) then {endLoadingScreen};
46 |
47 | _endText = _results select 2;
48 |
49 | REPORT( _ui, false, _ctrl, _endText );
50 |
51 | } else {
52 |
53 | private ["_msg"];
54 | _msg = "CRITICAL: AproxPI: An invalid method (" + _method + ") has been provided to the script.";
55 |
56 | diag_log text(_msg);
57 | hint _msg;
58 | };
59 |
60 | _r
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/init.sqf:
--------------------------------------------------------------------------------
1 |
2 | /************************************************
3 | * AproxPI
4 | *
5 | * Author: Naught (dylanplecki@gmail.com)
6 | * Description: A simple benchmarking tool.
7 | * Parameters: None.
8 | * Returns: None.
9 | * Notes: The current methods consist of:
10 | * - "montecarlo"
11 | *
12 | ************************************************/
13 |
14 | #include "x\x_defines.sqf"
15 |
16 | // [Semi] Constants
17 | AproxPI_methods = ["montecarlo"]; // First is default
18 |
19 | // Functions
20 | AproxPI_fnc_loadBench = compile preProcessFileLineNumbers PATH(x\fnc_loadBench.sqf);
21 | AproxPI_fnc_popDialog = compile preProcessFileLineNumbers PATH(x\fnc_populateDialog.sqf);
22 |
23 | // Main Class
24 | AproxPI_main = compile preProcessFileLineNumbers PATH(aproxPI.sqf);
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/rsc/def_standard.hpp:
--------------------------------------------------------------------------------
1 | class RscText {
2 | x = 0;
3 | y = 0;
4 | h = 0.037;
5 | w = 0.3;
6 | style = 0;
7 | shadow = 2;
8 | font = "Zeppelin32";
9 | type = 0;
10 | SizeEx = 0.03921;
11 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
12 | colorBackground[] = {0, 0, 0, 0};
13 | };
14 |
15 | class RscHTML {
16 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
17 | colorLink[] = {0.8784, 0.8471, 0.651, 1.0};
18 | colorBold[] = {0.8784, 0.8471, 0.651, 1.0};
19 | colorLinkActive[] = {1, 0.537, 0, 1};
20 | sizeEx = 0.03921;
21 | type = 9;
22 | prevPage = "\ca\ui\data\arrow_left_ca.paa";
23 | nextPage = "\ca\ui\data\arrow_right_ca.paa";
24 | shadow = 2;
25 |
26 | class H1 {
27 | font = "Zeppelin32";
28 | fontBold = "Zeppelin33";
29 | sizeEx = 0.03921;
30 | align = "left";
31 | };
32 |
33 | class H2 {
34 | font = "Zeppelin32";
35 | fontBold = "Zeppelin33";
36 | sizeEx = 0.03921;
37 | align = "left";
38 | };
39 |
40 | class H3 {
41 | font = "Zeppelin32";
42 | fontBold = "Zeppelin33";
43 | sizeEx = 0.03921;
44 | align = "left";
45 | };
46 |
47 | class H4 {
48 | font = "Zeppelin33Italic";
49 | fontBold = "Zeppelin33";
50 | sizeEx = 0.03921;
51 | align = "left";
52 | };
53 |
54 | class H5 {
55 | font = "Zeppelin32";
56 | fontBold = "Zeppelin33";
57 | sizeEx = 0.03921;
58 | align = "left";
59 | };
60 |
61 | class H6 {
62 | font = "Zeppelin32";
63 | fontBold = "Zeppelin33";
64 | sizeEx = 0.03921;
65 | align = "left";
66 | };
67 |
68 | class P {
69 | font = "Zeppelin32";
70 | fontBold = "Zeppelin33";
71 | sizeEx = 0.03921;
72 | align = "left";
73 | };
74 | };
75 |
76 | class RscPicture : RscText {
77 | shadow = false;
78 | colorText[] = {1, 1, 1, 1};
79 | x = 0;
80 | y = 0;
81 | w = 0.2;
82 | h = 0.15;
83 | type = 0;
84 | };
85 |
86 | class RscProgress {
87 | x = 0.344;
88 | y = 0.619;
89 | w = 0.313726;
90 | h = 0.0261438;
91 | shadow = 2;
92 | texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
93 | colorFrame[] = {0, 0, 0, 0};
94 | colorBar[] = {1, 1, 1, 1};
95 | type = 8;
96 | };
97 |
98 | class RscPictureKeepAspect : RscPicture {
99 | style = 0x30 + 0x800;
100 | };
101 |
102 | class CA_Mainback : RscPicture {
103 | x = 0.35;
104 | y = 0.8;
105 | w = 0.3;
106 | h = 0.2;
107 | text = "\ca\ui\data\ui_gradient_start_gs.paa";
108 | colorText[] = {0.424, 0.651, 0.247, 1};
109 | };
110 |
111 | class CA_Black_Back : CA_Mainback {
112 | x = "SafeZoneX - SafeZoneW";
113 | y = "SafeZoneY - SafeZoneH";
114 | w = "SafeZoneW * 4";
115 | h = "SafeZoneH * 4";
116 | text = "#(argb,8,8,3)color(0,0,0,1)";
117 | colorText[] = {0.023529, 0, 0.0313725, 1};
118 | color[] = {0.023529, 0, 0.0313725, 1};
119 | colorBackground[] = {0.023529, 0, 0.0313725, 1};
120 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/rsc/disp_loadingScreen.hpp:
--------------------------------------------------------------------------------
1 | class aproxPI_loadingScreen {
2 | idd = 987;
3 | duration = 10e10;
4 | fadein = 0;
5 | fadeout = 0;
6 | name = "LoadingScreen";
7 | onLoad = "with uiNamespace do {AproxPI_loadingScreenIDD = (_this select 0);};";
8 |
9 | class controls {
10 |
11 | class CA_Black_Back3 : CA_Black_Back {
12 | idc = -1;
13 | };
14 |
15 | class Name : RscText {
16 | idc = 101;
17 | text = "";
18 | style = 0;
19 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
20 | };
21 |
22 | class CA_ProgressBackground : RscText {
23 | idc = -1;
24 | style = 48;
25 | text = "\ca\ui\data\loadscreen_progressbar_ca.paa";
26 | colorText[] = {1, 1, 1, 0.1};
27 | x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.5/2/4)*3*SafezoneH";
28 | y = "SafezoneY+SafezoneH*0.95";
29 | w = "0.5* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
30 | h = 0.0261438;
31 | };
32 |
33 | class HintBackground : RscText {
34 | idc = 8405;
35 | x = "SafezoneX + (safezoneW - 1.3) / 2";
36 | y = "SafezoneY + (safezoneH - ((SafezoneW / 2) * (4/3))) / 2 + ((SafezoneW / 2) * (4/3)) - ( 1.3 / 8) * 4/3 * 1.1";
37 | w = 1.3;
38 | h = ( 1.3 / 8) * 4/3;
39 | text = "\ca\ui\data\ui_loading_text_ca.paa";
40 | style = 48;
41 | shadow = false;
42 | };
43 |
44 | class Hint : RscText {
45 | idc = 8404;
46 | x = "SafezoneX + (safezoneW - 1.3 * 0.7 * (0.98)) / 2";
47 | y = "SafezoneY + (safezoneH - ((SafezoneW / 2) * (4/3))) / 2 + ((SafezoneW / 2) * (4/3)) - ( 1.3 / 8) * 4/3 * 1.1 + ( ( 1.3 / 8) * 4/3 - 0.03921 * 3)/2";
48 | w = 1.3 * 0.7 * (0.98);
49 | h = 0.03921 * 3;
50 | text = "Estimating the value of PI...";
51 | style = 0x02 + 0x10 + 0x200;
52 | lineSpacing = 1;
53 | };
54 |
55 | class CA_Progress : RscProgress {
56 | idc = 104;
57 | x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.5/2/4)*3*SafezoneH";
58 | y = "SafezoneY+SafezoneH*0.95";
59 | w = "0.5* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
60 | texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
61 | style = 0;
62 | };
63 | };
64 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/rsc/load.hpp:
--------------------------------------------------------------------------------
1 |
2 | // Definitions ----------------------------------
3 | #include "def_standard.hpp"
4 | #include "def_custom.hpp"
5 |
6 | // Dialogs --------------------------------------
7 | #include "diag_main.hpp"
8 |
9 | // Displays -------------------------------------
10 | #include "disp_loadingScreen.hpp"
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/x/fnc_loadBench.sqf:
--------------------------------------------------------------------------------
1 |
2 | #include "x_defines.sqf"
3 |
4 | private ["_call"];
5 |
6 | _call = _this select 0;
7 |
8 | switch (_call) do {
9 |
10 | case "preset": {
11 |
12 | private ["_args", "_method"];
13 |
14 | _args = _this select 1;
15 |
16 | _method = LBCURTXT(1);
17 |
18 | _args set [3, _method];
19 |
20 | _args spawn AproxPI_main;
21 | };
22 |
23 | case "custom": {
24 |
25 | private ["_args"];
26 |
27 | _args = [ CTRLNUM(2), CTRLNUM(3), DFT_OUTPUTCTRL, LBCURTXT(4), true, true, CTRLNUM(5), CTRLNUM(6) ];
28 |
29 | _args spawn AproxPI_main;
30 | };
31 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/x/fnc_populateDialog.sqf:
--------------------------------------------------------------------------------
1 |
2 | #include "x_defines.sqf"
3 |
4 | if (dialog) then {
5 |
6 | // Add some background blur effects
7 | 'dynamicBlur' ppEffectEnable true;
8 | 'dynamicBlur' ppEffectAdjust [1.6];
9 | 'dynamicBlur' ppEffectCommit 0;
10 |
11 | {
12 | lbAdd [1, _x];
13 | lbAdd [4, _x];
14 | } forEach AproxPI_methods;
15 |
16 | lbSetCurSel [1, 0];
17 | lbSetCurSel [4, 0];
18 |
19 | ctrlSetText [2, str(DFT_ITERATIONS)];
20 | ctrlSetText [3, str(DFT_SUBITERATIONS)];
21 | ctrlSetText [5, str(DFT_TIMEPRECISION)];
22 | ctrlSetText [6, str(DFT_PIPRECISION)];
23 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/x/ref_pi.txt:
--------------------------------------------------------------------------------
1 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303820
--------------------------------------------------------------------------------
/Arma 2/AproxPI/Demo Missions/AproxPI_v1.utes/AproxPI_v1.utes/scripts/aproxPI/x/x_defines.sqf:
--------------------------------------------------------------------------------
1 |
2 | // Constants - Use these to override
3 |
4 | #define SCRIPTPATH scripts\aproxPI
5 |
6 | #define DFT_ITERATIONS 50
7 | #define DFT_SUBITERATIONS 10000
8 | #define DFT_OUTPUTCTRL AproxPI_outputCtrlIDC
9 | #define DFT_METHOD "montecarlo"
10 | #define DFT_LOAD true
11 | #define DFT_REPORT true
12 | #define DFT_TIMEPRECISION 4
13 | #define DFT_PIPRECISION 4
14 |
15 | #define TIMEMETHOD diag_tickTime
16 | #define STARTTEXT ("AproxPI Simulation")
17 | #define ENDTEXT(method) ("AproxPI Simulation (" + method + ") has finished.")
18 |
19 | /////////////////////////////////////////////////
20 |
21 | // QUOTE - Simple Enough
22 | #define QUOTE(var1) #var1
23 |
24 | // PATH - Generate a path for a file (var) based on SCRIPTPATH
25 | #define PATH(var) QUOTE(SCRIPTPATH\var)
26 |
27 | // REALPI - Gets the accepted value of PI
28 | #define REALPI \
29 | (parseNumber (preProcessFile QUOTE(SCRIPTPATH\x\ref_pi.txt)))
30 |
31 | // CTRLNUM - Parse a number from a control (con)
32 | #define CTRLNUM(con) \
33 | (parseNumber(ctrlText con))
34 |
35 | // LBCURTXT - Get the currently selected text from an LB control (con)
36 | #define LBCURTXT(con) \
37 | (lbText [con, (lbCurSel con)])
38 |
39 | // ROUNDRE - A "real" version of round() which round a value (val) and incorporates decimal precision (prec)
40 | #define ROUNDRE(val,prec) \
41 | ((round(val * (10 ^ prec))) / (10 ^ prec))
42 |
43 | // IFSETARG - Checks _this for index (ind) and sets the variable (var) to the value, if not available sets to default (dft)
44 | #define IFSETARG(var,ind,dft) \
45 | var = if ((count _this) > ind) then {_this select ind} else {dft}
46 |
47 | // IFDIAG - Checks for an open dialog and ctrl index (ind), then proceeds
48 | #define IFDIAG(ind) \
49 | if (dialog AND (ind >= 0))
50 |
51 | // REPORT - If enabled (enabled), it reports via control (ind) or else reverts to hinting, uses text (txt) and variable loading screen (loadScn)
52 | #define REPORT(enabled,loadScn,ind,txt) \
53 | if (enabled) then { \
54 | if (loadScn) then { \
55 | startLoadingScreen [txt, "aproxPI_loadingScreen"]; \
56 | } else { \
57 | IFDIAG(ind) then { \
58 | ctrlSetText [ind, txt]; \
59 | } else { \
60 | hint txt; \
61 | }; \
62 | }; \
63 | }
64 |
65 | // DBLRAND - A double-encompassing random number gen, pos + neg
66 | #define DBLRAND(radius) \
67 | radius - (2 * random(radius))
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/aproxPI.sqf:
--------------------------------------------------------------------------------
1 |
2 | /************************************************
3 | * AproxPI
4 | *
5 | * Author: Naught (dylanplecki@gmail.com)
6 | * Description: A simple benchmarking tool.
7 | * Parameters: 0 - Number of Iterations to run. (number)
8 | * 1 - Number of Sub-Iterations to run. (number)
9 | * 2 - Control for output. (number)
10 | * 3 - Method to use. (string)
11 | * 4 - Enable built-in reporting. (boolean)
12 | * 5 - Enable loading screen. (boolean)
13 | * 6 - Output Time Precision. (number)
14 | * 7 - Output PI Precision. (number)
15 | * Returns: Completion time in seconds. (number)
16 | * Notes: None.
17 | *
18 | ************************************************/
19 |
20 | #include "x\x_defines.sqf"
21 |
22 | private ["_i", "_subi", "_ctrl", "_method", "_load", "_ui", "_timePrec", "_piPrec", "_r"];
23 |
24 | IFSETARG( _i, 0, DFT_ITERATIONS );
25 | IFSETARG( _subi, 1, DFT_SUBITERATIONS );
26 | IFSETARG( _ctrl, 2, DFT_OUTPUTCTRL );
27 | IFSETARG( _method, 3, DFT_METHOD );
28 | IFSETARG( _ui, 4, DFT_REPORT );
29 | IFSETARG( _load, 5, DFT_LOAD );
30 | IFSETARG( _timePrec, 6, DFT_TIMEPRECISION );
31 | IFSETARG( _piPrec, 7, DFT_PIPRECISION );
32 |
33 | _r = [];
34 |
35 | _script = preProcessFileLineNumbers (QUOTE(SCRIPTPATH) + "\x\" + "md_" + _method + ".sqf");
36 |
37 | if (_script != "") then {
38 |
39 | private ["_results"];
40 |
41 | REPORT( _ui, _load, _ctrl, STARTTEXT );
42 |
43 | _results = _this call compile _script; // Must Return: [_totalTime, _aproxPI, _endText]
44 |
45 | if (_load) then {endLoadingScreen};
46 |
47 | _endText = _results select 2;
48 |
49 | REPORT( _ui, false, _ctrl, _endText );
50 |
51 | } else {
52 |
53 | private ["_msg"];
54 | _msg = "CRITICAL: AproxPI: An invalid method (" + _method + ") has been provided to the script.";
55 |
56 | diag_log text(_msg);
57 | hint _msg;
58 | };
59 |
60 | _r
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/init.sqf:
--------------------------------------------------------------------------------
1 |
2 | /************************************************
3 | * AproxPI
4 | *
5 | * Author: Naught (dylanplecki@gmail.com)
6 | * Description: A simple benchmarking tool.
7 | * Parameters: None.
8 | * Returns: None.
9 | * Notes: The current methods consist of:
10 | * - "montecarlo"
11 | *
12 | ************************************************/
13 |
14 | #include "x\x_defines.sqf"
15 |
16 | // [Semi] Constants
17 | AproxPI_methods = ["montecarlo"]; // First is default
18 |
19 | // Functions
20 | AproxPI_fnc_loadBench = compile preProcessFileLineNumbers PATH(x\fnc_loadBench.sqf);
21 | AproxPI_fnc_popDialog = compile preProcessFileLineNumbers PATH(x\fnc_populateDialog.sqf);
22 |
23 | // Main Class
24 | AproxPI_main = compile preProcessFileLineNumbers PATH(aproxPI.sqf);
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/rsc/def_standard.hpp:
--------------------------------------------------------------------------------
1 | class RscText {
2 | x = 0;
3 | y = 0;
4 | h = 0.037;
5 | w = 0.3;
6 | style = 0;
7 | shadow = 2;
8 | font = "Zeppelin32";
9 | type = 0;
10 | SizeEx = 0.03921;
11 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
12 | colorBackground[] = {0, 0, 0, 0};
13 | };
14 |
15 | class RscHTML {
16 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
17 | colorLink[] = {0.8784, 0.8471, 0.651, 1.0};
18 | colorBold[] = {0.8784, 0.8471, 0.651, 1.0};
19 | colorLinkActive[] = {1, 0.537, 0, 1};
20 | sizeEx = 0.03921;
21 | type = 9;
22 | prevPage = "\ca\ui\data\arrow_left_ca.paa";
23 | nextPage = "\ca\ui\data\arrow_right_ca.paa";
24 | shadow = 2;
25 |
26 | class H1 {
27 | font = "Zeppelin32";
28 | fontBold = "Zeppelin33";
29 | sizeEx = 0.03921;
30 | align = "left";
31 | };
32 |
33 | class H2 {
34 | font = "Zeppelin32";
35 | fontBold = "Zeppelin33";
36 | sizeEx = 0.03921;
37 | align = "left";
38 | };
39 |
40 | class H3 {
41 | font = "Zeppelin32";
42 | fontBold = "Zeppelin33";
43 | sizeEx = 0.03921;
44 | align = "left";
45 | };
46 |
47 | class H4 {
48 | font = "Zeppelin33Italic";
49 | fontBold = "Zeppelin33";
50 | sizeEx = 0.03921;
51 | align = "left";
52 | };
53 |
54 | class H5 {
55 | font = "Zeppelin32";
56 | fontBold = "Zeppelin33";
57 | sizeEx = 0.03921;
58 | align = "left";
59 | };
60 |
61 | class H6 {
62 | font = "Zeppelin32";
63 | fontBold = "Zeppelin33";
64 | sizeEx = 0.03921;
65 | align = "left";
66 | };
67 |
68 | class P {
69 | font = "Zeppelin32";
70 | fontBold = "Zeppelin33";
71 | sizeEx = 0.03921;
72 | align = "left";
73 | };
74 | };
75 |
76 | class RscPicture : RscText {
77 | shadow = false;
78 | colorText[] = {1, 1, 1, 1};
79 | x = 0;
80 | y = 0;
81 | w = 0.2;
82 | h = 0.15;
83 | type = 0;
84 | };
85 |
86 | class RscProgress {
87 | x = 0.344;
88 | y = 0.619;
89 | w = 0.313726;
90 | h = 0.0261438;
91 | shadow = 2;
92 | texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
93 | colorFrame[] = {0, 0, 0, 0};
94 | colorBar[] = {1, 1, 1, 1};
95 | type = 8;
96 | };
97 |
98 | class RscPictureKeepAspect : RscPicture {
99 | style = 0x30 + 0x800;
100 | };
101 |
102 | class CA_Mainback : RscPicture {
103 | x = 0.35;
104 | y = 0.8;
105 | w = 0.3;
106 | h = 0.2;
107 | text = "\ca\ui\data\ui_gradient_start_gs.paa";
108 | colorText[] = {0.424, 0.651, 0.247, 1};
109 | };
110 |
111 | class CA_Black_Back : CA_Mainback {
112 | x = "SafeZoneX - SafeZoneW";
113 | y = "SafeZoneY - SafeZoneH";
114 | w = "SafeZoneW * 4";
115 | h = "SafeZoneH * 4";
116 | text = "#(argb,8,8,3)color(0,0,0,1)";
117 | colorText[] = {0.023529, 0, 0.0313725, 1};
118 | color[] = {0.023529, 0, 0.0313725, 1};
119 | colorBackground[] = {0.023529, 0, 0.0313725, 1};
120 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/rsc/disp_loadingScreen.hpp:
--------------------------------------------------------------------------------
1 | class aproxPI_loadingScreen {
2 | idd = 987;
3 | duration = 10e10;
4 | fadein = 0;
5 | fadeout = 0;
6 | name = "LoadingScreen";
7 | onLoad = "with uiNamespace do {AproxPI_loadingScreenIDD = (_this select 0);};";
8 |
9 | class controls {
10 |
11 | class CA_Black_Back3 : CA_Black_Back {
12 | idc = -1;
13 | };
14 |
15 | class Name : RscText {
16 | idc = 101;
17 | text = "";
18 | style = 0;
19 | colorText[] = {0.8784, 0.8471, 0.651, 1.0};
20 | };
21 |
22 | class CA_ProgressBackground : RscText {
23 | idc = -1;
24 | style = 48;
25 | text = "\ca\ui\data\loadscreen_progressbar_ca.paa";
26 | colorText[] = {1, 1, 1, 0.1};
27 | x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.5/2/4)*3*SafezoneH";
28 | y = "SafezoneY+SafezoneH*0.95";
29 | w = "0.5* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
30 | h = 0.0261438;
31 | };
32 |
33 | class HintBackground : RscText {
34 | idc = 8405;
35 | x = "SafezoneX + (safezoneW - 1.3) / 2";
36 | y = "SafezoneY + (safezoneH - ((SafezoneW / 2) * (4/3))) / 2 + ((SafezoneW / 2) * (4/3)) - ( 1.3 / 8) * 4/3 * 1.1";
37 | w = 1.3;
38 | h = ( 1.3 / 8) * 4/3;
39 | text = "\ca\ui\data\ui_loading_text_ca.paa";
40 | style = 48;
41 | shadow = false;
42 | };
43 |
44 | class Hint : RscText {
45 | idc = 8404;
46 | x = "SafezoneX + (safezoneW - 1.3 * 0.7 * (0.98)) / 2";
47 | y = "SafezoneY + (safezoneH - ((SafezoneW / 2) * (4/3))) / 2 + ((SafezoneW / 2) * (4/3)) - ( 1.3 / 8) * 4/3 * 1.1 + ( ( 1.3 / 8) * 4/3 - 0.03921 * 3)/2";
48 | w = 1.3 * 0.7 * (0.98);
49 | h = 0.03921 * 3;
50 | text = "Estimating the value of PI...";
51 | style = 0x02 + 0x10 + 0x200;
52 | lineSpacing = 1;
53 | };
54 |
55 | class CA_Progress : RscProgress {
56 | idc = 104;
57 | x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.5/2/4)*3*SafezoneH";
58 | y = "SafezoneY+SafezoneH*0.95";
59 | w = "0.5* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
60 | texture = "\ca\ui\data\loadscreen_progressbar_ca.paa";
61 | style = 0;
62 | };
63 | };
64 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/rsc/load.hpp:
--------------------------------------------------------------------------------
1 |
2 | // Definitions ----------------------------------
3 | #include "def_standard.hpp"
4 | #include "def_custom.hpp"
5 |
6 | // Dialogs --------------------------------------
7 | #include "diag_main.hpp"
8 |
9 | // Displays -------------------------------------
10 | #include "disp_loadingScreen.hpp"
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/x/fnc_loadBench.sqf:
--------------------------------------------------------------------------------
1 |
2 | #include "x_defines.sqf"
3 |
4 | private ["_call"];
5 |
6 | _call = _this select 0;
7 |
8 | switch (_call) do {
9 |
10 | case "preset": {
11 |
12 | private ["_args", "_method"];
13 |
14 | _args = _this select 1;
15 |
16 | _method = LBCURTXT(1);
17 |
18 | _args set [3, _method];
19 |
20 | _args spawn AproxPI_main;
21 | };
22 |
23 | case "custom": {
24 |
25 | private ["_args"];
26 |
27 | _args = [ CTRLNUM(2), CTRLNUM(3), DFT_OUTPUTCTRL, LBCURTXT(4), true, true, CTRLNUM(5), CTRLNUM(6) ];
28 |
29 | _args spawn AproxPI_main;
30 | };
31 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/x/fnc_populateDialog.sqf:
--------------------------------------------------------------------------------
1 |
2 | #include "x_defines.sqf"
3 |
4 | if (dialog) then {
5 |
6 | // Add some background blur effects
7 | 'dynamicBlur' ppEffectEnable true;
8 | 'dynamicBlur' ppEffectAdjust [1.6];
9 | 'dynamicBlur' ppEffectCommit 0;
10 |
11 | {
12 | lbAdd [1, _x];
13 | lbAdd [4, _x];
14 | } forEach AproxPI_methods;
15 |
16 | lbSetCurSel [1, 0];
17 | lbSetCurSel [4, 0];
18 |
19 | ctrlSetText [2, str(DFT_ITERATIONS)];
20 | ctrlSetText [3, str(DFT_SUBITERATIONS)];
21 | ctrlSetText [5, str(DFT_TIMEPRECISION)];
22 | ctrlSetText [6, str(DFT_PIPRECISION)];
23 | };
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/x/ref_pi.txt:
--------------------------------------------------------------------------------
1 | 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303820
--------------------------------------------------------------------------------
/Arma 2/AproxPI/scripts/aproxPI/x/x_defines.sqf:
--------------------------------------------------------------------------------
1 |
2 | // Constants - Use these to override
3 |
4 | #define SCRIPTPATH scripts\aproxPI
5 |
6 | #define DFT_ITERATIONS 50
7 | #define DFT_SUBITERATIONS 10000
8 | #define DFT_OUTPUTCTRL AproxPI_outputCtrlIDC
9 | #define DFT_METHOD "montecarlo"
10 | #define DFT_LOAD true
11 | #define DFT_REPORT true
12 | #define DFT_TIMEPRECISION 4
13 | #define DFT_PIPRECISION 4
14 |
15 | #define TIMEMETHOD diag_tickTime
16 | #define STARTTEXT ("AproxPI Simulation")
17 | #define ENDTEXT(method) ("AproxPI Simulation (" + method + ") has finished.")
18 |
19 | /////////////////////////////////////////////////
20 |
21 | // QUOTE - Simple Enough
22 | #define QUOTE(var1) #var1
23 |
24 | // PATH - Generate a path for a file (var) based on SCRIPTPATH
25 | #define PATH(var) QUOTE(SCRIPTPATH\var)
26 |
27 | // REALPI - Gets the accepted value of PI
28 | #define REALPI \
29 | (parseNumber (preProcessFile QUOTE(SCRIPTPATH\x\ref_pi.txt)))
30 |
31 | // CTRLNUM - Parse a number from a control (con)
32 | #define CTRLNUM(con) \
33 | (parseNumber(ctrlText con))
34 |
35 | // LBCURTXT - Get the currently selected text from an LB control (con)
36 | #define LBCURTXT(con) \
37 | (lbText [con, (lbCurSel con)])
38 |
39 | // ROUNDRE - A "real" version of round() which round a value (val) and incorporates decimal precision (prec)
40 | #define ROUNDRE(val,prec) \
41 | ((round(val * (10 ^ prec))) / (10 ^ prec))
42 |
43 | // IFSETARG - Checks _this for index (ind) and sets the variable (var) to the value, if not available sets to default (dft)
44 | #define IFSETARG(var,ind,dft) \
45 | var = if ((count _this) > ind) then {_this select ind} else {dft}
46 |
47 | // IFDIAG - Checks for an open dialog and ctrl index (ind), then proceeds
48 | #define IFDIAG(ind) \
49 | if (dialog AND (ind >= 0))
50 |
51 | // REPORT - If enabled (enabled), it reports via control (ind) or else reverts to hinting, uses text (txt) and variable loading screen (loadScn)
52 | #define REPORT(enabled,loadScn,ind,txt) \
53 | if (enabled) then { \
54 | if (loadScn) then { \
55 | startLoadingScreen [txt, "aproxPI_loadingScreen"]; \
56 | } else { \
57 | IFDIAG(ind) then { \
58 | ctrlSetText [ind, txt]; \
59 | } else { \
60 | hint txt; \
61 | }; \
62 | }; \
63 | }
64 |
65 | // DBLRAND - A double-encompassing random number gen, pos + neg
66 | #define DBLRAND(radius) \
67 | radius - (2 * random(radius))
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_addUnit.sqf:
--------------------------------------------------------------------------------
1 | // Returns: Fired Event Handler Index
2 | private ["_unit", "_eventHandler"];
3 |
4 | // Macros
5 | #include "x-macros.hpp"
6 |
7 | // Variables
8 | _unit = _this select 0;
9 | _eventHandler = -1;
10 |
11 | // Script
12 | _eventHandler = _unit addEventHandler ["fired", {
13 | if ((_this select 4) in CRACK_sf_ammoArray) then {
14 | _unit = _this select 0;
15 | _this call CRACK_sf_fnc_shotFiredLocal;
16 | };
17 | }];
18 |
19 | _eventHandler
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_dirTo.sqf:
--------------------------------------------------------------------------------
1 | //
2 | // An Actually Working DirectionTo Function!
3 | // By Crackman
4 | //
5 | //------------------------------------------
6 |
7 | private ["_pos1", "_pos2", "_x", "_y", "_theta"];
8 |
9 | // Variables
10 | _pos1 = _this select 0;
11 | _pos2 = _this select 1;
12 |
13 | // Script
14 | if (typeName(_pos1) == "OBJECT") then {
15 | _pos1 = getPos _pos1;
16 | };
17 | if (typeName(_pos2) == "OBJECT") then {
18 | _pos2 = getPos _pos2;
19 | };
20 |
21 | _x = (_pos2 select 0) - (_pos1 select 0);
22 | _y = (_pos2 select 1) - (_pos1 select 1);
23 |
24 | _theta = (((_x atan2 _y) % 360) + 360) % 360;
25 |
26 | _theta
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_getQuadrant.sqf:
--------------------------------------------------------------------------------
1 | private ["_args", "_veh", "_xcor", "_ycor", "_rDir", "_sDir", "_vehPos", "_distance", "_fireLoc", "_vDir"];
2 |
3 | // Macros
4 | #include "x-macros.hpp"
5 |
6 | // Variables
7 | _veh = _this select 0;
8 | _distance = _this select 1;
9 | _fireLoc = _this select 2;
10 |
11 | // Script
12 | _sDir = [_veh, _fireLoc] call CRACK_sf_fnc_dirTo;
13 | _vDir = [(getDir _veh)] call CRACK_sf_fnc_simpDeg;
14 | _rDir = ((360 - _vDir) + _sDir) % 360;
15 |
16 | ifDebug(6) then {
17 | private ["_infoText"];
18 | _infoText = format["Vehicle %1 Quadrant: sDir=%2, vDir=%3, rDir=%4", _veh, _sDir, _vDir, _rDir];
19 | debugChat(_infoText,6);
20 | };
21 |
22 | //----------------------
23 |
24 | _args = switch (true) do {
25 |
26 | case ((_rDir > 345) || (_rDir <= 15)):
27 | {["sfs_12oclock", "sf_12oclock"]};
28 |
29 | case ((_rDir > 15) && (_rDir <= 45)):
30 | {["sfs_1oclock", "sf_1oclock"]};
31 |
32 | case ((_rDir > 45) && (_rDir <= 75)):
33 | {["sfs_2oclock", "sf_2oclock"]};
34 |
35 | case ((_rDir > 75) && (_rDir <= 105)):
36 | {["sfs_3oclock", "sf_3oclock"]};
37 |
38 | case ((_rDir > 105) && (_rDir <= 135)):
39 | {["sfs_4oclock", "sf_4oclock"]};
40 |
41 | case ((_rDir > 135) && (_rDir <= 165)):
42 | {["sfs_5oclock", "sf_5oclock"]};
43 |
44 | case ((_rDir > 165) && (_rDir <= 195)):
45 | {["sfs_6oclock", "sf_6oclock"]};
46 |
47 | case ((_rDir > 195) && (_rDir <= 225)):
48 | {["sfs_7oclock", "sf_7oclock"]};
49 |
50 | case ((_rDir > 225) && (_rDir <= 255)):
51 | {["sfs_8oclock", "sf_8oclock"]};
52 |
53 | case ((_rDir > 255) && (_rDir <= 285)):
54 | {["sfs_9oclock", "sf_9oclock"]};
55 |
56 | case ((_rDir > 285) && (_rDir <= 315)):
57 | {["sfs_10oclock", "sf_10oclock"]};
58 |
59 | case ((_rDir > 315) && (_rDir <= 345)):
60 | {["sfs_11oclock", "sf_11oclock"]};
61 |
62 | case default
63 | {["",""]};
64 | };
65 |
66 | //----------------------
67 |
68 | _args
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_setBoomerangStatus.sqf:
--------------------------------------------------------------------------------
1 | private ["_index", "_value", "_getVar"];
2 |
3 | // Macros
4 | #include "x-macros.hpp"
5 |
6 | // Variables
7 | _index = _this select 0;
8 | _value = _this select 1;
9 |
10 | // Script
11 | _getVar = CRACK_sf_interactTarget getVariable ["CRACK_sf_boomStatus", CRACK_sf_defaultVehVar];
12 | _getVar set [_index, _value];
13 | CRACK_sf_interactTarget setVariable ["CRACK_sf_boomStatus", _getVar];
14 |
15 | true
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_shotAlert.sqf:
--------------------------------------------------------------------------------
1 | private ["_veh", "_radio", "_title", "_result", "_getVar"];
2 |
3 | // Macros
4 | #include "x-macros.hpp"
5 |
6 | // Variables
7 | _veh = _this select 0;
8 | _sound = _this select 1;
9 | _title = _this select 2;
10 | _result = false;
11 |
12 | // Script
13 | if (!isDedicated) then {
14 |
15 | _getVar = _veh getVariable ["CRACK_sf_boomStatus", CRACK_sf_defaultVehVar];
16 |
17 | if (_getVar select 0) then {
18 |
19 | if (_getVar select 1) then {
20 | if (_getVar select 2) then {
21 | _veh vehicleRadio _sound;
22 | } else {
23 | _veh vehicleRadio "sfs_beep";
24 | };
25 | _result = true;
26 | };
27 |
28 | if (player in (crew _veh)) then {
29 | titleRsc [_title, "PLAIN"];
30 | _result = true;
31 | };
32 | };
33 |
34 | if (CRACK_sf_logBoomerangActs) then {
35 | [(format["BOOMERANG: Vehicle %1 heard shot at %2", _veh, _sound])] call jayarma2lib_fnc_writeLog;
36 | };
37 | };
38 |
39 | _result
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_shotFiredLocal.sqf:
--------------------------------------------------------------------------------
1 | private ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_affVeh", "_dirP", "_dirV", "_handle"];
2 |
3 | // Macros
4 | #include "x-macros.hpp"
5 |
6 | debugChat("Detectable Shot Fired Local",4);
7 |
8 | // Variables
9 | _unit = _this select 0;
10 | _weapon = _this select 1;
11 | _muzzle = _this select 2;
12 | _mode = _this select 3;
13 | _ammo = _this select 4;
14 | _affVeh = [];
15 |
16 | // Script
17 | {
18 | private ["_distance"];
19 |
20 | _distance = abs(_x distance _unit);
21 |
22 | if ((CRACK_sf_minDetectionRad <= _distance) AND (_distance <= CRACK_sf_maxDetectionRad)) then {
23 |
24 | _dirP = [(getDir _unit)] call CRACK_sf_fnc_simpDeg;
25 | _dirV = [_unit, _x] call CRACK_sf_fnc_dirTo;
26 |
27 | ifDebug(6) then {
28 | private ["_infoText"];
29 | _infoText = format["Vehicle %1: DirP=%2, DirV=%3, Dist=%4", _x, _dirP, _dirV, _distance];
30 | debugChat(_infoText,6);
31 | };
32 |
33 | if (((_dirV - CRACK_sf_dirConeSize) <= _dirP) AND (_dirP <= (_dirV + CRACK_sf_dirConeSize))) then {
34 |
35 | _affVeh = _affVeh + [_x];
36 |
37 | ifDebug(5) then {
38 | private ["_infoText"];
39 | _infoText = format["Vehicle %1 can detect %2", _x, _unit, _distance];
40 | debugChat(_infoText,5);
41 | };
42 | };
43 | };
44 | } forEach CRACK_sf_vehicleArray;
45 |
46 | debugChat("Sending Shot Fired Variable",5);
47 |
48 | CRACK_sf_shotFired = [_unit, (getpos _unit), (getdir _unit), _ammo, _affVeh];
49 | publicVariable "CRACK_sf_shotFired";
50 |
51 | debugChat("Shot Fired Variable Sent",5);
52 |
53 | // Just in case the local unit is near
54 | if (!isDedicated) then {
55 | _handle = CRACK_sf_shotFired spawn CRACK_sf_fnc_shotFiredRemote;
56 | };
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_shotFiredRemote.sqf:
--------------------------------------------------------------------------------
1 | private ["_unit", "_pos", "_dir", "_ammo", "_veh", "_result", "_vehicles", "_nearestVehs", "_dis", "_foo"];
2 |
3 | // Macros
4 | #include "x-macros.hpp"
5 |
6 | debugChat("Detectable Shot Fired Remote",4);
7 |
8 | // Variables
9 | _unit = _this select 0;
10 | _pos = _this select 1;
11 | _dir = _this select 2;
12 | _ammo = _this select 3;
13 | _vehs = _this select 4;
14 | _nearestVehs = [];
15 |
16 | // Script
17 | if ((count _vehs) > 0) then {
18 |
19 | debugChat("A Boomerang Vehicle is in Range",5);
20 |
21 | {
22 | _nearestVehs set [(count _nearestVehs), [_x, (_x distance _pos)]];
23 | } forEach _vehs;
24 |
25 | _nearestVehs = [_nearestVehs, 1] call CBA_fnc_sortNestedArray;
26 |
27 | ifDebug(6) then {
28 | private ["_infoText"];
29 | _infoText = format["Nearest Boomerang Vehicles: %1", _nearestVehs];
30 | debugChat(_infoText,6);
31 | };
32 |
33 | for "_i" from 0 to ((count _nearestVehs) - 1) do {
34 | _veh = _nearestVehs select _i;
35 | _foo = (_veh + [_pos]) spawn {
36 | _args = _this call CRACK_sf_fnc_getQuadrant;
37 | ([(_this select 0)] + _args) call CRACK_sf_fnc_shotAlert;
38 | ifDebug(4) then {
39 | private ["_infoText"];
40 | _infoText = format["Vehicle %1 Shot Detected, w/args: %2", (_this select 0), _args];
41 | debugChat(_infoText,4);
42 | };
43 | };
44 | };
45 | };
46 |
47 | _result
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/fnc_simpDeg.sqf:
--------------------------------------------------------------------------------
1 | //
2 | // Simplifies a Degree Measurement to Under 360
3 | // By Crackman
4 | //
5 | //---------------------------------------------
6 |
7 | private ["_deg"];
8 |
9 | // Variables
10 | _deg = _this select 0;
11 |
12 | // Script
13 | _deg = ((_deg % 360) + 360) % 360;
14 |
15 | _deg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/f/x-macros.hpp:
--------------------------------------------------------------------------------
1 | // Macros
2 | //----------------------
3 |
4 | #define ifDebug(debugLevel) if ((CRACK_sf_debugEnabled select 0) AND ((CRACK_sf_debugEnabled select 1) >= debugLevel))
5 | #define debug(debugLevel,codeToRun) ifDebug(debugLevel) then {codeToRun}
6 | #define ifThen(cond,codeToRun) if (cond) then {codeToRun}
7 |
8 | #define debugChat(chatText,debugLevel) debug(debugLevel, player sideChat chatText;)
9 | #define debugChatC(chatText,debugLevel,cond) ifThen(cond,debugChat(chatText,debugLevel))
10 |
11 | #define debugHint(hintText,debugLevel) debug(debugLevel, hint hintText;)
12 | #define debugHintC(hintText,debugLevel,cond) ifThen(cond,debugHint(hintText,debugLevel))
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/10oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/10oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/11oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/11oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/12oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/12oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/1oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/1oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/2oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/2oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/3oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/3oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/4oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/4oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/5oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/5oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/6oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/6oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/7oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/7oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/8oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/8oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/9oclock.paa:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/HUD/images/9oclock.paa
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/resources.hpp:
--------------------------------------------------------------------------------
1 | // Add #include "scripts\boomerang\rsc\resources.hpp" into your description.ext
2 |
3 | #include "sounds\sf_RadioDiag.hpp"
4 | #include "HUD\sf_GUI.hpp"
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/Beep.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/Beep.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/sf_RadioDiag.hpp:
--------------------------------------------------------------------------------
1 | class CfgRadio
2 | {
3 | sounds[] = {};
4 | class sfs_1oclock
5 | {
6 | name = "sfs_1oclock";
7 | sound[] = {"scripts\boomerang\rsc\sounds\shot1oclock.ogg", db-0, 1.0};
8 | title = "";
9 | };
10 | class sfs_2oclock
11 | {
12 | name = "sfs_2oclock";
13 | sound[] = {"scripts\boomerang\rsc\sounds\shot2oclock.ogg", db-0, 1.0};
14 | title = "";
15 | };
16 | class sfs_3oclock
17 | {
18 | name = "sfs_3oclock";
19 | sound[] = {"scripts\boomerang\rsc\sounds\shot3oclock.ogg", db-0, 1.0};
20 | title = "";
21 | };
22 | class sfs_4oclock
23 | {
24 | name = "sfs_4oclock";
25 | sound[] = {"scripts\boomerang\rsc\sounds\shot4oclock.ogg", db-0, 1.0};
26 | title = "";
27 | };
28 | class sfs_5oclock
29 | {
30 | name = "sfs_5oclock";
31 | sound[] = {"scripts\boomerang\rsc\sounds\shot5oclock.ogg", db-0, 1.0};
32 | title = "";
33 | };
34 | class sfs_6oclock
35 | {
36 | name = "sfs_6oclock";
37 | sound[] = {"scripts\boomerang\rsc\sounds\shot6oclock.ogg", db-0, 1.0};
38 | title = "";
39 | };
40 | class sfs_7oclock
41 | {
42 | name = "sfs_7oclock";
43 | sound[] = {"scripts\boomerang\rsc\sounds\shot7oclock.ogg", db-0, 1.0};
44 | title = "";
45 | };
46 | class sfs_8oclock
47 | {
48 | name = "sfs_8oclock";
49 | sound[] = {"scripts\boomerang\rsc\sounds\shot8oclock.ogg", db-0, 1.0};
50 | title = "";
51 | };
52 | class sfs_9oclock
53 | {
54 | name = "sfs_9oclock";
55 | sound[] = {"scripts\boomerang\rsc\sounds\shot9oclock.ogg", db-0, 1.0};
56 | title = "";
57 | };
58 | class sfs_10oclock
59 | {
60 | name = "sfs_10oclock";
61 | sound[] = {"scripts\boomerang\rsc\sounds\shot10oclock.ogg", db-0, 1.0};
62 | title = "";
63 | };
64 | class sfs_11oclock
65 | {
66 | name = "sfs_11oclock";
67 | sound[] = {"scripts\boomerang\rsc\sounds\shot11oclock.ogg", db-0, 1.0};
68 | title = "";
69 | };
70 | class sfs_12oclock
71 | {
72 | name = "sfs_12oclock";
73 | sound[] = {"scripts\boomerang\rsc\sounds\shot12oclock.ogg", db-0, 1.0};
74 | title = "";
75 | };
76 | };
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot10oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot10oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot11oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot11oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot12oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot12oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot1oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot1oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot2oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot2oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot3oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot3oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot4oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot4oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot5oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot5oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot6oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot6oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot7oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot7oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot8oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot8oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot9oclock.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Boomerang System Script/scripts/boomerang/rsc/sounds/shot9oclock.ogg
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/$PREFIX$:
--------------------------------------------------------------------------------
1 | x\crack\addons\main
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/XEH_preInit.sqf:
--------------------------------------------------------------------------------
1 | #include "script_component.hpp"
2 |
3 | // FUNCTIONS
4 | PREPMAINFUNC(toUnicodeDecimal);
5 | PREPMAINFUNC(arrayToString);
6 |
7 | // I guess that's it for now?
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/config.cpp:
--------------------------------------------------------------------------------
1 | class CfgPatches {
2 | class crack_main {
3 | units[] = {};
4 | weapons[] = {};
5 | requiredVersion = 1.0;
6 | requiredAddons[] = {"cba_main"};
7 | version = 1.0;
8 | author[] = {"Crackman"};
9 | };
10 | };
11 |
12 | class Extended_PreInit_EventHandlers {
13 | crack_main_preInit = "call compile preprocessFileLineNumbers 'x\crack\addons\main\XEH_preInit.sqf'";
14 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/f/fnc_arrayToString.sqf:
--------------------------------------------------------------------------------
1 | // [_textArray, _recursive(true|false)] call FUNCMAIN(arrayToString);
2 |
3 | #include "\x\crack\addons\main\script_component.hpp"
4 |
5 | private ["_text", "_textArray", "_newText"];
6 |
7 | _textArray = _this select 0;
8 | _recursive = _this select 1;
9 | _text = "";
10 |
11 | if (typename(_text) == typename([])) then {
12 |
13 | { // FOREACH
14 | _newText = "";
15 |
16 | if (typename(_x) == typename("Text")) then {
17 | _newText = _x;
18 | } else {
19 | if ((typename(_x) == typename([])) AND _recursive) then {
20 | _newText = [_textArray, _recursive] call FUNCMAIN(arrayToString);
21 | }
22 | };
23 |
24 | if (_newText != "") then {
25 | _text = _text + _newText;
26 | };
27 | } foreach _textArray;
28 |
29 | };
30 |
31 | _text
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/f/fnc_toUnicodeDecimal.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_textArray", "_unicodeArray"];
3 |
4 | _textArray = _this;
5 | _unicodeArray = [];
6 |
7 | {
8 | _unicodeArray = _unicodeArray + toArray(_x);
9 | } foreach _textArray;
10 |
11 | _unicodeArray
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/script_component.hpp:
--------------------------------------------------------------------------------
1 | #define COMPONENT main
2 | #include "script_mod.hpp"
3 |
4 | // #define DEBUG_MODE_FULL
5 |
6 | #ifdef DEBUG_ENABLED_MAIN
7 | #define DEBUG_MODE_FULL
8 | #endif
9 |
10 | #include "script_macros.hpp"
11 |
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/script_macros.hpp:
--------------------------------------------------------------------------------
1 | #include "\x\cba\addons\main\script_macros_common.hpp"
2 |
3 | // Default versioning level
4 | #define DEFAULT_VERSIONING_LEVEL 2
5 |
6 | // RGB Colors
7 | #define RGB_GREEN 0, 0.5, 0, 1
8 | #define RGB_BLUE 0, 0, 1, 1
9 | #define RGB_ORANGE 0.5, 0.5, 0, 1
10 | #define RGB_RED 1, 0, 0, 1
11 | #define RGB_YELLOW 1, 1, 0, 1
12 | #define RGB_WHITE 1, 1, 1, 1
13 | #define RGB_GRAY 0.5, 0.5, 0.5, 1
14 | #define RGB_BLACK 0, 0, 0, 1
15 | #define RGB_MAROON 0.5, 0, 0, 1
16 | #define RGB_OLIVE 0.5, 0.5, 0, 1
17 | #define RGB_NAVY 0, 0, 0.5, 1
18 | #define RGB_PURPLE 0.5, 0, 0.5, 1
19 | #define RGB_FUCHSIA 1, 0, 1, 1
20 | #define RGB_AQUA 0, 1, 1, 1
21 | #define RGB_TEAL 0, 0.5, 0.5, 1
22 | #define RGB_LIME 0, 1, 0, 1
23 | #define RGB_SILVER 0.75, 0.75, 0.75, 1
24 |
25 | // Some Functions for Functions
26 | #define PATHTO_FUNC(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\f\##var3.sqf
27 | #define COMPILE_FILE_FUNC(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_FUNC(var1,var2,var3)')
28 | #define PREP_FUNC2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_FUNC(var1,var3,DOUBLES(fnc,var4))
29 | #define PREPFUNC(var1) PREP_FUNC2(PREFIX,COMPONENT,COMPONENT_F,var1)
30 |
31 | // Some Functions for the API
32 | #define PATHTO_API(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\api\##var3.sqf
33 | #define COMPILE_FILE_API(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_API(var1,var2,var3)')
34 | #define PREP_API2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_API(var1,var3,DOUBLES(fnc,var4))
35 | #define PREPAPI(var1) PREP_API2(PREFIX,COMPONENT,COMPONENT_F,var1)
36 |
37 | // Some Functions for TEST
38 | #define PATHTO_TEST(var1,var2,var3) \MAINPREFIX\##var1\SUBPREFIX\##var2\test\##var3.sqf
39 | #define COMPILE_FILE_TEST(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_TEST(var1,var2,var3)')
40 | #define PREP_TEST2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_TEST(var1,var3,DOUBLES(fnc,var4))
41 | #define PREPTEST(var1) PREP_TEST2(PREFIX,COMPONENT,COMPONENT_F,var1)
42 |
43 | // Some functions for MAIN
44 | #define PREP_FUNCMAIN(var1,var2,var3) ##var1##_fnc_##var3 = COMPILE_FILE_FUNC(var1,var2,DOUBLES(fnc,var3))
45 | #define PREPMAINFUNC(var1) PREP_FUNCMAIN(PREFIX,MAINLOGIC,var1)
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_main/script_mod.hpp:
--------------------------------------------------------------------------------
1 | // COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp
2 | #define PREFIX crack
3 |
4 | #define MAJOR 1
5 | #define MINOR 0
6 | #define PATCHLVL 0
7 | #define BUILD 1
8 |
9 | #define VERSION MAJOR.MINOR.PATCHLVL.BUILD
10 | #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
11 |
12 | // MINIMAL required version for the Mod. Components can specify others..
13 | #define REQUIRED_VERSION 1.62
14 |
15 | /*
16 | #define DEBUG_ENABLED_SYS_MAIN
17 | */
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/$PREFIX$:
--------------------------------------------------------------------------------
1 | x\crack\addons\notepad
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/XEH_postClientInit.sqf:
--------------------------------------------------------------------------------
1 | // ____ ____ _ ____ _ __ _ _ ___ _____ _____ ____ _ ____
2 | // / ___| | _ \ / \ / ___| | |/ / | \ | | / _ \ |_ _| | ____| | _ \ / \ | _ \
3 | // | | | |_) | / _ \ | | | ' / | \| | | | | | | | | _| | |_) | / _ \ | | | |
4 | // | |___ | _ < / ___ \ | |___ | . \ | |\ | | |_| | | | | |___ | __/ / ___ \ | |_| |
5 | // \____| |_| \_\ /_/ \_\ \____| |_|\_\ |_| \_| \___/ |_| |_____| |_| /_/ \_\ |____/
6 | //
7 | //*********************************************************************************************************************
8 | //
9 | // XEH CLIENT POST-INITIALIZATION
10 | //
11 | //*********************************************************************************************************************
12 | if (!isdedicated) then {
13 |
14 | private ["_selfInteractCode", "_interactCode"];
15 |
16 | // Prepping Notepad Variable
17 | [] call FUNC(clearEntireLocalNotepad);
18 |
19 | // Add interact options
20 | GVAR(codeStringAceSelfInteractMenuDef) = format["_this call %1", QUOTE(FUNC(aceSelfInteractMenuDef))];
21 | GVAR(codeStringAceInteractMenuDef) = format["_this call crack_notepad_fnc_aceInteractMenuDef", QUOTE(FUNC(aceInteractMenuDef))];
22 |
23 | ["player", [ace_sys_interaction_key_self], -99999, [GVAR(codeStringAceSelfInteractMenuDef), "main"]] call CBA_ui_fnc_add; // Self-Interact Menu
24 |
25 | if (ismultiplayer) then {
26 | [["Man"], [ace_sys_interaction_key], -99999, [GVAR(codeStringAceInteractMenuDef), "main"]] call CBA_ui_fnc_add; // Interact Menu
27 | };
28 |
29 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/XEH_postInit.sqf:
--------------------------------------------------------------------------------
1 | // ____ ____ _ ____ _ __ _ _ ___ _____ _____ ____ _ ____
2 | // / ___| | _ \ / \ / ___| | |/ / | \ | | / _ \ |_ _| | ____| | _ \ / \ | _ \
3 | // | | | |_) | / _ \ | | | ' / | \| | | | | | | | | _| | |_) | / _ \ | | | |
4 | // | |___ | _ < / ___ \ | |___ | . \ | |\ | | |_| | | | | |___ | __/ / ___ \ | |_| |
5 | // \____| |_| \_\ /_/ \_\ \____| |_|\_\ |_| \_| \___/ |_| |_____| |_| /_/ \_\ |____/
6 | //
7 | //*********************************************************************************************************************
8 | //
9 | // XEH GLOBAL POST-INITIALIZATION
10 | //
11 | //*********************************************************************************************************************
12 | #include "script_component.hpp"
13 |
14 | private ["_handle", "_defaultSides"];
15 |
16 | //**********************************************************************************
17 |
18 | //------------------------------------ API CODE ------------------------------------
19 |
20 | // Prepping Specific API Variables
21 | ISNILS(GVAR(addonEnabled),true);
22 | ISNILS(GVAR(notepadEnabled),true);
23 | ISNILS(GVAR(remindersEnabled),true);
24 | ISNILS(GVAR(calculatorEnabled),true);
25 | ISNILS(GVAR(notepadMPEnabled),true);
26 | ISNILS(GVAR(notepadPages),10);
27 | ISNILS(GVAR(reminderCheckFrequency),10);
28 | ISNILS(GVAR(checkForByteLimit),true);
29 | ISNILS(GVAR(byteLimit),20000);
30 |
31 | // ISNILS Macro doesn't work with arrays? Huh.
32 | _defaultSides = [WEST,EAST,RESISTANCE,CIVILIAN,SIDEENEMY];
33 | ISNILS(GVAR(enabledSides),_defaultSides);
34 |
35 | //---------------------------------- END API CODE ----------------------------------
36 |
37 | //**********************************************************************************
38 |
39 | // Include to preserve Macros
40 | #include "XEH_postClientInit.sqf"
41 | #include "XEH_postServerInit.sqf"
42 |
43 | // Event Handler Init
44 | _handle = [] execVM "x\crack\addons\notepad\eventHandlerInit.sqf";
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/XEH_postServerInit.sqf:
--------------------------------------------------------------------------------
1 | // ____ ____ _ ____ _ __ _ _ ___ _____ _____ ____ _ ____
2 | // / ___| | _ \ / \ / ___| | |/ / | \ | | / _ \ |_ _| | ____| | _ \ / \ | _ \
3 | // | | | |_) | / _ \ | | | ' / | \| | | | | | | | | _| | |_) | / _ \ | | | |
4 | // | |___ | _ < / ___ \ | |___ | . \ | |\ | | |_| | | | | |___ | __/ / ___ \ | |_| |
5 | // \____| |_| \_\ /_/ \_\ \____| |_|\_\ |_| \_| \___/ |_| |_____| |_| /_/ \_\ |____/
6 | //
7 | //*********************************************************************************************************************
8 | //
9 | // XEH SERVER POST-INITIALIZATION
10 | //
11 | //*********************************************************************************************************************
12 | if (isserver) then {
13 |
14 | GVAR(synDataVar) = [-1, objNull, objNull, []]; // [_requestedDataType, _requestedDataCarrier, _sender, _args]
15 | publicvariable QUOTE(GVAR(synDataVar));
16 |
17 | GVAR(ackDataVar) = [-1, objNull, objNull, [], []]; // [_sentDataType, _requestedDataCarrier, _sentDataRequestor, _sentData, _args]
18 | publicvariable QUOTE(GVAR(ackDataVar));
19 |
20 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_canPlayerUseNotepad.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | _allowed = false;
4 |
5 | if (!isdedicated) then {
6 |
7 | // Because ARMA doesn't use LAZY evaluations
8 | if (GVAR(addonEnabled) AND !GVAR(notepadInUse) AND (GVAR(notepadEnabled) OR GVAR(remindersEnabled) OR GVAR(calculatorEnabled))) then {
9 | if ((side player) in GVAR(enabledSides)) then {
10 |
11 | if (!alive player) exitwith {};
12 |
13 | _allowed = true;
14 |
15 | if (!isnil QUOTE(GVAR(enabledUnits))) then {
16 | if !(player in GVAR(enabledUnits)) then {
17 | _allowed = false; // Player is not in units that can use Notepad
18 | };
19 | };
20 | };
21 | };
22 |
23 | };
24 |
25 | _allowed
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_checkForByteLimit.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(checkForByteLimit)
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_clearEntireLocalNotepad.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_strings", "_result"];
4 |
5 | _result = false;
6 |
7 | if (!isdedicated) then {
8 |
9 | _strings = call FUNC(createEmptyStrings);
10 |
11 | for "_i" from 0 to (GVAR(notepadPages) - 1) do {
12 | GVAR(notepadContents) set [_i, [(format["Page %1", (_i + 1)]), _strings]];
13 | };
14 |
15 | _result = true;
16 | };
17 |
18 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_clearNotepadPage.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_pageIndex", "_strings", "_result"];
4 |
5 | _pageIndex = _this select 0;
6 | _result = false;
7 |
8 | if (!isdedicated) then {
9 | _strings = call FUNC(createEmptyStrings);
10 |
11 | if (_pageIndex > (count GVAR(notepadContents) - 1)) exitwith {
12 | _text = format["Page index (%1) is greater than the total number of pages available (%2)", _pageIndex, (count GVAR(notepadContents) - 1)];
13 | ERROR(_text);
14 | };
15 |
16 | GVAR(notepadContents) set [_pageIndex, [(format["Page %1", (_i + 1)]), _strings]];
17 |
18 | _result = true;
19 | };
20 |
21 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_createNewReminder.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 | // _reminderTitle = [_title, _timer, _text] call FUNC(createNewReminder);
3 |
4 | private ["_title"];
5 |
6 | _title = _this select 0;
7 |
8 | _handle = _this spawn {
9 |
10 | private ["_title", "_timer", "_text"];
11 |
12 | _title = _this select 0;
13 | _timer = _this select 1;
14 | _text = _this select 2;
15 |
16 | _hintText = "REMINDER:
" + _text;
17 |
18 | _timerReal = _timer + time;
19 |
20 | waituntil {sleep GVAR(reminderCheckFrequency); time >= _timerReal;};
21 |
22 | if (GVAR(remindersShown) AND GVAR(remindersEnabled)) then {
23 | hint parsetext _hintText;
24 | };
25 |
26 | _result = [_title, false] call FUNC(deleteReminder);
27 |
28 | };
29 |
30 | GVAR(reminderCache) set [(count GVAR(reminderCache)), [_title, _handle]];
31 |
32 | _title
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_deleteReminder.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | // _result = [_title, false] call FUNC(deleteReminder);
4 |
5 | private ["_title", "_terminate", "_index", "_result"];
6 |
7 | _title = _this select 0;
8 | _terminate = if (count _this > 1) then {_this select 1} else {true};
9 | _result = false;
10 |
11 | for "_i" from 0 to (count GVAR(reminderCache) - 1) do {
12 | if (((GVAR(reminderCache) select _i) select 0) == _title) exitwith {_index = _i;};
13 | };
14 |
15 | if (_index != -1) then {
16 |
17 | if (_terminate) then {
18 | terminate ((GVAR(reminderCache) select _index) select 1)
19 | };
20 |
21 | GVAR(reminderCache) set [_index, (GVAR(reminderCache) select (count GVAR(reminderCache) - 1))];
22 | GVAR(reminderCache) resize (count GVAR(reminderCache) - 1);
23 |
24 | _result = true;
25 | };
26 |
27 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_dialogsInUse.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result"];
4 |
5 | _result = false;
6 |
7 | if (!isdedicated) then {
8 |
9 | _result = GVAR(notepadInUse);
10 | };
11 |
12 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_enableModule.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_enable", "_module"];
4 |
5 | _module = _this select 0;
6 | _enable = _this select 1;
7 | _result = false;
8 |
9 | if (!isdedicated) then {
10 |
11 | { // FOREACH
12 | if (_module == (_x select 0)) exitwith {
13 | call compile format["%1 = %2;", (_x select 1), _enable];
14 | _result = true;
15 | };
16 | } foreach GVAR(modules);
17 |
18 | };
19 |
20 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getAllReminders.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result"];
4 |
5 | _result = [];
6 |
7 | if (!isdedicated) then {
8 |
9 | _result = GVAR(reminderCache);
10 | };
11 |
12 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getAllowedSides.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(enabledSides)
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getAllowedUnits.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result"];
4 |
5 | _result = if (!isnil QUOTE(GVAR(enabledUnits))) then {GVAR(enabledUnits)} else {call CBA_fnc_players};
6 |
7 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getByteLimit.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(byteLimit)
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getNotepadContents.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result"];
4 |
5 | _result = [];
6 |
7 | if (!isdedicated) then {
8 |
9 | _result = GVAR(notepadContents);
10 | };
11 |
12 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getNotepadPageContents.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_page", "_index"];
4 |
5 | _page = _this select 0;
6 | _result = [];
7 |
8 | if (!isdedicated) then {
9 |
10 | _index = -1;
11 |
12 | if (typename(_page) == typename("Title")) then { // Page Title
13 | for "_i" from 0 to (count GVAR(notepadContents) - 1) do {
14 | if (((GVAR(notepadContents) select _i) select 0) == _page) exitwith {_index = _i;};
15 | };
16 | };
17 |
18 | if (typename(_page) == typename(2)) then { // Page Index
19 | _index = _page;
20 | };
21 |
22 | if (_index > (count GVAR(notepadContents) - 1)) exitwith {
23 | _text = format["Page index (%1) is greater than the total number of pages available (%2)", _pageIndex, (count GVAR(notepadContents) - 1)];
24 | ERROR(_text);
25 | };
26 |
27 | if (_index != -1) then {
28 | _result = GVAR(notepadContents) select _index;
29 | };
30 | };
31 |
32 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_getReminderHandle.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_reminderTitle", "_index"];
4 |
5 | _reminderTitle = _this select 0;
6 | _result = [];
7 |
8 | if (!isdedicated) then {
9 |
10 | for "_i" from 0 to (count GVAR(reminderCache) - 1) do {
11 | if (((GVAR(reminderCache) select _i) select 0) == _reminderTitle) exitwith {_index = _i;};
12 | };
13 |
14 | _result = (GVAR(reminderCache) select _index) select 1;
15 | };
16 |
17 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_moduleEnabled.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_module"];
4 |
5 | _module = _this select 0;
6 | _result = false;
7 |
8 | if (!isdedicated) then {
9 |
10 | { // FOREACH
11 | if (_module == (_x select 0)) exitwith {
12 | _result = call compile (_x select 1);
13 | };
14 | } foreach GVAR(modules);
15 |
16 | };
17 |
18 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_notepadExternalAccessEnabled.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result"];
4 |
5 | _result = false;
6 |
7 | if (!isdedicated) then {
8 | _result = player getvariable [QUOTE(GVAR(externalAccessEnabled)), true];
9 | };
10 |
11 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_reminderHintsEnabled.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(remindersShown)
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setAllowedSides.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(enabledSides) = _this;
4 |
5 | publicvariable QUOTE(GVAR(enabledSides));
6 |
7 | true
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setAllowedUnits.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(enabledUnits) = _this;
4 |
5 | publicvariable QUOTE(GVAR(enabledUnits));
6 |
7 | true
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setByteLimit.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(byteLimit) = _this select 0;
4 |
5 | true
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setCheckForByteLimit.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | GVAR(checkForByteLimit) = _this select 0;
4 |
5 | true
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setNotepadPageContent.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_pageIndex", "_title", "_lines", "_totalLines", "_text"];
4 |
5 | _pageIndex = _this select 0;
6 | _title = _this select 1;
7 | _lines = _this select 2;
8 |
9 | _result = -1;
10 |
11 | if (!isdedicated) then {
12 |
13 | if (_pageIndex > (count GVAR(notepadContents) - 1)) exitwith {
14 | _text = format["Page index (%1) is greater than the total number of pages available (%2)", _pageIndex, (count GVAR(notepadContents) - 1)];
15 | ERROR(_text);
16 | };
17 |
18 | _totalLines = GVAR(notepadEndLine) - (GVAR(notepadStartLine) - 1);
19 |
20 | while {(count _lines) < _totalLines} do {
21 | _lines = _lines + [""];
22 | };
23 |
24 | GVAR(notepadContents) set [_pageIndex, [_title, _lines]];
25 |
26 | _result = _pageIndex;
27 |
28 | };
29 |
30 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setNumberOfPages.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_pages", "_oldPages", "_result", "_strings"];
4 |
5 | _result = false;
6 |
7 | if (!isdedicated) then {
8 |
9 | _pages = _this select 0;
10 |
11 | _oldPages = count GVAR(notepadContents);
12 |
13 | GVAR(notepadContents) resize _pages;
14 |
15 | if (GVAR(notepadPages) < _pages) then { // Add Pages
16 |
17 | hint "done"; // DEBUGGING CODE
18 |
19 | _strings = call FUNC(createEmptyStrings);
20 |
21 | for "_i" from _oldPages to (_pages - 1) do {
22 | GVAR(notepadContents) set [_i, [(format["Page %1", (_i + 1)]), _strings]];
23 | };
24 |
25 | };
26 |
27 | GVAR(notepadPages) = _pages;
28 |
29 | _result = true;
30 |
31 | };
32 |
33 | _result
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/api/fnc_setReminderCheckFrequency.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_result", "_freq"];
4 |
5 | _freq = _this select 0;
6 |
7 | GVAR(reminderCheckFrequency) = _freq;
8 |
9 | true
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/config.cpp:
--------------------------------------------------------------------------------
1 | class CfgPatches {
2 | class crack_notepad {
3 | units[] = {};
4 | weapons[] = {};
5 | requiredVersion = 1.0;
6 | requiredAddons[] = {"cba_main"};
7 | version = 1.0;
8 | author[] = {"Crackman"};
9 | };
10 | };
11 |
12 | class Extended_PreInit_EventHandlers {
13 | crack_notepad_preInit = "call compile preprocessFileLineNumbers 'x\crack\addons\notepad\XEH_preInit.sqf'";
14 | };
15 |
16 | class Extended_PostInit_EventHandlers {
17 | crack_notepad_postInit = "call compile preprocessFileLineNumbers 'x\crack\addons\notepad\XEH_postInit.sqf'";
18 | };
19 |
20 | #include "rsc\diag.hpp"
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/eventHandlerInit.sqf:
--------------------------------------------------------------------------------
1 | // ____ ____ _ ____ _ __ _ _ ___ _____ _____ ____ _ ____
2 | // / ___| | _ \ / \ / ___| | |/ / | \ | | / _ \ |_ _| | ____| | _ \ / \ | _ \
3 | // | | | |_) | / _ \ | | | ' / | \| | | | | | | | | _| | |_) | / _ \ | | | |
4 | // | |___ | _ < / ___ \ | |___ | . \ | |\ | | |_| | | | | |___ | __/ / ___ \ | |_| |
5 | // \____| |_| \_\ /_/ \_\ \____| |_|\_\ |_| \_| \___/ |_| |_____| |_| /_/ \_\ |____/
6 | //
7 | //*********************************************************************************************************************
8 | //
9 | // EVENT-HANDLER INIT
10 | //
11 | //*********************************************************************************************************************
12 | #include "script_component.hpp"
13 |
14 | if (ismultiplayer) then {
15 |
16 | //-------------------------------------------
17 |
18 | if (!isdedicated) then {
19 |
20 | waituntil {!isnull player};
21 | GVAR(playerMPEHKilledIndex) = player addMPEventHandler ["mpkilled", {_this spawn FUNC(onPlayerDeath);}];
22 |
23 | waituntil {!isnil QUOTE(GVAR(synDataVar));};
24 | waituntil {!isnil QUOTE(GVAR(ackDataVar));};
25 |
26 | };
27 |
28 | //-------------------------------------------
29 |
30 | QUOTE(GVAR(synDataVar)) addPublicVariableEventHandler {(_this select 1) spawn FUNC(sendLocalVariable);};
31 |
32 | QUOTE(GVAR(ackDataVar)) addPublicVariableEventHandler {(_this select 1) spawn FUNC(recieveRemoteVariable);};
33 |
34 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_aceInteractMenuDef.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus", "_aliveStatus"];
4 |
5 | // _this==[_target, _menuNameOrParams]
6 | _target = _this select 0;
7 | _params = _this select 1;
8 |
9 | _menuName = "";
10 | _menuRsc = "popup";
11 |
12 | if (typeName _params == typeName []) then {
13 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
14 | _menuName = _params select 0;
15 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
16 | } else {
17 | _menuName = _params;
18 | };
19 | //-----------------------------------------------------------------------------
20 |
21 | _visible = false;
22 |
23 | // Because ARMA doesn't use LAZY evaluations
24 | if (ismultiplayer) then {
25 | if (GVAR(notepadMPEnabled) AND (call FUNC(canPlayerUseNotepad))) then { // Can use notepad
26 | if ((_target in (call CBA_fnc_players)) AND (alive _target)) then { // Target is an alive player
27 | if (_target getvariable [QUOTE(GVAR(externalAccessEnabled)), true]) then { // Hasn't blocked external access
28 | _visible = true;
29 | };
30 | } else {
31 | if (typename(_target getvariable [QUOTE(GVAR(oldNotepad)), 69]) != typename(69)) then { // Target is a dead player
32 | _visible = true;
33 | };
34 | };
35 | };
36 | };
37 |
38 | if (_visible) then {
39 | GVAR(currentCopyTarget) = _target;
40 | };
41 |
42 | _menus = [
43 | [
44 | ["main", "Main Menu", _menuRsc],
45 | [
46 | ["Copy Notepad",
47 | { [0, GVAR(currentCopyTarget), []] spawn FUNC(requestRemoteVariable); },
48 | "", "", "", -1,
49 | 1, (_visible)
50 | ]
51 | ]
52 | ]
53 | ];
54 |
55 |
56 | //-----------------------------------------------------------------------------
57 | _menuDef = [];
58 | {
59 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
60 | } forEach _menus;
61 |
62 | if (count _menuDef == 0) then {
63 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this}else{""}, __FILE__];
64 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
65 | };
66 |
67 | _menuDef // return value
68 |
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_createEmptyStrings.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_strings"];
4 | _strings = [];
5 | // Making Strings for Array
6 | for "_j" from GVAR(notepadStartLine) to GVAR(notepadEndLine) do {
7 | _strings = _strings + [""];
8 | };
9 | _strings
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_filterDataByType.sqf:
--------------------------------------------------------------------------------
1 | private ["_returnArray", "_dataType", "_data", "_args", "_title", "_index"];
2 |
3 | // [_dataType, _data, _args]
4 |
5 | _dataType = _this select 0;
6 | _data = _this select 1;
7 | _args = if ((count _this) > 2) then {_this select 2} else {[]};
8 | _returnArray = [];
9 |
10 | switch (_dataType) do {
11 |
12 | case 0: { // Titles
13 |
14 | {
15 | _title = _x select 0;
16 |
17 | {
18 | if (_x != "") exitwith {
19 | _returnArray = _returnArray + [_title];
20 | };
21 | } foreach (_x select 1);
22 |
23 | } foreach _data;
24 |
25 | };
26 |
27 | case 1: { // Contents
28 |
29 | _title = _args select 0;
30 | _index = -1;
31 |
32 | for "_i" from 0 to ((count _data) - 1) do {
33 | if (((_data select _i) select 0) == _title) exitwith {_index = _i;};
34 | };
35 |
36 | if (_index != -1) then {
37 | _returnArray = (_data select _index) select 1;
38 | } else {
39 | _returnArray = "ERROR";
40 | };
41 |
42 | };
43 | };
44 |
45 | _returnArray
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_limitTextSize.sqf:
--------------------------------------------------------------------------------
1 | // [_player, _array, _byteLimit] call FUNC(limitTextSize);
2 |
3 | #include "\x\crack\addons\notepad\script_component.hpp"
4 |
5 | private ["_player", "_text", "_byteLimit", "_isTruncated", "_characterCount", "_errorText"];
6 |
7 | _player = _this select 0;
8 | _text = _this select 1;
9 | _byteLimit = _this select 2;
10 | _isTruncated = false;
11 |
12 | if (typename(_text) == typename([])) then {
13 | _text = [_text, true] call FUNCMAIN(arrayToString);
14 | };
15 |
16 | if (typename(_text) == typename("Text")) then {
17 |
18 | _characterCount = [_text] call CBA_fnc_strLen;
19 |
20 | if (_characterCount > _byteLimit) then {
21 |
22 | _errorText = format["%1's NotePad contains over %2 Bytes of data - Too large to send", (name _player), _characterCount];
23 | [_errorText, "CRACK_NotePad", [false, true, true] ] call CBA_fnc_debug;
24 |
25 | _isTruncated = true;
26 |
27 | };
28 |
29 | };
30 |
31 | _isTruncated
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_onPlayerDeath.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_unit", "_killer", "_contents"];
4 |
5 | _unit = _this select 0;
6 | _killer = _this select 1;
7 |
8 | if (_unit == player) then {
9 |
10 | //if (([] call FUNC(canPlayerUseNotepad)) AND GVAR(notepadMPEnabled)) then {
11 |
12 | _contents = GVAR(notepadContents);
13 |
14 | _isTruncated = [player, _contents, GVAR(byteLimit)] call FUNC(limitTextSize);
15 |
16 | if (_isTruncated) exitwith {hint "Your notepad was too large to save - May be considered malicious";};
17 |
18 | [_unit] call compile format["(_this select 0) setvariable ['%1', %2, true];", QUOTE(GVAR(oldNotepad)), _contents];
19 |
20 | //};
21 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_recieveRemoteVariable.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_dataType", "_unit", "_reciever", "_recievedData", "_data", "_args", "_id"];
4 |
5 | _dataType = _this select 0; // Titles = 0 || Contents = 1
6 | _unit = _this select 1;
7 | _reciever = _this select 2;
8 | _recievedData = _this select 3;
9 | _args = _this select 4;
10 |
11 | if (ismultiplayer) then {
12 |
13 | if (!isdedicated) then {
14 |
15 | if (_reciever == player) then {
16 |
17 | if (typename(_recievedData) == typename("Text")) exitwith {
18 | if (_recievedData == "ERROR") then {
19 | _name = if (alive _unit) then {name _unit} else {_unit};
20 | _text = format["The page entitled '%1' requested on %2's notepad is currently not available.", (_args select 0), _name];
21 | };
22 | if (_recievedData == "TRUNCATED") then {
23 | _name = if (alive _unit) then {name _unit} else {_unit};
24 | _text = format["The page entitled '%1' requested on %2's notepad is currently too large to send - May be neglectful abuse.", (_args select 0), _name];
25 | };
26 | ERROR(_text);
27 | hint _text;
28 | };
29 |
30 | switch (_dataType) do {
31 |
32 | //-------------------------------------------------
33 |
34 | case 0: { // Titles
35 |
36 | createdialog "CRACK_notepad_diag_copy_page";
37 |
38 | {
39 | _id = lbadd [1, _x];
40 | } foreach _recievedData;
41 |
42 | {
43 | _id = lbAdd [2,(_x select 0)];
44 | } foreach GVAR(notepadContents);
45 |
46 | };
47 |
48 | //-------------------------------------------------
49 |
50 | case 1: { // Contents
51 |
52 | _title = (_args select 0);
53 | _contents = _recievedData;
54 | _index = -1;
55 |
56 | for "_i" from 0 to (count GVAR(notepadContents) - 1) do {
57 | if (((GVAR(notepadContents) select _i) select 0) == (_args select 1)) exitwith {_index = _i};
58 | };
59 |
60 | if (_index < 0) exitwith {
61 | _text = format["The page entitled '%1' no longer exists on the local player's notepad.", (_args select 1), _name];
62 | ERROR(_text);
63 | hint ("ERROR:\n\n" + _text);
64 | };
65 |
66 | GVAR(notepadContents) set [_index, [_title, _contents]];
67 |
68 | hint format["Notpad page '%1' successfully copied to your page of '%2'", (_args select 0), (_args select 1)];
69 |
70 | };
71 |
72 | //-------------------------------------------------
73 | };
74 | };
75 | };
76 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_requestRemoteVariable.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | // TITLE REQUESTS: [0, _unit, []] call FUNC(requestRemoteVariable);
4 | // CONTENT REQUESTS: [1, _unit, [_titleFrom, _titleTo]] call FUNC(requestRemoteVariable);
5 |
6 | private ["_dataType", "_unit", "_args", "_data", "_isTruncated", "_contents"];
7 |
8 | _dataType = _this select 0; // Titles = 0 || Contents = 1
9 | _unit = _this select 1;
10 | _args = if ((count _this) > 2) then {_this select 2} else {[]};
11 | _isTruncated = false;
12 |
13 | if (ismultiplayer) then {
14 |
15 | _contents = _unit getvariable [QUOTE(GVAR(oldNotepad)), 69];
16 |
17 | if (typename(_contents) == typename([])) exitwith {
18 |
19 | _data = [_dataType, _contents, _args] call FUNC(filterDataByType);
20 |
21 | [_dataType, _unit, player, _data, _args] spawn FUNC(recieveRemoteVariable); // [_sentDataType, _requestedDataCarrier, _sentDataRequestor, _sentData, _args]
22 |
23 | };
24 |
25 | if (GVAR(checkForByteLimit)) then {
26 | _isTruncated = [player, _args, GVAR(byteLimit)] call FUNC(limitTextSize);
27 | };
28 |
29 | if (_isTruncated) exitwith {
30 | hint "Your data is too large to send.";
31 | };
32 |
33 | GVAR(synDataVar) = [_dataType, _unit, player, _args]; // [_requestedDataType, _requestedDataCarrier, _sender, _args]
34 | publicvariable QUOTE(GVAR(synDataVar));
35 |
36 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/f/fnc_sendLocalVariable.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | private ["_dataType", "_unit", "_sender", "_args", "_sentData", "_data", "_isTruncated", "_contents"];
4 |
5 | _dataType = _this select 0; // Titles = 0 || Contents = 1
6 | _unit = _this select 1;
7 | _sender = _this select 2;
8 | _args = _this select 3;
9 | _data = false;
10 |
11 | if (ismultiplayer) then {
12 |
13 | if (_unit == player) then {
14 | _data = GVAR(notepadContents);
15 | };
16 |
17 | if (isserver) then {
18 |
19 | _contents = _unit getvariable [QUOTE(GVAR(oldNotepad)), 69];
20 |
21 | if (typename(_contents) == typename([])) then {
22 |
23 | _data = _contents;
24 | };
25 | };
26 |
27 | if (typename(_data) == typename([])) then {
28 |
29 | _sentData = [_dataType, _data, _args] call FUNC(filterDataByType);
30 |
31 | if ((_unit == player) AND GVAR(checkForByteLimit)) then {
32 | _isTruncated = [player, _sentData, GVAR(byteLimit)] call FUNC(limitTextSize);
33 |
34 | if (_isTruncated) then {
35 | _sentData = "TRUNCATED";
36 | hintsilent "Your data is too large to send to the requestor - This may be considered abuse of the system.";
37 | };
38 | };
39 |
40 | GVAR(ackDataVar) = [_dataType, _unit, _sender, _sentData, _args]; // [_sentDataType, _requestedDataCarrier, _sentDataRequestor, _sentData, _args]
41 | publicvariable QUOTE(GVAR(ackDataVar));
42 |
43 | };
44 | };
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/script_component.hpp:
--------------------------------------------------------------------------------
1 | #define COMPONENT notepad
2 | #include "\x\crack\addons\main\script_mod.hpp"
3 |
4 | // #define DEBUG_MODE_FULL
5 |
6 | #ifdef DEBUG_ENABLED_NOTEPAD
7 | #define DEBUG_MODE_FULL
8 | #endif
9 |
10 | #include "\x\crack\addons\main\script_macros.hpp"
11 |
--------------------------------------------------------------------------------
/Arma 2/Crack Addons v1.1/crack_notepad/test/fnc_transferTest.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\crack\addons\notepad\script_component.hpp"
2 |
3 | // [-2, {[] spawn crack_notepad_fnc_transferTest;}] call CBA_fnc_globalExecute; - Local Execute
4 |
5 | private ["_contents", "_strings", "_oldFunc"];
6 |
7 | GVAR(transferTesting) = true;
8 | _oldFunc = FUNC(sendLocalVariable);
9 |
10 | FUNC(sendLocalVariable) = {
11 | private ["_dataType", "_unit", "_sender", "_args", "_sentData", "_data", "_isTruncated", "_contents"];
12 |
13 | _dataType = _this select 0; // Titles = 0 || Contents = 1
14 | _unit = _this select 1;
15 | _sender = _this select 2;
16 | _args = _this select 3;
17 | _data = false;
18 |
19 | if (ismultiplayer) then {
20 |
21 | if (isserver) then {
22 | _data = GVAR(notepadContents);
23 | };
24 |
25 | /*
26 | if (isserver) then {
27 |
28 | _contents = _unit getvariable [QUOTE(GVAR(oldNotepad)), 69];
29 |
30 | if (typename(_contents) == typename([])) then {
31 |
32 | _data = _contents;
33 | };
34 | };
35 | */
36 |
37 | if (typename(_data) == typename([])) then {
38 |
39 | _sentData = [_dataType, _data, _args] call FUNC(filterDataByType);
40 |
41 | if ((isserver) AND GVAR(checkForByteLimit)) then {
42 | _isTruncated = [objnull, _sentData, GVAR(byteLimit)] call FUNC(limitTextSize);
43 |
44 | if (_isTruncated) then {
45 | _sentData = "TRUNCATED";
46 | hintsilent "Your data is too large to send to the requestor - This may be considered abuse of the system.";
47 | };
48 | };
49 |
50 | GVAR(ackDataVar) = [_dataType, _unit, _sender, _sentData, _args]; // [_sentDataType, _requestedDataCarrier, _sentDataRequestor, _sentData, _args]
51 | publicvariable QUOTE(GVAR(ackDataVar));
52 |
53 | };
54 | };
55 | }; // END FUNCTION
56 |
57 | if (isserver) then {
58 |
59 | _contents = [];
60 | _strings = [];
61 |
62 | for "_j" from GVAR(notepadStartLine) to GVAR(notepadEndLine) do {
63 | _strings = _strings + [(format["Line %1", (_j - 5)])];
64 | };
65 |
66 | for "_i" from 0 to GVAR(notepadPages) do {
67 | _contents = _contents + [[(format["Page %1", (_i + 1)]), _strings]];
68 | };
69 |
70 | GVAR(notepadContents) = _contents;
71 | };
72 |
73 | if (!isdedicated) then {
74 |
75 | hint "10 Seconds till Transfer";
76 |
77 | sleep 10;
78 |
79 | [0, player, []] call FUNC(requestRemoteVariable);
80 |
81 | };
82 |
83 | //waituntil {sleep 1; !(GVAR(transferTesting));};
84 |
85 | //FUNC(sendLocalVariable) = _oldFunc;
--------------------------------------------------------------------------------
/Arma 2/Extra Huey Slots/scripts/CRACK_selfInteractMenu.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\cba\addons\main\script_macros_common.hpp"
2 | #include "\x\cba\addons\ui_helper\script_dikCodes.hpp"
3 |
4 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
5 |
6 | // _this==[_target, _menuNameOrParams]
7 | _target = _this select 0;
8 | _params = _this select 1;
9 |
10 | _menuName = "";
11 | _menuRsc = "buttonList";
12 |
13 | if (typeName _params == typeName []) then {
14 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__]};
15 | _menuName = _params select 0;
16 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
17 | } else {
18 | _menuName = _params;
19 | };
20 |
21 | //-----------------------------------------------------------------------------
22 |
23 | _menus =
24 | [
25 | [
26 | ["main", "CRACKSelfInteracts", _menuRsc],
27 | [
28 | [
29 | "Get Out",
30 | "nul = [0] spawn CRACK_fnc_dismountHuey;",
31 | "","","", -1, 1, (CRACK_var_huey_playeronhuey)
32 | ],
33 | [
34 | "Roll Out",
35 | "nul = [1] spawn CRACK_fnc_dismountHuey;",
36 | "","","", -1, 1, (CRACK_var_huey_playeronhuey)
37 | ]
38 | ]
39 | ]
40 | ];
41 |
42 | _menuName = "main";
43 |
44 | //-----------------------------------------------------------------------------
45 |
46 | _menuDef = [];
47 | {
48 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
49 | } forEach _menus;
50 |
51 | if (count _menuDef == 0) then {
52 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this} else {""}, __FILE__];
53 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
54 | };
55 |
56 | _menuDef // return value
--------------------------------------------------------------------------------
/Arma 2/FPS Monitor/fpsmon.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/FPS Monitor/fpsmon.sqf
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/README.txt:
--------------------------------------------------------------------------------
1 |
2 | GM Functions v1.0
3 | By Naught
4 | UnitedOperations.Net
5 |
6 | /***********************************************/
7 |
8 | Install:
9 |
10 | 1. Put '!GM' folder in Arma main directory (ie. 'C:\Program Files (x86)\Steam\SteamApps\Common\Arma 2 Operation Arrowhead\!GM')
11 |
12 | /***********************************************/
13 |
14 | Execute In-Mission To Load Functions:
15 |
16 | nul = [] execVM '\!GM\init.sqf';
17 |
18 | /***********************************************/
19 |
20 | Functions:
21 |
22 | ["PATH"] call GM_fnc_cacheFile; // Caches a file statically for the duration of the Arma process
23 |
24 | ["PlayerName", CODE (, [PARAMS])] call GM_fnc_execOnPlayer; // Executes code on specified player's machine (params are local)
25 | ["PlayerName", CODE (, [PARAMS])] call GM_fnc_execOnPlayerLocal; // Executes code on local machine with specified player's object passed via (_this select 0)
26 |
27 | [] call GM_fnc_execScratchPad; // Executes code in the scratchpad.sqf file
28 |
29 | ["PlayerName", "WeaponName" (, RuckBool)] call GM_fnc_givePlayerWeapon; // Gives player a specified weapon (optionally in his ruck)
30 | ["PlayerName", "MagName" (, MagCountInt, RuckBool)] call GM_fnc_givePlayerMagazine; // Gives player (a) specified magazine(s) (optionally in his ruck)
31 | ["PlayerName", "WeaponName"] call GM_fnc_givePlayerWOB; // Gives player a specified weapon on his back
32 |
33 | [] call GM_fnc_spawnCrate; // Spawns a crate with specified cargo, check function file for specific params
34 |
35 | ["PlayerName"] call GM_fnc_giveBandage; // Gives specified player a bandage (instantaneous, no simulation)
36 | ["PlayerName"] call GM_fnc_giveLargeBandage; // Gives specified player a large bandage (instantaneous, no simulation)
37 | ["PlayerName"] call GM_fnc_giveTourniquet; // Gives specified player a tourniquet (instantaneous, no simulation)
38 | ["PlayerName"] call GM_fnc_removeTourniquet; // Removes a tourniquet from the specified player (instantaneous, no simulation)
39 | ["PlayerName"] call GM_fnc_giveMorphine; // Gives specified player morphine (instantaneous, no simulation)
40 | ["PlayerName"] call GM_fnc_giveEpi; // Gives specified player epinephrine (instantaneous, no simulation)
41 |
42 | [] call GM_fnc_fixEarplugs; // Fixes Rocko's idiotic coding (putting in earplugs decreases game volume by 60%)
43 |
44 | /***********************************************/
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_cacheFile.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_GM_CACHE_KEYS"];
3 |
4 | _GM_CACHE_KEYS = uiNamespace getVariable "GM_CACHE_KEYS";
5 |
6 | if (isNil "_GM_CACHE_KEYS") then {
7 | _GM_CACHE_KEYS = [];
8 | uiNamespace setVariable ["GM_CACHE_KEYS", _GM_CACHE_KEYS];
9 | };
10 |
11 | GM_CACHE_KEYS = _GM_CACHE_KEYS;
12 |
13 | #ifdef BENCHMARK
14 | if (isNil "GM_STR_BENCH") then { GM_STR_BENCH = "private '_GM_int_time'; _GM_int_time = diag_tickTime; call (uiNamespace getVariable '%1'); diag_log [diag_frameNo, diag_tickTime, time, '%1', _GM_int_time, diag_tickTime - _GM_int_time]; if !(isNil '_ret') then { nil } else { _ret };" };
15 | #endif
16 |
17 | _fnc_compile = uiNamespace getVariable "GM_fnc_cacheFile";
18 |
19 | if (isNil "_fnc_compile") then {
20 |
21 | _fnc_compile = {
22 |
23 | private ["_GM_int_code", "_recompile", "_isCached"];
24 |
25 | _recompile = if (isNil "GM_COMPILE_RECOMPILE") then {
26 | false;
27 | } else {
28 | GM_COMPILE_RECOMPILE;
29 | };
30 |
31 | // TODO: Unique namespace?
32 | _GM_int_code = uiNamespace getVariable _this;
33 | _isCached = if (isNil "GM_CACHE_KEYS") then { false } else { !isMultiplayer || isDedicated || _this in GM_CACHE_KEYS };
34 | if (isNil '_GM_int_code' || _recompile || !_isCached) then {
35 |
36 | #ifdef BENCHMARK
37 | // TODO: Fix
38 | //_GM_int_code = compile ("private '_GM_int_time'; _GM_int_time = diag_tickTime; call (uiNamespace getVariable '%1'); diag_log [diag_frameNo, diag_tickTime, time, '%1', _GM_int_time, diag_tickTime - _GM_int_time]; if !(isNil '_ret') then { nil } else { _ret };", _this]);
39 | uiNamespace setVariable [_this, compile preProcessFileLineNumbers _this];
40 | _GM_int_code = compile format[SLX_XEH_STR_BENCH, _this];
41 | #else
42 | _GM_int_code = compile preProcessFileLineNumbers _this;
43 | uiNamespace setVariable [_this, _GM_int_code];
44 | #endif
45 |
46 | if (!_isCached && !isNil "GM_CACHE_KEYS") then {
47 | GM_CACHE_KEYS = GM_CACHE_KEYS + [_this];
48 | uiNamespace setVariable ["GM_CACHE_KEYS", GM_CACHE_KEYS];
49 | };
50 | };
51 |
52 | _GM_int_code;
53 |
54 | };
55 |
56 | uiNamespace setVariable ["GM_fnc_cacheFile", _fnc_compile];
57 |
58 | };
59 |
60 | GM_fnc_cacheFile = _fnc_compile;
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_execOnPlayer.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_execOnPlayer = {
3 |
4 | private ["_playerName", "_code", "_params"];
5 |
6 | _playerName = _this select 0;
7 | _code = _this select 1;
8 | _params = if ((count _this) > 2) then {_this select 2} else {[]};
9 |
10 | [ -1,
11 | {
12 | if ((format ["%1", (name player)]) == (_this select 0)) then {
13 | [player, (_this select 2)] spawn (_this select 1);
14 | };
15 | },
16 | [_playerName, _code, _params]
17 | ] call CBA_fnc_globalExecute;
18 |
19 | };
20 |
21 | GM_fnc_execOnPlayerLocal = {
22 |
23 | private ["_playerName", "_code", "_params"];
24 |
25 | _playerName = _this select 0;
26 | _code = _this select 1;
27 | _params = if ((count _this) > 2) then {_this select 2} else {[]};
28 |
29 | {
30 | if ((format ["%1", (name _x)]) == _playerName) exitWith {
31 | [_x, _params] spawn _code;
32 | };
33 | } forEach (call CBA_fnc_players);
34 |
35 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_execScratchpad.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_execScratchPad = {
3 |
4 | private ["_params", "_handle"];
5 |
6 | _params = _this;
7 |
8 | _handle = _params spawn compile preProcessFileLineNumbers "\!GM\scratchpad.sqf";
9 |
10 | _handle
11 |
12 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_fixEarplugs.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_fixEarplugs = {
3 |
4 | //enableEnvironment true;
5 | 0 fadeSound 1;
6 | 0 fadeRadio 1;
7 | 0 fadeMusic 1;
8 |
9 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_loadSixMenu.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_initSixMenu = {
3 |
4 | ace_referee = true;
5 |
6 | ace_sys_menu = "Logic" createVehicleLocal (getPos player);
7 |
8 | ace_sys_menu setVariable ["config_group", true, false];
9 | ace_sys_menu setVariable ["config_config", true, false];
10 |
11 | ace_sys_menu setVariable ["config_laser", true, false];
12 | ace_sys_menu setVariable ["config_character", true, false];
13 | ace_sys_menu setVariable ["config_weapons", true, false];
14 | ace_sys_menu setVariable ["config_teamstatus", true, false];
15 |
16 | // Dr.EyeBall dialog framework init
17 | [] call compile preProcessFileLineNumbers "x\ace\addons\sys_menu\DebugInit.sqf";
18 |
19 | // init common functions
20 | [] call compile preProcessFileLineNumbers "x\ace\addons\sys_menu\CommonFunctions.sqf";
21 | [] call compile preProcessFileLineNumbers "x\ace\addons\sys_menu\CommonDialogFunctions.sqf";
22 |
23 | // Group Callsign module
24 | [] call compile preProcessFileLineNumbers "x\ace\addons\sys_menu\init_cs.sqf";
25 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_loadUODebug.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_initUODebug = {
3 |
4 | private ["_timeOut", "_endTime"];
5 |
6 | _timeOut = 30;
7 |
8 | _endTime = diag_tickTime + _timeOut;
9 |
10 | waitUntil {((!(isNil "k_fnc_exMP") || !isMultiplayer) && !(isNil "GM_temp_fnc_exMP")) || (diag_tickTime > _endTime)};
11 |
12 | if ((isNil "k_fnc_exMP") || (isNil "GM_temp_fnc_exMP")) exitWith {
13 | diag_log text "UO Debug loading timed-out.";
14 | diag_log text "Try loading it later or setting k_fnc_exMP to some value.";
15 | };
16 |
17 | k_fnc_exMP = GM_temp_fnc_exMP;
18 |
19 | };
20 |
21 | GM_fnc_loadUODebug = {
22 |
23 | createDialog 'RMM_ui_debug';
24 |
25 | };
26 |
27 | GM_temp_fnc_exMP = {
28 |
29 | /********************************************
30 | * 0 - All Machines
31 | * 1 - Server Only
32 | * 2 - All Clients
33 | * 3 - Local Only
34 | ********************************************/
35 |
36 | private ["_locality","_params","_code", "_return"];
37 |
38 | _locality = _this select 0;
39 | _params = _this select 1;
40 | _code = _this select 2;
41 |
42 | _return = "";
43 |
44 | if (isNil "_params") then {
45 | _params = [];
46 | };
47 |
48 | if (_locality in [0, 1, 2]) then {
49 |
50 | private ["_cbaLocality"];
51 |
52 | _cbaLocality = switch (_locality) do {
53 | case 0: {-2}; // All Machines
54 | case 1: {0}; // Server Only
55 | case 2: {-1}; // All Clients
56 | };
57 |
58 | // Global Execute
59 | [_cbaLocality, _code, _params] call CBA_fnc_globalExecute;
60 |
61 | };
62 |
63 | if (_locality in [3]) then {
64 |
65 | // Local Call
66 | _return = _params call _code;
67 |
68 | };
69 |
70 | _return
71 |
72 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_log.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_log = {
3 |
4 | private ["_text", "_line", "_file", "", ""];
5 |
6 | _text = _this select 0;
7 | _file = if ((count _this) > 1) then {_this select 1} else {"NULL"};
8 | _line = if ((count _this) > 2) then {_this select 2} else {-1};
9 |
10 | _text = format["[T: %1 | F: '%2' | L: %3 | M: %4] ", diag_tickTime, _file, _line, (SLX_XEH_MACHINE select 10)] + _text;
11 |
12 | player sideChat _text;
13 | diag_log text _text;
14 |
15 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_medical.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_giveBandage = {
3 | private ["_unitName"];
4 | _unitName = _this select 0;
5 | [
6 | _unitName,
7 | {[player, _this] call ace_sys_wounds_fnc_RemoveBleed;},
8 | 'ACE_Bandage'
9 | ] call GM_fnc_execOnPlayer;
10 | };
11 |
12 | GM_fnc_giveLargeBandage = {
13 | private ["_unitName"];
14 | _unitName = _this select 0;
15 | [
16 | _unitName,
17 | {[player, _this] call ace_sys_wounds_fnc_RemoveBleed;},
18 | 'ACE_LargeBandage'
19 | ] call GM_fnc_execOnPlayer;
20 | };
21 |
22 | GM_fnc_giveTourniquet = {
23 | private ["_unitName"];
24 | _unitName = _this select 0;
25 | [
26 | _unitName,
27 | {[player, _this] call ace_sys_wounds_fnc_RemoveBleed;},
28 | 'ACE_Tourniquet'
29 | ] call GM_fnc_execOnPlayer;
30 | };
31 |
32 | GM_fnc_removeTourniquet = {
33 | private ["_unitName"];
34 | _unitName = _this select 0;
35 | [
36 | _unitName,
37 | {player spawn compile preProcessFileLineNumbers "\x\ace\addons\sys_wounds\self_CATremove.sqf";},
38 | []
39 | ] call GM_fnc_execOnPlayer;
40 | };
41 |
42 | GM_fnc_giveMorphine = {
43 | private ["_unitName"];
44 | _unitName = _this select 0;
45 | [
46 | _unitName,
47 | {player call ace_sys_wounds_fnc_RemovePain;},
48 | []
49 | ] call GM_fnc_execOnPlayer;
50 | };
51 |
52 | GM_fnc_giveEpi = {
53 | private ["_unitName"];
54 | _unitName = _this select 0;
55 | [
56 | _unitName,
57 | {player call ace_sys_wounds_fnc_RemoveUncon;},
58 | []
59 | ] call GM_fnc_execOnPlayer;
60 | };
61 |
62 | GM_fnc_giveMedkit = {
63 | private ["_unitName"];
64 | _unitName = _this select 0;
65 | [
66 | _unitName,
67 | {['ace_sys_wounds_heal', [(_this select 0), 0]] call ACE_fnc_receiverOnlyEvent;},
68 | []
69 | ] call GM_fnc_execOnPlayerLocal;
70 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_selfInteractMenu.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_selfInteractMenu = {
3 |
4 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus"];
5 |
6 | // _this==[_target, _menuNameOrParams]
7 | _target = _this select 0;
8 | _params = _this select 1;
9 |
10 | _menuName = "";
11 | _menuRsc = "popup";
12 |
13 | if (typeName _params == typeName []) then {
14 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
15 | _menuName = _params select 0;
16 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
17 | } else {
18 | _menuName = _params;
19 | };
20 | //-----------------------------------------------------------------------------
21 |
22 | _menus = [
23 | [
24 | ["main", "Main Menu", _menuRsc],
25 | [
26 | ["GM Debug >", "", "", "",
27 | ["_this call GM_fnc_selfInteractMenu", "GM_debugMenu", 1],
28 | -1, 1, (true)]
29 | ]
30 | ]
31 | ];
32 |
33 | if(_menuName == "GM_debugMenu") then {
34 |
35 | _menus set [count _menus,
36 | [
37 | ["GM_debugMenu", "Debug Menu", "popup", ""],
38 | [
39 | [
40 | "ACE Debug Console",
41 | { [] spawn GM_fnc_loadACEDebug; },
42 | "", "", "", -1, 1,
43 | (true), (true)
44 | ],
45 | [
46 | "UO Debug Console",
47 | { [] spawn GM_fnc_loadUODebug; },
48 | "", "", "", -1, 1,
49 | (true), (true)
50 | ],
51 | [
52 | "SIX Menu",
53 | { [] spawn ("x\ace\addons\sys_menu\ActivatePopupMenuViaAction.sqf" call GM_fnc_cacheFile); },
54 | "", "", "", -1, 1,
55 | (true), (true)
56 | ],
57 | [
58 | "Execute Scratchpad",
59 | { [] spawn GM_fnc_execScratchpad; },
60 | "", "", "", -1, 1,
61 | (true), (true)
62 | ]
63 | ]
64 | ]
65 | ];
66 | };
67 |
68 | //-----------------------------------------------------------------------------
69 | _menuDef = [];
70 | {
71 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
72 | } forEach _menus;
73 |
74 | if (count _menuDef == 0) then {
75 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this}else{""}, __FILE__];
76 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
77 | };
78 |
79 | _menuDef // return value
80 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/functions/fnc_spawnCrate.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_fnc_spawnCrate = {
3 |
4 | private ["_crateCargo", "_crateClass", "_cratePos", "_maxDistance", "_return", "_relCratePos",
5 | "_crate", "_createMarker", "_markerName", "_markerType", "_markerGlobal"];
6 |
7 | if (isNil "GM_CRATE_COUNT") then {
8 | GM_CRATE_COUNT = 0;
9 | };
10 |
11 | _crateCargo = _this select 0; // [[TypeInt, "ClassName"(, CountInt)] ...] : TypeInt = 0 Weapon, 1 Mag
12 | _crateClass = if ((count _this) > 1) then {_this select 1} else {"ACE_MagazineBox_Launchers_BIS_US"};
13 | _cratePos = if ((count _this) > 2) then {_this select 2} else {getPos player};
14 | _maxDistance = if ((count _this) > 3) then {_this select 3} else {15};
15 | _createMarker = if ((count _this) > 4) then {_this select 4} else {true};
16 | _markerName = if ((count _this) > 5) then {_this select 5} else {"Crate #%1"};
17 | _markerType = if ((count _this) > 6) then {_this select 6} else {"b_support"};
18 | _markerGlobal = if ((count _this) > 7) then {_this select 7} else {false};
19 | _return = false;
20 |
21 | _relCratePos = _cratePos findEmptyPosition [0, _maxDistance, _crateClass];
22 |
23 | if ((count _relCratePos) > 0) then {
24 |
25 | _crate = _crateClass createVehicle _relCratePos;
26 | _return = true;
27 |
28 | if ((count _crateCargo) > 0) then {
29 | {
30 | private ["_class", "_count"];
31 | _class = _this select 1;
32 | _count = if ((count _x) > 2) then {_this select 2} else {1};
33 |
34 | switch (_x select 0) do {
35 | case 0: {
36 | _crate addWeaponCargoGlobal [_class, _count];
37 | };
38 | case 1: {
39 | _crate addMagazineCargoGlobal [_class, _count];
40 | };
41 | };
42 | } forEach _crateCargo;
43 | };
44 |
45 | GM_CRATE_COUNT = GM_CRATE_COUNT + 1;
46 |
47 | if (_createMarker) then {
48 |
49 | private ["_marker"];
50 |
51 | if (_markerGlobal) then {
52 | _marker = createMarker [(format["crate_marker_%1", GM_CRATE_COUNT]), _relCratePos];
53 | _marker setMarkerType _markerType;
54 | _marker setMarkerText (format[_markerName, GM_CRATE_COUNT]);
55 | _marker setMarkerColor "ColorGreenAlpha";
56 | } else {
57 | _marker = createMarkerLocal [(format["crate_marker_%1", GM_CRATE_COUNT]), _relCratePos];
58 | _marker setMarkerTypeLocal _markerType;
59 | _marker setMarkerTextLocal (format[_markerName, GM_CRATE_COUNT]);
60 | _marker setMarkerColorLocal "ColorGreenAlpha";
61 | };
62 | };
63 |
64 | player sideChat format["Crate #%1 Created @ '%2'", GM_CRATE_COUNT, _relCratePos];
65 |
66 | } else {
67 | player sideChat "Cannot Create Crate: No empty positions within max distance.";
68 | };
69 |
70 | _return
71 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/init.sqf:
--------------------------------------------------------------------------------
1 |
2 | // Execute In-Mission To Load Functions:
3 | // nul = [] execVM '\!GM\init.sqf';
4 |
5 | #define COMPILE_FILE(file) (compile preProcessFileLineNumbers file)
6 | #define CALL_FILE(file) (call COMPILE_FILE(file))
7 | #define CACHE_FILE(file) (file call GM_fnc_cacheFile)
8 | #define CALL_CACHE_FILE(file) (call CACHE_FILE(file))
9 |
10 | GM_init = true;
11 |
12 | if (isNil "GM_initRuns") then {
13 | GM_initRuns = 0;
14 | };
15 |
16 | GM_initRuns = GM_initRuns + 1;
17 |
18 | CALL_FILE("\!GM\settings.sqf");
19 |
20 | [] spawn {
21 |
22 | /********************************************
23 | * Loading Functions
24 | ********************************************/
25 | CALL_FILE("\!GM\functions\fnc_cacheFile.sqf"); // GM_fnc_execScratchpad
26 | CALL_CACHE_FILE("\!GM\functions\fnc_execOnPlayer.sqf"); // GM_fnc_execOnPlayer
27 | CALL_CACHE_FILE("\!GM\functions\fnc_execScratchpad.sqf"); // GM_fnc_execScratchpad
28 | CALL_CACHE_FILE("\!GM\functions\fnc_fixEarplugs.sqf"); // GM_fnc_fixEarplugs
29 | CALL_CACHE_FILE("\!GM\functions\fnc_givePlayer.sqf"); // Multiple Functions
30 | CALL_CACHE_FILE("\!GM\functions\fnc_loadACEDebug.sqf"); // GM_fnc_loadACEDebug
31 | CALL_CACHE_FILE("\!GM\functions\fnc_loadSixMenu.sqf"); // GM_fnc_loadSixMenu
32 | CALL_CACHE_FILE("\!GM\functions\fnc_loadUODebug.sqf"); // GM_fnc_loadUODebug
33 | CALL_CACHE_FILE("\!GM\functions\fnc_log.sqf"); // GM_fnc_log
34 | CALL_CACHE_FILE("\!GM\functions\fnc_medical.sqf"); // Multiple Functions
35 | CALL_CACHE_FILE("\!GM\functions\fnc_selfInteractMenu.sqf"); // GM_fnc_selfInteractMenu
36 | CALL_CACHE_FILE("\!GM\functions\fnc_spawnCrate.sqf"); // GM_fnc_spawnCrate
37 |
38 | /********************************************
39 | * Initializing
40 | ********************************************/
41 | [] spawn GM_fnc_initSixMenu;
42 | //[] spawn GM_fnc_initUODebug; // For broken GM console
43 |
44 | /********************************************
45 | * Finalizing Run
46 | ********************************************/
47 | waitUntil {!isNil "CBA_ui_fnc_add"};
48 | ["player", [ace_sys_interaction_key_self], -999999, ["_this call GM_fnc_selfInteractMenu", "main"]] call CBA_ui_fnc_add;
49 |
50 | };
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/scratchpad.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/GM Functions/!GM/scratchpad.sqf
--------------------------------------------------------------------------------
/Arma 2/GM Functions/!GM/settings.sqf:
--------------------------------------------------------------------------------
1 |
2 | GM_COMPILE_RECOMPILE = true;
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/README.txt:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // README
11 | //
12 | //*************************************************************************************************
13 |
14 | Call this in the init.sqf (top-most preferably) for all machines:
15 |
16 | _handle = [] execVM "scripts\CRACK_gearFunctions\init.sqf";
17 | waituntil {scriptDone _handle};
18 |
19 | //*************************************************************************************************
20 |
21 | Here's the syntax for after the init above: (NOTE: for the strings, put "" to keep empty, for the arrays put [])
22 |
23 | [_man, "PrimaryWeapon", "SecondaryWeapon", "OnBack", "ACE_OnBack", _items, _optics, _pMags, _sMags, _rWeapons, _rItems, _rpMags, _rsMags, _IFAK, _earPlugs] call CRACK_fnc_setLoadout;
24 |
25 | _man = player; // Or 'this' if placed in a unit's init field
26 |
27 | _items = ["Item", "Item", "Item", "Item"]; // Up to 12
28 |
29 | _optics = ["Optic", "Optic"]; // Up to 2
30 |
31 | _pMags = ["PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine"]; // Up to 12
32 | _pMags = [["PrimaryMagazine", Count], ["PrimaryMagazine", Count], ["PrimaryMagazine", Count]]; // Up to 12 Total
33 |
34 | _sMags = ["SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine"]; // Up to 8
35 | _sMags = [["SecondaryMagazine", Count], ["SecondaryMagazine", Count], ["SecondaryMagazine", Count]]; // Up to 8 Total
36 |
37 | _rWeapons = ["Weapon", "Weapon"]; // Rucksack - Unlimited
38 |
39 | _rItems = ["Item", "Item", "Item", "Item"]; // Rucksack - Unlimited
40 |
41 | _rpMags = ["PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine"]; // Rucksack - Unlimited
42 | _rpMags = [["PrimaryMagazine", Count], ["PrimaryMagazine", Count], ["PrimaryMagazine", Count]]; // Rucksack - Unlimited
43 |
44 | _rsMags = ["SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine"]; // Rucksack - Unlimited
45 | _rsMags = [["SecondaryMagazine", Count], ["SecondaryMagazine", Count], ["SecondaryMagazine", Count]]; // Rucksack - Unlimited
46 |
47 | _IFAK = 1; // Set 1 for a full IFAK, 0 for nothing
48 |
49 | _earPlugs = 1; // Set 1 for Ear Protection, 0 for nothing
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_addEarProtection.sqf:
--------------------------------------------------------------------------------
1 | #define __check configFile >> "CfgIdentities" >> "Identity" >> "name"
2 |
3 | if (!isDedicated) then {
4 | waitUntil {!isNull player};
5 |
6 | _earplugs = {
7 | if ( ((getText(__check) == "") || (getText(__check) != (name player))) && isMultiplayer ) then { // indentity incorrect
8 | // don't wait
9 | } else { // wait for init
10 | waitUntil { sleep 0.5; _earplugs = player getVariable "ace_sys_goggles_earplugs"; !isNil "_earplugs" };
11 | };
12 | player setVariable ["ace_sys_goggles_earplugs", true, false];
13 | player setVariable ["ace_ear_protection", true, false];
14 | };
15 |
16 | [] spawn _earplugs;
17 | ["sandi_framework_respawnedLocal", { [] spawn _earplugs; }] call CBA_fnc_addEventHandler;
18 | };
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_addMagArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {_man addMagazine _x;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | for "_i" from 1 to (_x select 1) do {
14 | _man addMagazine (_x select 0);
15 | };
16 | };
17 | };
18 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_addRuckMagArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {[_man, _x, 1] call ACE_fnc_PackMagazine;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | [_man, (_x select 0), (_x select 1)] call ACE_fnc_PackMagazine;
14 | };
15 | };
16 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_addRuckWepArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {[_man, _x, 1] call ACE_fnc_PackWeapon;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | [_man, (_x select 0), (_x select 1)] call ACE_fnc_PackWeapon;
14 | };
15 | };
16 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_rucksackOperations.sqf:
--------------------------------------------------------------------------------
1 | _man = _this select 0;
2 | _wlist = _this select 1;
3 | _alist = _this select 2;
4 |
5 | _result = [_man] call ACE_fnc_HasRuck;
6 | if (_result) then {
7 |
8 | waitUntil {!isNil "ACE_Sys_Ruck_fnc_AddMagToRuck" && !isNil "ACE_Sys_Ruck_fnc_AddWepToRuck" && !isNil "ACE_fnc_PutWeaponOnBack"};
9 |
10 | // Adding Rucksack Weapons + Items
11 | if ((count _wlist) > 0) then {
12 | _result = [_man, _wlist] call CRACK_fnc_addRuckWepArray;
13 | };
14 |
15 | // Adding Rucksack Primary + Secondary Magazines
16 | if ((count _alist) > 0) then {
17 | _result = [_man, _alist] call CRACK_fnc_addRuckMagArray;
18 | };
19 |
20 | };
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_selectPrimaryWep.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 |
5 | if (count (weapons _man) > 0) then {
6 |
7 | _type = ((weapons _man) select 0);
8 |
9 | // check for multiple muzzles (eg: GL)
10 | _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");
11 |
12 | if (count _muzzles > 1) then
13 | {
14 | _man selectWeapon (_muzzles select 0);
15 | }
16 | else
17 | {
18 | _man selectWeapon _type;
19 | };
20 | } else {
21 |
22 | if !(player hasweapon "ace_safe") then {player addweapon "ace_safe"};
23 | player selectweapon "ace_safe";
24 |
25 | };
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/fnc_setLoadout.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 |
5 | if (local _man) then {
6 |
7 | _primaryWeapon = _this select 1;
8 | _secondaryWeapon = _this select 2;
9 | _weaponOnBack = _this select 3;
10 | _weaponOnBackACE = _this select 4;
11 | _items = _this select 5;
12 | _optics = _this select 6;
13 | _pMags = _this select 7;
14 | _sMags = _this select 8;
15 | _rWeapons = _this select 9;
16 | _rItems = _this select 10;
17 | _rpMags = _this select 11;
18 | _rsMags = _this select 12;
19 | _IFAK = _this select 13;
20 | _earPlugs = _this select 14;
21 |
22 | // Removing Current Weapons + Ammunition
23 | removeAllWeapons _man;
24 | removeAllItems _man;
25 | removeBackpack _man;
26 |
27 | // ACE Weapon-On-Back
28 | [_man, "WOB"] call ACE_fnc_RemoveGear;
29 | ifStringIsSet(_weaponOnBackACE) then {
30 | _man addWeapon _weaponOnBackACE;
31 | [_man, _weaponOnBackACE] call ACE_fnc_PutWeaponOnBack;
32 | };
33 |
34 | // Adding Weapons + Items + Optics
35 | _list = _items + _optics + [_primaryWeapon, _secondaryWeapon, _weaponOnBack];
36 | if ((count _list) > 0) then {
37 | {
38 | ifStringIsSet(_x) then {_man addWeapon _x;};
39 | } foreach _list;
40 | };
41 |
42 | // Adding Primary + Secondary Magazines
43 | _list = _pMags + _sMags;
44 | if ((count _list) > 0) then {
45 | [_man, _list] call CRACK_fnc_addMagArray;
46 | };
47 |
48 | // Rucksack Weapons + Items + Ammunition
49 | _wlist = _rWeapons + _rItems;
50 | _alist = _rpMags + _rsMags;
51 | if (((count _wlist) > 0) OR ((count _alist) > 0)) then {
52 | [_man, _wlist, _alist] call CRACK_fnc_rucksackOperations;
53 | };
54 |
55 | // Select Primary Weapon
56 | [_man] call CRACK_fnc_selectPrimaryWep;
57 |
58 | // Client only stuff
59 | if (!isdedicated) then {
60 |
61 | // Adding IFAK Contents
62 | if ((_IFAK == 1) AND (_man == player)) then {
63 | [_man, 1, 1, 1] call ACE_fnc_PackIFAK;
64 | };
65 |
66 | // Adding in earplugs if needed
67 | if ((_earPlugs == 1) AND (_man == player)) then {
68 | [] call CRACK_fnc_addEarProtection;
69 | };
70 | };
71 | };
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/f/script_macros.hpp:
--------------------------------------------------------------------------------
1 | #define QUOTE(var) #var
2 |
3 | #define defDir(localdir) QUOTE(scripts\CRACK_gearFunctions\localdir)
4 |
5 | #define ifIsString(var) if (typeName(var) == typeName("HelloWorld"))
6 | #define ifIsArray(var) if (typeName(var) == typeName([1,0]))
7 |
8 | #define ifStringIsSet(var) if (var != "")
9 | #define ifArrayIsSet(array) if (((array select 0) != "") AND ((array select 1) > 0) AND (((array select 1) % 1) == 0))
--------------------------------------------------------------------------------
/Arma 2/Gear Functions/scripts/CRACK_gearFunctions/init.sqf:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // Initialization File
11 | //
12 | //*************************************************************************************************
13 | #include "f\script_macros.hpp"
14 |
15 | CRACK_fnc_addMagArray = compile preprocessfilelinenumbers defDir(f\fnc_addMagArray.sqf); // []
16 | CRACK_fnc_addEarProtection = compile preprocessfilelinenumbers defDir(f\fnc_addEarProtection.sqf);
17 | CRACK_fnc_addRuckMagArray = compile preprocessfilelinenumbers defDir(f\fnc_addRuckMagArray.sqf);
18 | CRACK_fnc_addRuckWepArray = compile preprocessfilelinenumbers defDir(f\fnc_addRuckWepArray.sqf);
19 | CRACK_fnc_selectPrimaryWep = compile preprocessfilelinenumbers defDir(f\fnc_selectPrimaryWep.sqf);
20 | CRACK_fnc_rucksackOperations = compile preprocessfilelinenumbers defDir(f\fnc_rucksackOperations.sqf);
21 | CRACK_fnc_setLoadout = compile preprocessfilelinenumbers defDir(f\fnc_setLoadout.sqf);
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/description.ext:
--------------------------------------------------------------------------------
1 | #include "scripts\naught\handleDamage\rsc\diag_init.hpp"
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/init.sqf:
--------------------------------------------------------------------------------
1 | foo = [] execVM "scripts\naught\handleDamage\init.sqf";
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/defaults.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_instructors", "_medics", "_isInstructor", "_medicalAbility"];
3 |
4 | _instructors = [Instructor1];
5 | _medics = [];
6 |
7 | _isInstructor = player in _instructors;
8 | _hasMedicalAbility = (player in _medics) OR _isInstructor;
9 |
10 | cm_handleDamage_defaults = [
11 |
12 | [ // 0
13 | "cm_hd_script",
14 | "cm_handleDamage_hds_hintOnHit_hint" // Options: "cm_handleDamage_hds_hintOnHit_hint", "ACE_Wounds"
15 | ],
16 |
17 | [ // 1
18 | "cm_hd_hintOnHit_params",
19 | [ // Array of Boolean values
20 | true, // 0 - Allow player to check their own damage
21 | _hasMedicalAbility, // 1 - Allow player to change their own damage
22 | _isInstructor, // 2 - Allow player to turn off/on his Hint-on-Hit
23 | _hasMedicalAbility, // 3 - Allow player to check other units' damages
24 | _hasMedicalAbility, // 4 - Allow player to change other units' damages
25 | _isInstructor // 5 - Allow player to turn off/on other units Hint-on-Hit
26 | ]
27 | ]
28 |
29 | ];
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/f/fnc_aceInteract.sqf:
--------------------------------------------------------------------------------
1 | #include "\ca\editor\Data\Scripts\dikCodes.h"
2 |
3 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus", "_type"];
4 |
5 | // _this==[_target, _menuNameOrParams]
6 | _target = _this select 0;
7 | _params = _this select 1;
8 |
9 | _menuName = "";
10 | _menuRsc = "popup";
11 |
12 | if (typeName _params == typeName []) then {
13 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
14 | _menuName = _params select 0;
15 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
16 | } else {
17 | _menuName = _params;
18 | };
19 | //-----------------------------------------------------------------------------
20 |
21 | cm_siTarget = _target;
22 |
23 | _menus = [
24 | [
25 | ["main", "Main Menu", _menuRsc],
26 | [
27 | ["" + (localize "STR_CM_HD_INTERACT") + " >", "", "", "",
28 | ["_this call cm_handleDamage_fnc_aceInteract", "medicaloptions", 1],
29 | -1, 1, (cm_handleDamage)]
30 | ]
31 | ]
32 | ];
33 |
34 | if(_menuName == "medicaloptions") then {
35 |
36 | private ["_popupArray", "_menuShown", "_playerName"];
37 |
38 | _popupArray = [];
39 | _menuShown = false;
40 |
41 | {
42 | if (typeName(_x) == typeName("string")) then {_x = compile _x;};
43 | if (typeName(_x) == typeName([])) exitWith {diag_log (text "CRITICAL: Handle Damage: Array found in interact options!")};
44 |
45 | _popupArray = _popupArray + (_this call _x);
46 |
47 | } forEach cm_handleDamage_interactMenu;
48 |
49 | {
50 | if (_x select 7) exitwith {
51 | _menuShown = true;
52 | };
53 | } forEach _popupArray;
54 |
55 | if (!_menuShown OR (count _popupArray < 1)) then {
56 | _popupArray = [
57 | [
58 | (localize "STR_CM_HD_INTERACT_EMPTY"),
59 | {},
60 | "", "", "", -1,
61 | 0, true
62 | ]
63 | ];
64 | };
65 |
66 | _playerName = if (player == _target) then {"Player"} else {name _target};
67 |
68 | _menus set [count _menus,
69 | [
70 | ["medicaloptions", ((localize "STR_CM_HD_INTERACT") + " (" + _playerName + ")"), "popup", ""],
71 | _popupArray
72 | ]
73 | ];
74 | };
75 |
76 |
77 | //-----------------------------------------------------------------------------
78 | _menuDef = [];
79 | {
80 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
81 | } forEach _menus;
82 |
83 | if (count _menuDef == 0) then {
84 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this}else{""}, __FILE__];
85 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
86 | };
87 |
88 | _menuDef // return value
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/f/fnc_addHit.sqf:
--------------------------------------------------------------------------------
1 | private ["_dam", "_params", "_injuredUnit", "_injuredPart", "_partDamage", "_injurer", "_ammoClass", "_return", "_index", "_oldDam", "_script", "_forcePlayer", "_scriptParams"];
2 |
3 | _dam = _this select 0;
4 | _params = _this select 1;
5 |
6 | _injuredUnit = _dam select 0;
7 | _injuredPart = _dam select 1;
8 | _partDamage = _dam select 2;
9 | _injurer = _dam select 3;
10 | _ammoClass = _dam select 4;
11 |
12 | _script = _params select 0;
13 | _forcePlayer = _params select 1;
14 | _scriptParams = _params select 2;
15 |
16 | _return = 0;
17 | _index = cm_handleDamage_dic_bodyParts find _injuredPart;
18 |
19 | if (_index >= 0) then {
20 |
21 | if (_forcePlayer AND (_injuredUnit != player)) exitWith {};
22 |
23 | _oldDam = cm_handleDamage_localDamArray select _index;
24 | cm_handleDamage_localDamArray set [_index, (_partDamage + _oldDam)];
25 |
26 | if (_index == ((count cm_handleDamage_dic_bodyParts) - 1)) then { // Last Body Part
27 |
28 | cm_handleDamage_localDamArray set [(_index + 1), diag_ticktime];
29 | player setVariable ["cm_handleDamage_localDamArray", cm_handleDamage_localDamArray, true];
30 |
31 | cm_handleDamage_localDamArray call compile (_scriptParams + " call " + _script);
32 | };
33 | };
34 |
35 | _return
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/f/fnc_onDeath.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_unit", "_killer"];
3 |
4 | _unit = _this select 0;
5 | _killer = _this select 1;
6 |
7 | for "_i" from 0 to (count cm_handleDamage_defaults - 1) do {
8 |
9 | private ["_var", "_val", "_dft"];
10 |
11 | _x = cm_handleDamage_defaults select _i;
12 |
13 | _var = _x select 0;
14 | _dft = _x select 1;
15 |
16 | _val = _unit getVariable [_var, _dft];
17 |
18 | cm_handleDamage_defaults set [_i, [_var, _val]];
19 |
20 | _unit setVariable [_var, nil, true];
21 |
22 | };
23 |
24 | waitUntil {alive player};
25 |
26 | [player] call cm_handleDamage_fnc_onSpawn;
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/f/fnc_onSpawn.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_unit"];
3 |
4 | _unit = _this select 0;
5 |
6 | {
7 | private ["_var", "_val"];
8 |
9 | _var = _x select 0;
10 | _val = _x select 1;
11 |
12 | _unit setVariable [_var, _val, true];
13 |
14 | } forEach cm_handleDamage_defaults;
15 |
16 | _unit setVariable ["ace_w_allow_dam", (if ([_unit] call cm_handleDamage_hds_hintOnHit_checkEnabled) then {false} else {nil}), true];
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/ace/interact.sqf:
--------------------------------------------------------------------------------
1 | _return = [
2 |
3 | [
4 | (localize "STR_HINTONHIT_CHECKDAM"),
5 | { [(cm_siTarget getVariable ["cm_handleDamage_localDamArray", cm_handleDamage_dft_localDamArray]), ((localize "STR_HINTONHIT_CHECK") + " (" + (name cm_siTarget) + "):")] call cm_handleDamage_hds_hintOnHit_hint; },
6 | "", "", "", -1,
7 | 1, (_hintOnHit AND (_status select 3))
8 | ],
9 |
10 | [
11 | (localize "STR_HINTONHIT_SETDAM"),
12 | { ["create", ["remote", cm_siTarget]] call cm_handleDamage_hds_hintOnHit_diag_setDamage; },
13 | "", "", "", -1,
14 | 1, (_hintOnHit AND (_status select 4))
15 | ],
16 |
17 | [
18 | (if (!_hintOnHit) then {localize "STR_ENABLE"} else {localize "STR_DISABLE"}) + " " + (localize "STR_HINTONHIT_NAME"),
19 | { ["cm_hd_hintOnHit_toggle", [cm_siTarget]] call CBA_fnc_globalEvent; },
20 | "", "", "", -1,
21 | 1, (_status select 5)
22 | ]
23 |
24 | ];
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/ace/loadInteract.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_status", "_hintOnHit", "_status", "_return", "_statusDFT"];
3 |
4 | _unit = cm_siTarget;
5 |
6 | _return = [];
7 | _statusDFT = [];
8 |
9 | if (_unit getVariable ["cm_handleDamage", false]) then {
10 |
11 | _hintOnHit = [_unit] call cm_handleDamage_hds_hintOnHit_checkEnabled;
12 |
13 | _status = player getVariable ["cm_hd_hintOnHit_params", ((cm_handleDamage_defaults select 1) select 1)];
14 |
15 | if (_unit == player) then { // ACE Self Interact
16 |
17 | #include "selfInteract.sqf"
18 |
19 | } else { // ACE Interact
20 |
21 | #include "interact.sqf"
22 |
23 | };
24 | };
25 |
26 | _return
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/ace/selfInteract.sqf:
--------------------------------------------------------------------------------
1 | _return = [
2 |
3 | [
4 | (localize "STR_HINTONHIT_CHECKDAM"),
5 | { [(player getVariable ["cm_handleDamage_localDamArray", cm_handleDamage_dft_localDamArray]), ((localize "STR_HINTONHIT_CHECK") + ":")] call cm_handleDamage_hds_hintOnHit_hint; },
6 | "", "", "", -1,
7 | 1, (_hintOnHit AND (_status select 0))
8 | ],
9 |
10 | [
11 | (localize "STR_HINTONHIT_SETDAM"),
12 | { ["create", ["local", player]] call cm_handleDamage_hds_hintOnHit_diag_setDamage; },
13 | "", "", "", -1,
14 | 1, (_hintOnHit AND (_status select 1))
15 | ],
16 |
17 | [
18 | (if (!_hintOnHit) then {localize "STR_ENABLE"} else {localize "STR_DISABLE"}) + " " + (localize "STR_HINTONHIT_NAME"),
19 | { ["cm_hd_hintOnHit_toggle", [player]] call CBA_fnc_localEvent; },
20 | "", "", "", -1,
21 | 1, (_status select 2)
22 | ]
23 |
24 | ];
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/diag_hintOnHit_setDamage.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_call"];
3 |
4 | _call = _this select 0;
5 |
6 | switch (_call) do {
7 |
8 | case "create": {
9 |
10 | private ["_params", "_type", "_unit"];
11 |
12 | _params = _this select 1;
13 |
14 | _type = _params select 0;
15 | _unit = _params select 1;
16 |
17 | createDialog "cm_handleDamage_hintOnHit_setDamage";
18 |
19 | ctrlSetText [98, (name _unit)];
20 |
21 | cm_handleDamage_diagHintOnHit_type = _type;
22 |
23 | };
24 |
25 | /////////////////////////////////////////////
26 |
27 | case "load": {
28 |
29 | private ["_damArray"];
30 |
31 | _damArray = cm_siTarget getVariable ["cm_handleDamage_localDamArray", cm_handleDamage_dft_localDamArray];
32 |
33 | waitUntil {dialog};
34 |
35 | for "_i" from 0 to 4 do {
36 |
37 | private ["_dam"];
38 |
39 | _dam = (round((_damArray select _i) * 10000)) / 100; // Rounds to hundreths place
40 |
41 | ctrlSetText [(_i + 1), str(_dam)];
42 | };
43 |
44 | [] spawn {
45 |
46 | private ["_tooFar"];
47 |
48 | waitUntil {
49 | _tooFar = (player distance cm_siTarget) > 15;
50 | _tooFar or !dialog;
51 | };
52 |
53 | if (_tooFar AND dialog) then {
54 | closeDialog 70529;
55 | };
56 | };
57 | };
58 |
59 | /////////////////////////////////////////////
60 |
61 | case "save": {
62 |
63 | private ["_damArray", "_exit"];
64 |
65 | _exit = false;
66 |
67 | _damArray = [
68 | ctrlText 1, // Overall
69 | ctrlText 2, // Head
70 | ctrlText 3, // Body
71 | ctrlText 4, // Hands
72 | ctrlText 5 // Legs
73 | ];
74 |
75 | for "_i" from 0 to (count _damArray - 1) do {
76 |
77 | private ["_dam", "_num"];
78 |
79 | _dam = _damArray select _i;
80 |
81 | _num = parseNumber _dam;
82 |
83 | if ((_num == 0) && !(_dam in ["0", "0.0", "0.00", "0%", "0.0%", "0.00%"])) exitWith {
84 | hint "You have provided an invalid number!";
85 | _exit = true;
86 | };
87 |
88 | _damArray set [_i, (_num / 100)];
89 |
90 | };
91 |
92 | if (_exit) exitWith {};
93 |
94 | _damArray = _damArray + [diag_tickTime];
95 |
96 | [cm_handleDamage_diagHintOnHit_type, _damArray] call cm_handleDamage_hds_hintOnHit_setPlayerDamage;
97 |
98 | closeDialog 70529;
99 |
100 | };
101 |
102 | /////////////////////////////////////////////
103 |
104 | };
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/fnc_checkEnabled.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_unit"];
3 |
4 | _unit = _this select 0;
5 |
6 | ((_unit getVariable ["cm_hd_script", ""]) == "cm_handleDamage_hds_hintOnHit_hint")
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/fnc_enableHDS.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_unit", "_status", "_script"];
3 |
4 | _unit = _this select 0;
5 | _status = !([_unit] call cm_handleDamage_hds_hintOnHit_checkEnabled);
6 |
7 | if (local _unit) then {
8 |
9 | _script = if (_status) then {"cm_handleDamage_hds_hintOnHit_hint"} else {""};
10 |
11 | _unit setVariable ["cm_hd_script", _script, true];
12 |
13 | _unit setVariable ["ace_w_allow_dam", (if (_status) then {false} else {nil}), true];
14 |
15 | hint ((localize "STR_HINTONHIT_NAME") + " " + (if (_status) then {localize "STR_ENABLED"} else {localize "STR_DISABLED"}));
16 | };
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/fnc_hint.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_damArray", "_dead", "_call", "_textArray"];
3 |
4 | _damArray = _this select 0;
5 | _call = _this select 1;
6 |
7 | _dead = false;
8 |
9 | _textArray = [parseText("" + _call + "")];
10 |
11 | _textArray = _textArray + [parseText("
" + (localize "STR_HINTONHIT_TIME") + ": " + str(date select 3) + ":" + str(date select 4) + ":" + str(round(time % 60)))];
12 |
13 | _textArray = _textArray + [parseText("
" + (localize "STR_HINTONHIT_PDAM") + ": ")];
14 |
15 | for "_i" from 1 to ((count _damArray) - 1) do {
16 |
17 | private ["_dam", "_partName", "_vitalOrgs"];
18 |
19 | _dam = _damArray select _i;
20 | _partName = cm_handleDamage_dic_bodyPartNames select _i;
21 |
22 | _vitalOrgs = [1,2,3];
23 |
24 | if ((_i in _vitalOrgs) AND (_dam >= 1)) then {
25 | _dead = true;
26 | };
27 |
28 | // NN.N% Format, will simplify decimals
29 | _dam = round (_dam * 1000);
30 | _dam = _dam / 10;
31 |
32 | if (_dam > 100) then {
33 | _dam = 100;
34 | };
35 |
36 | _textArray = _textArray + [parseText("
" + _partName + ": " + str(_dam) + "%")];
37 | };
38 |
39 | if (_dead) then {
40 | _textArray = _textArray + [parseText("
" + (localize "STR_HINTONHIT_DEAD") + "")];
41 | };
42 |
43 | // Add Extra Spaces Below
44 | _textArray = _textArray + [parseText("
")];
45 |
46 | hint composeText(_textArray);
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/fnc_setPlayerDamage.sqf:
--------------------------------------------------------------------------------
1 |
2 | private ["_call", "_dam"];
3 |
4 | _call = _this select 0;
5 | _dam = _this select 1;
6 |
7 | switch (_call) do {
8 |
9 | case "local": {
10 |
11 | player setVariable ["cm_handleDamage_localDamArray", (_dam + [diag_tickTime]), true];
12 |
13 | hint "Local Player Damage Changed!";
14 | };
15 |
16 | case "remote": {
17 |
18 | [-1, {
19 | if (player == (_this select 0)) then {
20 | ["local", _dam] call cm_handleDamage_fnc_setPlayerDamage;
21 | };
22 | }, cm_siTarget] call CBA_fnc_globalExecute;
23 | };
24 | };
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/hintOnHit/load.sqf:
--------------------------------------------------------------------------------
1 |
2 | cm_handleDamage_hds_hintOnHit_checkEnabled = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\fnc_checkEnabled.sqf";
3 | cm_handleDamage_hds_hintOnHit_enableHDS = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\fnc_enableHDS.sqf";
4 | cm_handleDamage_hds_hintOnHit_hint = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\fnc_hint.sqf";
5 | cm_handleDamage_hds_hintOnHit_setPlayerDamage = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\fnc_setPlayerDamage.sqf";
6 |
7 | cm_handleDamage_hds_hintOnHit_diag_setDamage = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\diag_hintOnHit_setDamage.sqf";
8 |
9 | cm_handleDamage_hds_hintOnHit_interact = compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\ace\loadInteract.sqf";
10 | cm_handleDamage_interactMenu = cm_handleDamage_interactMenu + [cm_handleDamage_hds_hintOnHit_interact];
11 |
12 | cm_handleDamage_hds_hintOnHit_toggleEH = ["cm_hd_hintOnHit_toggle", cm_handleDamage_hds_hintOnHit_enableHDS] call CBA_fnc_addEventHandler;
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/hds/load.sqf:
--------------------------------------------------------------------------------
1 | [] call compile preProcessFileLineNumbers "scripts\naught\handleDamage\hds\hintOnHit\load.sqf";
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/scripts/naught/handleDamage/rsc/diag_init.hpp:
--------------------------------------------------------------------------------
1 | //*********************************************************************************************************************
2 | //
3 | // DIALOG INIT
4 | //
5 | // Put in your description.ext:
6 | // #include "scripts\naught\handleDamage\rsc\diag_init.hpp"
7 | //
8 | //*********************************************************************************************************************
9 | #include "defines.hpp"
10 |
11 | //*********************************************************************************************************************
12 | // Initial Defines
13 |
14 | #define CRACK_xPos 1
15 | #define CRACK_textSize 0.036
16 | #define CRACK_soundPush {"", 0.1, 1}
17 | #define CRACK_borderHeight 0.1
18 | #define CRACK_borderWidth2 (CRACK_Box_W / 256)
19 | #define CRACK_captionTextSize 0.032
20 |
21 | //*********************************************************************************************************************
22 | // Dialogs
23 |
24 | #include "dialogs\diag_hintOnHit_setDamage.hpp"
--------------------------------------------------------------------------------
/Arma 2/Handle Damage Script/stringtable.csv:
--------------------------------------------------------------------------------
1 | LANGUAGE, English
2 |
3 | STR_PLAYER, Player
4 | STR_ENABLE, Enable
5 | STR_DISABLE, Disable
6 | STR_ENABLED, Enabled
7 | STR_DISABLED, Disabled
8 | STR_SAVE, Save
9 | STR_CLOSE, Close
10 |
11 | STR_BODY_ALL, Overall
12 | STR_BODY_HEAD, Head
13 | STR_BODY_BODY, Body
14 | STR_BODY_HANDS, Hands
15 | STR_BODY_LEGS, Legs
16 |
17 | STR_CM_HD_INTERACT, UOTC Medical
18 | STR_CM_HD_INTERACT_EMPTY, (No options)
19 |
20 | STR_HINTONHIT_NAME, Player HintOnHit System
21 | STR_HINTONHIT_HIT, HIT!
22 | STR_HINTONHIT_CHECK, CHECK
23 | STR_HINTONHIT_DEAD, Dead!
24 | STR_HINTONHIT_TIME, Time
25 | STR_HINTONHIT_PDAM, Player Damage
26 | STR_HINTONHIT_CHECKDAM, Check Damage
27 | STR_HINTONHIT_SETDAM, Set Damage
28 | STR_HINTONHIT_NOTETEXT, Note: These are damage values so a value of 0% is full health and a value of 100% is full damage.
--------------------------------------------------------------------------------
/Arma 2/Helo Drop Smoke Script/heloDropSmoke/f/fnc_dropSmoke.sqf:
--------------------------------------------------------------------------------
1 | private ["_ammoName", "_index", "_return", "_smokesLeft", "_veh", "_getVar", "_value", "_smoke"];
2 |
3 | _ammoName = _this select 0;
4 | _index = _this select 1;
5 | _veh = _this select 2;
6 | _return = false;
7 |
8 | _smokesLeft = [_veh, _index] call CRACK_fnc_heloDS_getSmokesLeft;
9 |
10 | if (_smokesLeft > 0) then {
11 |
12 | _smoke = _ammoName createVehicle (_veh modelToWorld CRACK_heloDS_heloDropPos);
13 |
14 | _getVar = _veh getVariable "CRACK_heloDS_smokesLeft";
15 | _value = _getVar select _index;
16 | _getVar set [_index, (_value - 1)];
17 | _veh setVariable ["CRACK_heloDS_smokesLeft", _getVar, true];
18 |
19 | _return = true;
20 |
21 | } else {
22 | hint "Out of Smokes!";
23 | };
24 |
25 | _return
--------------------------------------------------------------------------------
/Arma 2/Helo Drop Smoke Script/heloDropSmoke/f/fnc_getSmokesLeft.sqf:
--------------------------------------------------------------------------------
1 | private ["_veh", "_index", "_value", "_return", "_getVar", "_default"];
2 |
3 | _veh = _this select 0;
4 | _index = _this select 1;
5 | _return = -1;
6 | _default = [];
7 |
8 | _getVar = _veh getVariable ["CRACK_heloDS_smokesLeft", 69];
9 |
10 | if ((typeName(_getVar) == typeName([]))) then {
11 | if ((count _getVar) <= _index) exitWith {};
12 | if (typeName(_getVar select _index) != typeName(69)) exitWith {};
13 | _return = _getVar select _index;
14 | };
15 |
16 | if (_return < 0) then {
17 | for "_i" from 0 to (count CRACK_heloDS_smokes - 1) do {
18 | _value = (CRACK_heloDS_smokes select _i) select 3;
19 | _default set [_i, _value];
20 | };
21 |
22 | _veh setVariable ["CRACK_heloDS_smokesLeft", _default, true];
23 | _return = _default select _index;
24 | };
25 |
26 | _return
--------------------------------------------------------------------------------
/Arma 2/Helo Drop Smoke Script/heloDropSmoke/init.sqf:
--------------------------------------------------------------------------------
1 | // nul = [] execVM "scripts\heloDropSmoke\init.sqf"
2 |
3 | #define QUOTE(var1) #var1
4 | #define SCRIPTPATH(var1) QUOTE(scripts\heloDropSmoke\var1)
5 |
6 | scriptName SCRIPTPATH(init.sqf);
7 |
8 | private ["_return"];
9 |
10 | _return = false;
11 |
12 | if (!isDedicated) then {
13 |
14 | //------------------
15 | // Some Settings Here
16 |
17 | CRACK_heloDS_usability = 2; // 0 - Pilot Only, 1 - CoPilot/Crew Only, 2 - Both Pilot and CoPilot/Crew
18 |
19 | CRACK_heloDS_vehType = "AH6_Base_EP1"; // DEFAULT: "AH6_Base_EP1"
20 |
21 | CRACK_heloDS_heloDropPos = [0,0,-1.5]; // DEFAULT: [0,0,-1.5]
22 |
23 | CRACK_heloDS_smokes = [ // ["SmokeName", "AmmoName", "#RGBCLR", _numberPerAircraft]
24 | ["White Smoke", "SmokeShell", "#ffffff", 50],
25 | ["Yellow Smoke", "SmokeShellYellow", "#ffff00", 50],
26 | ["Orange Smoke", "SmokeShellOrange", "#ffa500", 50],
27 | ["Red Smoke", "SmokeShellRed", "#ff0000", 50],
28 | ["Green Smoke", "SmokeShellGreen", "#00ff00", 50],
29 | ["Blue Smoke", "SmokeShellBlue", "#0000ff", 50],
30 | ["Purple Smoke", "SmokeShellPurple", "#a020f0", 50]
31 | //["Frag Grenade", "GrenadeHand", "#7b8165", 50]
32 | ];
33 |
34 | //------------------
35 |
36 | CRACK_fnc_heloDS_dropSmoke = compile preProcessFileLineNumbers SCRIPTPATH(f\fnc_dropSmoke.sqf);
37 | CRACK_fnc_heloDS_getSmokesLeft = compile preProcessFileLineNumbers SCRIPTPATH(f\fnc_getSmokesLeft.sqf);
38 | CRACK_fnc_heloDS_selfInteract = compile preProcessFileLineNumbers SCRIPTPATH(f\fnc_selfInteract.sqf);
39 |
40 | //------------------
41 |
42 | waitUntil {!isNull player};
43 |
44 | ["player", [ace_sys_interaction_key_self], 99999, ["_this call CRACK_fnc_heloDS_selfInteract;", "main"]] call CBA_ui_fnc_add;
45 |
46 | };
47 |
48 | _return
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/ORBAT_Syntax.txt:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // ORBAT EOF Syntax
11 | //
12 | //*************************************************************************************************
13 |
14 | [_man, "PrimaryWeapon", "SecondaryWeapon", "OnBack", "ACE_OnBack", _items, _optics, _pMags, _sMags, _rWeapons, _rItems, _rpMags, _rsMags, _IFAK, _earPlugs]
15 |
16 | _man = player; // Or 'this' if placed in a unit's init field
17 |
18 | _items = ["Item", "Item", "Item", "Item"]; // Up to 12
19 |
20 | _optics = ["Optic", "Optic"]; // Up to 2
21 |
22 | _pMags = ["PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine"]; // Up to 12
23 | _pMags = [["PrimaryMagazine", Count], ["PrimaryMagazine", Count], ["PrimaryMagazine", Count]]; // Up to 12 Total
24 |
25 | _sMags = ["SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine"]; // Up to 8
26 | _sMags = [["SecondaryMagazine", Count], ["SecondaryMagazine", Count], ["SecondaryMagazine", Count]]; // Up to 8 Total
27 |
28 | _rWeapons = ["Weapon", "Weapon"]; // Rucksack - Unlimited
29 |
30 | _rItems = ["Item", "Item", "Item", "Item"]; // Rucksack - Unlimited
31 |
32 | _rpMags = ["PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine", "PrimaryMagazine"]; // Rucksack - Unlimited
33 | _rpMags = [["PrimaryMagazine", Count], ["PrimaryMagazine", Count], ["PrimaryMagazine", Count]]; // Rucksack - Unlimited
34 |
35 | _rsMags = ["SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine", "SecondaryMagazine"]; // Rucksack - Unlimited
36 | _rsMags = [["SecondaryMagazine", Count], ["SecondaryMagazine", Count], ["SecondaryMagazine", Count]]; // Rucksack - Unlimited
37 |
38 | _IFAK = 1; // Set 1 for IFAK, 0 for nothing
39 |
40 | _earPlugs = 1; // Set 1 for Ear Protection, 0 for nothing
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/custom/ORBAT_CUSTOM_USMC_Woodland.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/custom/ORBAT_CUSTOM_USMC_Woodland.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/custom/ORBAT_CUSTOM_US_Army_ACU.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/custom/ORBAT_CUSTOM_US_Army_ACU.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/init.sqf:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // ORBAT Init File
11 | //
12 | //*************************************************************************************************
13 | #include "script_component.hpp"
14 |
15 | _params = _this;
16 |
17 | // List of ORBATS ---------------------------------------------------------------------------------
18 |
19 | CRACK_ORBATS_US_ARMY = defDir(us_army\ORBAT.sqf);
20 | CRACK_ORBATS_USMC = defDir(usmc\ORBAT.sqf);
21 | CRACK_ORBATS_SHACKTAC = defDir(shacktac\ORBAT.sqf);
22 | CRACK_ORBATS_CUSTOM = defDir(custom\ORBAT.sqf);
23 |
24 | // ORBAT Initialization ---------------------------------------------------------------------------
25 |
26 | {
27 |
28 | _ORBAT = _x select 0;
29 | _ORBATParams = _x select 1;
30 |
31 | _result = call compile format ["%1 execVM %2;", _ORBATParams, _ORBAT];
32 |
33 | } foreach _params;
34 |
35 | // ------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/script_component.hpp:
--------------------------------------------------------------------------------
1 | #define QUOTE(var) #var
2 |
3 | #define defDir(localdir) QUOTE(CRACK_ORBAT\ORBATS\localdir)
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/shacktac/ORBAT_SHACKTAC_USMC_Desert.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/shacktac/ORBAT_SHACKTAC_USMC_Desert.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/shacktac/ORBAT_SHACKTAC_USMC_Woodland.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/shacktac/ORBAT_SHACKTAC_USMC_Woodland.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_ACU.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_ACU.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_DCU.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_DCU.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_OCP.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_OCP.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_Woodland.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/us_army/ORBAT_US_Army_Woodland.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/usmc/ORBAT_USMC_Desert.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/usmc/ORBAT_USMC_Desert.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/usmc/ORBAT_USMC_Woodland.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/ORBAT/CRACK_ORBAT/ORBATS/usmc/ORBAT_USMC_Woodland.rar
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_addEarProtection.sqf:
--------------------------------------------------------------------------------
1 | #define __check configFile >> "CfgIdentities" >> "Identity" >> "name"
2 |
3 | if (!isDedicated) then {
4 | waitUntil {!isNull player};
5 |
6 | _earplugs = {
7 | if ( ((getText(__check) == "") || (getText(__check) != (name player))) && isMultiplayer ) then { // indentity incorrect
8 | // don't wait
9 | } else { // wait for init
10 | waitUntil { sleep 0.5; _earplugs = player getVariable "ace_sys_goggles_earplugs"; !isNil "_earplugs" };
11 | };
12 | player setVariable ["ace_sys_goggles_earplugs", true, false];
13 | player setVariable ["ace_ear_protection", true, false];
14 | };
15 |
16 | [] spawn _earplugs;
17 | ["sandi_framework_respawnedLocal", { [] spawn _earplugs; }] call CBA_fnc_addEventHandler;
18 | };
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_addMagArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {_man addMagazine _x;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | for "_i" from 1 to (_x select 1) do {
14 | _man addMagazine (_x select 0);
15 | };
16 | };
17 | };
18 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_addRuckMagArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {[_man, _x, 1] call ACE_fnc_PackMagazine;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | [_man, (_x select 0), (_x select 1)] call ACE_fnc_PackMagazine;
14 | };
15 | };
16 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_addRuckWepArray.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 | _list = _this select 1;
5 |
6 | {
7 | ifIsString(_x) then {
8 | ifStringIsSet(_x) then {[_man, _x, 1] call ACE_fnc_PackWeapon;};
9 | };
10 |
11 | ifIsArray(_x) then {
12 | ifArrayIsSet(_x) then {
13 | [_man, (_x select 0), (_x select 1)] call ACE_fnc_PackWeapon;
14 | };
15 | };
16 | } foreach _list;
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_rucksackOperations.sqf:
--------------------------------------------------------------------------------
1 | _man = _this select 0;
2 | _wlist = _this select 1;
3 | _alist = _this select 2;
4 |
5 | _result = [_man] call ACE_fnc_HasRuck;
6 | if (_result) then {
7 |
8 | waitUntil {!isNil "ACE_Sys_Ruck_fnc_AddMagToRuck" && !isNil "ACE_Sys_Ruck_fnc_AddWepToRuck" && !isNil "ACE_fnc_PutWeaponOnBack"};
9 |
10 | // Adding Rucksack Weapons + Items
11 | if ((count _wlist) > 0) then {
12 | _result = [_man, _wlist] call CRACK_fnc_addRuckWepArray;
13 | };
14 |
15 | // Adding Rucksack Primary + Secondary Magazines
16 | if ((count _alist) > 0) then {
17 | _result = [_man, _alist] call CRACK_fnc_addRuckMagArray;
18 | };
19 |
20 | };
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_selectPrimaryWep.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 |
5 | if (count (weapons _man) > 0) then {
6 |
7 | _type = ((weapons _man) select 0);
8 |
9 | // check for multiple muzzles (eg: GL)
10 | _muzzles = getArray(configFile >> "cfgWeapons" >> _type >> "muzzles");
11 |
12 | if (count _muzzles > 1) then
13 | {
14 | _man selectWeapon (_muzzles select 0);
15 | }
16 | else
17 | {
18 | _man selectWeapon _type;
19 | };
20 | } else {
21 |
22 | if !(player hasweapon "ace_safe") then {player addweapon "ace_safe"};
23 | player selectweapon "ace_safe";
24 |
25 | };
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/fnc_setLoadout.sqf:
--------------------------------------------------------------------------------
1 | #include "script_macros.hpp"
2 |
3 | _man = _this select 0;
4 |
5 | if (local _man) then {
6 |
7 | _primaryWeapon = _this select 1;
8 | _secondaryWeapon = _this select 2;
9 | _weaponOnBack = _this select 3;
10 | _weaponOnBackACE = _this select 4;
11 | _items = _this select 5;
12 | _optics = _this select 6;
13 | _pMags = _this select 7;
14 | _sMags = _this select 8;
15 | _rWeapons = _this select 9;
16 | _rItems = _this select 10;
17 | _rpMags = _this select 11;
18 | _rsMags = _this select 12;
19 | _IFAK = _this select 13;
20 | _earPlugs = _this select 14;
21 |
22 | // Removing Current Weapons + Ammunition
23 | removeAllWeapons _man;
24 | removeAllItems _man;
25 | removeBackpack _man;
26 |
27 | // ACE Weapon-On-Back
28 | [_man, "WOB"] call ACE_fnc_RemoveGear;
29 | ifStringIsSet(_weaponOnBackACE) then {
30 | _man addWeapon _weaponOnBackACE;
31 | [_man, _weaponOnBackACE] call ACE_fnc_PutWeaponOnBack;
32 | };
33 |
34 | // Adding Weapons + Items + Optics
35 | _list = _items + _optics + [_primaryWeapon, _secondaryWeapon, _weaponOnBack];
36 | if ((count _list) > 0) then {
37 | {
38 | ifStringIsSet(_x) then {_man addWeapon _x;};
39 | } foreach _list;
40 | };
41 |
42 | // Adding Primary + Secondary Magazines
43 | _list = _pMags + _sMags;
44 | if ((count _list) > 0) then {
45 | [_man, _list] call CRACK_fnc_addMagArray;
46 | };
47 |
48 | // Rucksack Weapons + Items + Ammunition
49 | _wlist = _rWeapons + _rItems;
50 | _alist = _rpMags + _rsMags;
51 | if (((count _wlist) > 0) OR ((count _alist) > 0)) then {
52 | [_man, _wlist, _alist] call CRACK_fnc_rucksackOperations;
53 | };
54 |
55 | // Select Primary Weapon
56 | [_man] call CRACK_fnc_selectPrimaryWep;
57 |
58 | // Client only stuff
59 | if (!isdedicated) then {
60 |
61 | // Adding IFAK Contents
62 | if ((_IFAK == 1) AND (_man == player)) then {
63 | [_man, 1, 1, 1] call ACE_fnc_PackIFAK;
64 | };
65 |
66 | // Adding in earplugs if needed
67 | if ((_earPlugs == 1) AND (_man == player)) then {
68 | [] call CRACK_fnc_addEarProtection;
69 | };
70 | };
71 | };
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/f/script_macros.hpp:
--------------------------------------------------------------------------------
1 | #define QUOTE(var) #var
2 |
3 | #define defDir(localdir) QUOTE(CRACK_ORBAT\localdir)
4 |
5 | #define ifIsString(var) if (typeName(var) == typeName("HelloWorld"))
6 | #define ifIsArray(var) if (typeName(var) == typeName([1,0]))
7 |
8 | #define ifStringIsSet(var) if (var != "")
9 | #define ifArrayIsSet(array) if (((array select 0) != "") AND ((array select 1) > 0) AND (((array select 1) % 1) == 0))
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/init.sqf:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // Initialization File
11 | //
12 | //*************************************************************************************************
13 | #include "f\script_macros.hpp"
14 |
15 | // DISABLE ACE MEDICAL EXTRA SUPPLIES + AI MEDICAL FOR PERFORMANCE
16 | ace_sys_wounds_no_medical_gear = true;
17 | ace_sys_wounds_noai = true;
18 |
19 | // Settings
20 | _settings = call compile preprocessfilelinenumbers defDir(settings.sqf);
21 | _ORBATParams = _settings select 0;
22 | _teamRosterParams = _settings select 1;
23 |
24 | // Function Initialization
25 | CRACK_fnc_addMagArray = compile preprocessfilelinenumbers defDir(f\fnc_addMagArray.sqf);
26 | CRACK_fnc_addEarProtection = compile preprocessfilelinenumbers defDir(f\fnc_addEarProtection.sqf);
27 | CRACK_fnc_addRuckMagArray = compile preprocessfilelinenumbers defDir(f\fnc_addRuckMagArray.sqf);
28 | CRACK_fnc_addRuckWepArray = compile preprocessfilelinenumbers defDir(f\fnc_addRuckWepArray.sqf);
29 | CRACK_fnc_selectPrimaryWep = compile preprocessfilelinenumbers defDir(f\fnc_selectPrimaryWep.sqf);
30 | CRACK_fnc_rucksackOperations = compile preprocessfilelinenumbers defDir(f\fnc_rucksackOperations.sqf);
31 | CRACK_fnc_setLoadout = compile preprocessfilelinenumbers defDir(f\fnc_setLoadout.sqf);
32 |
33 | // Waiting for the player to join the game
34 | if (!isdedicated) then {
35 | waitUntil {!isNull player};
36 | };
37 |
38 | // Team Roster Script Initialization
39 | if (!isdedicated AND (_teamRosterParams select 0)) then {nul = _teamRosterParams execVM defDir(scripts\team_roster\team_roster.sqf);};
40 |
41 | // ORBAT Initialization
42 | nul = _ORBATParams execVM defDir(ORBATS\init.sqf);
43 |
44 |
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/scripts/team_roster/README.txt:
--------------------------------------------------------------------------------
1 | // Team Roster Script v1
2 | // By Crackman
3 | //
4 | // You can contact me at dylanplecki@gmail.com
5 | // Or on the United Operations forums as crackman
6 | //
7 | // Script Description:
8 | // This script will make an entry in the map screen that will show all players and their unit's description, so Leaders can now who their subordinates are, vis versa, and so on
9 | // ***********************************************************************************************************************************************
10 | // Notes:
11 | // Usage:
12 | // EVERY PLAYABLE UNIT REQUIRES A NAME. Read Below.
13 | // The first word BEFORE THE UNDERSCORE ("_") of a Unit's name will act as its description, so a unit with the name "Grenadier_1_4" will have a description of "Grenadier"
14 | // If "69" appears before the first underscore, it will be turned into a space. So 69 = Space. Ex - "Squad69Leader_1_4" = "Squad Leader"
15 | // Arma Group Names can be changed by putting this into the leaders INIT field: '(group this) setGroupId ["1'4 Delta","GroupColor0"];' (without beginning and ending apostrophes, 1'4 Delta Squad can be changed)
16 | // if (!isdedicated) then {nul = [] execVM "scripts\team_roster.sqf";}; //Add this line into init.sqf
17 | //
18 | // Known Issues:
19 | // Until BI comes out with a way to delete Diary Entries, this script may take up a little memory (About 300KB Total for 50 players on an hour long mission with standard 61 sec cycle)
20 | // Formula for calculating Total Roster Size: Size(In KB) = (Number of players * .1) * (Mission Time / Cycle Time)
21 | // ***********************************************************************************************************************************************
--------------------------------------------------------------------------------
/Arma 2/ORBAT/CRACK_ORBAT/settings.sqf:
--------------------------------------------------------------------------------
1 | // _____ _____ _____ _ __ ____ _____ ____ _______
2 | // / ____| | __ \ /\ / ____| | |/ / / __ \ | __ \ | _ \ /\ |__ __|
3 | // | | | |__) | / \ | | | ' / | | | | | |__) | | |_) | / \ | |
4 | // | | | _ / / /\ \ | | | < | | | | | _ / | _ < / /\ \ | |
5 | // | |____ | | \ \ / ____ \ | |____ | . \ | |__| | | | \ \ | |_) | / ____ \ | |
6 | // \_____| |_| \_\ /_/ \_\ \_____| |_|\_\ \____/ |_| \_\ |____/ /_/ \_\ |_|
7 | //
8 | //*************************************************************************************************
9 | //
10 | // Settings File
11 | //
12 | //*************************************************************************************************
13 |
14 | // ORBATS and Loadouts ----------------------------------------------------------------------------
15 |
16 | _ORBATS = [ // ORBATS in use in the current mission, check the ORBAT.sqf for the faction for syntax
17 | //["CRACK_ORBATS_US_ARMY", [1, 1, 2, 2, 0, 0, 1, 1]], // Default US Army ORBAT
18 | //["CRACK_ORBATS_USMC", [1, 1, 2, 2, 0, 0, 1, 1]], // Default USMC ORBAT
19 | //["CRACK_ORBATS_SHACKTAC", [1, 1, 2, 2, 0, 0, 1, 1]] // Default ShackTac ORBAT
20 | ];
21 |
22 | // Team Roster Script -----------------------------------------------------------------------------
23 |
24 | _teamRosterOn = true; // True to turn the Team Roster on, False to turn it off
25 |
26 | _cycle_time = 301; // Time between each update of the list in seconds, shorter values provide more accuracy but may decrease FPS and memory, each loop is "Logged" in diary
27 | _diary_subject = "Team Roster"; // Text to be shown as the subject in the Map Screen, like Notes and Units.
28 | _arma_group = true; // Toggles whether to show Arma Group ID (ex. B 1-1-A), true is on and false is off (Most useful to turn off when you have already included group in description)
29 | _end_condition = true; // Condition to end script, it will stop updating the Roster but will keep units already listed, true for always on
30 |
31 | //-------------------------------------------------------------------------------------------------
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | // Sends settings to parent script, *** DO NOT MODIFY ***
82 | _results = [_ORBATS, [_teamRosterOn,_cycle_time,_diary_subject,_arma_group,_end_condition]];
83 | _results
--------------------------------------------------------------------------------
/Arma 2/Set Identity Script/set_identity.sqf:
--------------------------------------------------------------------------------
1 | // SetIdentity Script
2 | // By: Crackman
3 | //
4 | // In init.sqf: nul = [] execVM "scripts\set_identity.sqf";
5 | //********************************************************
6 | // Initialization
7 | _numberOfIdentities = 23;
8 | HELL_identities = [];
9 | HELL_enabledSides = [EAST, CIVILIAN];
10 | if (isnil "HELL_finishedIdent") then {HELL_finishedIdent = [];};
11 |
12 | for "_i" from 1 to _numberOfIdentities do {
13 | _newIdentity = format["Identity%1", _i];
14 | HELL_identities = HELL_identities + [_newIdentity];
15 | };
16 |
17 | HELL_setIdentity = {
18 | {
19 | _man = _x select 0;
20 | _index = _x select 1;
21 | if (!(_man in HELL_finishedIdent)) then {
22 | _man setIdentity (HELL_identities select _index);
23 | HELL_finishedIdent = HELL_finishedIdent + [_man];
24 | };
25 | } foreach HELL_broadcastedIdentities;
26 |
27 | };
28 |
29 | HELL_playerInit = {
30 | if ((side player) in HELL_enabledSides) then {
31 | _playerDone = false;
32 | {
33 | if ((_x select 0) == player) exitWith {_playerDone = true;};
34 | } foreach HELL_broadcastedIdentities;
35 | if (!_playerDone) then { // Continues if the player isn't in the array, ie. JIP
36 | _index = (floor(random((count HELL_identities) - 1)));
37 | HELL_broadcastedIdentities = HELL_broadcastedIdentities + [[player, _index]];
38 | publicvariable "HELL_broadcastedIdentities";
39 | player setIdentity (HELL_identities select _index);
40 | };
41 | };
42 | };
43 |
44 | HELL_onPlayerDeath = {
45 | if (isServer) then {
46 | _exit = false;
47 | _count = (count HELL_broadcastedIdentities) - 1;
48 | for "_i" from 0 to _count do {
49 | _array = HELL_broadcastedIdentities select _i;
50 | if ((_array select 0) == (_this select 0)) then {
51 | HELL_broadcastedIdentities set [_i, (HELL_broadcastedIdentities select _count)];
52 | HELL_broadcastedIdentities resize _count;
53 | publicvariable "HELL_broadcastedIdentities";
54 | _exit = true;
55 | };
56 | if (_exit) exitwith {};
57 | };
58 | };
59 | if (!isDedicated AND ((_this select 0) == player)) then {
60 | waitUntil {!isNull player};
61 | [] call HELL_playerInit;
62 | };
63 | };
64 |
65 | // Script
66 |
67 | if (isserver) then {
68 | private ["_index"];
69 | HELL_broadcastedIdentities = [];
70 | {
71 | if ((side _x) in HELL_enabledSides) then {
72 | _index = (floor(random((count HELL_identities) - 1)));
73 | HELL_broadcastedIdentities = HELL_broadcastedIdentities + [[_x, _index]];
74 | };
75 | } foreach allUnits;
76 | publicvariable "HELL_broadcastedIdentities";
77 | } else {
78 | waituntil {!isnil "HELL_broadcastedIdentities"};
79 | waituntil {!isnull player};
80 | };
81 |
82 | [] call HELL_setIdentity;
83 | "HELL_broadcastedIdentities" addPublicVariableEventHandler HELL_setIdentity;
84 |
85 | if (!isdedicated) then {
86 | sleep 1;
87 | player addMPEventHandler ["mpkilled", {_this call HELL_onPlayerDeath;}];
88 | [] call HELL_playerInit;
89 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/action.sqf:
--------------------------------------------------------------------------------
1 | private ["_code", "_target", "_id"];
2 |
3 | _target = _this select 0; // Usually local player
4 |
5 | _caller = if (count _this > 1) then {(_this select 1)} else {"nil"};
6 | _id = if (count _this > 2) then {(_this select 2)} else {"nil"};
7 | _code = if (count _this > 3) then {(_this select 3)} else {"false"};
8 |
9 | if (typename(_code) == typename("String")) then {
10 | _code = compile _code;
11 | };
12 |
13 | [_target, _caller, _id] spawn _code;
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/defines.hpp:
--------------------------------------------------------------------------------
1 | #define SCRIPTPATH scripts\surrender
2 | #define GETSCRIPTPATH(var1) SCRIPTPATH\##var1
3 |
4 | #define COMPONENT surrender
5 |
6 | #define PREFIX crack
7 |
8 | #define MAJOR 1
9 | #define MINOR 0
10 | #define PATCHLVL 0
11 | #define BUILD 1
12 |
13 | #define VERSION MAJOR.MINOR.PATCHLVL.BUILD
14 | #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
15 |
16 | // MINIMAL required version for the Mod. Components can specify others..
17 | #define REQUIRED_VERSION 1.62
18 |
19 | /*
20 | #define DEBUG_ENABLED_SYS_MAIN
21 | */
22 |
23 | // #define DEBUG_MODE_FULL
24 |
25 | #ifdef DEBUG_ENABLED_MAIN
26 | #define DEBUG_MODE_FULL
27 | #endif
28 |
29 | #include "\x\cba\addons\main\script_macros_common.hpp"
30 |
31 | // Default versioning level
32 | #define DEFAULT_VERSIONING_LEVEL 2
33 |
34 | // RGB Colors
35 | #define RGB_GREEN 0, 0.5, 0, 1
36 | #define RGB_BLUE 0, 0, 1, 1
37 | #define RGB_ORANGE 0.5, 0.5, 0, 1
38 | #define RGB_RED 1, 0, 0, 1
39 | #define RGB_YELLOW 1, 1, 0, 1
40 | #define RGB_WHITE 1, 1, 1, 1
41 | #define RGB_GRAY 0.5, 0.5, 0.5, 1
42 | #define RGB_BLACK 0, 0, 0, 1
43 | #define RGB_MAROON 0.5, 0, 0, 1
44 | #define RGB_OLIVE 0.5, 0.5, 0, 1
45 | #define RGB_NAVY 0, 0, 0.5, 1
46 | #define RGB_PURPLE 0.5, 0, 0.5, 1
47 | #define RGB_FUCHSIA 1, 0, 1, 1
48 | #define RGB_AQUA 0, 1, 1, 1
49 | #define RGB_TEAL 0, 0.5, 0.5, 1
50 | #define RGB_LIME 0, 1, 0, 1
51 | #define RGB_SILVER 0.75, 0.75, 0.75, 1
52 |
53 | // Some Functions for Functions
54 | #define PATHTO_FUNC(var1,var2,var3) SCRIPTPATH\f\##var3.sqf
55 | #define COMPILE_FILE_FUNC(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_FUNC(var1,var2,var3)')
56 | #define PREP_FUNC2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_FUNC(var1,var3,DOUBLES(fnc,var4))
57 | #define PREPFUNC(var1) PREP_FUNC2(PREFIX,COMPONENT,COMPONENT_F,var1)
58 |
59 | // Some Functions for the API
60 | #define PATHTO_API(var1,var2,var3) SCRIPTPATH\api\##var3.sqf
61 | #define COMPILE_FILE_API(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_API(var1,var2,var3)')
62 | #define PREP_API2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_API(var1,var3,DOUBLES(fnc,var4))
63 | #define PREPAPI(var1) PREP_API2(PREFIX,COMPONENT,COMPONENT_F,var1)
64 |
65 | // Some Functions for TEST
66 | #define PATHTO_TEST(var1,var2,var3) SCRIPTPATH\test\##var3.sqf
67 | #define COMPILE_FILE_TEST(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_TEST(var1,var2,var3)')
68 | #define PREP_TEST2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_TEST(var1,var3,DOUBLES(fnc,var4))
69 | #define PREPTEST(var1) PREP_TEST2(PREFIX,COMPONENT,COMPONENT_F,var1)
70 |
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_capture.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_target", "_result"];
4 |
5 | _target = _this select 0;
6 |
7 | _result = _target getvariable QUOTE(GVAR(surrenderedStatus));
8 | _result set [1, true];
9 | _target setvariable [QUOTE(GVAR(surrenderedStatus)), _result, true];
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_disableWeapons.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_unit", "_nearAmmoPoints", "_nearestAmmoPoint"];
4 |
5 | _unit = _this select 0;
6 |
7 | while {true} do {
8 |
9 | waituntil { // Idk about the performance here, but oh well :)
10 | ((count (weapons _unit) > 0) OR (count (magazines _unit) > 0));
11 | };
12 |
13 | _nearAmmoPoints = nearestObjects [_unit, ["ReammoBox", "LandVehicle", "Air"], 10];
14 |
15 | if (count _nearAmmoPoints > 0) then {
16 | _nearestAmmoPoint = _nearAmmoPoints select 0;
17 | } else {
18 | _nearestAmmoPoint = "WeaponHolder" createVehicle (getpos _unit);
19 | _nearestAmmoPoint setposATL [(getpos _unit select 0), (getpos _unit select 1), 0];
20 | };
21 |
22 | [_unit, _nearestAmmoPoint, (weapons _unit), (magazines _unit), false] call FUNC(removeWeaponsAndMagsToCache);
23 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_findInNestedArray.sqf:
--------------------------------------------------------------------------------
1 | private ["_array", "_nestedValue", "_nestedValueIndex", "_value", "_index", "_result", "_returnValueIndex"];
2 |
3 | _index = -1;
4 | _result = false;
5 |
6 | _array = _this select 0;
7 | _nestedValue = _this select 1;
8 | _nestedValueIndex = _this select 2;
9 | _returnValueIndex = _this select 3;
10 |
11 | _arrayCount = (count _array) - 1;
12 |
13 | for "_i" from 0 to _arrayCount do {
14 | _value = (_array select _i) select _nestedValueIndex;
15 | if (_value == _nestedValue) exitwith {_index = _i;};
16 | };
17 |
18 | if (_index != -1) then {
19 | _result = (_array select _index) select _returnValueIndex;
20 | };
21 |
22 | _result
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_getNearEnemies.sqf:
--------------------------------------------------------------------------------
1 | Private ["_nearPlayers", "_unitCenter", "_radius", "_nearMen"];
2 |
3 | _nearPlayers = [];
4 | _unitCenter = _this select 0;
5 | _radius = _this select 1;
6 | _nearMen = (getpos _unitCenter) nearobjects ["Man", _radius];
7 |
8 | { // foreach
9 | if ((isplayer _x) && (_x != player) && ((side _x != side player) AND (side _x != civilian))) then {_nearPlayers = _nearPlayers + [_x];};
10 | } foreach _nearMen;
11 | _nearPlayers
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_hintSurrender.sqf:
--------------------------------------------------------------------------------
1 | private ["_playerArray", "_player", "_text"];
2 |
3 | _playerArray = _this select 0;
4 | _player = _this select 1;
5 | _text = _this select 2;
6 |
7 | if (player in _playerArray) then {
8 | hint format[_text, (name _player)];
9 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_interact.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus", "_surrendered", "_captured", "_visible"];
4 |
5 | // _this==[_target, _menuNameOrParams]
6 | _target = _this select 0;
7 | _params = _this select 1;
8 |
9 | _menuName = "";
10 | _menuRsc = "popup";
11 |
12 | if (typeName _params == typeName []) then {
13 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
14 | _menuName = _params select 0;
15 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
16 | } else {
17 | _menuName = _params;
18 | };
19 |
20 | //-----------------------------------------------------------------------------
21 |
22 | _visible = if ((alive _target) AND ((count (_target getvariable [QUOTE(GVAR(surrenderedStatus)), []])) > 0)) then {true} else {false};
23 |
24 | _menus = [
25 | [
26 | ["main", "Main Menu", _menuRsc],
27 | [
28 | ["Prisoner Menu >", "", "", "",
29 | [GVAR(codeStringAceSelfInteract), "prisonermenu", 1],
30 | -1, 1, (_visible)]
31 | ]
32 | ]
33 | ];
34 |
35 | if((_menuName == "prisonermenu") AND _visible) then {
36 |
37 | _surrendered = (_target getvariable QUOTE(GVAR(surrenderedStatus))) select 0;
38 | _captured = (_target getvariable QUOTE(GVAR(surrenderedStatus))) select 1;
39 |
40 | _menus set [count _menus,
41 | [
42 | ["prisonermenu", "Prisoner Menu", "popup", ""],
43 | [
44 | [
45 | "Capture",
46 | { [] call FUNC(capture); },
47 | "", "", "", -1, 1,
48 | (_surrendered AND !_captured), (true)
49 | ],
50 | [
51 | "Release",
52 | { ["CRACK_ceh_releaseUnit", [_target]] call CBA_fnc_globalEvent; },
53 | "", "", "", -1, 1,
54 | (_surrendered AND _captured), (true)
55 | ]
56 | ]
57 | ]
58 | ];
59 | };
60 |
61 | //-----------------------------------------------------------------------------
62 |
63 | _menuDef = [];
64 | {
65 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
66 | } forEach _menus;
67 |
68 | if (count _menuDef == 0) then {
69 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this}else{""}, __FILE__];
70 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
71 | };
72 |
73 | _menuDef // return value
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_onPlayerDeath.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_target", "_result"];
4 |
5 | _target = _this select 0;
6 |
7 | if (isserver) then {
8 | _result = _target getvariable QUOTE(GVAR(surrenderedStatus));
9 | for "_i" from 0 to (count _result - 1) do {
10 | _result set [_i, false];
11 | };
12 | _target setvariable [QUOTE(GVAR(surrenderedStatus)), _result, true];
13 | };
14 |
15 | if (_target == player) then {
16 |
17 | if (!isnil QUOTE(GVAR(scriptHandle_noWeaponScript))) then {
18 | terminate GVAR(scriptHandle_noWeaponScript);
19 | };
20 |
21 | [_target] call FUNC(removeAllActions);
22 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_releaseUnit.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_result", "_target"];
4 |
5 | _target = _this select 0;
6 |
7 | if (_target == player) then {
8 | // Reversing all the variables
9 | _result = _target getvariable QUOTE(GVAR(surrenderedStatus));
10 | for "_i" from 0 to (count _result - 1) do {
11 | _result set [_i, false];
12 | };
13 | _target setvariable [QUOTE(GVAR(surrenderedStatus)), _result, true];
14 | _target setCaptive false;
15 |
16 | // Ending the "No Weapon" script
17 | terminate GVAR(scriptHandle_noWeaponScript);
18 | GVAR(scriptHandle_noWeaponScript) = nil;
19 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_removeAllActions.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_target", "_array", "_indexes", "_selection"];
4 |
5 | _target = _this select 0;
6 | _indexes = [];
7 |
8 | // Remove actions having to do with certain unit
9 | _array = GVAR(surrenderActionIndexes);
10 | for "_i" from 0 to ((count _array) - 1) do {
11 | _selection = _array select _i;
12 |
13 | if ((_selection select 0) == _target) then {
14 | _target removeaction (_selection select 1);
15 | _indexes = _indexes + [_i];
16 | };
17 | };
18 | { // foreach
19 | _array set [_x, (_array select ((count _array) - 1))];
20 | _array resize ((count _array) - 1);
21 | } foreach _indexes;
22 | GVAR(surrenderActionIndexes) = _array;
23 | _array
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_removeFromNestedArray.sqf:
--------------------------------------------------------------------------------
1 | private ["_array", "_nestedValue", "_nestedValueIndex", "_value", "_index", "_result"];
2 |
3 | _index = -1;
4 | _result = false;
5 |
6 | _array = _this select 0;
7 | _nestedValue = _this select 1;
8 | _nestedValueIndex = _this select 2;
9 |
10 | _arrayCount = (count _array) - 1;
11 |
12 | for "_i" from 0 to _arrayCount do {
13 | _value = (_array select _i) select _nestedValueIndex;
14 | if (_value == _nestedValue) exitwith {_index = _i;};
15 | };
16 |
17 | if (_index != -1) then {
18 | _array set [_index, (_array select _arrayCount)];
19 | _array resize _arrayCount;
20 | _result = _array;
21 | };
22 |
23 | _result
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_removeWeaponsAndMagsToCache.sqf:
--------------------------------------------------------------------------------
1 | private ["_target", "_cache", "_weapons", "_mags", "_ace"];
2 |
3 | _target = _this select 0;
4 | _cache = _this select 1;
5 | _weapons = _this select 2;
6 | _mags = _this select 3;
7 | _ace = _this select 4;
8 |
9 | if (!_ace) then {
10 | { // foreach
11 | _target removeWeapon _x;
12 | _cache addWeaponCargoGlobal [_x, 1];
13 | } forEach _weapons;
14 | { // foreach
15 | _target removeMagazine _x;
16 | _cache addMagazineCargoGlobal [_x, 1];
17 | } forEach _mags;
18 | };
19 | if (_ace) then {
20 | {_cache addMagazineCargoGlobal [_x select 0, _x select 1]} forEach _mags;
21 | {_cache addWeaponCargoGlobal _x} forEach _weapons;
22 | };
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_runAway.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_result", "_nearPlayers"];
4 |
5 | // Hint the surrounding players that the target is surrendering.
6 | _nearPlayers = [player, GVAR(runAwayHintRadius)] call FUNC(getNearEnemies);
7 |
8 | // START - Hinted this out for now, for Headshot's benefit
9 | /*
10 | if ((count _nearPlayers) > 0) exitwith {
11 | hint "You can't run now, there are still enemies near you!";
12 | };
13 | */
14 | // END HINTED OUT CODE
15 |
16 | [player] call FUNC(removeAllActions);
17 |
18 | // Executing things to reverse surrender action
19 | _result = player getvariable QUOTE(GVAR(surrenderedStatus));
20 | _result set [0, false];
21 | player setvariable [QUOTE(GVAR(surrenderedStatus)), _result, true];
22 | player setCaptive false;
23 | terminate GVAR(scriptHandle_noWeaponScript);
24 | GVAR(scriptHandle_noWeaponScript) = nil;
25 |
26 | ["CRACK_ceh_hintSurrender", [_nearPlayers, player, "%1 is running away!!!"]] call CBA_fnc_globalEvent;
27 |
28 | [player] call FUNC(addSurrenderAction);
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_selfInteract.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_menuDef", "_target", "_params", "_menuName", "_menuRsc", "_menus", "_surrendered", "_captured"];
4 |
5 | // _this==[_target, _menuNameOrParams]
6 | _target = _this select 0;
7 | _params = _this select 1;
8 |
9 | _menuName = "";
10 | _menuRsc = "popup";
11 |
12 | if (typeName _params == typeName []) then {
13 | if (count _params < 1) exitWith {diag_log format["Error: Invalid params: %1, %2", _this, __FILE__];};
14 | _menuName = _params select 0;
15 | _menuRsc = if (count _params > 1) then {_params select 1} else {_menuRsc};
16 | } else {
17 | _menuName = _params;
18 | };
19 |
20 | //-----------------------------------------------------------------------------
21 |
22 | _menus = [
23 | [
24 | ["main", "Main Menu", _menuRsc],
25 | [
26 | ["Surrender >", "", "", "",
27 | [GVAR(codeStringAceSelfInteract), "surrendermenu", 1],
28 | -1, 1, (true)]
29 | ]
30 | ]
31 | ];
32 |
33 | if(_menuName == "surrendermenu") then {
34 |
35 | _surrendered = (player getvariable QUOTE(GVAR(surrenderedStatus))) select 0;
36 | _captured = (player getvariable QUOTE(GVAR(surrenderedStatus))) select 1;
37 |
38 | _menus set [count _menus,
39 | [
40 | ["surrendermenu", "Surrender Menu", "popup", ""],
41 | [
42 | [
43 | "Surrender",
44 | { [] call FUNC(surrender); },
45 | "", "", "", -1, 1,
46 | (!(_surrendered) AND !(_captured)), (true)
47 | ],
48 | [
49 | "Run Away",
50 | { [] call FUNC(runAway); },
51 | "", "", "", -1, 1,
52 | (_surrendered AND !_captured), (true)
53 | ],
54 | [
55 | "Take Cyanide",
56 | { [] call FUNC(takeCyanide); },
57 | "", "", "", -1, 1,
58 | (GVAR(cyanide) AND !GVAR(playerIsTakingCyanide)), (true)
59 | ]
60 | ]
61 | ]
62 | ];
63 | };
64 |
65 | //-----------------------------------------------------------------------------
66 |
67 | _menuDef = [];
68 | {
69 | if (_x select 0 select 0 == _menuName) exitWith {_menuDef = _x};
70 | } forEach _menus;
71 |
72 | if (count _menuDef == 0) then {
73 | hintC format ["Error: Menu not found: %1\n%2\n%3", str _menuName, if (_menuName == "") then {_this}else{""}, __FILE__];
74 | diag_log format ["Error: Menu not found: %1, %2, %3", str _menuName, _this, __FILE__];
75 | };
76 |
77 | _menuDef // return value
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_surrender.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_result", "_nearPlayers", "_weapons", "_cache", "_ruckWeapons", "_ruckMags", "_WOB"];
4 |
5 | // Hint the surrounding players that the target is surrendering.
6 | _nearPlayers = [player, GVAR(surrenderHintRadius)] call FUNC(getNearEnemies);
7 | ["CRACK_ceh_hintSurrender", [_nearPlayers, player, "%1 is surrendering!!!"]] call CBA_fnc_globalEvent;
8 |
9 | // Stuff to do to surrender
10 | player playMove GVAR(surrenderAnimation);
11 | player setCaptive true;
12 | GVAR(scriptHandle_noWeaponScript) = [player] spawn FUNC(disableWeapons);
13 |
14 | // Drop weapons/magazines on ground
15 | _weapons = weapons player;
16 | _mags = magazines player;
17 | _cache = "WeaponHolder" createVehicle (getpos player);
18 | _cache setposATL [(getpos player select 0), (getpos player select 1), 0]; // (getpos player)
19 |
20 | [player, _cache, _weapons, _mags, false] call FUNC(removeWeaponsAndMagsToCache);
21 |
22 | // ACE Weapon Removal
23 | if ([player] call ACE_fnc_HasRuck) then {
24 |
25 | _ruckWeapons = [player] call ACE_fnc_RuckWeaponsList;
26 | _ruckMags = [player] call ACE_fnc_RuckMagazinesList;
27 |
28 | [player, _cache, _ruckWeapons, _ruckMags, true] call FUNC(removeWeaponsAndMagsToCache);
29 |
30 | [player, "BTH"] call ACE_fnc_RemoveGear;
31 |
32 | };
33 |
34 | _WOB = [player] call ACE_fnc_WeaponOnBackName;
35 |
36 | if (_WOB != "") then {
37 |
38 | [player, "WOB"] call ACE_fnc_RemoveGear;
39 | _cache addWeaponCargoGlobal [_WOB, 1];
40 |
41 | };
42 |
43 | // So other units can capture the player
44 | _result = player getvariable QUOTE(GVAR(surrenderedStatus));
45 | _result set [0, true];
46 | player setvariable [QUOTE(GVAR(surrenderedStatus)), _result, true];
--------------------------------------------------------------------------------
/Arma 2/Surrender Script/scripts/surrender/f/fnc_takeCyanide.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | private ["_index"];
4 |
5 | if (!isdedicated) then {
6 |
7 | _index = player addaction ["ABORT CYANIDE", QUOTE(GETSCRIPTPATH(action.sqf)), {GVAR(canceledCyanide) = true;}, 99999, false, true, "", ""];
8 | GVAR(surrenderActionIndexes) = GVAR(surrenderActionIndexes) + [[player, _index]];
9 | GVAR(playerIsTakingCyanide) = true;
10 |
11 | [_index] spawn {
12 | private ["_index", "_willDie", "_timer"];
13 |
14 | _index = _this select 0;
15 | _willDie = true;
16 | _timer = 11;
17 |
18 | for "_i" from 1 to _timer do {
19 | hint format ["You are taking Cyanide\nThis will kill you\n\nTo abort, use the scroll wheel\n\nDeath in:\n%1 seconds", (_timer - _i)];
20 | sleep 1;
21 | if (!isnil QUOTE(GVAR(canceledCyanide))) exitwith {
22 | _willDie = false;
23 | GVAR(canceledCyanide) = nil;
24 | hint "Cyanide dosage cancelled!";
25 | };
26 | };
27 |
28 | player removeaction _index;
29 |
30 | if (_willDie) then {
31 | hintsilent "";
32 | sleep .2;
33 | [player, "ACE_Scream237"] call CBA_fnc_globalSay3d;
34 | sleep (1 + random(1));
35 | };
36 |
37 | GVAR(playerIsTakingCyanide) = false;
38 |
39 | if (_willDie) then {
40 | player setdamage 1;
41 | };
42 | };
43 | };
--------------------------------------------------------------------------------
/Arma 2/Team Roster/Team_Roster_1_4_dev.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Team Roster/Team_Roster_1_4_dev.rar
--------------------------------------------------------------------------------
/Arma 2/Team Roster/scripts/teamRoster/f/defines.hpp:
--------------------------------------------------------------------------------
1 | #define SCRIPTPATH scripts\teamRoster
2 | #define GETSCRIPTPATH(var1) SCRIPTPATH\##var1
3 | #define GETSCRIPTPATHQ(var1) QUOTE(GETSCRIPTPATH(var1))
4 |
5 | #define COMPONENT teamRoster
6 |
7 | #define PREFIX naught
8 |
9 | #define MAJOR 1
10 | #define MINOR 4
11 |
12 | #define VERSION MAJOR.MINOR
13 | #define VERSION_AR MAJOR,MINOR
14 |
15 | // MINIMAL required version for the Mod. Components can specify others..
16 | #define REQUIRED_VERSION 1.0
17 |
18 | /*
19 | #define DEBUG_ENABLED_SYS_MAIN
20 | */
21 |
22 | // #define DEBUG_MODE_FULL
23 |
24 | #ifdef DEBUG_ENABLED_MAIN
25 | #define DEBUG_MODE_FULL
26 | #endif
27 |
28 | #include "\x\cba\addons\main\script_macros_common.hpp"
29 |
30 | // Default versioning level
31 | #define DEFAULT_VERSIONING_LEVEL 2
32 |
33 | // RGB Colors
34 | #define RGB_GREEN 0, 0.5, 0, 1
35 | #define RGB_BLUE 0, 0, 1, 1
36 | #define RGB_ORANGE 0.5, 0.5, 0, 1
37 | #define RGB_RED 1, 0, 0, 1
38 | #define RGB_YELLOW 1, 1, 0, 1
39 | #define RGB_WHITE 1, 1, 1, 1
40 | #define RGB_GRAY 0.5, 0.5, 0.5, 1
41 | #define RGB_BLACK 0, 0, 0, 1
42 | #define RGB_MAROON 0.5, 0, 0, 1
43 | #define RGB_OLIVE 0.5, 0.5, 0, 1
44 | #define RGB_NAVY 0, 0, 0.5, 1
45 | #define RGB_PURPLE 0.5, 0, 0.5, 1
46 | #define RGB_FUCHSIA 1, 0, 1, 1
47 | #define RGB_AQUA 0, 1, 1, 1
48 | #define RGB_TEAL 0, 0.5, 0.5, 1
49 | #define RGB_LIME 0, 1, 0, 1
50 | #define RGB_SILVER 0.75, 0.75, 0.75, 1
51 |
52 | // Some Functions for Functions
53 | #define PATHTO_FUNC(var1,var2,var3) SCRIPTPATH\f\##var3.sqf
54 | #define COMPILE_FILE_FUNC(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_FUNC(var1,var2,var3)')
55 | #define PREP_FUNC2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_FUNC(var1,var3,DOUBLES(fnc,var4))
56 | #define PREPFUNC(var1) PREP_FUNC2(PREFIX,COMPONENT,COMPONENT_F,var1)
57 |
58 | // Some Functions for the API
59 | #define PATHTO_API(var1,var2,var3) SCRIPTPATH\api\##var3.sqf
60 | #define COMPILE_FILE_API(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_API(var1,var2,var3)')
61 | #define PREP_API2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_API(var1,var3,DOUBLES(fnc,var4))
62 | #define PREPAPI(var1) PREP_API2(PREFIX,COMPONENT,COMPONENT_F,var1)
63 |
64 | // Some Functions for TEST
65 | #define PATHTO_TEST(var1,var2,var3) SCRIPTPATH\test\##var3.sqf
66 | #define COMPILE_FILE_TEST(var1,var2,var3) COMPILE_FILE2_SYS('PATHTO_TEST(var1,var2,var3)')
67 | #define PREP_TEST2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_TEST(var1,var3,DOUBLES(fnc,var4))
68 | #define PREPTEST(var1) PREP_TEST2(PREFIX,COMPONENT,COMPONENT_F,var1)
69 |
70 | // Parameters stuff
71 | #define GETPARAM(var1) (GVAR(parameters) select var1)
--------------------------------------------------------------------------------
/Arma 2/Team Roster/scripts/teamRoster/f/fnc_abbreviateRank.sqf:
--------------------------------------------------------------------------------
1 | //#include "defines.hpp"
2 |
3 | private ["_man", "_rankId", "_rank"];
4 |
5 | _man = _this select 0;
6 |
7 | _rankId = rankId _man;
8 |
9 | switch (_rankId) do
10 | {
11 | case 0: {_rank = "Pvt. ";};
12 | case 1: {_rank = "Cpl. ";};
13 | case 2: {_rank = "Sgt. ";};
14 | case 3: {_rank = "Lt. ";};
15 | case 4: {_rank = "Cpt. ";};
16 | case 5: {_rank = "Maj. ";};
17 | case 6: {_rank = "Col. ";};
18 | default {_rank = "";};
19 | };
20 |
21 | // Return Value
22 | _rank
--------------------------------------------------------------------------------
/Arma 2/Team Roster/scripts/teamRoster/f/fnc_getPlayerEntry.sqf:
--------------------------------------------------------------------------------
1 | #include "defines.hpp"
2 |
3 | //----------------------
4 |
5 | private ["_player", "_string", "_playerDesc"];
6 | _player = _this select 0;
7 | _string = GETPARAM(5);
8 |
9 | if ((leader (group _player)) == _player) then {
10 | if (GETPARAM(0)) then {
11 | _string = "
" + _string + (format["%1%2", (group _player), GETPARAM(7)]);
12 | };
13 | } else {
14 | _string = _string + (GETPARAM(1));
15 | };
16 |
17 | _playerDesc = [str player, GETPARAM(8)] call CBA_fnc_split;
18 | if ((count _playerDesc) > 0) then {
19 | _playerDesc = [_playerDesc, GETPARAM(6), " "] call CBA_fnc_replace;
20 | } else {_playerDesc = "";};
21 |
22 | if (_playerDesc == "") then {
23 | _playerDesc = "Player";
24 | };
25 |
26 | _string = _string + ([_player] call FUNC(abbreviateRank)) + (name _player) + " (" + _playerDesc + ")"; // "Alpha Squad - Sgt. Crackman (Squad Leader)" or " Pvt. Crackman (Machinegunner)"
27 |
28 | // FireTeam Coloring Code
29 | if (((GETPARAM(12) == "1") || (GETPARAM(12) == "2")) && !{(GETPARAM(12) == "1") AND !(_player in (units (group player)))}) then {
30 | private ["_team"];
31 | _team = if (isMultiplayer) then {
32 | _player getVariable ["ST_FTHud_assignedTeam", "MAIN"]; // NEEDS ST FT HUD TO WORK ACCURATELY ON MP
33 | } else {
34 | assignedTeam _player; // SINGLEPLAYER ONLY
35 | };
36 |
37 | private ["_color"];
38 | switch (_team) do {
39 | case "MAIN": {_color = "#ffffff"};
40 | case "RED": {_color = "#ff0000"};
41 | case "BLUE": {_color = "#0000ff"};
42 | case "GREEN": {_color = "#00ff00"};
43 | case "YELLOW": {_color = "#ffff00"};
44 | };
45 |
46 | _string = (format ["", _color]) + _string + "";
47 | };
48 |
49 | _string = _string + "
";
50 |
51 | //----------------------
52 |
53 | // Return Value
54 | _string
--------------------------------------------------------------------------------
/Arma 2/Team Roster/scripts/teamRoster/loop.sqf:
--------------------------------------------------------------------------------
1 | #include "f\defines.hpp"
2 |
3 | //----------------------
4 |
5 | private ["_i"];
6 | _i = 1;
7 | while {([_i] call compile GETPARAM(4))} do {
8 | private ["_usedGroups", "_groups", "_allUnits", "_side"];
9 | _usedGroups = [];
10 | _groups = [];
11 | _allUnits = call compile GETPARAM(9);
12 | _side = playerSide;
13 |
14 | /*
15 | // Workaround for when players die/need revive
16 | if (alive player) then {
17 | player setVariable [QUOTE(GVAR(lastSavedSide)), _side];
18 | } else {
19 | _side = player getVariable [QUOTE(GVAR(lastSavedSide)), _side];
20 | };
21 | */
22 |
23 | private ["_j"];
24 | _j = 0;
25 | { // forEach
26 | private ["_group"];
27 | _group = group _x;
28 |
29 | if !(_group in _usedGroups) then {
30 | private ["_groupArray"];
31 | _groupArray = [];
32 | _usedGroups set [_j, _group];
33 |
34 | { // forEach
35 | if ((side _x) == _side) then {
36 | if !(_x in GETPARAM(10)) then {
37 | private ["_leadership"];
38 | _leadership = (leader _group) == _x;
39 | if (((GETPARAM(13) == "0") && _leadership) ||
40 | ((GETPARAM(13) == "1") && (_leadership || (_x in (units (group player))))) ||
41 | (GETPARAM(13) == "2")
42 | ) then {
43 | _groupArray set [(([_x] call CBA_fnc_getGroupIndex) - 1), ([_x] call FUNC(getPlayerEntry))];
44 | };
45 | };
46 | };
47 | } forEach (units _group);
48 |
49 | if ((count _groupArray) > 0) then {
50 | _groups set [_j, _groupArray];
51 | _j = _j + 1;
52 | };
53 | };
54 |
55 | } forEach _allUnits;
56 |
57 | private ["_text"];
58 | _text = "
" + ([GETPARAM(11), ":SIDE:", str(_side)] call CBA_fnc_replace) + "
--------------------------------------------------
";
59 |
60 | { // forEach
61 | if ((typeName _x) == (typeName [])) then {
62 | { // forEach
63 | if ((typeName _x) == (typeName "String")) then {
64 | _text = _text + _x;
65 | };
66 | } forEach _x;
67 | };
68 | } forEach _groups;
69 |
70 | player createDiaryRecord ["roster", [(format["%1 (%2) - %3", GETPARAM(14), _side, _i]), _text]];
71 |
72 | // Waiting for Next Synchronized Iteration
73 | private ["_time"];
74 | _time = time + (GETPARAM(2) - (time % GETPARAM(2)));
75 | waitUntil {uisleep 0.5; time > _time;};
76 |
77 | _i = _i + 1;
78 | };
--------------------------------------------------------------------------------
/Arma 2/Team Roster/scripts/teamRoster/parameters.sqf:
--------------------------------------------------------------------------------
1 | // GETPARAM(var1)
2 |
3 | #include "f\defines.hpp"
4 |
5 | //***********************************************************************************************************************************************
6 |
7 | //======================================================//
8 | //===================== Parameters =====================//
9 | //======================================================//
10 | GVAR(parameters) = [
11 |
12 | true, // 0 - ArmaGroup - Toggles whether to show Arma Group ID (ex. B 1-1-A or anything else set by the MM) (DEFAULT: true)
13 | " ", // 1 - BeginningChar - Leading character to seperate Squad Members from their leaders, like an indent (DEFAULT: " ")
14 | (5 * 60), // 2 - CycleTime - Time between each update of the list in seconds (DEFAULT: 300)
15 | "Team Roster", // 3 - SubjectText - Text to be shown as the subject in the Map Screen(DEFAULT: "Team Roster")
16 | "true", // 4 - LoopCondition - Conditional statement for loop; it will end on this returning false (DEFAULT: true)
17 | "", // 5 - StartingString - The initial string for all lines logged to the roster (DEFAULT: "")
18 | "99", // 6 - SpaceChar - Character(s) in a unit's name which will create a space in the printed diary entry (DEFAULT: "99")
19 | " - ", // 7 - DividerChar - Character(s) that will serve as a divider for all parts of a line (DEFAULT: " - ")
20 | "_", // 8 - SplitChar - Character(s) that will end a unit's name (all text before the first instance of this character is used) (DEFAULT: "_")
21 | "call CBA_fnc_players", // 9 - UnitArray - String of command for all units to be included in Roster (DEFAULT: "call CBA_fnc_players")
22 | [], // 10 - SkippedUnits - Array of all units NOT to be included in Roster regardless of side (DEFAULT: [])
23 | "Team Roster (:SIDE:)", // 11 - HeaderText - Text to be shown above the Team Roster, ":SIDE:" represent's player's side (DEFAULT: "Team Roster (:SIDE:)")
24 | "1", // 12 - FireteamColor - Coloring of fireteams on the Team Roster, "0" = off, "1" = player's squad only, "2" = all units (DEFAULT: "1")
25 | "2", // 13 - Confidentiality - Controls who a player can see on their roster, "0" = leadership, "1" = player's squad + leadership, "2" = all units (DEFAULT: "2")
26 | "Team Roster", // 14 - DiaryTitle - Title in the Diary section of the Map Screen (left-most control) (DEFAULT: "Team Roster")
27 | true // 15 - PlayerDesc - Toggle whether a description should be shown for each player, setting to false will disable parameter 6 also (DEFAULT: true)
28 | ];
29 |
30 | //***********************************************************************************************************************************************
--------------------------------------------------------------------------------
/Arma 2/Tracking Script/tracking.sqf:
--------------------------------------------------------------------------------
1 | if (isServer) then {
2 | CRACK_track_briefcase_object = briefcase; // INSERT NAME OF TRACKING OBJECT HERE
3 | publicVariable "CRACK_track_briefcase_object";
4 |
5 | CRACK_track_loopTime = 30; // Loop Time for Tracking
6 | publicVariable "CRACK_track_loopTime";
7 | };
8 |
9 | if (!isdedicated) then {
10 |
11 | _condition = true;
12 |
13 | waituntil {!isnil "CRACK_track_briefcase_object" AND !isNil "CRACK_track_loopTime"};
14 |
15 | if (time == 0) then {sleep .01;};
16 |
17 | _centerMarker = createMarkerLocal ["briefcase_location_tracking_marker_center", [0,0,0]];
18 | _centerMarker setMarkerShapeLocal "ICON";
19 | _centerMarker setMarkerTypeLocal "Dot";
20 | _centerMarker setMarkerAlphaLocal 1;
21 | _centerMarker setMarkerSizeLocal [.8, .8];
22 | _centerMarker setMarkerColorLocal "ColorBlue";
23 |
24 | _circleMarker = createMarkerLocal ["briefcase_location_tracking_marker_circle", [0,0,0]];
25 | _circleMarker setMarkerShapeLocal "ELLIPSE";
26 | _circleMarker setMarkerBrushLocal "Solid";
27 | _circleMarker setMarkerAlphaLocal 0.3;
28 | _circleMarker setMarkerSizeLocal [10, 10];
29 | _circleMarker setMarkerColorLocal "ColorBlue";
30 |
31 | _perimeterMarker = createMarkerLocal ["briefcase_location_tracking_marker_perimeter", [0,0,0]];
32 | _perimeterMarker setMarkerShapeLocal "ELLIPSE";
33 | _perimeterMarker setMarkerBrushLocal "Border";
34 | _perimeterMarker setMarkerAlphaLocal 0.7;
35 | _perimeterMarker setMarkerSizeLocal [10.05, 10.05];
36 | _perimeterMarker setMarkerColorLocal "ColorBlue";
37 |
38 | _markers = [_centerMarker, _circleMarker, _perimeterMarker];
39 |
40 | _oldPos = [0,0,0];
41 |
42 | while {_condition} do {
43 |
44 | _briefcasepos = getpos CRACK_track_briefcase_object;
45 |
46 | //player sideChat (format["%1 ...:::... %2",_oldPos,_briefcasepos]); // DEBUGGING CODE
47 |
48 | if (((_briefcasepos select 0) != (_oldPos select 0)) OR ((_briefcasepos select 1) != (_oldPos select 1)) OR ((_briefcasepos select 2) != (_oldPos select 2))) then {
49 | _oldPos = _briefcasepos;
50 | // Randomizing Function
51 | _briefcasepos = [(((_briefcasepos select 0) + 4) - random(8)),(((_briefcasepos select 1) + 4) - random(8)),(_briefcasepos select 2)];
52 | };
53 |
54 | //player sideChat (format["%1 ...:::... %2",_oldPos,_briefcasepos]); // DEBUGGING CODE
55 |
56 | {
57 | _x setMarkerPosLocal _briefcasepos;
58 | } foreach _markers;
59 |
60 | _time = time + (CRACK_track_loopTime - (time % CRACK_track_loopTime)); // REMEMBER THIS PERFECT ALGORITHM
61 | waitUntil {sleep 0.1; time > _time;};
62 | };
63 | };
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/description.ext:
--------------------------------------------------------------------------------
1 | #include "scripts\unitCaching\description.ext"
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/config.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/config.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/description.ext:
--------------------------------------------------------------------------------
1 |
2 | class Extended_PreInit_EventHandlers
3 | {
4 | UCD_pre_init = "call compile preProcessFileLineNumbers 'scripts\unitCaching\init.sqf'";
5 | //UCD_pre_init = "call ('scripts\unitCaching\init.sqf' call SLX_XEH_COMPILE)";
6 | };
7 |
8 | class Extended_Init_EventHandlers
9 | {
10 | class AllVehicles
11 | {
12 | UCD_veh_init = "_this spawn UCD_fnc_cacheObject";
13 | };
14 | };
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/init.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/init.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/lib/arrays.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/lib/arrays.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/lib/caching.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/lib/caching.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/lib/distribution.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/lib/distribution.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/lib/hashmaps.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/lib/hashmaps.sqf
--------------------------------------------------------------------------------
/Arma 2/Unit Caching/scripts/unitCaching/lib/objects.sqf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 2/Unit Caching/scripts/unitCaching/lib/objects.sqf
--------------------------------------------------------------------------------
/Arma 3/Bullet Tracking/Demo Missions/Bullet_Tracking_Mission.rar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dylanplecki/ArmaScripts/7842f4eebe69f2b15daff86174c9e8e45846cf8a/Arma 3/Bullet Tracking/Demo Missions/Bullet_Tracking_Mission.rar
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/$PREFIX$:
--------------------------------------------------------------------------------
1 | x\uo\addons\debugger
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/XEH/XEH_postInit.sqf:
--------------------------------------------------------------------------------
1 | //
2 | // Arma 3 Debug Console Access
3 | //
4 | // By Crackman [dylanplecki@gmail.com]
5 | // Original by Taosenai (Public Domain)
6 | // Debug Console by Bohemia Interactive
7 | //
8 | ///////////////////////////////////////////////////////////
9 | //
10 | // Post-Initialization
11 | //
12 | ///////////////////////////////////////////////////////////
13 | #include "\x\uo\addons\debugger\script_component.hpp"
14 |
15 | if (isServer) then {
16 | GVAR(adminList) = GVAR(adminListLocal);
17 | publicVariable QUOTE(GVAR(adminList));
18 | };
19 |
20 | // Add key handler an other stuff. (Wait required for A3 CBA. Seems to run this before the display is up otherwise. This wasn't true for A2. But I used CBA_fnc_addDisplayHandler then, so I'm not sure).
21 | if (!isDedicated) then {
22 | [] spawn {
23 | private ["_allowed", "_diaryRecords", "_countSub"];
24 |
25 | waituntil {sleep 0.5; !(isNull (findDisplay 46)) && !(isNull player);};
26 |
27 | _allowed = call FUNC(checkAllowed);
28 |
29 | if (_allowed) then {
30 |
31 | sleep 1; // Init should be done by now
32 |
33 | // Diary Stuff Below
34 | player createDiarySubject ["a3debugconsole", "Debug Console"];
35 |
36 | _diaryRecords = [
37 | ["Documentation", GVAR(docDocumentation)],
38 | ["Functions", GVAR(docFunctions)],
39 | ["Changelog", GVAR(docChangelog)],
40 | ["Credits", GVAR(docCredits)]
41 | ];
42 |
43 | _countSub = (count _diaryRecords) - 1;
44 |
45 | for "_i" from 0 to _countSub do {
46 | private ["_title", "_text"];
47 |
48 | // Have to do it backwards...
49 | _title = (_diaryRecords select (_countSub - _i)) select 0;
50 | _text = (_diaryRecords select (_countSub - _i)) select 1;
51 |
52 | player createDiaryRecord ["a3debugconsole", [_title, _text]];
53 | };
54 |
55 | // Add Display EH
56 | GVAR(keyDownEHID) = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call " + QUOTE(FUNC(keyHandler)) + ";"];
57 |
58 | };
59 | };
60 | };
61 |
62 | ///////////////////////////////////////////////////////////
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/XEH/XEH_preInit.sqf:
--------------------------------------------------------------------------------
1 | //
2 | // Arma 3 Debug Console Access
3 | //
4 | // By Crackman [dylanplecki@gmail.com]
5 | // Original by Taosenai (Public Domain)
6 | // Debug Console by Bohemia Interactive
7 | //
8 | ///////////////////////////////////////////////////////////
9 | //
10 | // Pre-Initialization
11 | //
12 | ///////////////////////////////////////////////////////////
13 | #include "\x\uo\addons\debugger\script_component.hpp"
14 |
15 |
16 | // Include Manifests
17 | #include "\x\uo\addons\debugger\manifests\support.manifest"
18 | #include "\x\uo\addons\debugger\manifests\functions.manifest"
19 |
20 |
21 | ///////////////////////////////////////////////////////////
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/config.cpp:
--------------------------------------------------------------------------------
1 | class CfgPatches {
2 | class uo_debugger {
3 | units[] = {};
4 | weapons[] = {};
5 | requiredVersion = 1.0;
6 | requiredAddons[] = {"cba_main"};
7 | version = 1.0;
8 | author[] = {"Crackman"};
9 | };
10 | };
11 |
12 | class Extended_PreInit_EventHandlers {
13 | uo_debugger_preInit = "call compile preprocessFileLineNumbers 'x\uo\addons\debugger\XEH\XEH_preInit.sqf'";
14 | };
15 |
16 | class Extended_PostInit_EventHandlers {
17 | uo_debugger_postInit = "call compile preprocessFileLineNumbers 'x\uo\addons\debugger\XEH\XEH_postInit.sqf'";
18 | };
19 |
20 | #include "resources\RscDisplayDebugUO.dialog"
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/functions/fnc_checkAllowed.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | private ["_allowed"];
4 |
5 | _allowed = false;
6 |
7 | if (!isMultiplayer) then {
8 | _allowed = true;
9 | } else {
10 |
11 | /*
12 | // Admin of dedicated server - NOT USED BY UO
13 | if (isDedicated && serverCommandAvailable "#ban") then {
14 | _allowed = true;
15 | };
16 | */
17 |
18 | // Host of multiplayer server
19 | if (isServer) then {
20 | _allowed = true;
21 | };
22 |
23 | // Administrator List Stuff
24 | if (!_allowed) then {
25 |
26 | private ["_waitTime"];
27 |
28 | _waitTime = time + 10;
29 |
30 | waitUntil {(time >= _waitTime) OR (!isNil QUOTE(GVAR(adminList)))};
31 |
32 | if (isNil QUOTE(GVAR(adminList))) then {
33 | GVAR(adminList) = GVAR(adminListLocal);
34 | };
35 |
36 | // Player UID in Administrator List
37 | if ((getPlayerUID player) in GVAR(adminList)) then {
38 | _allowed = true;
39 | };
40 | };
41 | };
42 |
43 | _allowed
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/functions/fnc_keyHandler.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | private["_handled", "_display", "_ctrl", "_keyCode", "_shift", "_alt", "_allowed"];
4 |
5 | _display = _this select 0;
6 | _keyCode = _this select 1;
7 | _shift = _this select 2;
8 | _ctrl = _this select 3;
9 | _alt = _this select 4;
10 |
11 | _handled = false;
12 |
13 | // Are we allowed to use debug commands?
14 | _allowed = call FUNC(checkAllowed);
15 |
16 | if (_allowed) then {
17 |
18 | // CTRL + SHIFT + [KEYCODE]
19 | if (_ctrl && _shift && !_alt && _keyCode == GVAR(keyCode)) then {
20 | /*
21 | // Not Needed?
22 | if (isnull (finddisplay 26)) then {
23 | createDialog "RscDisplayDebugPublicTricker";
24 | };
25 | createDialog "RscDisplayDebugPublicMod";
26 | */
27 | createDialog "RscDisplayDebugUO"; // BASIC
28 | _handled = true;
29 | };
30 |
31 | // CTRL + SHIFT + ALT + [KEYCODE]
32 | if (_ctrl && _shift && _alt && _keyCode == GVAR(keyCode)) then {
33 | createDialog "RscDisplayDebug"; // ADVANCED
34 | _handled = true;
35 | };
36 | };
37 |
38 | _handled;
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/manifests/functions.manifest:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Name: Function-File Manifest
3 | * Description: List of function-type files to be loaded at game start
4 | * Notes: MACRO-BASED MANIFEST
5 | * Parameters: N/A
6 | * Return value: N/A
7 | ******************************************************************************/
8 |
9 | PREPFUNC(checkAllowed);
10 | PREPFUNC(keyHandler);
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/manifests/support.manifest:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Name: Support-File Manifest
3 | * Description: List of support-type files to be loaded at game start
4 | * Notes: CALL-MACRO BASED MANIFEST.
5 | * Parameters: N/A
6 | * Return value: N/A
7 | ******************************************************************************/
8 |
9 | // Script
10 | call COMPILE_FILE_SUPT(adminList);
11 | call COMPILE_FILE_SUPT(defaultSettings);
12 |
13 | // Diary
14 | call COMPILE_FILE_SUPT(changelog);
15 | call COMPILE_FILE_SUPT(credits);
16 | call COMPILE_FILE_SUPT(documentation);
17 | call COMPILE_FILE_SUPT(functions);
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/script_component.hpp:
--------------------------------------------------------------------------------
1 | #define COMPONENT debugger
2 |
3 | // "\x\uo\addons\debugger"
4 | #define COMPONENTPATH \x\uo\addons\debugger
5 |
6 | #include "script_mod.hpp"
7 |
8 | #ifdef DEBUG_ENABLED_MAIN
9 | #define DEBUG_MODE_FULL
10 | #endif
11 |
12 | #ifdef DEBUG_SETTINGS_MAIN
13 | #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
14 | #endif
15 |
16 | #include "script_macros.hpp"
17 |
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/script_macros.hpp:
--------------------------------------------------------------------------------
1 | #include "\x\cba\addons\main\script_macros_common.hpp"
2 |
3 | // Some Functions for Functions
4 | #define PATHTO_FUNC(var1,var2,var3) COMPONENTPATH\functions\##var3.sqf
5 | #define COMPILE_FILE_FUNC(var1,var2,var3) compile preProcessFileLineNumbers 'PATHTO_FUNC(var1,var2,var3)'
6 | #define PREP_FUNC2(var1,var2,var3,var4) ##var1##_##var2##_fnc_##var4 = COMPILE_FILE_FUNC(var1,var3,DOUBLES(fnc,var4))
7 | #define PREPFUNC(var1) PREP_FUNC2(PREFIX,COMPONENT,COMPONENT_F,var1)
8 |
9 | // Some Functions for Support
10 | #define PATHTO_SUPT(var1) COMPONENTPATH\support\##var1.sqf
11 | #define COMPILE_FILE_SUPT(var1) compile preProcessFileLineNumbers 'PATHTO_SUPT(var1)'
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/script_mod.hpp:
--------------------------------------------------------------------------------
1 | // COMPONENT should be defined in the script_component.hpp and included BEFORE this hpp
2 | #define PREFIX uo
3 | // TODO: Consider Mod-wide or Component-narrow versions (or both, depending on wishes!)
4 | #define MAJOR 1
5 | #define MINOR 0
6 | #define PATCHLVL 0
7 | #define BUILD 1
8 |
9 | #define VERSION MAJOR.MINOR.PATCHLVL.BUILD
10 | #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD
11 |
12 | /*
13 | // Defined DEBUG_MODE_NORMAL in a few CBA_fncs to prevent looped logging :)
14 | #ifndef DEBUG_MODE_NORMAL
15 | #define DEBUG_MODE_FULL
16 | #endif
17 | */
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/adminList.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | // List of all Server Administrators' UID's
4 |
5 | GVAR(adminListLocal) = [
6 | // EX: "67981419" // Crackman
7 | ];
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/changelog.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | GVAR(docChangelog) = "
4 |
5 |
///////////////////////////////////////
6 |
/// Debug Console Changelog
7 |
///////////////////////////////////////
8 |
9 |
v1.1
10 |
- Added MP support for the basic debugger
11 |
12 |
v1.0
13 |
- Created
14 | ";
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/credits.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | GVAR(docCredits) = "
4 |
5 |
///////////////////////////////////////
6 |
/// Debug Console Credits
7 |
///////////////////////////////////////
8 |
9 |
By Crackman [dylanplecki@gmail.com]
10 |
Original by Taosenai (Public Domain)
11 |
Debug Console by Bohemia Interactive
12 |
13 |
This version is designed for United Operations.
14 | ";
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/defaultSettings.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | // CTRL + SHIFT (+ ALT) + [KEYCODE] - For activating the consoles
4 | GVAR(keyCode) = 88;
5 | GVAR(keyCodeName) = "F12";
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/documentation.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | GVAR(docDocumentation) = "
4 |
5 |
///////////////////////////////////////
6 |
/// Debug Console Documentation
7 |
///////////////////////////////////////
8 |
9 |
Press Shift-Ctrl-" + GVAR(keyCodeName) + " to open the BIS Splendid Debug (public) tool.
10 |
11 |
Press Shift-Ctrl-Alt-" + GVAR(keyCodeName) + " to open the BIS Splendid Debug (advanced) tool.
12 |
13 |
You must be one of these in order to use the Debug Console:
14 |
- Playing Singleplayer
15 |
- Host of a Multiplayer Server
16 |
- Listed in the Administrator List (By UID)
17 |
18 |
NOTE: This Debug Console is provided by BIS and is baked-in to the game, so any updating of the console is done solely by BIS and not the makers of this script.
19 | ";
--------------------------------------------------------------------------------
/Arma 3/Debug Console Addon/debugger/support/functions.sqf:
--------------------------------------------------------------------------------
1 | #include "\x\uo\addons\debugger\script_component.hpp"
2 |
3 | GVAR(docFunctions) = "
4 |
5 |
///////////////////////////////////////
6 |
/// Debug Console Functions
7 |
///////////////////////////////////////
8 |
9 |
No Functions Yet!
10 |
11 |
Feel free to message me suggestions either on the UO Forums @crackman or by email at dylanplecki@gmail.com
12 | ";
--------------------------------------------------------------------------------