Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addons/training/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x\kat\addons\training

38 changes: 38 additions & 0 deletions addons/training/RscDisplayMain.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
class RscStandardDisplay;
class RscControlsGroupNoScrollbars;
class RscDisplayMain: RscStandardDisplay {
class controls {
class GroupSingleplayer: RscControlsGroupNoScrollbars {
class Controls;
};
class GroupTutorials: GroupSingleplayer {
h = "(6 * 1.5) * (pixelH * pixelGrid * 2)";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be
h = "(7 * 1.5) * (pixelH * pixelGrid * 2)";

as right now it makes community guides not show


class Controls: Controls {
class Bootcamp;
class Arsenal;
class GVAR(mission): Arsenal {
idc = -1;
text = CSTRING(Mission);
tooltip = CSTRING(Mission_tooltip);
y = "(4 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
onbuttonclick = QUOTE(playMission [ARR_2('','PATHTOF(missions\MedicTraining.VR)')]);

animTextureNormal = QPATHTOF(data\KamMissionLogo.paa);
animTextureDisabled = QPATHTOF(data\KamMissionLogo.paa);
animTextureOver = QPATHTOF(data\KamMissionLogoWhite.paa);
animTextureFocused = QPATHTOF(data\KamMissionLogoWhite.paa);
animTexturePressed = QPATHTOF(data\KamMissionLogo.paa);
animTextureDefault = QPATHTOF(data\KamMissionLogo.paa);

};
class FieldManual: Bootcamp {
y = "(5 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
};
class CommunityGuides: Bootcamp {
y = "(6 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
};
};
};
};
};
33 changes: 33 additions & 0 deletions addons/training/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
requiredVersion = REQUIRED_VERSION;
units[] = { };
weapons[] = {};
magazines[] = { };
requiredAddons[] = {
"kat_main",
"ace_medical",
"ace_medical_ai",
"ace_medical_blood",
"ace_medical_damage",
"ace_medical_engine",
"ace_medical_feedback",
"ace_medical_gui",
"ace_medical_statemachine",
"ace_medical_status",
"ace_medical_treatment",
"ace_medical_vitals",
"ace_dogtags",
"cba_settings"
};
author = "kolmipilot";
authors[] = {"kolmipilot"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "RscDisplayMain.hpp"
Binary file added addons/training/data/KamMissionLogo.paa
Binary file not shown.
Binary file added addons/training/data/KamMissionLogoWhite.paa
Binary file not shown.
12 changes: 12 additions & 0 deletions addons/training/missions/MedicTraining.VR/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// These files are from the VR mission, not the base addon folder
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call compile preprocessFileLineNumbers 'XEH_preInit.sqf');
};
};

class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call compile preprocessFileLineNumbers 'XEH_postInit.sqf');
};
};
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions addons/training/missions/MedicTraining.VR/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "script_component.hpp"

enableSaving [false, false];
cba_diagnostic_projectileMaxLines = 10;
5 changes: 5 additions & 0 deletions addons/training/missions/MedicTraining.VR/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "script_component.hpp"

INFO("Loading VR Mission");

PREP(createPatient);
13 changes: 13 additions & 0 deletions addons/training/missions/MedicTraining.VR/description.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "script_component.hpp"

briefing = 0;
dev = "kolmipilot";
author = "KAM Team";
onLoadName = "KAM medical training";
onLoadMission = "KAT - Advanced Medical Training Mission the KAM Team";
debriefing = 0;
loadScreen = "KAMLogoHighRes.paa";
overviewText = "KAT - Advanced Medical Training Mission by kolmipilot";
enableDebugConsoleSP = 1;

#include "CfgEventHandlers.hpp"
35 changes: 35 additions & 0 deletions addons/training/missions/MedicTraining.VR/fnc_createPatient.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "script_component.hpp"
/*
* Author: kolmipilot
* mission patient handiling
*
* Arguments:
* 0: Mode (damaged = 1, not = 0)<Number>
*
* Return Value:
* Can use NPWT <BOOLEAN>
*
* Example:
* [1] call kat_training_fnc_createPatient
*
* Public: No
*/

params ["_mode"];
private _pos = getPos hspawn;
private _group = createGroup [civilian, true];
private _patient = _group createUnit ["B_Soldier_F", _pos, [], 0, "NONE"];

_patient disableAI "MOVE";
_patient disableAI "FSM";
missionNamespace setVariable ["kat_training_lastPatient", _patient, true];
spawned = true;
publicVariable "spawned";
if (_mode == 1) then {
[_patient, true] call ace_medical_fnc_setUnconscious;
private _selections = ["body", "head", "hand_r", "hand_l", "leg_r", "leg_l"];
for "_i" from 1 to 4 do {
private _sel = selectRandom _selections;
[_patient, 0.8, _sel, "bullet"] call ace_medical_fnc_addDamageToUnit;
};
};
159 changes: 159 additions & 0 deletions addons/training/missions/MedicTraining.VR/initPlayerLocal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
#include "script_component.hpp"

