-
Notifications
You must be signed in to change notification settings - Fork 113
Training - Add medical trainning mission #825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kolmipilot
wants to merge
4
commits into
KAT-Advanced-Medical:dev-Tomcat
Choose a base branch
from
kolmipilot:dev-Tomcat
base: dev-Tomcat
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| x\kat\addons\training | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)"; | ||
|
|
||
| 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)"; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
addons/training/missions/MedicTraining.VR/CfgEventHandlers.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| INFO("Loading VR Mission"); | ||
|
|
||
| PREP(createPatient); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
35
addons/training/missions/MedicTraining.VR/fnc_createPatient.sqf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
159
addons/training/missions/MedicTraining.VR/initPlayerLocal.sqf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| if (isServer) then { | ||
| spawned = false; | ||
| publicVariable "spawned"; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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