[{!isNull (missionNamespace getVariable ["laptop", objNull])}, {
laptop addAction ["<t color='#00FF00'>[Patient] Spawn: Healthy</t>", {
params ["_target", "_caller"];
[0] call FUNC(createPatient);
[format ["%1 spawned healthy patient.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "!spawned", 5];

laptop addAction ["<t color='#FFCC00'>[Patient] Spawn: Random Injuries</t>", {
params ["_target", "_caller"];
[1] call FUNC(createPatient);
[format ["%1 spawned an injured patient.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "!spawned", 5];

laptop addAction ["<t color='#FF3333'>[Cardiac] Asystole (No Pulse, No Shock)</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
["ace_medical_FatalVitals", [_patient], _patient] call CBA_fnc_targetEvent;
_patient setVariable ["kat_circulation_cardiacArrestType", 0, true];
} else {
[_patient, true] call ace_medical_fnc_setUnconscious;
};
[format ["%1 - Asystole applied.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#FF7744'>[Cardiac] PEA (Fake Pulse, No Shock)</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
["ace_medical_FatalVitals", [_patient], _patient] call CBA_fnc_targetEvent;
_patient setVariable ["kat_circulation_cardiacArrestType", 1, true];
} else {
[_patient, true] call ace_medical_fnc_setUnconscious;
};
[format ["%1 - PEA applied.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#FFAA00'>[Cardiac] V-Fib (Fast Pulse, Shockable)</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
["ace_medical_FatalVitals", [_patient], _patient] call CBA_fnc_targetEvent;
_patient setVariable ["kat_circulation_cardiacArrestType", 2, true];
} else {
[_patient, true] call ace_medical_fnc_setUnconscious;
};
[format ["%1 - V-Fib applied.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#FFFF00'>[Cardiac] V-Tach (Fast Pulse, Shockable)</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
["ace_medical_FatalVitals", [_patient], _patient] call CBA_fnc_targetEvent;
_patient setVariable ["kat_circulation_cardiacArrestType", 3, true];
} else {
[_patient, true] call ace_medical_fnc_setUnconscious;
};
[format ["%1 - V-Tach applied.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#3399FF'>[Breathing] Tension Pneumothorax</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
_patient setVariable ["kat_breathing_tensionpneumothorax", true, true];
_patient setVariable ["kat_breathing_pneumothorax", 4, true];
[_patient] call kat_circulation_fnc_updateInternalBleeding;
} else {
[_patient, 0.8, "body", "wound"] call ace_medical_fnc_addDamageToUnit;
};
[format ["%1 added Tension Pneumothorax.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#9966FF'>[Breathing] Hemopneumothorax</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
_patient setVariable ["kat_breathing_hemopneumothorax", true, true];
_patient setVariable ["kat_breathing_pneumothorax", 4, true];
[_patient] call kat_circulation_fnc_updateInternalBleeding;
} else {
[_patient, 0.8, "body", "wound"] call ace_medical_fnc_addDamageToUnit;
};
[format ["%1 added Hemopneumothorax.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#CC66FF'>[Cardiac] Tamponade</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

if (isClass (configFile >> "CfgPatches" >> "kat_main")) then {
[_patient] call kat_breathing_fnc_createTamponade;
} else {
[_patient, true] call ace_medical_fnc_setUnconscious;
};
[format ["%1 added Cardiac Tamponade.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#FF6600'>[Patient] Add: Random Damage</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!alive _patient) exitWith {
[format ["%1 - No living patient!", name _caller]] remoteExecCall ["systemChat", _caller];
};

private _selections = ["body", "head", "hand_r", "hand_l", "leg_r", "leg_l"];
private _damageTypes = ["grenade", "stab", "bullet", "falling"];
private _count = 2 + floor random 5;
for "_i" from 1 to _count do {
private _sel = selectRandom _selections;
private _dmg = 0.5 + random 0.5;
private _type = selectRandom _damageTypes;
[_patient, _dmg, _sel, _type] call ace_medical_fnc_addDamageToUnit;
};
[format ["%1 added %2 random injuries.", name _caller, _count]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];

laptop addAction ["<t color='#FF0000'>[Patient] Delete patient</t>", {
params ["_target", "_caller"];
private _patient = missionNamespace getVariable ["kat_training_lastPatient", objNull];
if (!isNull _patient) then {
deleteVehicle _patient;
};

spawned = false;
publicVariable "spawned";
[format ["%1 deleted the patient.", name _caller]] remoteExecCall ["systemChat", 0];
}, nil, 1.5, true, true, "", "spawned", 5];
}] call CBA_fnc_waitUntilAndExecute;
4 changes: 4 additions & 0 deletions addons/training/missions/MedicTraining.VR/initServer.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if (isServer) then {
spawned = false;
publicVariable "spawned";
};
Loading
Loading