diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..af1c2ff --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3c59efe --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto +*.png binary +*.jpg binary +*.paa binary diff --git a/.gitignore b/.gitignore index b4708dc..9296e8e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ DUWS-R.iml localDevDeploy.properties -DUWS-R_dev.Altis.pbo \ No newline at end of file +DUWS-R_dev.Altis.pbo diff --git a/source/AIS/AIS_SETUP.sqf b/source/AIS/AIS_SETUP.sqf new file mode 100644 index 0000000..13bbc0c --- /dev/null +++ b/source/AIS/AIS_SETUP.sqf @@ -0,0 +1,38 @@ +// by Psychobastard +// AIS REVIVE Setup-File + +//__________________________________________________________________________________________________________________________________________________________________ +// v v v v v v v v v v v v --- Main Settings --- v v v v v v v v v v v v + +AIS_REVIVE_INIT_UNITS = "allPlayers"; // Auto-Init a group of units: "allPlayers" , "allPlayables" , "allUnits", "allUnitsBLUFOR", "allUnitsOPFOR", "allUnitsINDFOR", "allUnitsCIVILIAN" + // Warning: I didn't recomment to use "allUnits" if you play with a lot of AI units! AIS is mainly created for players and/or their AI group. +AIS_MEDICAL_EDUCATION = 1; // Who can revive an unconscious unit? 0 == Everybody, 1 == Everybody with a First Aid Kit or Medkit, 2 == Only Medics (this affects both, AI and players!). +AIS_REVIVE_GUARANTY = false; // If true you will fall everytime in uncoscious mode, regardless how strong the impact of damage was. +AIS_MEDEVAC_STATIONS = [];// Add one or more objects and a radius to activate the medevac feature. If enabled revive is only at this place(s) possible. Empty array means feature is disabled. + // Syntax: f.e.: [ [myMedevacVehicle, 15], [myMedicTent, 10] ] --> make sure the variable name is avalible at gamestart. Otherwise call it later in a function. + + +//__________________________________________________________________________________________________________________________________________________________________ +// v v v v v v v v v v v v --- Optional Settings --- v v v v v v v v v v v v + +AIS_DAMAGE_TOLLERANCE_FACTOR = 1; // A higher value means more damage tolerance. 1 is Vanilla. 0.8 mean all damage will reduce to 80% of Vanilla. +AIS_BLEEDOUT_TIME = 300; // Basic life time in seconds until the unit bleed out and die.. The real life time depends on the real damage of the unit. (can be less or more time from the basic value) +AIS_REVIVETIME = 30; // Basic revive time in seconds. The real revive time depends on the real damage of the unit. (can be less or more time from the basic value) +AIS_STABILIZETIME = 20; // Basic stabilize time in seconds to stop the bleeding of a unconscious unit. The real revive time depends on the real damage of the unit. (can be less or more time from the basic value) +AIS_REVIVE_HEAL = false; // If set to true the injured unit get completely healed after the revive. (casual gameplay without a medic) +AIS_TOGGLE_RADIO = true; // If set to true, unconscious players cannot use his TFAR or ACRE radios. +AIS_NO_CHAT = true; // If set to true, a injured player cannot use text chat during he is uncoscious. +AIS_AI_HELP_RADIUS = 50; // Number, Radius in metres. Units in this radius will help to revive if no group member is able to revive. Max value is 200 metres. +AIS_DISABLE_RESPAWN_BUTTON = 30; // Time in seconds while the respawn button is disabled (Esc Menu). Set to 0 to enable the respawn button everytime. +AIS_DISABLE_FURTHER_DAMAGE = false; // If set to true, an unconcious unit wont become further damage til death. If set to false, an unconcious unit can also die before bleedout timer is over. (f.e. trough near explosions) + + +//__________________________________________________________________________________________________________________________________________________________________ +// v v v v v v v v v v v v --- Visual Settings --- v v v v v v v v v v v v + +AIS_SHOW_UNC_MARKERS = true; // If set to true, a marker will show injured units on the map. +AIS_SHOW_UNC_MESSAGE_TO = "Group"; // "None", "Side", "Group" --> who read the message about wounded units. +AIS_SHOW_UNC_3D_MARKERS = true; // If set to true, an in-game visible 3D-icon shows you the position of injured units (within a range of 20 metres and 35 metres for medics). +AIS_IMPACT_EFFECTS = true; // Set to true to enable impact effects. (simple simluation of supressing effects) +AIS_SHOW_COUNTDOWN = true; // If set to true, an unconscious unit will be able to see the bleed out timer. +AIS_SHOW_DIARYINFO = true; // If set to true, a diary entry with some informations about the AIS (Credits, features, How to) is added. \ No newline at end of file diff --git a/source/AIS/Core/cfgFunctions.hpp b/source/AIS/Core/cfgFunctions.hpp new file mode 100644 index 0000000..1e731b1 --- /dev/null +++ b/source/AIS/Core/cfgFunctions.hpp @@ -0,0 +1,30 @@ +class AIS_Core +{ + class AIS_Core + { + file = "AIS\Core"; + class preInit { preInit = 1; }; + class postInit { postInit = 1; }; + class addAction; + class aisInitHost; + class aisInitPlayer; + class bindEventHandler; + class createLocalMarker; + class dynamicText; + class initEvents; + class inRange; + class interaction_Loop; + class isPlayable; + class onEachFrame; + class onNextFrame; + class progress_ShowBar; + class progress_ShowBarText; + class removeonEachFrame; + class setPosAGLS; + class setVariables; + class triggerEvent; + class waitUntilAndExecute; + class handleDisconnect; + class resetOnTeamSwitch; + }; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_Interaction_Loop.sqf b/source/AIS/Core/fn_Interaction_Loop.sqf new file mode 100644 index 0000000..400b168 --- /dev/null +++ b/source/AIS/Core/fn_Interaction_Loop.sqf @@ -0,0 +1,46 @@ +/* + Author: NetFusion + Description: + Continuously checks whether an action should be added to the cursorTarget. + Parameter(s): + - + Remarks: + * Should only be called once per mission. + + Returns: + - + Example: + - +*/ + +AIS_Core_lastCursorTarget = objNull; + +[{ + _cursorTarget = cursorTarget; + if (_cursorTarget isEqualTo AIS_Core_lastCursorTarget || {player distance _cursorTarget > 15}) exitWith {}; // psycho: prevent cycling trough cursorTargets more than 15m away (engine limitation is 15m for every action) + AIS_Core_lastCursorTarget = _cursorTarget; + + private _objActions = _cursorTarget getVariable ["AIS_Core_actionStorage", []]; + { + _x params ["_onObject", "_text", "_distance", "_condition", "_callback", "_args", "_formated"]; + + if (!(_x in _objActions)) then { + if ((_onObject isEqualType "" && {_cursorTarget isKindOf _onObject}) || (_onObject isEqualType objNull && {_cursorTarget isEqualTo _onObject})) then { + private _action = _cursorTarget addAction [_text, _callback, _args, 1.5, true, true, "", _condition, _distance]; + _objActions pushBack _x; + + if (_formated != "") then { + _cursorTarget setUserActionText [ + _action, + _text, + format [_formated, _text], + "" + ]; + }; + }; + }; + nil + } count (missionNamespace getVariable ["AIS_Core_actionStorage", []]); + + _cursorTarget setVariable ["AIS_Core_actionStorage", _objActions]; //@todo maybe init array and remove this line - this requires module dependencies +}] call AIS_Core_fnc_onEachFrame; \ No newline at end of file diff --git a/source/AIS/Core/fn_addAction.sqf b/source/AIS/Core/fn_addAction.sqf new file mode 100644 index 0000000..a6c3dcc --- /dev/null +++ b/source/AIS/Core/fn_addAction.sqf @@ -0,0 +1,81 @@ +/* + Author: [C-L-F] NetFusion + Edited: Psychobastard + + Description: + Add an action to an object or type(s) of object(s). + + Parameter(s): + 0: STRING - the title of the action. + 1: OBJECT, ARRAY, STRING - the object (type) which the action should be added to. + 2: NUMBER - the distance in which the action is visible. + 3: STRING - the condition which is evaluated on every frame (if play is in range) to determine whether the action is visible. + 4: CODE - the callback which gets called when the action is activated. + 5: ARRAY - (optional) the arguments which get passed to the callback. + + Remarks: + * '_target' is the object inside the condition string. + * [object, caller, ID, arguments] is _this in the callback + + Returns: + - + + Example: + ["Hint Hello!", player, 0, "true", { hint format ["Hello %1", name player]; }] call AIS_Core_fnc_addAction; + ["Hint Hello!", "Man", 3, "true", { hint format ["Hello %1", name (_this select 0)]; }] call AIS_Core_fnc_addAction; +*/ + +params ["_text", "_onObject", "_distance", "_condition", "_callback", ["_args", []], ["_formated", "", [""]]]; + + +if (_distance > 0) then { + _condition = format ["([cursorTarget, %1] call AIS_Core_fnc_inRange) && {%2}", _distance, _condition]; +}; + + +if (_onObject isEqualType objNull && {_onObject isEqualTo AIS_Core_realPlayer}) exitWith { + private _action = _onObject addAction [_text, _callback, _args, 1.5, false, true, "", _condition, _distance]; + + if (_formated != "") then { + _onObject setUserActionText [ + _action, + _text, + format [_formated, _text], + "" + ]; + }; + + [ + "AIS_playerChanged", { + params ["_data", "_params"]; + _data params ["_currentPlayer", "_oldPlayer"]; + _params params ["_text", "_callback", "_distance", ["_args", []], "_condition", ["_formated", "", [""]]]; + + private _action = _currentPlayer addAction [_text, _callback, _args, 1.5, false, true, "", _condition, _distance]; + + if (_formated != "") then { + _currentPlayer setUserActionText [ + _action, + _text, + format [_formated, _text], + "" + ]; + }; + }, + [_text, _callback, _distance, _args, _condition, _formated] + ] call AIS_Core_fnc_bindEventHandler; + +}; + +if (!(_onObject isEqualType [])) then { + _onObject = [_onObject]; +}; + +private _actionStorage = missionNamespace getVariable ["AIS_Core_actionStorage", []]; +{ + _actionStorage pushBack [_x, _text, _distance, _condition, _callback, _args, _formated]; + nil +} count _onObject; +missionNamespace setVariable ["AIS_Core_actionStorage", _actionStorage]; //@todo maybe init array and remove this line + +_action \ No newline at end of file diff --git a/source/AIS/Core/fn_aisInitHost.sqf b/source/AIS/Core/fn_aisInitHost.sqf new file mode 100644 index 0000000..3993bb4 --- /dev/null +++ b/source/AIS/Core/fn_aisInitHost.sqf @@ -0,0 +1,33 @@ +// this script run on the server/host for every unit which should be added to the revive system. It run's once by starting the mission. +params ["_unit"]; +if (_unit getVariable ["AIS_noReviveInit", false]) exitWith {}; + +if (!isNil {_unit getVariable "ais_aisInit"}) then { + _unit removeAllEventHandlers "Killed"; + _unit removeAllEventHandlers "Respawn"; + _unit removeAllEventHandlers "HandleHeal"; + [_unit] call AIS_Core_fnc_setVariables; +}; +_unit setVariable ["ais_aisInit", true]; + + +// set damage EH only for local and non-player units! +// last check if unit is local +if (local _unit && !(isPlayer _unit)) then { + [_unit] spawn { + _unit = _this select 0; + + waitUntil {!isNil {_unit getVariable "BIS_fnc_feedback_hitArrayHandler"} || {time > 0}}; + _unit removeAllEventHandlers "handleDamage"; + ["%1 --- add damageEH to AI %2", diag_ticktime, _unit] call BIS_fnc_logFormat; + ais_hdEH = _unit addEventHandler ["HandleDamage", {_this call AIS_Damage_fnc_handleDamage}]; + + ais_hkEH = _unit addEventHandler ["Killed", {_this call AIS_System_fnc_killed}]; + + if ([_unit] call AIS_Core_fnc_isPlayable) then { + ais_hrEH = _unit addEventHandler ["Respawn", {_this call AIS_System_fnc_respawn}]; + }; + _unit removeAllEventHandlers "HandleHeal"; + ais_hhEH = _unit addEventHandler ["HandleHeal", {_this call AIS_System_fnc_handleHeal}]; + }; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_aisInitPlayer.sqf b/source/AIS/Core/fn_aisInitPlayer.sqf new file mode 100644 index 0000000..9ddeb61 --- /dev/null +++ b/source/AIS/Core/fn_aisInitPlayer.sqf @@ -0,0 +1,105 @@ +// this script run only by the player! +private _player = _this; +if (_player != player) exitWith {["%1 --- exit aisInitPlayer cause it's not the local player itself %2", diag_ticktime, _player] call BIS_fnc_logFormat}; +if (isClass (configFile >> "CfgPatches" >> "ace_medical")) exitWith {["AIS: AIS shutdown itself cause ACE medical system is also running. ACE medical and AIS cant work at the same time."] call BIS_fnc_logFormat}; + +if (_player getVariable ["AIS_noReviveInit", false]) exitWith {}; + +// set damage EH local to the player +if (local _player) then { + [_player] call AIS_Core_fnc_setVariables; + + [_player] spawn { + _player = _this select 0; + waitUntil {!isNil {_player getVariable "BIS_fnc_feedback_hitArrayHandler"} || {time > 0}}; + _player removeAllEventHandlers "handleDamage"; // make sure nothing else working byside + //["%1 --- add damageEH to player %2", diag_ticktime, _player] call BIS_fnc_logFormat; + _player addEventHandler ["HandleDamage", {_this call AIS_Damage_fnc_handleDamage}]; + + _player addEventHandler ["Killed", {_this call AIS_System_fnc_killed}]; + + _player addEventHandler ["Respawn", {_this call AIS_System_fnc_respawn}]; + + _player addEventHandler ["HandleHeal", {_this call AIS_System_fnc_handleHeal}]; + + waitUntil {!isNull (findDisplay 46)}; + (findDisplay 46) displayAddEventHandler ["KeyDown", {_this call AIS_System_fnc_keyHandler}]; + }; +}; + +// AI is local to the group leader on dedicated environment +if (!isServer && (count (units group player) > 1)) then { + if (leader group _player isEqualTo _player) then { + + [_player] spawn { + _player = _this select 0; + _groupWithoutPlayers = ((units group _player) - (allUnits select {isPlayer _x})); + {[_x] call AIS_Core_fnc_setVariables; true} count _groupWithoutPlayers; + + waitUntil {!isNil {_player getVariable "BIS_fnc_feedback_hitArrayHandler"} || {time > 0}}; + { + _x removeAllEventHandlers "handleDamage"; + //["%1 --- add damageEH to groupmember of %3's group: %2", diag_ticktime, _x, _player] call BIS_fnc_logFormat; + _x addEventHandler ["HandleDamage", {_this call AIS_Damage_fnc_handleDamage}]; + + _x removeAllEventHandlers "Killed"; + _x addEventHandler ["Killed", {_this call AIS_System_fnc_killed}]; + + _x removeAllEventHandlers "Respawn"; + if ([_x] call AIS_Core_fnc_isPlayable) then { + _x addEventHandler ["Respawn", {_this call AIS_System_fnc_respawn}]; + }; + + _x addEventHandler ["HandleHeal", {_this call AIS_System_fnc_handleHeal}]; + + true + } count _groupWithoutPlayers; + }; + + }; +}; + + +// add handleHeal local to the player for every unit and set the correct anim-state (local) +private _allPlayers = allUnits select {isPlayer _x}; // doesn't use allPlayers at this point, cause it can be delayed in self-hosted env. +private _ais_revive_units = toLower AIS_REVIVE_INIT_UNITS; +private _init_units = call { + if (_ais_revive_units isEqualTo "allunits") exitWith {allUnits}; + if (_ais_revive_units isEqualTo "allplayers") exitWith {_allPlayers}; // at this point only as a dummy. Cause everytime every player will auto-init, regardless what the setup will say. + if (_ais_revive_units isEqualTo "allplayables") exitWith {if (isMultiplayer) then {playableUnits} else {switchableUnits}}; + if (_ais_revive_units isEqualTo "allunitsblufor") exitWith {allUnits select {(side _x) isEqualTo blufor}}; + if (_ais_revive_units isEqualTo "allunitsopfor") exitWith {allUnits select {(side _x) isEqualTo opfor}}; + if (_ais_revive_units isEqualTo "allunitsindfor") exitWith {allUnits select {(side _x) isEqualTo resistance}}; + if (_ais_revive_units isEqualTo "allunitscivilian") exitWith {allUnits select {(side _x) isEqualTo civilian}}; + diag_log "AIS ERROR: Issue in Setup-File found! Parameter AIS_REVIVE_UNITS wrong defined."; [] +}; +{ + _x removeAllEventHandlers "HandleHeal"; + _x addEventHandler ["HandleHeal", {_this call AIS_System_fnc_handleHeal}]; + + if (_x getVariable ["ais_unconscious", false]) then { + if (!isNull(_x getVariable ["ais_DragDrop_Player", objNull])) then { + _x switchMove "AinjPpneMrunSnonWnonDb"; + } else { + _x playActionNow "agonyStart"; + }; + }; + + true +} count _init_units; + + +ais_medequip_array = []; +if (AIS_TOGGLE_RADIO) then { + [true] call AIS_Effects_fnc_toggleRadio; +}; + +// JIP in a unconscious AI... and avoid cheating by left in lobby... +if (_player getVariable ["ais_unconscious", false]) then { + [{[(_this select 0)] call AIS_System_fnc_setUnconscious}, [_player]] call AIS_Core_fnc_onNextFrame; +}; + +inGameUISetEventHandler ["Action", "_this call AIS_System_fnc_overrideHealAction"]; + + +_respawnDelay = getMissionConfigValue ["respawnDelay", 0]; \ No newline at end of file diff --git a/source/AIS/Core/fn_bindEventHandler.sqf b/source/AIS/Core/fn_bindEventHandler.sqf new file mode 100644 index 0000000..83130c2 --- /dev/null +++ b/source/AIS/Core/fn_bindEventHandler.sqf @@ -0,0 +1,30 @@ +/* + Arma Mission Enhancement - Core\Events\fn_bindEventHandler.sqf + + Author: NetFusion + + Description: + Bind an EH for a custom event. This EH will be called when the event is triggered. + + Parameter(s): + - 0: STRING - the name of the event + - 1: CODE - the code which get called (_this select 0 will be the data, _this select 1 will be the params) + - 2: ARRAY - the params passed to the code (optional) + + Returns: + - + Example: + + ["playerChanged", { hint "Player has changed"; }] call AIS_Core_fnc_bindEventHandler; +*/ + + +params ["_name", "_code", ["_params", []]]; + +// Form the name of the EH storage +_name = format ["AIS_Core_eventHandlersFor%1", _name]; + +// Push the data on the EH array (specific by name). +private _eventHandlers = missionNamespace getVariable [_name, []]; +_eventHandlers pushBack [_code, _params]; +missionNamespace setVariable [_name, _eventHandlers]; \ No newline at end of file diff --git a/source/AIS/Core/fn_createLocalMarker.sqf b/source/AIS/Core/fn_createLocalMarker.sqf new file mode 100644 index 0000000..bcef002 --- /dev/null +++ b/source/AIS/Core/fn_createLocalMarker.sqf @@ -0,0 +1,26 @@ +// ["my marker", position player, "ICON", "ColorRed", [0.5,0.5]] call AIS_Core_fnc_createLocalMarker; + +params [ + ["_name","",[""]], + ["_pos",[0,0],[[]]], + ["_shape","ICON",[""]], + ["_color","Default",[""]], + ["_size",[1,1],[[]]], + ["_text","",[""]], + ["_dir",0,[0]], + ["_type","mil_dot",[""]], + ["_brush","",[""]] +]; + +private _marker = createMarkerLocal [_name, _pos]; + +_marker setMarkerShapeLocal _shape; +_marker setMarkerColorLocal _color; +_marker setMarkerSizeLocal _size; +_marker setMarkerTextLocal _text; +_marker setMarkerDirLocal _dir; +_marker setMarkerTypeLocal _type; +if (_brush != "") then {_marker setMarkerBrushLocal _brush}; + + +_marker \ No newline at end of file diff --git a/source/AIS/Core/fn_dynamicText.sqf b/source/AIS/Core/fn_dynamicText.sqf new file mode 100644 index 0000000..cfb83dd --- /dev/null +++ b/source/AIS/Core/fn_dynamicText.sqf @@ -0,0 +1,10 @@ +/* + ["Mein Text"] call AIS_Core_fnc_dynamicText; +*/ + +_text = _this param [0,"",["",{}]]; + +_text = "" + _text + ""; +[_text, (safeZoneX - 0.15), (safeZoneY + 0.3), 3, 1, 0, 3] spawn BIS_fnc_dynamicText; + +true \ No newline at end of file diff --git a/source/AIS/Core/fn_handleDisconnect.sqf b/source/AIS/Core/fn_handleDisconnect.sqf new file mode 100644 index 0000000..2d381e7 --- /dev/null +++ b/source/AIS/Core/fn_handleDisconnect.sqf @@ -0,0 +1,44 @@ +/* + * Author: Psycho + + * Server side handling of disconnected players. The disconnected entity get transfered to the server and re-init the AIS. + + * Arguments: + 0: Entity (Object, old player) + + * Return value: + - + + * Attention! + Override: If this EH code returns true, the unit, previously occupied by player, gets transferred to the server, becomes AI and continues to live, even with description.ext param disabledAI = 1; +*/ + + +params ["_entity"]; + +// delete unit if mission designer have set disabledAI param set to 1 +_deleteEntity = false; +_deleteEntity = if ((getMissionConfigValue "disabledAI") isEqualType 0) then { + _back = if ((getMissionConfigValue ["disabledAI", 0]) > 0) then {true} else {false};_back +} else { + _back = if ((toUpper((getMissionConfigValue ["disabledAI", "false"]))) isEqualTo "TRUE") then {true} else {false};_back +}; + +if (_deleteEntity) exitWith { + if (local _entity) then { + if (!isNull objectParent _entity) then { + unassignVehicle _entity; + moveOut _entity; + }; + deleteVehicle _entity; + }; + false +}; + +// othrwise re-init the unit on the new owner (server) +if (!isNil {_entity getVariable "ais_unconscious"}) then { + _entity call AIS_Core_fnc_aisInitHost; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Core/fn_inRange.sqf b/source/AIS/Core/fn_inRange.sqf new file mode 100644 index 0000000..7cf4acc --- /dev/null +++ b/source/AIS/Core/fn_inRange.sqf @@ -0,0 +1,30 @@ +/* + Author: [C-L-F] NetFusion + + Description: + Checks whether an object is in a given range to player. + + Parameter(s): + 0: OBJECT - the object which should be checked. + 1: NUMBER - the range to check. + + Returns: + - BOOL - true if the object in in range, false if not. + + Example: + [object, 10] call AIS_Core_fnc_inRange; +*/ + +params [ + ["_object", objNull, [player]], + ["_distance", 15, [0]] +]; + +_return = if (!isNull _object && {player distance2D _object < _distance}) then { + true +} else { + false +}; + + +_return \ No newline at end of file diff --git a/source/AIS/Core/fn_initEvents.sqf b/source/AIS/Core/fn_initEvents.sqf new file mode 100644 index 0000000..a5c17e1 --- /dev/null +++ b/source/AIS/Core/fn_initEvents.sqf @@ -0,0 +1,77 @@ +/* + Arma Mission Enhancement - Core\Events\fn_initEvents.sqf + Author: NetFusion + Changed: Psycho - expand function with "next-frame" and "waitUntil" elements + + Description: + Adds a loop which call all OEF EHs. Will be called by autoload for client and server. There is no need to call it manually. + + Parameter(s): + - + + Returns: + - + + Example: + - +*/ + +AIS_nextFrameNo = diag_frameno + 1; +// PostInit can be 2 frames after preInit, need to manually set AIS_nextFrameNo, so new items get added to buffer B while processing A for the first time: +AIS_nextFrameBufferA = [[[], {AIS_nextFrameNo = diag_frameno;}]]; +AIS_nextFrameBufferB = []; +AIS_waitUntilAndExecArray = []; + + +AIS_Core_eachFrameHandlerId = addMissionEventHandler ["EachFrame", { + + // Execute per frame handlers + // Fetch all OEF EHs from missionNamespace. + private _onEachFrameHandler = missionNamespace getVariable ["AIS_Core_onEachFrameData", []]; + { + _x params ["_code", "_delay", "_nextExecTime", "_params"]; + + // If the execution time is up call the function. + if (diag_tickTime > _nextExecTime) then { + // Set the new execution time depending on the provided delay. + _x set [2, _nextExecTime + _delay]; + + [_forEachIndex, _params] call _code; //@todo if an EH removed itself the next EH may be skipped + }; + } forEach _onEachFrameHandler; + + + // Execute the exec next frame functions (from CBA) + if (count AIS_nextFrameBufferA > 0) then { + { + (_x select 0) call (_x select 1); + false + } count AIS_nextFrameBufferA; + // Swap double-buffer: + AIS_nextFrameBufferA = AIS_nextFrameBufferB; + AIS_nextFrameBufferB = []; + AIS_nextFrameNo = diag_frameno + 1; + }; + + + // handle the waitUntil and execute function (from CBA) + if (count AIS_waitUntilAndExecArray > 0) then { + private _delete = false; + { + // if condition is satisfied call statement + if ((_x select 2) call (_x select 0)) then { + (_x select 2) call (_x select 1); + AIS_waitUntilAndExecArray set [_forEachIndex, objNull]; + _delete = true; + }; + } forEach AIS_waitUntilAndExecArray; + if (_delete) then { + AIS_waitUntilAndExecArray = AIS_waitUntilAndExecArray - [objNull]; + }; + }; + + // remove the pfh if client left the mission + if (getClientState == "GAME FINISHED") then { + removeMissionEventHandler ["EachFrame", AIS_Core_eachFrameHandlerId]; + }; +}]; \ No newline at end of file diff --git a/source/AIS/Core/fn_isPlayable.sqf b/source/AIS/Core/fn_isPlayable.sqf new file mode 100644 index 0000000..c0bdc06 --- /dev/null +++ b/source/AIS/Core/fn_isPlayable.sqf @@ -0,0 +1,24 @@ +/* + * Author: Psycho + + * Check if a unit is a playable unit. + + * Arguments: + 0: Unit (Object) + + * Return value: + BOOL (true if playable) +*/ + +params ["_unit"]; +private _isplayable = false; +if (isPlayer _unit) exitWith {true}; + +_isplayable = if (isMultiplayer) then { + if (_unit in playableUnits) then {true} else {false}; +} else { + if (_unit in switchableUnits) then {true} else {false}; +}; + + +_isplayable \ No newline at end of file diff --git a/source/AIS/Core/fn_onEachFrame.sqf b/source/AIS/Core/fn_onEachFrame.sqf new file mode 100644 index 0000000..cbeff02 --- /dev/null +++ b/source/AIS/Core/fn_onEachFrame.sqf @@ -0,0 +1,31 @@ +/* + Arma Mission Enhancement - Core\Events\fn_onEachFrame.sqf + + Author: NetFusion + + Description: + Adds an OEF EHs. The EH will be called on each frame with a custom delay between the calls. + + Parameter(s): + - 1: CODE - the code which is called (_this select 0 will be the EH id, _this select 1 will be the params) + - 2: SCALAR - the delay between two code calls in seconds (optional) + - 3: ARRAY - the parameters which get passed to the code on call (optional) + + Returns: + - + + Example: + [{ hint (str diagFrameNo); }] call AIS_Core_fnc_onEachFrame; +*/ + + +params [ + "_code", + ["_delay", 0], + ["_params", []] +]; + +// Push the data on the OEF EH array. +private _onEachFrameData = missionNamespace getVariable ["AIS_Core_onEachFrameData", []]; +_onEachFrameData pushBack [_code, _delay, diag_tickTime + _delay, _params]; +missionNamespace setVariable ["AIS_Core_onEachFrameData", _onEachFrameData]; \ No newline at end of file diff --git a/source/AIS/Core/fn_onNextFrame.sqf b/source/AIS/Core/fn_onNextFrame.sqf new file mode 100644 index 0000000..9040dc5 --- /dev/null +++ b/source/AIS/Core/fn_onNextFrame.sqf @@ -0,0 +1,31 @@ +/* ---------------------------------------------------------------------------- +Function: AIS_Core_fnc_onNextFrame + +Description: + Executes a code once in non sched environment on the next frame. +Parameters: + + _function - The function to run. + _args - Parameters passed to the function executing. This will be the same array every execution. [optional] +Returns: + Nothing + +Examples: + (begin example) + [{player sideChat format ["This is frame %1, not %2", diag_frameno, _this select 0];}, [diag_frameno]] call AIS_Core_fnc_onNextFrame; + (end) + +Author: + esteldunedain and PabstMirror, donated from ACE3 +---------------------------------------------------------------------------- */ + +params [ + ["_function", {}, [{}]], + ["_args", []] +]; + +if (diag_frameno != AIS_nextFrameNo) then { + AIS_nextFrameBufferA pushBack [_args, _function]; +} else { + AIS_nextFrameBufferB pushBack [_args, _function]; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_postinit.sqf b/source/AIS/Core/fn_postinit.sqf new file mode 100644 index 0000000..e2662c8 --- /dev/null +++ b/source/AIS/Core/fn_postinit.sqf @@ -0,0 +1,73 @@ +if (ais_ace_shutdown) exitWith {["AIS: AIS shutdown itself cause ACE mod was detected. ACE and AIS cant work at the same time."] call BIS_fnc_logFormat}; +#include "..\AIS_SETUP.sqf" + +if (isServer) then { + private _allPlayers = allUnits select {isPlayer _x}; // doesn't use allPlayers at this point, cause it can be delayed in self-hosted env. + + private _ais_revive_units = toLower AIS_REVIVE_INIT_UNITS; + private _init_units = call { + if (_ais_revive_units isEqualTo "allunits") exitWith {allUnits}; + if (_ais_revive_units isEqualTo "allplayers") exitWith {_allPlayers}; // at this point only as a dummy. Cause everytime every player will auto-init, regardless what the setup will say. + if (_ais_revive_units isEqualTo "allplayables") exitWith {if (isMultiplayer) then {playableUnits} else {switchableUnits}}; + if (_ais_revive_units isEqualTo "allunitsblufor") exitWith {allUnits select {(side _x) isEqualTo blufor}}; + if (_ais_revive_units isEqualTo "allunitsopfor") exitWith {allUnits select {(side _x) isEqualTo opfor}}; + if (_ais_revive_units isEqualTo "allunitsindfor") exitWith {allUnits select {(side _x) isEqualTo resistance}}; + if (_ais_revive_units isEqualTo "allunitscivilian") exitWith {allUnits select {(side _x) isEqualTo civilian}}; + diag_log "AIS ERROR: Issue in Setup-File found! Parameter AIS_REVIVE_UNITS wrong defined."; [] + }; + + // run the init for all units present by game/mission start + _init_units = _init_units - _allPlayers; + //diag_log format ["ais init units: %1", _init_units]; + if (count _init_units > 0) then { + { + [_x] call AIS_Core_fnc_aisInitHost; + true + } count _init_units; + }; + + addMissionEventHandler ["HandleDisconnect", {_this call AIS_Core_fnc_handleDisconnect}]; +}; + +if (isNil "AIS_MEDEVAC_STATIONS") then { + AIS_MEDEVAC_STATIONS = []; +} else { + if !(AIS_MEDEVAC_STATIONS isEqualType []) then { + AIS_MEDEVAC_STATIONS = []; + ["AIS: AIS_MEDEVAC_STATIONS wasnt defined in the correct way."] call BIS_fnc_logFormat; + }; +}; + +if (isDedicated || !hasInterface) exitWith {}; + +// This is needed to provide a player object for zeus controlled units. Important to ensure that player is not null here (which is done in autoload). +AIS_Core_realPlayer = player; +AIS_Core_realPlayer call AIS_Core_fnc_aisInitPlayer; +AIS_Core_realSide = getNumber (configfile >> "CfgVehicles" >> (typeOf AIS_Core_realPlayer) >> "side"); + +[{ + // There is no command to get the current player but BI has an variable in mission namespace we can use. + private _currentPlayer = missionNameSpace getVariable ["bis_fnc_moduleRemoteControl_unit", player]; // Psycho: isNull until a unit is remote controlled + + // If the player changed we trigger an event and update the global variable. + if (AIS_Core_realPlayer != _currentPlayer) then { + removeAllActions AIS_Core_realPlayer; + AIS_Core_realPlayer enableAI "TEAMSWITCH"; + + ["AIS_playerChanged", [_currentPlayer, AIS_Core_realPlayer]] call AIS_Core_fnc_triggerEvent; + + AIS_Core_realPlayer = _currentPlayer; + AIS_Core_realSide = getNumber (configfile >> "CfgVehicles" >> (typeOf AIS_Core_realPlayer) >> "side"); + }; +}] call AIS_Core_fnc_onEachFrame; + +true call AIS_Core_fnc_Interaction_loop; + +if (AIS_SHOW_DIARYINFO) then { + call AIS_System_fnc_diary; +}; + +true spawn { + waitUntil {time > 0}; + AIS_Core_3DEHId = addMissionEventHandler ["Draw3D", {_this call AIS_Effects_fnc_draw3D}]; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_preinit.sqf b/source/AIS/Core/fn_preinit.sqf new file mode 100644 index 0000000..54bb585 --- /dev/null +++ b/source/AIS/Core/fn_preinit.sqf @@ -0,0 +1,21 @@ +diag_log format ["############## %1 ############## - AIS init started", missionName]; + +if (isServer) then { + ais_ace_shutDown = false; + if (isClass (configFile >> "CfgPatches" >> "ace_medical")) then { + ais_ace_shutDown = true; + ["AIS: AIS shutdown itself cause ACE medical system is also running. ACE medical and AIS cant work at the same time."] call BIS_fnc_logFormat; + }; + publicVariable "ais_ace_shutDown"; +}; + +if (!isNil "AIS_Core_3DEHId") then { + removeMissionEventHandler ["Draw3D", AIS_Core_3DEHId]; +}; + +if (!isNil "AIS_Core_eachFrameHandlerId") then { + removeMissionEventHandler ["EachFrame", AIS_Core_eachFrameHandlerId]; +}; + +call AIS_Core_fnc_initEvents; +AIS_Core_Interaction_Actions = []; \ No newline at end of file diff --git a/source/AIS/Core/fn_progress_ShowBar.sqf b/source/AIS/Core/fn_progress_ShowBar.sqf new file mode 100644 index 0000000..1f9c6b4 --- /dev/null +++ b/source/AIS/Core/fn_progress_ShowBar.sqf @@ -0,0 +1,74 @@ +/* + * Author: NetFusion + * modified/changed by Psycho + + * Generate progress bar dialog and pass trough the code what's to do after finish or abort the progress. + + * Arguments: + 0: Title (String) + 1: duration in sec (Integer) + 2: callback (Code) + 3: arguments for callback (Object or Array) + 4: onAbort (optional) (Code) + 5: doAbort (optional) (Bool) + + * Return value: + nothing +*/ + + + + +private _title = _this select 0; +_duration = _this select 1; +_callback = _this select 2; +_arguments = _this select 3; +_onAbort = if (count _this > 4) then {_this select 4} else {{}}; +_doAbort = if (count _this > 5) then {_this select 5} else {false}; // added by Psycho +_endTime = time + _duration; +_affectingObject = if (typeName _arguments == "ARRAY") then {_arguments select 0} else {_arguments}; + +if (typeName _affectingObject == "OBJECT") then { + if (_affectingObject getVariable ["AIS_Core_Progress_inUse", false]) exitWith { + ["Object in use" call XOrangeText] call AIS_Core_fnc_dynamicText; + }; + + _affectingObject setVariable ["AIS_Core_Progress_inUse", true, true]; +}; + +closeDialog 0; +createDialog "AIS_Core_Progress_BarDlg"; + +_texts = player getVariable ["AIS_Core_displayText", []]; +_texts pushBack ("(" + _title + ")"); +player setVariable ["AIS_Core_displayText", _texts, true]; + +disableSerialization; +_progressBar = uiNamespace getVariable "AIS_Core_Progress_ProgressBar"; + +_progressBar ctrlSetPosition [safeZoneX + 0.298906 * safeZoneW, safeZoneY + 0.082 * safeZoneH, 0.407344 * safeZoneW, 0.011 * safeZoneH]; +_progressBar ctrlCommit (_duration / accTime); + +_time = time; + +//waitUntil {!dialog || time > _endTime || !alive player || _doAbort}; +while {dialog && {time < _endTime} && {alive player} && {!_doAbort}} do { + sleep 0.5; + [_title, ((time - _time) / (_duration)) min 1] spawn AIS_Core_fnc_progress_showBarText; +}; + +closeDialog 0; + +_texts = _texts - ["(" + _title + ")"]; +player setVariable ["AIS_Core_displayText", _texts, true]; + +if (time > _endTime) then { + _arguments spawn _callback; +} else { + ["Abbort..."] call AIS_Core_fnc_dynamicText; + _arguments spawn _onAbort; +}; + +if (typeName _affectingObject == "OBJECT") then { + _affectingObject setVariable ["AIS_Core_Progress_inUse", false, true]; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_progress_ShowBarText.sqf b/source/AIS/Core/fn_progress_ShowBarText.sqf new file mode 100644 index 0000000..786ddd5 --- /dev/null +++ b/source/AIS/Core/fn_progress_ShowBarText.sqf @@ -0,0 +1,21 @@ +// by psycho +private _title = _this select 0; +_value = _this select 1; + +disableSerialization; +private _progressTitle = uiNamespace getVariable "AIS_Core_Progress_ProgressTitle"; + +_sitrepArray = toArray format [" ....%1", str (round (_value * 100)) + "%"]; +{_sitrepArray set [_foreachindex, toString [_x]]} foreach _sitrepArray; +_sitrep = ""; +_sitrepFormat = "" + _title + ":%1"; + +for "_i" from 0 to (count _sitrepArray - 1) do { + _letter = _sitrepArray select _i; + _delay = if (_letter == "|") then {_letter = "
"; 1} else {0.02}; + _sitrep = _sitrep + _letter; + _text = parseText format [_sitrepFormat, _sitrep + "_"]; + + _progressTitle ctrlSetText str(_text); + sleep _delay; +}; \ No newline at end of file diff --git a/source/AIS/Core/fn_removeOnEachFrame.sqf b/source/AIS/Core/fn_removeOnEachFrame.sqf new file mode 100644 index 0000000..890d435 --- /dev/null +++ b/source/AIS/Core/fn_removeOnEachFrame.sqf @@ -0,0 +1,23 @@ +/* + Arma Mission Enhancement - Core\Events\fn_removeOnEachFrame.sqf + + Author: NetFusion + + Description: + Remove an OEF EH by its id. Ids are not persistent but unique inside one frame. + + Parameter(s): + - SCALAR - the id of the OEF EH + + Returns: + - + + Example: + _id call AIS_Core_fnc_removeOnEachFrame; +*/ + + +// Deletes the OEF EH with the given id. +private _onEachFrameData = missionNamespace getVariable ["AIS_Core_onEachFrameData", []]; +_onEachFrameData deleteAt _this; +missionNamespace setVariable ["AIS_Core_onEachFrameData", _onEachFrameData]; \ No newline at end of file diff --git a/source/AIS/Core/fn_resetOnTeamSwitch.sqf b/source/AIS/Core/fn_resetOnTeamSwitch.sqf new file mode 100644 index 0000000..e93dd53 --- /dev/null +++ b/source/AIS/Core/fn_resetOnTeamSwitch.sqf @@ -0,0 +1,31 @@ +/* + * Author: Psycho + + * Handle unit state after a teamswtich was performed. + + * Arguments: + 0: Player New (Object) + 1: Unit Old (Object) + + * Return value: + - +*/ + +params ["_new_player", "_old_player"]; + + +removeAllActions _old_player; +_old_player enableAI "TEAMSWITCH"; + +AIS_Core_realSide = getNumber (configfile >> "CfgVehicles" >> (typeOf _new_player) >> "side"); + +if (_old_player getVariable ["ais_unconscious", false]) then { + ais_character_changed = true; // reset blood splatter screen +}; + +if (_new_player getVariable ["ais_unconscious", false]) then { + [_new_player] call AIS_System_fnc_bloodloss; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Core/fn_setPosAGLS.sqf b/source/AIS/Core/fn_setPosAGLS.sqf new file mode 100644 index 0000000..0f0b634 --- /dev/null +++ b/source/AIS/Core/fn_setPosAGLS.sqf @@ -0,0 +1,22 @@ +// from Killzone Kid + +/* + //---This will place player exactly on top deck of Cargo HQ on Stratis: + [player, [2437.18,5693.47,0]] call AIS_Core_fnc_setPosAGLS; + + //---This will place player 2m above top deck of Cargo HQ on Stratis: + [player, [2437.18,5693.47,2]] call AIS_Core_fnc_setPosAGLS; + + //---This will place player 2m below top deck of Cargo HQ on Stratis: + [player, [2437.18,5693.47,-2]] call AIS_Core_fnc_setPosAGLS; +*/ + +params ["_obj", "_pos", "_offset"]; + +_offset = _pos select 2; +if (isNil "_offset") then {_offset = 0}; +_pos set [2, worldSize]; +_obj setPosASL _pos; +_pos set [2, vectorMagnitude (_pos vectorDiff getPosVisual _obj) + _offset]; + +_obj setPosASL _pos; \ No newline at end of file diff --git a/source/AIS/Core/fn_setVariables.sqf b/source/AIS/Core/fn_setVariables.sqf new file mode 100644 index 0000000..aa9a9ac --- /dev/null +++ b/source/AIS/Core/fn_setVariables.sqf @@ -0,0 +1,37 @@ +/* + * Author: Psycho + + * Set all needed vars to the unit. + + * Arguments: + 0: Healer Unit (Object) + + * Return value: + Nothing +*/ + +params ["_unit"]; + +// local +_unit setVariable ["ais_fireDamage", 0]; +_unit setVariable ["ais_frameNo_damageCaching", diag_frameno]; +_unit setVariable ["ais_protector_delay", diag_tickTime]; +_unit setVariable ["AIS_UnitIsDead", false]; +_unit setVariable ["ais_side", side _unit]; +_unit setVariable ["ais_CarryDrop_Torso", false]; +ais_reenable_teamswitch = false; + +// global (players and AI's) +// set Vars only if it is Nil. Isnt't everytime Nil(f.e. JIP's use AI to join in - get the last state from this AI) +if (isNil {_unit getVariable "ais_unconscious"}) then { + _unit setVariable ["ais_unconscious", false, true]; + _unit setVariable ["ais_stabilized", false, true]; + _unit setVariable ["ais_hasHelper", objNull, true]; + _unit setVariable ["ais_DragDrop_Player", objNull, true]; + _unit setVariable ["ais_DragDrop_Torso", objNull];// local is enough? + _unit setVariable ["AIS_MedicalStore", [0,0,0,0], true]; + _unit setVariable ["ais_man_pullOut", false, true]; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Core/fn_triggerEvent.sqf b/source/AIS/Core/fn_triggerEvent.sqf new file mode 100644 index 0000000..aa3a629 --- /dev/null +++ b/source/AIS/Core/fn_triggerEvent.sqf @@ -0,0 +1,45 @@ +/* + Arma Mission Enhancement - Core\Events\fn_triggerEvent.sqf + + Author: NetFusion + + Description: + Triggers an custom event. This should call all previously bound EH for the specific event. + + Parameter(s): + - 1: STRING - the name of the event + - 2: ARRAY - the data which gets passed to all EH (optional) + + Returns: + - + + Example: + ["myEvent", [1, 2, 3]] call AIS_Core_fnc_triggerEvent; +*/ + + +params ["_name", ["_data", []]]; + +//player sideChat ("Event: " + _name); + +// Form the name of the EH storage +_name = format ["AIS_Core_eventHandlersFor%1", _name]; +private _eventHandlers = missionNamespace getVariable [_name, []]; + +// Set the default return value to false. +AIS_Core_eventReturn = nil; + +// Cycle through all EHs and call them with the given data and their params +{ + _x params ["_code", "_params"]; + + [_data, _params] call _code; + nil +} count _eventHandlers; + +//@todo find a better way for returning stuff +if (!isNil "AIS_Core_eventReturn") then { + AIS_Core_eventReturn +} else { + nil +}; diff --git a/source/AIS/Core/fn_waitUntilAndExecute.sqf b/source/AIS/Core/fn_waitUntilAndExecute.sqf new file mode 100644 index 0000000..086f8cd --- /dev/null +++ b/source/AIS/Core/fn_waitUntilAndExecute.sqf @@ -0,0 +1,35 @@ +/* ---------------------------------------------------------------------------- +Function: AIS_Core_fnc_waitUntilAndExecute + +Description: + Executes a code once in unscheduled environment after a condition is true. + +Parameters: + _condition - The function to evaluate as condition. + _statement - The function to run once the condition is true. + _args - Parameters passed to the functions (statement and condition) executing. (optional) + +Passed Arguments: + _this - Parameters passed by this function. Same as '_args' above. + +Returns: + Nothing + +Examples: + (begin example) + [{(_this select 0) == vehicle (_this select 0)}, {(_this select 0) setDamage 1;}, [player]] call AIS_Core_fnc_waitUntilAndExecute; + (end) + +Author: + joko // Jonas, donated from ACE3 +---------------------------------------------------------------------------- */ + +params [ + ["_condition", {}, [{}]], + ["_statement", {}, [{}]], + ["_args", []] +]; + +AIS_waitUntilAndExecArray pushBack [_condition, _statement, _args]; + +nil \ No newline at end of file diff --git a/source/AIS/Damage/cfgFunctions.hpp b/source/AIS/Damage/cfgFunctions.hpp new file mode 100644 index 0000000..35a8d97 --- /dev/null +++ b/source/AIS/Damage/cfgFunctions.hpp @@ -0,0 +1,12 @@ +class AIS_Damage +{ + class AIS_Damage + { + file = "AIS\Damage"; + class exitDamageHandler; + class getHitIndexValue; + class goToDead; + class handleDamage; + class verifyDamageType; + }; +}; \ No newline at end of file diff --git a/source/AIS/Damage/fn_exitDamageHandler.sqf b/source/AIS/Damage/fn_exitDamageHandler.sqf new file mode 100644 index 0000000..c731542 --- /dev/null +++ b/source/AIS/Damage/fn_exitDamageHandler.sqf @@ -0,0 +1,20 @@ +/* + * Author: Psycho + + * give back the last damage of the specific body part + + * Arguments: + 0: Unit (Object) + 1: hitPartIndex (Number) + + * Return value: + damage + */ + +params ["_unit", "_hitPartIndex"]; + +_return_part_damage = [damage _unit, _unit getHitIndex _hitPartIndex] select (_hitPartIndex >= 0); + + + +_return_part_damage \ No newline at end of file diff --git a/source/AIS/Damage/fn_getHitIndexValue.sqf b/source/AIS/Damage/fn_getHitIndexValue.sqf new file mode 100644 index 0000000..5f87eb9 --- /dev/null +++ b/source/AIS/Damage/fn_getHitIndexValue.sqf @@ -0,0 +1,39 @@ +/* + * Author: Psycho + + * Give back a wanted hitDamageIndex. Index number or correspondending Hitpart. + + * Arguments: + 0: Unit (Object) + 1: Hitindex or Hitpart (Number OR String) + + * Return value: + ["Hitpart" , IndexNumber, partDamage] + */ + +params [ + "_unit", + ["_hitValue", 0, [0,""]] +]; + + +_ret = if (_hitValue isEqualType 0) then { + + if (_hitValue > 10 || _hitValue < 0) exitWith {diag_log format ["AIS ERROR: AIS_Damage_fnc_getHitIndexValue, input number is out of range: %1", _hitValue]; ["",_hitValue, 0]}; + [((getAllHitPointsDamage _unit) select 1) select _hitValue, _hitValue, ((getAllHitPointsDamage _unit) select 2) select _hitValue] + +} else { + + _hitValue = toLower _hitValue; + private _num = ((getAllHitPointsDamage _unit) select 1) find _hitValue; + + if (_num < 0) then { + [_hitValue, -1, damage _unit] + } else { + [_hitValue, _num, ((getAllHitPointsDamage _unit) select 2) select _num] + }; + +}; + + +_ret \ No newline at end of file diff --git a/source/AIS/Damage/fn_goToDead.sqf b/source/AIS/Damage/fn_goToDead.sqf new file mode 100644 index 0000000..bff8dbc --- /dev/null +++ b/source/AIS/Damage/fn_goToDead.sqf @@ -0,0 +1,41 @@ +/* + * Author: Psycho + + * Set the unit to the real dead. (overall damage == 1) + + * Arguments: + 0: Unit (Object) + + * Return value: + - + */ + +params ["_unit", ["_killer",objNull,[]]]; + +if (!alive _unit) exitWith {}; +if (_unit getVariable ["AIS_UnitIsDead", false]) exitWith {}; + +_unit setVariable ["AIS_UnitIsDead", true]; + +// unit is dragged. So the dragger have to call the release function. +if (!(isNull (_unit getVariable ["ais_DragDrop_Player", objNull]))) then { + _dragger = _unit getVariable ["ais_DragDrop_Player", objNull]; + [_unit] remoteExecCall ["AIS_System_fnc_release", _dragger, false]; +}; + +_unit call AIS_System_fnc_restoreFaks; + +// kill message and score point +if (!isNull _killer && {isPlayer _killer}) then { + [_killer, 1] remoteExec ["addScore", 2]; + if (isPlayer _unit) then { + _text = format ["%1 was killed by %2", name _unit, name _source]; + [_text] remoteExec ["systemChat", 0]; + }; +}; + +// dead... if some issues with the deadcam (shown killer) give the dead a deleay of 1 frame --> need testing +_unit setDamage 1; + + +true \ No newline at end of file diff --git a/source/AIS/Damage/fn_handleDamage.sqf b/source/AIS/Damage/fn_handleDamage.sqf new file mode 100644 index 0000000..8f1168c --- /dev/null +++ b/source/AIS/Damage/fn_handleDamage.sqf @@ -0,0 +1,188 @@ +/* + * by Psycho + + * Arguments: + * 0: Unit That Was Hit (Object) + * 1: Hit Selection (String) + * 2: Damage (Number) + * 3: Shooter (object) + * 4: Projectile (string) + * 5: HitPartIndex (number) + * 6: Instigator (object) + * 7: HitPoint CfgName (String) + + * Return Value: + * Damage +*/ + +/* allHitPointsDamage +[ + ["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"], + ["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs"], + [0,0,0,0,0,0,0,0,0,0,0] +] +*/ + +params [ + "_unit", // Object the event handler is assigned to. + "_hitSelection", // Name of the selection where the unit was damaged. "" for over-all structural damage, "?" for unknown selections. + "_damage", // Resulting level of damage for the selection. + "_source", // The source unit (shooter) that caused the damage. + "_projectile", // Classname of the projectile that caused inflicted the damage. ("" for unknown, such as falling damage.) (String) + "_hitPartIndex", // Hit part index of the hit point, -1 otherwise. + "_instigator", // Person who pulled the trigger. (Object) + "_hitPoint" // hit point Cfg name (String) +]; + +// remote Units +if !(local _unit) exitWith {false}; +if (_damage == 0) exitWith {[_unit, _hitPartIndex] call AIS_Damage_fnc_exitDamageHandler}; +// forbite forther damage when unit is already unconcious +if (AIS_DISABLE_FURTHER_DAMAGE && {_unit getVariable ["ais_unconscious", false]}) exitWith {0.89}; +// dead unit +if (_unit getVariable ["AIS_UnitIsDead", false]) exitWith {0.89}; +// unknown part selection +if (_hitSelection == "?") exitWith {[_unit, _hitPartIndex] call AIS_Damage_fnc_exitDamageHandler}; +// new damage of the selected part +private _new_damage = if (_hitPartIndex >= 0) then {_damage - (_unit getHitIndex _hitPartIndex)} else {_damage - (damage _unit)}; + +// define where the damage come from --> possible outputs: "crash", "smallfire", "bigfire", "falling", "bullet", "grenade", "baaam" +_damageType = [_unit, _hitSelection, _new_damage, _source, _projectile, _hitPartIndex] call AIS_Damage_fnc_verifyDamageType; + +// handle the damage from a fire +if (_damageType isEqualTo "smallfire") exitWith {[_unit, _hitPartIndex] call AIS_Damage_fnc_exitDamageHandler}; +if (_damageType isEqualTo "bigfire") then { + _fire_damage = _unit getVariable ["ais_fireDamage", 0]; + // fire damage is everytime at index -1, part "" --> set the part to "body" and avoid real overall damage + _hitSelection = "body"; + _this set [1, _hitSelection]; + _new_damage = _fire_damage; // point where we can change the influence of fire + _unit setVariable ["ais_fireDamage", 0]; +}; + +// exit if the damage is only minor or we have a negative hitpart index +if (_new_damage < 0.05) exitWith {[_unit, _hitPartIndex] call AIS_Damage_fnc_exitDamageHandler}; + +// handle the damage of falling (adapted from ACE3) +if (_damageType isEqualTo "falling") then { + if !(_hitSelection in ["", "legs"]) then { + _new_damage = [ + _new_damage * 0.5, + _new_damage * abs(_unit getVariable ["ais_impactVelocity", _impactVelocity]) / 50 + ] select (_hitSelection isEqualTo "body"); + _new_damage = if (_new_damage < 0.1) then {0}; //Filter minor falling damage to non-leg hitpoints + } else { + if (_hitSelection isEqualTo "") then { + _hitSelection = "legs"; + _this set [1, _hitSelection]; + }; + _new_damage = _new_damage * 0.7; + }; +}; + +// handle the damage of a crash. Remove the overall damage and bring the damage to a random defined body part. +if (_damageType isEqualTo "crash") then { + if (_hitSelection isEqualTo "") then { + _hitSelection = selectRandom ["head", "hands", "legs"]; + _this set [1, _hitSelection]; + }; + private _min = [1, 0.89] select (_hitSelection isEqualTo "head"); + _new_damage = if (_new_damage < 0.1) then {0} else {_new_damage min _min}; +}; + + +/* +For some reason the engine won't handle the damage to the new(changed) body part. (Bug?) The damage will everytime go to the original part. +So we have to set the damage by ourself to the wanted hitPartIndex. +*/ +_hitPart = [_unit, _hitSelection] call AIS_Damage_fnc_getHitIndexValue; +_damage = (_hitPart select 2) + (_new_damage * AIS_DAMAGE_TOLLERANCE_FACTOR); + +// bullet/splitter impact post process effects +if (AIS_IMPACT_EFFECTS) then { + if (_damageType in ["grenade", "bullet"]) then { + if (isPlayer _unit) then { + [_unit, _damage] call AIS_Effects_fnc_bulletImpact; + }; + }; +}; + +// if there is no revive guarantee, handle a realistic mode. Now we have random chance to die. The risk is increasing with higer damage values and some type of damages. (explos and grenades) +if !(AIS_REVIVE_GUARANTY) then { + private _critical_hit = false; + // vehicle blow-up is everytime critical. Set to dead... + if (!(isNull objectParent _unit)) then { + if (damage (vehicle _unit) >= 1) exitWith { + [_unit,_source] call AIS_Damage_fnc_goToDead; + }; + }; + // critical hit trough explos? + if (_damageType in ["grenade", "baaam"] && {_hitSelection in ["pelvis", "head", "body"]}) then { + if (_damage > 1 && {(0.7 + ((0.05 * (_damage - 1)) * 10)) > random 2}) then { + _critical_hit = true; + }; + }; + // critical hit caused by a head shoot? + if (_damageType isEqualTo "bullet" && {_hitSelection isEqualTo "head"}) then { + if (_damage > 1.2 && {(0.6 + ((0.05 * (_damage - 1)) * 10)) > random 2}) then { + _critical_hit = true; + }; + }; + + // unit is instant death - no revive chance + if (_critical_hit) exitWith {[_unit,_source] call AIS_Damage_fnc_goToDead}; +}; + +// if a stabilized unit become new damage they won't be longer in the stbilized state +_unit setVariable ["ais_stabilized", false, true]; + +// unit can die if they get to mutch new damage in unconscious mode +if ((diag_tickTime > _unit getVariable ["ais_protector_delay", 0]) && {_unit getVariable ["ais_unconscious", false]}) exitWith { + if (_damage > 0.9) then {[_unit,_source] call AIS_Damage_fnc_goToDead}; + _damage = _damage min 0.89; + _damage +}; + + +// not dead? From this point only unconsciousness is possible +private _set_unconscious = false; +// if the unit is in a exploding vehicle... +if (!(isNull objectParent _unit)) then { + if (damage (vehicle _unit) >= 1) then { + [{_this call AIS_System_fnc_checkUnload}, { + [[_this select 0, _this select 1, 0], {_this call AIS_System_fnc_moveCargoRemote}] remoteExec ["call"] + }, [_unit, vehicle _unit]] call AIS_Core_fnc_waitUntilAndExecute; + _set_unconscious = true; + }; +}; +if ((_damage > 0.9) && {_hitSelection in ["", "head", "body"]}) then { + _set_unconscious = true; +}; +// more attention to closer explosives +if ((_damage > 1.5) && {_hitSelection in ["pelvis", "head", "body"]} && {_damageType in ["grenade", "baaam"]}) then { + _set_unconscious = true; +}; +if (_set_unconscious && {!(_unit getVariable ["ais_unconscious", false])}) then { + [{[(_this select 0)] call AIS_System_fnc_setUnconscious}, [_unit]] call AIS_Core_fnc_onNextFrame; + // need this delay to prevent new damage for some seconds after the unit go unconscious. after the delay it is possible to kill the unit when they get to much new damage. + _unit setVariable ["ais_protector_delay", (diag_tickTime + 6)]; + + // kill message and score point + if (!isNull _source && {isPlayer _source}) then { + if (side _source != side _unit) then { + [_source, 1] remoteExec ["addScore", 2]; + } else { + [_source, -1] remoteExec ["addScore", 2]; + }; + if (isPlayer _unit) then { + _text = format ["%1 was seriously wounded by %2", name _unit, name _source]; + [_text] remoteExec ["systemChat", 0]; + }; + }; +}; + +_damage = _damage min 0.89; +//diag_log format ["Selection: %1 --- Damage1: %2 --- Damage2: %3 --- partIndex: %4 --- Projectile: %5 ----> %6", _hitSelection, _damage, (_hitPart select 2), _hitPartIndex, _projectile, diag_frameno]; + +_unit setHitIndex [_hitPart select 1, _damage]; +_damage \ No newline at end of file diff --git a/source/AIS/Damage/fn_verifyDamageType.sqf b/source/AIS/Damage/fn_verifyDamageType.sqf new file mode 100644 index 0000000..ee1bae9 --- /dev/null +++ b/source/AIS/Damage/fn_verifyDamageType.sqf @@ -0,0 +1,54 @@ +params ["_unit", "_hitSelection", "_new_damage", "_source", "_projectile", "_hitPartIndex"]; +private _damageType = ""; + +// Vehicle crash? +private _vehicle = vehicle _unit; +if (!(isNull objectParent _unit) && {_projectile isEqualTo ""} && {_hitSelection isEqualTo ""} && {_source in [objNull, driver _vehicle, _vehicle]} && {!(_vehicle isKindOf "StaticWeapon")}) exitWith { + "crash" +}; + +// Fire? save the micro damages to an storage. Fire is everytime on selection == "". +if ((_projectile isEqualTo "") && {_new_damage < 0.05}) exitWith { + if ((_new_damage + (_unit getVariable ["ais_fireDamage", 0])) > 0.15) then { + "bigfire" + } else { + if !(_unit getVariable ["ais_uncoscious", false]) then { // protect from fire if unconscious + _unit setVariable ["ais_fireDamage", (_unit getVariable ["ais_fireDamage", 0]) + _new_damage]; + }; + "smallfire" + }; +}; + +// Unit is falling? Detect a falling unit and reduce their damage depending on affected body part +private _impactVelocity = (velocity _unit) select 2; +if (_impactVelocity < -5 && {isNull objectParent _unit}) then { + _unit setVariable ["ais_impactVelocity", _impactVelocity]; + _damageType = "falling"; +}; + +// Bullet? +{ + if (_projectile isKindOf _x) exitWith { + _damageType = "bullet"; + }; +} count ["BulletBase", "ShotgunBase"]; + +// Grenade? +{ + if (_projectile isKindOf _x) exitWith { + _damageType = "grenade"; + }; +} count ["Grenade", "GrenadeCore"]; + +// Explosion? +{ + if (_projectile isKindOf _x) exitWith { + _damageType = "baaam"; + }; +} count ["TimeBombCore", "BombCore", "MineCore", "FuelExplosion", "ShellBase", "RocketBase", "MissileBase", "LaserBombCore"]; + + + + + +_damageType \ No newline at end of file diff --git a/source/AIS/Effects/BarDlg.hpp b/source/AIS/Effects/BarDlg.hpp new file mode 100644 index 0000000..800f845 --- /dev/null +++ b/source/AIS/Effects/BarDlg.hpp @@ -0,0 +1,62 @@ +class AIS_Core_Progress_BarDlg { + idd = -1; + movingEnable = false; + onLoad = "uiNamespace setVariable ['AIS_Core_Progress_ProgressBar', (_this select 0) displayCtrl 1]; uiNamespace setVariable ['AIS_Core_Progress_ProgressTitle', (_this select 0) displayCtrl 2];"; + objects[] = {}; + + class controlsBackground { + class Background { + idc = -1; + moving = 0; + font = "PuristaMedium"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0.7}; + colorText[] = {0, 0, 0, 0}; + x = "0.298906 * safezoneW + safezoneX"; + y = "0.082 * safezoneH + safezoneY"; + w = "0.407344 * safezoneW"; + h = "0.011 * safezoneH"; + }; + class ProgressBar { + idc = 1; + moving = 0; + text = ""; + font = "PuristaMedium"; + sizeEx = "1 / 40 / (getResolution select 5)"; + lineSpacing = 0; + access = 0; + type = 0; + style = 2; + size = 1; + colorBackground[] = {0.6784, 0.7490, 0.5137, 0.7}; + colorText[] = {1,1,1,1}; + x = "0.298906 * safezoneW + safezoneX"; + y = "0.082 * safezoneH + safezoneY"; + w = "0.001 * safezoneW"; + h = "0.011 * safezoneH"; + }; + class TitleBar : ProgressBar { + idc = 2; + style = 0x00; + colorBackground[] = {0, 0, 0, 0}; + x = "0.298906 * safezoneW + safezoneX"; + y = "0.093 * safezoneH + safezoneY"; + w = "0.407344 * safezoneW"; + h = "0.022 * safezoneH"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "0.02 / (getResolution select 5)"; + font = "EtelkaMonospaceProBold"; + color = "#FFFFFF"; + align = "left"; + valign = "left"; + shadow = 1; + shadowColor = "#000000"; + }; + }; +}; \ No newline at end of file diff --git a/source/AIS/Effects/cfgFunctions.hpp b/source/AIS/Effects/cfgFunctions.hpp new file mode 100644 index 0000000..fe65444 --- /dev/null +++ b/source/AIS/Effects/cfgFunctions.hpp @@ -0,0 +1,22 @@ +class AIS_Effects +{ + class AIS_Effects + { + file = "AIS\Effects"; + class preInit { preInit = 1; }; + class bleeding; + class BloodSplatterScreen; + class bulletImpact; + class deleteBloodSplatterScreen; + class draw3D; + class garbage; + class helpScream; + class injuredMarker; + class medEquip; + class removeInjuredMarker; + class scream; + class stabil; + class toggleRadio; + class posUpdateInjuredMarker; + }; +}; \ No newline at end of file diff --git a/source/AIS/Effects/fn_bleeding.sqf b/source/AIS/Effects/fn_bleeding.sqf new file mode 100644 index 0000000..0f4266c --- /dev/null +++ b/source/AIS/Effects/fn_bleeding.sqf @@ -0,0 +1,84 @@ +/* + * Author: Psycho + + * Visual bleeding effects and counter for revive time. Will self-run in a loop till unit get revived/stabilized or died. + + * Arguments: + 0: Unit (Object) + 1: Revive Time (Number) + + * Return value: + - +*/ + +params ["_unit", "_revive_time"]; + +// breack out if unit died or revived +if (!alive _unit || {!(_unit getVariable ["ais_unconscious", false])}) exitWith { + _unit setBleedingRemaining 10; + _unit setFatigue 0.6; + resetCamShake; + titleText ["", "PLAIN DOWN", 1]; + + {_x ppEffectEnable false; true} count ais_ppEff; + ppEffectDestroy ais_ppEff; +}; + +// breack out if unit get stabilized +if (_unit getVariable ["ais_stabilized", false]) exitWith { + _unit setBleedingRemaining 10; + _unit setFatigue 0.7; + addCamShake [12, 999, 0.9]; + titleText ["You are stabilized.", "PLAIN DOWN", 1]; + + // loop + private _acc_time = diag_tickTime + 1.5; + [{diag_tickTime >= (_this select 1)}, {_this call AIS_Effects_fnc_stabil}, [_unit, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +}; + + +// get the revive time +_revive_time = [_unit] call AIS_System_fnc_calculateLifeTime; +_unit setBleedingRemaining _revive_time; + +private _timeleft = (ais_start_unc_time + _revive_time) - diag_tickTime; + +// to late +if (_timeleft <= 0) exitWith { + _unit setBleedingRemaining 5; + resetCamShake; + titleText ["", "PLAIN DOWN", 1]; + + {_x ppEffectEnable false; true} count ais_ppEff; + ppEffectDestroy ais_ppEff; + + [_unit, objNull] call AIS_Damage_fnc_goToDead; +}; + +if (AIS_SHOW_COUNTDOWN) then { + [titleText ["It's to late for you.","PLAIN DOWN",1], titleText [format ["Bleedout in %1 Seconds", floor _timeleft],"PLAIN DOWN",0.2]] select (_timeleft > 3); +}; + +_unit setFatigue 1; + +// init pp effects +ais_ppEff = []; +ais_ppEff = ppEffectCreate [["radialBlur", 17091], ["colorCorrections", 1580]]; +{_x ppEffectEnable true; nil} count ais_ppEff; + +// set visual pp effects +_brightness = (_timeleft / _revive_time) + (random 0.1); +(ais_ppEff select 1) ppEffectAdjust [ + _brightness, // brightness, image brightness (0 - black, 1 - unchanged, 2 - white ) + 1, // contrast, image contrast (1 - normal contrast) + 0, // offset, image contrast offset (0 - unchanged ) + random 0.9 max 0.3, 0, 0.05, random 0.75, // color for blending ( R,G,B - color, A - blend factor (0 - original color, 1 - blend color )) + 0.2, 0, 0.5, 0.9, // color for colorization ( R,G,B - color, A - saturation (0 - original color, 1 - B&W multiplied by colorize color)) + 0.199, 0.587, 0.114, 1 // RGB weights for desaturation (0.299, 0.587, 0.114, NA) +]; +(ais_ppEff select 1) ppEffectCommit 0.5; + + +// loop +private _acc_time = diag_tickTime + 1; +[{diag_tickTime >= (_this select 2)}, {_this call AIS_Effects_fnc_bleeding}, [_unit, _revive_time, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/source/AIS/Effects/fn_bloodSplatterScreen.sqf b/source/AIS/Effects/fn_bloodSplatterScreen.sqf new file mode 100644 index 0000000..190e5c2 --- /dev/null +++ b/source/AIS/Effects/fn_bloodSplatterScreen.sqf @@ -0,0 +1,64 @@ +/* + * Author: Vladimir Hynek (BI) + Changed: Psycho + + * Posst process blood effects. (original from BIS_fnc_bloodEffect) + + * Arguments: + - + + * Return value: + - +*/ + +if (!canSuspend) exitWith {[] spawn AIS_Effects_fnc_bloodSplatterScreen;}; +disableSerialization; + +if (isnil {uinamespace getvariable "RscHealthTextures"}) then {uinamespace setvariable ["RscHealthTextures",displaynull]}; +if (isnull (uinamespace getvariable "RscHealthTextures")) then {(["HealthPP_blood"] call bis_fnc_rscLayer) cutrsc ["RscHealthTextures","plain"]}; +_display = uinamespace getvariable "RscHealthTextures"; + + +_texLower = _display displayctrl 1211; +_texLower ctrlsetfade 1; +_texLower ctrlcommit 0; + +_texMiddle = _display displayctrl 1212; +_texMiddle ctrlsetfade 1; +_texMiddle ctrlcommit 0; + +_texUpper = _display displayctrl 1213; +_texUpper ctrlsetfade 1; +_texUpper ctrlcommit 0; + +_x = ((0 * safezoneW) + safezoneX) + ((safezoneW - (2.125 * safezoneW * 3/4)) / 2); +_y = (-0.0625 * safezoneH) + safezoneY; +_w = 2.125 * safezoneW * 3/4; +_h = 1.125 * safezoneH; + +_texLower ctrlsetposition [_x, _y, _w, _h]; +_texMiddle ctrlsetposition [_x, _y, _w, _h]; +_texUpper ctrlsetposition [_x, _y, _w, _h]; + +_texLower ctrlcommit 0; +_texMiddle ctrlcommit 0; +_texUpper ctrlcommit 0; + +_texLower ctrlsetfade 0.2; +_texMiddle ctrlsetfade 0.7; +_texUpper ctrlsetfade 0.7; + +_texLower ctrlcommit 0.2; +_texMiddle ctrlcommit 0.2; +_texUpper ctrlcommit 0.2; + + +// remove effect if player get revived/stabilized or died or character changed (teamswitch or zeus f.e.) +[ + {!alive player || {!(player getVariable ["ais_unconscious", false])} || {(player getVariable ["ais_stabilized", false])}}, + {_this spawn AIS_Effects_fnc_deleteBloodSplatterScreen}, + [_texLower,_texMiddle,_texUpper] +] call AIS_Core_fnc_waitUntilAndExecute; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_bulletImpact.sqf b/source/AIS/Effects/fn_bulletImpact.sqf new file mode 100644 index 0000000..673efd5 --- /dev/null +++ b/source/AIS/Effects/fn_bulletImpact.sqf @@ -0,0 +1,50 @@ +/* + * Author: Psycho + + * Impact effect on bullet hit. + + * Arguments: + 0: Unit (Object) + 1: Strength (Number) + + * Example: + [player, 0.5] call AIS_Effects_fnc_bulletImpact; + + * Return value: + - +*/ + +params ["_unit", "_strength"]; + +if (!local player) exitWith {}; +if (_unit getVariable "ais_unconscious") exitWith {}; + + +if (isNull objectParent _unit && {cameraView in ["INTERNAL", "GUNNER"]}) then { + + _strength = if (_strength < 0.2) then {0.2 + (random 0.3)} else {_strength}; + _strength = if (_strength > 5) then {4 + (random 1)} else {_strength}; + private _power = _strength + 4; + enableCamShake true; + + addCamShake [_power, 0.4, 30]; + private _color = (1 - _strength) max 0.15; + + // set color corrections + "colorCorrections" ppEffectEnable true; + "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, _color], [1, 1, 1, 0.0]]; + "colorCorrections" ppEffectCommit 0; + "dynamicBlur" ppEffectEnable true; + "dynamicBlur" ppEffectAdjust [1.8]; + "dynamicBlur" ppEffectCommit 0; + + // set effect duration, depending on hit strength + "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 0.0]]; + "colorCorrections" ppEffectCommit _strength; + + "dynamicBlur" ppEffectAdjust [0]; + "dynamicBlur" ppEffectCommit _strength; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_deleteBloodSplatterScreen.sqf b/source/AIS/Effects/fn_deleteBloodSplatterScreen.sqf new file mode 100644 index 0000000..28e55bc --- /dev/null +++ b/source/AIS/Effects/fn_deleteBloodSplatterScreen.sqf @@ -0,0 +1,26 @@ +/* + * Author: Psycho + + * Remove post process blood effects. + + * Arguments: + - + + * Return value: + - +*/ +disableSerialization; +params ["_texLower", "_texMiddle", "_texUpper"]; + +_texLower ctrlsetfade 1; +_texMiddle ctrlsetfade 1; +_texUpper ctrlsetfade 1; + +_texUpper ctrlcommit 1.5; +sleep 1; +_texMiddle ctrlcommit 1; +sleep 0.5; +_texLower ctrlcommit 0.8; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_draw3D.sqf b/source/AIS/Effects/fn_draw3D.sqf new file mode 100644 index 0000000..5ddd695 --- /dev/null +++ b/source/AIS/Effects/fn_draw3D.sqf @@ -0,0 +1,53 @@ +//if (!isNull (findDisplay 12)) exitWith {}; // Map +if (isNull (findDisplay 46)) exitWith {}; +if (!isNull (findDisplay 49)) exitWith {}; // Esc Menu + +// remove the meh if client left the mission +if (getClientStateNumber in [11,12]) exitWith { + removeMissionEventHandler ["draw3D", AIS_Core_3DEHId]; +}; + +private _targets = []; + +_recognize_distance = if (player call AIS_System_fnc_isMedic) then {35} else {20}; +_targets = player nearEntities ["CAManBase", _recognize_distance]; +if (count _targets < 1) exitWith {}; + +private _playerPos = positionCameraToWorld [0, 0, 0]; + +if (!surfaceIsWater _playerPos) then { + _playerPos = ATLtoASL _playerPos; +}; + +{ + private _target = effectiveCommander _x; + + if ( + _target getVariable ["ais_unconscious", false] && + {_target != player} && + //{isPlayer _target} && + {!(_x in allUnitsUAV)} && + {alive player} && + {AIS_Core_realSide isEqualTo (getNumber (configfile >> "CfgVehicles" >> (typeOf _target) >> "side"))} + ) then { + _targetPos = getPosASLVisual _target; + _distance = _targetPos distance2D _playerPos; + _headPosition = _target modelToWorldVisual (_target selectionPosition "spine"); + _alpha = 0.8; + //_color = [0.94,1,0,_alpha];//Yellow + //_color = [0.65,0.15,0,_alpha];//Dark Red + _color = [0.87,0.03,0,_alpha];//shiny Red + _targetPos set [2, ((_target modelToWorld [0,0,0]) select 2) + _height + _distance * 0.026]; + _text = format ["%1 (%2m)", name _target, ceil (player distance _target)]; + + _icon = if (_target getVariable ["ais_stabilized", false]) then { + "\a3\ui_f\data\IGUI\Cfg\Actions\heal_ca.paa" + } else { + "\a3\ui_f\data\IGUI\Cfg\Actions\bandage_ca.paa" + }; + + drawIcon3D [_icon, _color, _headPosition vectorAdd [0, 0, 0.4], 0.8, 0.8, 0, _text, 1, 0.04, "PuristaMedium", "center", true]; + }; + + true +} count _targets; \ No newline at end of file diff --git a/source/AIS/Effects/fn_garbage.sqf b/source/AIS/Effects/fn_garbage.sqf new file mode 100644 index 0000000..f4447bc --- /dev/null +++ b/source/AIS/Effects/fn_garbage.sqf @@ -0,0 +1,38 @@ +/* + * Author: Alwarren + + * Remove ambient medical equimpment from the ground. If euqipment is marked as "do not delete", the loop will set it to delete list for the next time the function is called. + + * Arguments: + - + + * Example: + [player] call AIS_Effects_fnc_garbage; + + * Return value: + - +*/ + +if (!local player) exitWith {}; +private _delete = false; + +if (count ais_medequip_array > 0) then { + { + if (count _x > 1) then { + if ((_x select 0) > 0) then { + deleteVehicle (_x select 1); + ais_medequip_array set [_forEachIndex, objNull]; + } else { + _x set [0,1]; + }; + } else { + ais_medequip_array set [_forEachIndex, objNull]; + _delete = true; + }; + } forEach ais_medequip_array; +}; + +ais_medequip_array = ais_medequip_array - [objNull]; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_helpScream.sqf b/source/AIS/Effects/fn_helpScream.sqf new file mode 100644 index 0000000..80df17b --- /dev/null +++ b/source/AIS/Effects/fn_helpScream.sqf @@ -0,0 +1,28 @@ +/* + * Author: Psycho + + * Play a random screaming sound when a unit go unconcsious + + * Arguments: + 0: Unit (Object) + 1: audible distance (optional) + + * Return value: + - + +* Exapmle: + [player, 30] call AIS_Effects_fnc_helpScream; +*/ + +params [ + ["_injured", objNull], + ["_dist", 50, [0]] +]; + + +// playSound is global +_helpsound = format ["a3\sounds_f\characters\human-sfx\%1\%2", ais_personal_soundset select 0, selectRandom (ais_personal_soundset select 1)]; +playSound3D [_helpsound, _injured, false, getPosASL _injured, 1.5, 1, _dist]; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_injuredMarker.sqf b/source/AIS/Effects/fn_injuredMarker.sqf new file mode 100644 index 0000000..5cde957 --- /dev/null +++ b/source/AIS/Effects/fn_injuredMarker.sqf @@ -0,0 +1,33 @@ +/* + * Author: Psycho + + * Create a local marker for unconcious units + + * Arguments: + 0: Unit (Object) + + * Return value: + the marker itself + +* Exapmle: + player call AIS_Effects_fnc_injuredMarker + */ + +private _unit = _this; +private _mark = ""; + +_str = name _unit; +_marker = format ["%1_ais_marker", _str]; + +if (!isNil {_unit getVariable ["ais_unitMarker", Nil]}) then { + _unit call AIS_Effects_fnc_removeInjuredMarker; +}; + +_mark = [_marker, position _unit, "ICON", "Color1_FD_F", [0.7, 0.7], format ["%1 down", _str], 0, "loc_Hospital"] call AIS_Core_fnc_createLocalMarker; +_unit setVariable ["ais_unitMarker", _marker]; + +_acc_time = diag_tickTime + 5; +[{diag_tickTime > (_this select 1)}, {[_this select 0] call AIS_Effects_fnc_posUpdateInjuredMarker}, [_unit, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; + + +_mark \ No newline at end of file diff --git a/source/AIS/Effects/fn_medEquip.sqf b/source/AIS/Effects/fn_medEquip.sqf new file mode 100644 index 0000000..ad76b84 --- /dev/null +++ b/source/AIS/Effects/fn_medEquip.sqf @@ -0,0 +1,62 @@ +/* + * Author: Alwarren + + * Spawn randomized some ambient medical equipment around the injured. + + * Arguments: + 0: Unit Helper (Object) + 1: Unit wounded (Object) + + * Example: + [player] call AIS_Effects_fnc_medEquip; + + * Return value: + - +*/ + +params [ + "_healer", + "_injured" +]; +if (!local _healer) exitWith {}; + +// spawn defi and a bloodbag +if (_healer call AIS_System_fnc_isMedic) then { + _defi_pos = _healer modelToWorld [-0.5,0.2,0]; + _defi = "Land_Defibrillator_F" createVehicle _defi_pos; + [_defi, [_defi_pos select 0, _defi_pos select 1, 0]] call AIS_Core_fnc_setPosAGLS; + _defi setDir (getDir _healer - 180); + ais_medequip_array pushBack [1,_defi]; + + if (damage _injured >= 0.5 && {(random 2) >= 1}) then { + _bb_pos = _healer modelToWorld [0.4,(0.2 - (random 0.5)),0]; + _bb = "Land_BloodBag_F" createVehicle _bb_pos; + [_bb, [_bb_pos select 0, _bb_pos select 1, 0]] call AIS_Core_fnc_setPosAGLS; + _bb setDir (random 359); + ais_medequip_array pushBack [0,_bb]; + }; +}; + +// spawn bandages +for "_i" from 1 to (1 + (round random 3)) do { + _band_pos = _healer modelToWorld [(random 1.3),(0.8 + (random 0.6)),0]; + _band = "Land_Bandage_F" createVehicle _band_pos; + [_band, [_band_pos select 0, _band_pos select 1, 0]] call AIS_Core_fnc_setPosAGLS; + _band setDir (random 359); + if (_i > 1) then { + ais_medequip_array pushBack [0,_band]; + } else { + ais_medequip_array pushBack [1,_band]; + }; +}; + +// spawn antibioticum +if (random 2 >= 1) then { + _ab_pos = _healer modelToWorld [-0.8,(0.6 - (random 0.4)),0]; + _ab = "Land_Antibiotic_F" createVehicle _ab_pos; + [_ab, [_ab_pos select 0, _ab_pos select 1, 0]] call AIS_Core_fnc_setPosAGLS; + _ab setDir (random 359); + ais_medequip_array pushBack [0,_ab]; +}; + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_posUpdateInjuredMarker.sqf b/source/AIS/Effects/fn_posUpdateInjuredMarker.sqf new file mode 100644 index 0000000..7c98032 --- /dev/null +++ b/source/AIS/Effects/fn_posUpdateInjuredMarker.sqf @@ -0,0 +1,34 @@ +/* + * Author: Psycho + + * Update the marker position every 5 seconds until the marker is deleted. + + * Arguments: + 0: Unit (Object) + 1: Marker (String) + + * Return value: + - + +* Exapmle: + - + */ + +params ["_unit"]; +_marker = _unit getVariable ["ais_unitMarker", Nil]; + +if (!isNil "_marker") then { + if (_unit getVariable ["ais_unconscious", false]) then { + _marker setMarkerPosLocal (getPos _unit); + + _acc_time = diag_tickTime + 5; + [{diag_tickTime > (_this select 1)}, {[_this select 0] call AIS_Effects_fnc_posUpdateInjuredMarker}, [_unit, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; + }; + + if (!alive _unit || {isNull _unit}) then { + _unit call AIS_Effects_fnc_removeInjuredMarker; + }; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_preinit.sqf b/source/AIS/Effects/fn_preinit.sqf new file mode 100644 index 0000000..08508c8 --- /dev/null +++ b/source/AIS/Effects/fn_preinit.sqf @@ -0,0 +1,37 @@ +// from domination +ais_help_screaming = [ + [ + "Person0", + [ + "P0_moan_13_words.wss", "P0_moan_14_words.wss", "P0_moan_15_words.wss", "P0_moan_16_words.wss", + "P0_moan_17_words.wss", "P0_moan_18_words.wss", "P0_moan_19_words.wss", "P0_moan_20_words.wss" + ] + ], + [ + "Person1", + [ + "P1_moan_19_words.wss", "P1_moan_20_words.wss", "P1_moan_21_words.wss", "P1_moan_22_words.wss", + "P1_moan_23_words.wss", "P1_moan_24_words.wss", "P1_moan_25_words.wss", "P1_moan_26_words.wss", + "P1_moan_27_words.wss", "P1_moan_28_words.wss", "P1_moan_29_words.wss", "P1_moan_30_words.wss", + "P1_moan_31_words.wss", "P1_moan_32_words.wss", "P1_moan_33_words.wss" + ] + ], + [ + "Person2", + [ + "P2_moan_14_words.wss", "P2_moan_15_words.wss", "P2_moan_16_words.wss", "P2_moan_17_words.wss", + "P2_moan_18_words.wss", "P2_moan_19_words.wss", "P2_moan_20_words.wss", "P2_moan_21_words.wss" + ] + ], + [ + "Person3", + [ + "P3_moan_10_words.wss", "P3_moan_11_words.wss", "P3_moan_12_words.wss", "P3_moan_13_words.wss", + "P3_moan_14_words.wss", "P3_moan_15_words.wss", "P3_moan_16_words.wss", "P3_moan_17_words.wss", + "P3_moan_18_words.wss", "P3_moan_19_words.wss", "P3_moan_20_words.wss" + ] + ] +]; + +// every player set only onetime his personal voice set. +ais_personal_soundset = selectRandom ais_help_screaming; \ No newline at end of file diff --git a/source/AIS/Effects/fn_removeinjuredMarker.sqf b/source/AIS/Effects/fn_removeinjuredMarker.sqf new file mode 100644 index 0000000..e29a116 --- /dev/null +++ b/source/AIS/Effects/fn_removeinjuredMarker.sqf @@ -0,0 +1,25 @@ +/* + * Author: Psycho + + * Delete a local unconcsious marker + + * Arguments: + 0: Unit (Object) + + * Return value: + - + +* Exapmle: + player call AIS_Effects_fnc_removeInjuredMarker; + */ + +private _unit = _this; +private _marker = _unit getVariable ["ais_unitMarker", Nil]; + +if (!isNil "_marker") then { + deleteMarkerLocal _marker; + _unit setVariable ["ais_unitMarker", Nil]; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_scream.sqf b/source/AIS/Effects/fn_scream.sqf new file mode 100644 index 0000000..6f89aaa --- /dev/null +++ b/source/AIS/Effects/fn_scream.sqf @@ -0,0 +1,29 @@ +/* + * Author: Psycho + + * Play a random screaming sound when a unit go unconcsious + + * Arguments: + 0: Unit (Object) + 1: audible distance (optional) + + * Return value: + - + +* Exapmle: + [player, 30] call AIS_Effects_fnc_Scream; +*/ + +params [ + ["_injured", objNull], + ["_dist", 50, [0]] +]; + +// playSound is global +if (random 3 > 1.7) then { + _deathsound = format ["A3\sounds_f\characters\human-sfx\P0%1\Hit_Max_%2.wss", selectRandom [4,5,6,7,8,9], selectRandom [1,2,3,4,5]]; + playSound3D [_deathsound, _injured, false, getPosASL _injured, 1.5, 1, _dist]; +}; + + +true \ No newline at end of file diff --git a/source/AIS/Effects/fn_stabil.sqf b/source/AIS/Effects/fn_stabil.sqf new file mode 100644 index 0000000..68cb984 --- /dev/null +++ b/source/AIS/Effects/fn_stabil.sqf @@ -0,0 +1,69 @@ +/* + * Author: Psycho + + * Visual bleeding effects and counter for revive time. Will self-run in a loop till unit get revived/stabilized or died. + + * Arguments: + 0: Unit (Object) + 1: Revive Time (Number) + + * Return value: + - +*/ + +params ["_unit"]; + +// breack out if unit died or revived +if (!alive _unit || {!(_unit getVariable ["ais_unconscious", false])}) exitWith { + _unit setBleedingRemaining 10; + _unit setFatigue 0.6; + resetCamShake; + titleText ["", "PLAIN DOWN", 1]; + + {_x ppEffectEnable false; true} count ais_ppEff; + ppEffectDestroy ais_ppEff; +}; + +// breack out if unit get new damage (no longer stabilized) +if (!(_unit getVariable ["ais_stabilized", false])) exitWith { + _unit setBleedingRemaining 10; + _unit setFatigue 1; + addCamShake [15, 999, 0.7]; + + // Function use disableSerialisation and can corrupt some other functions in the same frame. So it need a delay till next frame. + [{call AIS_Effects_fnc_bloodSplatterScreen}] call AIS_Core_fnc_onNextFrame; + + // get the revive time + _revive_time = [_unit] call AIS_System_fnc_calculateLifeTime; + _unit setBleedingRemaining _revive_time; + + // loop + private _acc_time = diag_tickTime + 1; + [{diag_tickTime >= (_this select 2)}, {_this call AIS_Effects_fnc_bleeding}, [_unit, _revive_time, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +}; + + + +titleText ["You are stabilized.", "PLAIN DOWN", 1.5]; +_unit setFatigue 0.6; + +// init pp effects +ais_ppEff = []; +ais_ppEff = ppEffectCreate [["radialBlur", 17091], ["colorCorrections", 1580]]; +{_x ppEffectEnable true; nil} count ais_ppEff; + +// set visual pp effects +(ais_ppEff select 1) ppEffectAdjust [ + 0.9 + (random 0.2), // brightness, image brightness (0 - black, 1 - unchanged, 2 - white ) + 1, // contrast, image contrast (1 - normal contrast) + 0, // offset, image contrast offset (0 - unchanged ) + random 0.7 max 0.2, 0, 0.05, random 0.6, // color for blending ( R,G,B - color, A - blend factor (0 - original color, 1 - blend color )) + 0.2, 0, 0.5, 0.9, // color for colorization ( R,G,B - color, A - saturation (0 - original color, 1 - B&W multiplied by colorize color)) + 0.199, 0.587, 0.114, 1 // RGB weights for desaturation (0.299, 0.587, 0.114, NA) +]; +(ais_ppEff select 1) ppEffectCommit 0.5; + + +// loop +private _acc_time = diag_tickTime + 1.5; +[{diag_tickTime >= (_this select 1)}, {_this call AIS_Effects_fnc_stabil}, [_unit, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; \ No newline at end of file diff --git a/source/AIS/Effects/fn_toggleRadio.sqf b/source/AIS/Effects/fn_toggleRadio.sqf new file mode 100644 index 0000000..0c0304a --- /dev/null +++ b/source/AIS/Effects/fn_toggleRadio.sqf @@ -0,0 +1,34 @@ +/* + * Author: Psycho + + * Enable/disable the TFAR and/or ACRE radios when player is unconscious. + + * Arguments: + 0: Unit (Object) + + * Return value: + Bool + */ + + +_canUse = param [0, true, [true]]; + +if (_canUse) then { + player setVariable ["tf_globalVolume", 1]; + player setVariable ["tf_voiceVolume", 1]; + player setVariable ["tf_unable_to_use_radio", false]; + + player setVariable ["acre_sys_core_isDisabled", false, true]; + player setVariable ["acre_sys_core_globalVolume", 1]; + +} else { + + player setVariable ["tf_globalVolume", 0.4]; + player setVariable ["tf_voiceVolume", 0]; + player setVariable ["tf_unable_to_use_radio", true]; + + player setVariable ["acre_sys_core_isDisabled", true, true]; + player setVariable ["acre_sys_core_globalVolume", 0]; +}; + +true \ No newline at end of file diff --git a/source/AIS/System/cfgFunctions.hpp b/source/AIS/System/cfgFunctions.hpp new file mode 100644 index 0000000..2b1c9fb --- /dev/null +++ b/source/AIS/System/cfgFunctions.hpp @@ -0,0 +1,56 @@ +class AIS_System +{ + class AIS_System + { + file = "AIS\System"; + class postInit { postInit = 1; }; + class addMedEvacObj; + class AIselfCheck; + class allowCarry; + class allowDrag; + class allowPullIn; + class allowPullOut; + class allowRevive; + class allowStabilize; + class bloodloss; + class bloodlossAI; + class calculateLifeTime; + class calculateReviveTime; + class calculateStabilizeTime; + class callHelp; + class carry; + class checkLauncher; + class checkUnload; + class diary; + class disableRespawnButton; + class drag; + class findAIHelper; + class getCargoIndex; + class getOutMan; + class handleHeal; + class isMedic; + class keyHandler; + class killed; + class loadAIS; + class loadAISlocalToPlayer; + class loadInjured; + class medEvacArea; + class moveAIHelper; + class moveCargoRemote; + class overrideHealAction; + class release; + class removeFaks; + class respawn; + class restoreFaks; + class reveal; + class Revive; + class ReviveAI; + class secondsToString; + class setUnconscious; + class stabilize; + class unconcsiousRemote; + class unconsciousAI; + class unconsciousPlayer; + class unloadInjured; + }; +}; \ No newline at end of file diff --git a/source/AIS/System/fn_AIselfCheck.sqf b/source/AIS/System/fn_AIselfCheck.sqf new file mode 100644 index 0000000..2e2adad --- /dev/null +++ b/source/AIS/System/fn_AIselfCheck.sqf @@ -0,0 +1,41 @@ +/* + * Author: Psycho + + * Check if no player is in this group. (only AI's) If it is so, the AI will call for other AI's to help him. Otherwise a AI-only group cant be revive. + + * Arguments: + 0: Injured Unit (Object) + + * Return value: + Nothing +*/ + +params ["_injured_ai"]; + +// breack the self check loop if help is no longer needed or possible. +if (!alive _injured_ai) exitWith {}; +if (!(_injured_ai getVariable ["ais_unconscious", false])) exitWith {}; + +// injured is in handling. check some seconds later if handlin was interrupted. +if (!isNull (_injured_ai getVariable ["ais_hasHelper", objNull])) then { + private _acc_time = (diag_tickTime + 30); + [{diag_tickTime > (_this select 1)}, {[(_this select 0)] call AIS_System_fnc_AIselfCheck}, [_injured_ai, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +}; + + +// searching for players in the group +private _group_with_player = false; +private _all_members = (units group _injured_ai) - [_injured_ai]; +if (count _all_members > 0) then { + {if (isPlayer _x) exitWith {_group_with_player = true};true} count _all_members; +}; + +// do nothing if players in group +if (_group_with_player) exitWith {}; + +// if no player is present call for help (with a short delay) +private _acc_time = (diag_tickTime + 40); +[{diag_tickTime > (_this select 2)}, {_this call AIS_System_fnc_findAIHelper}, [_injured_ai, objNull, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_Revive.sqf b/source/AIS/System/fn_Revive.sqf new file mode 100644 index 0000000..cb8bfa8 --- /dev/null +++ b/source/AIS/System/fn_Revive.sqf @@ -0,0 +1,109 @@ +/* + * Author: Psycho + + * Handle Revive actions from a PLAYER + + * Arguments: + 0: Healer Unit (Object) + 1: Injured Unit (Object) + + * Return value: + Nothing +*/ + +params [ + ["_healer", player, [player]], + "_injured" +]; + +_injured setVariable ["ais_hasHelper", _healer, true]; + +//_injured playMove "AinjPpneMstpSnonWrflDnon_rolltoback"; // from AIS fsm +[_injured, "AinjPpneMstpSnonWrflDnon_rolltoback"] remoteExec ["playMove", 0]; + +// switch to primary weapon if possible. Small delay for handling is needed. +if (primaryWeapon _healer != "") then { + _healer switchmove "amovpercmstpsraswrfldnon"; + _healer selectWeapon (primaryWeapon _healer); +}; + +_healer playAction "medicStart"; + +// full heal anim only with primary weapon possible. +ais_animChangeEVH = _healer addEventhandler ["AnimChanged", { + params ["_healer","_anim"]; + if (primaryWeapon _healer isEqualTo "") then { + if (_anim in ["amovpknlmstpsnonwnondnon","amovpknlmstpsraswlnrdnon"]) then { + _healer playActionNow "medicStart"; + }; + }; +}]; + +_offset = [0,0,0]; _dir = 0; +_relpos = _healer worldToModel position _injured; +if (((_healer getDir _injured) - (_injured getDir _healer)) < 0) then {_offset = [-0.2,0.7,0]; _dir = 90} else {_offset = [0.2,0.7,0]; _dir = 270}; + +_injured attachTo [_healer, _offset]; +[_injured, _dir] remoteExec ["setDir", 0, false]; + +[_healer, _injured] call AIS_Effects_fnc_medEquip; +private _duration = [_healer, _injured] call AIS_System_fnc_calculateReviveTime; +//hint format ["Revive Time Duration: %1", _duration]; // debug + +[ + "Applying First Aid", + _duration, + { + params ["_injured", "_healer"]; + + _injured setVariable ["ais_unconscious", false, true]; + + _healer removeEventHandler ["AnimChanged", ais_animChangeEVH]; + detach _healer; + detach _injured; + + _healer playAction "medicStop"; + [_healer, 1] remoteExec ["addScore", 2]; // +1 per revive + + _injured setVariable ["ais_hasHelper", ObjNull, true]; + call AIS_Effects_fnc_garbage; + + // healing if enabled + if (AIS_REVIVE_HEAL) then { + _injured setDamage 0; + _injured setVariable ["ais_fireDamage", 0]; + } else { + // make sure the unit can walk after revive + if ((_injured getHitIndex 10) > 0.49) then { + [{(_this select 0) setHitIndex [10, 0.49]}, [_injured]] call AIS_Core_fnc_onNextFrame; + }; + }; + + [_injured] remoteExecCall ["AIS_System_fnc_restoreFaks", _injured, false]; + + _injured stop false; + {_injured enableAI _x; nil} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; + [_injured, false] remoteExecCall ["AIS_System_fnc_unconcsiousRemote", 0, false]; + [_injured, false] remoteExec ["setCaptive", 0, false]; + + ["GetOutMan"] remoteExec ["removeAllEventHandlers", _injured, false]; + }, + [_injured, _healer], + { + params ["_injured", "_healer"]; + + _injured setVariable ["ais_hasHelper", ObjNull, true]; + + _healer removeEventHandler ["AnimChanged", ais_animChangeEVH]; + detach _healer; + detach _injured; + + call AIS_Effects_fnc_garbage; + + if (alive _healer) then { + _healer playActionNow "medicStop"; + }; + if (!alive _injured) then {["He is not with us anymore."] call AIS_Core_fnc_dynamicText}; + }, + (!alive _injured || _healer getVariable ["ais_unconscious",false]) +] call AIS_Core_fnc_Progress_ShowBar; \ No newline at end of file diff --git a/source/AIS/System/fn_ReviveAI.sqf b/source/AIS/System/fn_ReviveAI.sqf new file mode 100644 index 0000000..4027104 --- /dev/null +++ b/source/AIS/System/fn_ReviveAI.sqf @@ -0,0 +1,108 @@ +/* + * Author: Psycho + + * Handle Revive actions from a AI. + + * Arguments: + 0: Healer Unit (Object) + 1: Injured Unit (Object) + + * Return value: + Nothing +*/ + +params [ + ["_healer", player, [player]], + "_injured" +]; + +_injured setVariable ["ais_hasHelper", _healer, true]; + +_behaviour = behaviour _healer; + +// move the wounded out of the vehicle +if (!isNull objectParent _injured) exitWith { + [[_injured, vehicle _injured, 0], {_this call AIS_System_fnc_moveCargoRemote}] remoteExec ["call"]; + _acc_time = diag_tickTime + 1.382; + [{diag_tickTime > (_this select 2)}, {[_this select 0, _this select 1] spawn AIS_System_fnc_ReviveAI}, [_healer, _injured, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +}; + +[_injured, "AinjPpneMstpSnonWrflDnon_rolltoback"] remoteExec ['playMove', 0]; + +// switch to primary weapon if possible. Small delay for handling is needed. +if (primaryWeapon _healer != "") then { + _healer selectWeapon primaryWeapon _healer; + sleep 0.5; +}; + +_healer setPos (getPos _injured); // avoid to move the injured a few metres away +[_healer, "medicStart"] remoteExec ['playAction', 0]; + +_healer stop true; +{_healer disableAI _x; true} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; + +_offset = [0,0,0]; _dir = 0; +_relpos = _healer worldToModel position _injured; +if ((_relpos select 0) < 0) then {_offset = [-0.2,0.7,0]; _dir = 90} else {_offset = [0.2,0.7,0]; _dir = 270}; + +_injured attachTo [_healer, _offset]; +[_injured, _dir] remoteExec ["setDir", 0, false]; + +private _duration = [_healer, _injured] call AIS_System_fnc_calculateReviveTime; + + +private _startTime = diag_tickTime + _duration; +waitUntil { + diag_tickTime > _startTime || + !alive _healer || + !alive _injured || + _healer getVariable ["ais_unconscious", false] +}; + +_injured setVariable ["ais_hasHelper", ObjNull, true]; + +detach _healer; +detach _injured; + +if (!alive _healer || _healer getVariable ["ais_unconscious", false]) exitWith {}; +_healer playActionNow "medicStop"; + +_healer stop false; +{_healer enableAI _x; true} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; +_healer setBehaviour _behaviour; + + +if (alive _injured) then { + _injured setVariable ["ais_unconscious", false, true]; + + // healing if enabled + if (AIS_REVIVE_HEAL) then { + _injured setDamage 0; + _injured setVariable ["ais_fireDamage", 0]; + } else { + // make sure the unit can walk after revive + if ((_injured getHitIndex 10) > 0.49) then { + [{(_this select 0) setHitIndex [10, 0.49]}, [_injured]] call AIS_Core_fnc_onNextFrame; + }; + }; + + [_injured] remoteExecCall ["AIS_System_fnc_restoreFaks", _injured, false]; + + if (isPlayer _injured) then { + [true] remoteExec ['showHud', _injured]; + if (AIS_TOGGLE_RADIO) then { + [true] remoteExecCall ["AIS_Effects_fnc_toggleRadio", _injured, false]; + }; + } else { + _injured stop false; + {_injured enableAI _x; nil} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; + }; + + [_injured, false] remoteExecCall ["AIS_System_fnc_unconcsiousRemote", 0]; + [_injured, false] remoteExec ["setCaptive", 0, false]; + + ["GetOutMan"] remoteExec ["removeAllEventHandlers", _injured, false]; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_addMedEvacObj.sqf b/source/AIS/System/fn_addMedEvacObj.sqf new file mode 100644 index 0000000..3334140 --- /dev/null +++ b/source/AIS/System/fn_addMedEvacObj.sqf @@ -0,0 +1,31 @@ +/* + * Author: psycho + + * Set a object / Vehicle in function of a medevac point and make it public. Usable for spawned objects for example. Public function. + + * Arguments: + 0: Vehicle (Object) + 1: Distance (Number) + + * Return value: + changed AIS_MEDEVAC_STATIONS array. + Return a Bool if no new object was added. (error) + */ + +params [["_obj",objNull,[objNull]], ["_distance",0,[0]]]; +private _return = false; + +if (!isNull _obj) then { + _index = AIS_MEDEVAC_STATIONS pushBackUnique [_obj, _distance]; + if (_index != -1) then {_return = true}; +} else { + _return = false; +}; + +if (_return) exitWith { + publicVariable "AIS_MEDEVAC_STATIONS"; + AIS_MEDEVAC_STATIONS +}; + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_allowCarry.sqf b/source/AIS/System/fn_allowCarry.sqf new file mode 100644 index 0000000..60a6f9b --- /dev/null +++ b/source/AIS/System/fn_allowCarry.sqf @@ -0,0 +1,35 @@ +/* + * Author: psycho + + * Check Unit if carrying is possible/allowed. If yes, drag-action is shown up. + + * Arguments: + 0: Unit (Object) + + * Return value: + Bool + */ + +private _target = _this; + +_isUnc = _target getVariable ["ais_unconscious",false]; +_isUncHealer = player getVariable ["ais_unconscious",false]; +_Drag = !(isNull (_target getVariable ['ais_DragDrop_Player', objNull])); +_Draging = !(isNull (player getVariable ['ais_DragDrop_Torso', objNull])); + + + +_return = if ( + + _isUnc && + !_isUncHealer && + {alive _target} && + {_Drag} && + {_Draging} + +) then {true} else {false}; + + + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_allowDrag.sqf b/source/AIS/System/fn_allowDrag.sqf new file mode 100644 index 0000000..d96f4f2 --- /dev/null +++ b/source/AIS/System/fn_allowDrag.sqf @@ -0,0 +1,37 @@ +/* + * Author: psycho + + * Check Unit if dragging/carrying is possible/allowed. If yes, drag-action is shown up. + + * Arguments: + 0: Unit (Object) + + * Return value: + Bool + */ + +private _target = _this; + +_isUnc = _target getVariable ["ais_unconscious",false]; +_isUncHealer = player getVariable ["ais_unconscious",false]; +_noHealer = isNull (_target getVariable ['ais_hasHelper', objNull]); +_noDrag = isNull (_target getVariable ['ais_DragDrop_Player', objNull]); +_noDraging = isNull (player getVariable ['ais_DragDrop_Torso', objNull]); + + + +_return = if ( + + _isUnc && + !_isUncHealer && + {alive _target} && + {_noHealer} && + {_noDrag} && + {_noDraging} + +) then {true} else {false}; + + + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_allowPullIn.sqf b/source/AIS/System/fn_allowPullIn.sqf new file mode 100644 index 0000000..3b9bba3 --- /dev/null +++ b/source/AIS/System/fn_allowPullIn.sqf @@ -0,0 +1,18 @@ +/* + * Author: Psycho + + * Check if uncoscious Unit can load in a vehicle.. + + * Arguments: + 0: Vehicle (Object) + + * Return value: + Bool + */ + +private _targetVehicle = _this; + +_canload = [false, true] select (count ([_targetVehicle] call AIS_System_fnc_getCargoIndex) > 0); + + +_canload \ No newline at end of file diff --git a/source/AIS/System/fn_allowPullOut.sqf b/source/AIS/System/fn_allowPullOut.sqf new file mode 100644 index 0000000..e7d8e91 --- /dev/null +++ b/source/AIS/System/fn_allowPullOut.sqf @@ -0,0 +1,28 @@ +/* + * Author: psycho + + * Check Unit if get a unit out of a vehicle is possible + + * Arguments: + 0: Vehicle (Object) + + * Return value: + Bool + */ + +private _targetVehicle = _this; + +private _crew = crew _targetVehicle; +private _isUncInside = false; + +if (count _crew > 0) then { + { + if (_x getVariable ["ais_unconscious", false]) then { + if (_x call AIS_System_fnc_checkUnload) exitWith {_isUncInside = true}; + }; + true + } count _crew; +}; + + +_isUncInside \ No newline at end of file diff --git a/source/AIS/System/fn_allowRevive.sqf b/source/AIS/System/fn_allowRevive.sqf new file mode 100644 index 0000000..7dfb123 --- /dev/null +++ b/source/AIS/System/fn_allowRevive.sqf @@ -0,0 +1,53 @@ +/* + * Author: Psycho + + * Check Unit if Revive is possible. If yes, Revive-Action is shown up. + + * Arguments: + 0: Unit (Object) + + * Return value: + Bool + */ + +private _target = _this; + +_isUnc = _target getVariable ["ais_unconscious",false]; +_isStabil = _target getVariable ["ais_stabilized",false]; +_isUncHealer = player getVariable ["ais_unconscious",false]; +_noHealer = isNull (_target getVariable ['ais_hasHelper', objNull]); +_noDrag = isNull (_target getVariable ['ais_DragDrop_Player', objNull]); +_noDraging = isNull (player getVariable ['ais_DragDrop_Torso', objNull]); + +private _station = true; +if (count AIS_MEDEVAC_STATIONS > 0) then { + _station = [player, _target] call AIS_System_fnc_medEvacArea; +}; + + +_is_able_to_do = switch (AIS_MEDICAL_EDUCATION) do { + case (0) : {true}; + case (1) : {(items player) find "FirstAidKit" > -1 || {(items player) find "Medikit" > -1}}; + case (2) : {player call AIS_System_fnc_isMedic}; + default {true}; +}; + + +_return = if ( + + _isUnc && + {_isStabil} && + {!_isUncHealer} && + {alive _target} && + {_noHealer} && + {_noDrag} && + {_noDraging} && + {_is_able_to_do} && + {_station} + +) then {true} else {false}; + + + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_allowStabilize.sqf b/source/AIS/System/fn_allowStabilize.sqf new file mode 100644 index 0000000..bdd35b3 --- /dev/null +++ b/source/AIS/System/fn_allowStabilize.sqf @@ -0,0 +1,38 @@ +/* + * Author: Psycho + + * Check Unit if Revive is possible. If yes, Revive-Action is shown up. + + * Arguments: + 0: Unit (Object) + + * Return value: + Bool + */ + +private _target = _this; + +_isUnc = _target getVariable ["ais_unconscious",false]; +_isStabil = _target getVariable ["ais_stabilized",false]; +_isUncHealer = player getVariable ["ais_unconscious",false]; +_noHealer = isNull (_target getVariable ['ais_hasHelper', objNull]); +_noDrag = isNull (_target getVariable ['ais_DragDrop_Player', objNull]); +_noDraging = isNull (player getVariable ['ais_DragDrop_Torso', objNull]); + + +_return = if ( + + _isUnc && + {!_isStabil} && + {!_isUncHealer} && + {alive _target} && + {_noHealer} && + {_noDrag} && + {_noDraging} + +) then {true} else {false}; + + + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_bloodloss.sqf b/source/AIS/System/fn_bloodloss.sqf new file mode 100644 index 0000000..25fa371 --- /dev/null +++ b/source/AIS/System/fn_bloodloss.sqf @@ -0,0 +1,37 @@ +/* + * Author: Psycho + + * Calculate the time till the unit will die (Revive-Time) and control the injury-effects. + + * Arguments: + 0: Unit (Object) + 1: Killer (Object) + + * Return value: + - +*/ +params ["_unit"]; +if (!local _unit) exitWith {}; + + +// Function use disableSerialisation and can corrupt some other functions in the same frame. So it need a delay till next frame. +[{call AIS_Effects_fnc_bloodSplatterScreen}] call AIS_Core_fnc_onNextFrame; + +// shacking gun +addCamShake [15, 999, 0.7]; + +//if (tcb_ais_bloodParticle) then {[_unit] call tcb_fnc_setBleeding}; // not implemented yet + +// get the revive time +_revive_time = [_unit] call AIS_System_fnc_calculateLifeTime; +_unit setBleedingRemaining _revive_time; + +// no reset of this variable until the unit fall in a completely new unconsciou state. +ais_start_unc_time = diag_tickTime; + +// start the timer and the visula effetcs +private _acc_time = diag_tickTime + 1; +[{diag_tickTime >= (_this select 2)}, {_this call AIS_Effects_fnc_bleeding}, [_unit, _revive_time, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_bloodlossAI.sqf b/source/AIS/System/fn_bloodlossAI.sqf new file mode 100644 index 0000000..9f65558 --- /dev/null +++ b/source/AIS/System/fn_bloodlossAI.sqf @@ -0,0 +1,56 @@ +/* + * Author: Psycho + + * Calculate the time till the AI units will die (Revive-Time) and check if the get revived. + + * Arguments: + 0: Unit (Object) + + * Return value: + - +*/ + +params ["_unit"]; +if (!canSuspend) exitWith {[_unit] spawn AIS_System_fnc_bloodlossAI}; +if (!local _unit) exitWith {}; + + +// AI help AI +[_unit] call AIS_System_fnc_AIselfCheck; + +// get the revive time +_revive_time = [_unit] call AIS_System_fnc_calculateLifeTime; +_unit setBleedingRemaining _revive_time; + +// no reset of this variable until the unit fall in a completely new unconsciou state. +private _ai_time_over = diag_tickTime + _revive_time; + +// wait until something happens +waitUntil { + !alive _unit || + {!(_unit getVariable ["ais_unconscious", false])} || + {_unit getVariable ["ais_stabilized", false]} || + {diag_tickTime > _ai_time_over} +}; + + +if (diag_tickTime > _ai_time_over) exitWith {[_unit] call AIS_Damage_fnc_goToDead}; + +if (_unit getVariable ["ais_stabilized", false]) then { + waitUntil {!alive _unit || {!(_unit getVariable ["ais_unconscious", false])}}; +}; + +if (!alive _unit) exitWith {_unit call AIS_System_fnc_restoreFaks}; + +_unit stop false; +{_unit enableAI _x; nil} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; + +/* + +... place to some AI stuff after revive if necessary... + + +*/ + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_calculateLifeTime.sqf b/source/AIS/System/fn_calculateLifeTime.sqf new file mode 100644 index 0000000..7dd4a89 --- /dev/null +++ b/source/AIS/System/fn_calculateLifeTime.sqf @@ -0,0 +1,38 @@ +/* + * Author: Psycho + + * Calculate the real revive time. Time depends on real summary damage of all body parts. + + * Arguments: + 0: Unit (Object) + + * Return value: + NUMBER (Life Time) +*/ + +params ["_unit"]; + +private _calculated_life_time = AIS_BLEEDOUT_TIME; + +// A bigger factor mean we have a bigger deviation in revive time depending in our real damage deviation. (recommended values between 0.5 and 2.0) +_ais_variation_factor = 1.0; +// If the unit stay at this avg damage we are near the basic revive time. If the real damage is less or stronger also the real revive time will change. (no big changes recommended!) +_ais_avg_damage_factor = 6; + +// get real damage (all body parts + overall damage) +private _summary_damage = 0; +{ + _summary_damage = _summary_damage + (((getAllHitPointsDamage _unit) select 2) select _x); + true +} count [0,1,2,3,4,5,6,7,8,9,10]; +_summary_damage = _summary_damage + (damage _unit); + +// calculate life time +_calculated_life_time = if (_unit getVariable ["AIS_noBleedOut", false]) then { + 999999999 +} else { + AIS_BLEEDOUT_TIME + ((_ais_variation_factor * (_ais_avg_damage_factor - _summary_damage)) * 10); +}; + + +_calculated_life_time \ No newline at end of file diff --git a/source/AIS/System/fn_calculateReviveTime.sqf b/source/AIS/System/fn_calculateReviveTime.sqf new file mode 100644 index 0000000..70f850d --- /dev/null +++ b/source/AIS/System/fn_calculateReviveTime.sqf @@ -0,0 +1,40 @@ +/* + * Author: Psycho + + * Calculate the needed time to revive a unit. + + * Arguments: + 0: Unit (Object) + 1: Injured (Object) + + * Return value: + NUMBER (Revive Time) +*/ + +params ["_unit", "_injured"]; + +private _calculated_revive_time = AIS_REVIVETIME; + +// A bigger factor mean we have a bigger deviation in revive time depending in our real damage deviation. (recommended values between 0.5 and 2.0) +_ais_variation_factor = 0.7; +// If the unit stay at this avg damage we are near the basic revive time. If the real damage is less or stronger also the real revive time will change. (no big changes recommended!) +_ais_avg_damage_factor = 6; + +// get real damage (all body parts + overall damage) +private _summary_damage = 0; +{ + _summary_damage = _summary_damage + (((getAllHitPointsDamage _injured) select 2) select _x); + true +} count [0,1,2,3,4,5,6,7,8,9,10]; +_summary_damage = _summary_damage + (damage _injured); + +// calculate revive time +_calculated_revive_time = (AIS_REVIVETIME + ((_ais_variation_factor * (_summary_damage - _ais_avg_damage_factor)) * 2)) max (AIS_REVIVETIME / 2); + +// rezise the time if the helper is a medic +if (_unit call AIS_System_fnc_isMedic) then { + _calculated_revive_time = _calculated_revive_time / 1.5; +}; + + +_calculated_revive_time \ No newline at end of file diff --git a/source/AIS/System/fn_calculateStabilizeTime.sqf b/source/AIS/System/fn_calculateStabilizeTime.sqf new file mode 100644 index 0000000..29fe353 --- /dev/null +++ b/source/AIS/System/fn_calculateStabilizeTime.sqf @@ -0,0 +1,40 @@ +/* + * Author: Psycho + + * Calculate the needed time to stabilize a unit. + + * Arguments: + 0: Unit (Object) + 1: Injured (Object) + + * Return value: + NUMBER (Stabilize Time) +*/ + +params ["_unit", "_injured"]; + +private _calculated_stabilize_time = AIS_STABILIZETIME; + +// A bigger factor mean we have a bigger deviation in revive time depending in our real damage deviation. (recommended values between 0.5 and 2.0) +_ais_variation_factor = 0.7; +// If the unit stay at this avg damage we are near the basic revive time. If the real damage is less or stronger also the real revive time will change. (no big changes recommended!) +_ais_avg_damage_factor = 6; + +// get real damage (all body parts + overall damage) +private _summary_damage = 0; +{ + _summary_damage = _summary_damage + (((getAllHitPointsDamage _injured) select 2) select _x); + true +} count [0,1,2,3,4,5,6,7,8,9,10]; +_summary_damage = _summary_damage + (damage _injured); + +// calculate revive time +_calculated_stabilize_time = (AIS_STABILIZETIME + ((_ais_variation_factor * (_summary_damage - _ais_avg_damage_factor)) * 2)) max (AIS_STABILIZETIME / 2); + +// rezise the time if the helper is a medic +if (_unit call AIS_System_fnc_isMedic) then { + _calculated_stabilize_time = _calculated_stabilize_time / 1.5; +}; + + +_calculated_stabilize_time \ No newline at end of file diff --git a/source/AIS/System/fn_callHelp.sqf b/source/AIS/System/fn_callHelp.sqf new file mode 100644 index 0000000..26edb72 --- /dev/null +++ b/source/AIS/System/fn_callHelp.sqf @@ -0,0 +1,26 @@ +/* + * Author: Psycho + + * Call for help and also start to check if a AI can help you. + + * Arguments: + 0: Unit (Object) + + * Return value: + BOOL (true if help is called, false if not) +*/ + +params ["_unit"]; + +if (!isNull (_unit getVariable ["ais_hasHelper", objNull])) exitWith {}; + +if ((_unit getVariable ["callHelpDelay", 0]) > diag_tickTime) exitWith {["You already have called for help!"] call AIS_Core_fnc_dynamicText; false}; +_unit setVariable ["callHelpDelay", diag_tickTime + 9]; + +[""] call AIS_Core_fnc_dynamicText; +[_unit] call AIS_Effects_fnc_helpScream; + +if (rating _unit < -1999) exitWith {false}; + +[_unit, objNull] call AIS_System_fnc_findAIHelper; +true \ No newline at end of file diff --git a/source/AIS/System/fn_carry.sqf b/source/AIS/System/fn_carry.sqf new file mode 100644 index 0000000..ae0042a --- /dev/null +++ b/source/AIS/System/fn_carry.sqf @@ -0,0 +1,73 @@ +/* + * Author: Psycho + + * Start to carry a unit. + + * Arguments: + 0: Unit Drager (Object) + 1: Unit wounded (Object) + + * Return value: + - +*/ + +params ["_unit"]; +private _target = _unit getVariable ["ais_DragDrop_Torso", objNull]; + +// switch to primary weapon, exit if no primary weapon is present (animation cant be played without a primary :( ) +if (primaryWeapon _unit isEqualTo "") exitWith { + ["This action is only with a primary Weapon possible."] call AIS_Core_fnc_dynamicText; +}; + +if (primaryWeapon _unit != "") then { + _unit switchmove "amovpercmstpsraswrfldnon"; + _unit selectWeapon (primaryWeapon _unit); +}; + +if (_unit call AIS_System_fnc_checkLauncher) exitWith { + ["You are not able to carry anyone else while carrying a launcher on your back."] call AIS_Core_fnc_dynamicText; +}; +_unit setVariable ["ais_CarryDrop_Torso", true]; + + +[_target,_unit] spawn { + + _target = _this select 0; + _unit = _this select 1; + detach _unit; + detach _target; + + _pos = _unit ModelToWorld [0,1.8,0]; + _target setPos _pos; + [_target, "grabCarried"] remoteExec ["playActionNow", 0, false]; + disableUserInput true; + sleep 2.5; + if (!isPlayer _target) then {_target disableAI "ANIM"}; + [_unit, "grabCarry"] remoteExec ["playActionNow", 0, false]; + _unit playActionNow "grabCarry"; + disableUserInput false; + disableUserInput true; + disableUserInput false; + + _timenow = time; + waitUntil {!alive _target || {!alive _unit} || {_unit getVariable ["ais_unconscious", false]} || {time > _timenow + 16}}; + _state = _unit getVariable ["ais_unconscious", false]; + if (!alive _target || {!alive _unit} || {_state}) then { + if (alive _target) then { + [_target, "agonyStart"] remoteExec ["playActionNow", 0, false]; + _target setVariable ["ais_DragDrop_Player", objNull, true]; + }; + if (alive _unit && {!(_state)}) then { + [_unit, "amovpknlmstpsraswrfldnon"] remoteExec ["playMoveNow", 0, false]; + }; + _unit setVariable ["ais_DragDrop_Torso", objNull]; + _unit setVariable ["ais_CarryDrop_Torso", false]; + } else { + _target attachTo [_unit, [-0.6, 0.28, -0.05]]; + [_target, 0] remoteExec ["setDir", 0, false]; + }; + +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_checkLauncher.sqf b/source/AIS/System/fn_checkLauncher.sqf new file mode 100644 index 0000000..9c29fc5 --- /dev/null +++ b/source/AIS/System/fn_checkLauncher.sqf @@ -0,0 +1,15 @@ +/* + * Author: Psycho + + * Check if the unit have a launcher. + + * Arguments: + 0: Unit (Object) + + * Return value: + BOOL (true when Launcer is present) +*/ + +_ret = if (SecondaryWeapon _this isEqualTo "") then {false} else {true}; + +_ret \ No newline at end of file diff --git a/source/AIS/System/fn_checkUnload.sqf b/source/AIS/System/fn_checkUnload.sqf new file mode 100644 index 0000000..8b2ba42 --- /dev/null +++ b/source/AIS/System/fn_checkUnload.sqf @@ -0,0 +1,22 @@ +/* + * Author: psycho + + * Check if a unit can be unload from a vehicle at the actual situation + + * Arguments: + 0: Unit (Object) + + * Example: + [player] call AIS_System_fnc_checkUnload; + + * Return value: + Bool +*/ + +params ["_unit"]; +private _vehicle = vehicle _unit; + + +if (surfaceIsWater position _unit) exitWith {false}; + +((speed _vehicle < 2) && {((getPosATL _vehicle) select 2) < 2}) \ No newline at end of file diff --git a/source/AIS/System/fn_diary.sqf b/source/AIS/System/fn_diary.sqf new file mode 100644 index 0000000..9eee6b0 --- /dev/null +++ b/source/AIS/System/fn_diary.sqf @@ -0,0 +1,77 @@ +/* + * Author: psycho + + * Diary entry. + + * Arguments: + - + + * Return value: + Bool + */ + +private _who_can_revive = switch (AIS_MEDICAL_EDUCATION) do { + case (0) : {"Everyone can revive"}; + case (1) : {"Everybody with a First Aid Kit or Medkit"}; + case (2) : {"Only medics can revive"}; +}; +private _revive_guaranty = if (AIS_REVIVE_GUARANTY) then {"You are protected from insta-death"} else {"Heavy damage can end in insta-death"}; +private _revive_heal = if (AIS_REVIVE_HEAL) then {"completely healed"} else {"separately healing action needed"}; + +_subject = player createDiarySubject ["ais_settings", "AIS Settings"]; +_log_briefing = player createDiaryRecord ["ais_settings", ["Medical Education", " +Who can revive: " + _who_can_revive]]; +_log_briefing = player createDiaryRecord ["ais_settings", ["Heavy Damage Handling", " +Revive Chance: " + _revive_guaranty]]; +_log_briefing = player createDiaryRecord ["ais_settings", ["Bleedout Time", +format ["Average Bleedout Time: %1", AIS_BLEEDOUT_TIME]]]; +_log_briefing = player createDiaryRecord ["ais_settings", ["Healing Status", " +Damage status after revive: " + _revive_heal]]; + +_subject = player createDiarySubject ["ais", "First Aid System"]; +_log_briefing = player createDiaryRecord ["ais", ["About and Credits", " +Made by: Psychobastard
+Version: 3072018

+ +Credits
+- BonInf* for the first multiplayer compatible version (Arma 2)
+- BI for the design idea (Wounding module Arma 2)
+- Alwarren for his feedback and fixes
+- Lukio for his text revisions and better translations
+- NetFusion for the way of handling interactions
+- ACE3 Team for damage handling of droping units
+- CBA Team for some functions +"]]; + +_log_briefing = player createDiaryRecord ["ais", ["Instructions", " +If you are unconscious:
+- Press 'FORWARD' to go prone and fire your current weapon.

+- You can CRAWL to a safe position.

+- Press 'H' key to call friendly AI for help.



+ +How to give first aid:
+- Move close to an unconscious unit and select 'Stabilize' to stop heavy bleeding. This will prevent the injured unit from bleedout. (death)

+- Move close to an unconscious unit and select 'First Aid' to revive the unit.

+- If it is needed and you want to 'Abbort' a revive process, simply press 'ESC' Button.

+- Move close to an unconscious unit and select 'Drag' to drag the body out of the line of fire (Mousewheel menu).

+- While you are dragging a unit, you can select 'Carry' to carry the unit on your shoulders (better to cover long distances).

+- In some cases you need medical equipment (First Aid Kit or Medkit) or must be a medic to start the 'First aid' action. +"]]; + +_log_briefing = player createDiaryRecord ["ais", ["About wounding / death:", " +If a unit receives too much damage, the unit goes unconscious. This means that the unit starts to bleed out and needs help from other units.

+If someone comes to help, he can stop the bleeding to prevent the injured from bleeding out and die. After the unit is stabilized you can start the first aid process to revive the unit. After a unit is revived maybe they need a regular healing process too.

+If nobody comes to help the unit eventually bleeds out. The time depends on the amount of damage the unit received. Everyone can stabilize unconscious units. The ability to start the first aid process can depend on the medical education. (medic or not, medical equipment)

+It is possible to load/unload wounded units in vehicles to bring them out of a dangerous area or evacuate them to a field hospital. +"]]; + +_log_briefing = player createDiaryRecord ["ais", ["Description", " +Psycho's Wounding System

+This First Aid System (AIS = Alternative Injury System) is an alternative system to all the current normal revive scripts.

+The main difference to a standard revive system is that the unit does not die before going into a state of agony. If critical damage level is reached, the unit goes unconscious and does not immediately die like in most other systems. The advantage: You can use it in missions without a revive option as well!

+Another advantage of the system is that if a unit is gravely wounded and waiting for others to help, the wounded unit is not completely defenseless. A wounded unit can go prone, crawl and use a weapon as last stand (until the magazine is empty). +AIS also supports AI. AI soldiers can be unconscious or give first aid as well. +"]]; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_disableRespawnButton.sqf b/source/AIS/System/fn_disableRespawnButton.sqf new file mode 100644 index 0000000..8c4c857 --- /dev/null +++ b/source/AIS/System/fn_disableRespawnButton.sqf @@ -0,0 +1,31 @@ +/* + * Author: Psycho + + * Disable the respawn button for given time. + + * Arguments: + 1: Key (Number) + + * Return value: + Bool +*/ +disableSerialization; +waitUntil {!(isNull (findDisplay 49))}; + +_downTime = player getVariable ["ais_protector_delay", 0]; +private _delay = _downTime + AIS_DISABLE_RESPAWN_BUTTON - 6; +private _ctrl = (findDisplay 49) displayCtrl 1010; + +while {!isNull (findDisplay 49) && {diag_tickTime < _delay}} do { + _ctrl ctrlEnable false; + _ctrl ctrlSetText format ["Respawn Disabled (%1 sec)", [(_delay - diag_tickTime)] call AIS_System_fnc_secondsToString]; + uisleep 0.08; +}; + +if (!ctrlEnabled _ctrl) then { + _ctrl ctrlEnable true; + _ctrl ctrlSetText "Respawn"; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_drag.sqf b/source/AIS/System/fn_drag.sqf new file mode 100644 index 0000000..f426683 --- /dev/null +++ b/source/AIS/System/fn_drag.sqf @@ -0,0 +1,39 @@ +/* + * Author: Psycho + + * Start to drag a unit. + + * Arguments: + 0: Unit Drager (Object) + 1: Unit wounded (Object) + + * Return value: + - +*/ + + +params ["_unit", "_target"]; + +_unit setVariable ["ais_DragDrop_Torso", _target]; +_target setVariable ["ais_DragDrop_Player", _unit, true]; + +_target setVariable ["ais_hasHelper", _unit, true]; + + +detach _unit; +detach _target; + +[_target, "AinjPpneMrunSnonWnonDb"] remoteExec ["switchMove", 0]; +[_unit, "grabDrag"] remoteExec ["playActionNow", 0, false]; +//waitUntil {animationState _unit in ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon"]}; + +_attachPoint = [0, 1.1, 0.05]; +_target attachTo [_unit, _attachPoint]; +[_target, 180] remoteExec ["setDir", 0, false]; + +// release the injured if the helper getin a vehicle +[ + {isNull ((_this select 1) getVariable ["ais_DragDrop_Player", objNull]) || {!(isNull objectParent (_this select 0))}}, + {if (!(isNull objectParent (_this select 0))) then {[(_this select 0)] call AIS_System_fnc_release}}, + [_unit,_target] +] call AIS_Core_fnc_waitUntilAndExecute; diff --git a/source/AIS/System/fn_findAIHelper.sqf b/source/AIS/System/fn_findAIHelper.sqf new file mode 100644 index 0000000..09bc379 --- /dev/null +++ b/source/AIS/System/fn_findAIHelper.sqf @@ -0,0 +1,68 @@ +/* + * Author: Psycho + + * Searching for the best helper in the near of a player. + + * Arguments: + 0: Unit (Object) (Unit which called for help) + 1: Helper (Object (AI which can help) + + * Return value: + Nothing +*/ + +params [ + ["_injured", objNull, [objNull]], + ["_helper", objNull, [objNull]] +]; + +// + +// start searching for a match +if (isNull _helper) then { + + // looking for a valid AI group member. + private _all_members = (units group _injured) - [_injured]; + if (count _all_members > 0) then { + private _matching_members_array = []; + {if (!(_x getVariable ["ais_unconscious", false]) && {!isPlayer _x}) then {_matching_members_array pushBack _x};true} count _all_members; + + if (count _matching_members_array > 0) then { + {if (_x call AIS_System_fnc_isMedic) exitWith {_helper = _x};true} count _matching_members_array; + if (isNull _helper) then {_helper = selectRandom _matching_members_array}; + }; + }; + + // if no valid AI group member was found looking for close AI units of the same side + if (isNull _helper) then { + private _allMenNear = []; + if (AIS_AI_HELP_RADIUS > 200) then {AIS_AI_HELP_RADIUS = 200}; // max 200 metres + _allMenNear = (position _injured) nearEntities ["CAManBase", AIS_AI_HELP_RADIUS]; + _allMenNear = _allMenNear - [_injured]; + if (count _allMenNear > 0) then { + private _matching_side_array = []; + private _side = _injured getVariable ["ais_side", civilian]; // needed, cause the injured can be captive (captive == side civilian) + {if ((_side isEqualTo (side _x)) && {!(_x getVariable ["ais_unconscious", false])} && {!isPlayer _x}) then {_matching_side_array pushBack _x};true} count _allMenNear; + if (count _matching_side_array > 0) then { + {if (_x call AIS_System_fnc_isMedic) exitWith {_helper = _x};true} count _matching_side_array; + if (isNull _helper) then {_helper = _matching_side_array select 0}; // no random value to pick the closest one + }; + }; + }; +}; + +// if no match... +if (isNull _helper) exitWith {}; + +// ...otherwise our new helper will make his way to the injured unit. +private _acc_time = diag_tickTime + 1; +if (local _helper) then { + [{diag_tickTime > (_this select 2)}, {_this call AIS_System_fnc_moveAIHelper}, [_injured, _helper, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +} else { + [{diag_tickTime > (_this select 2)}, { + [_this select 0, _this select 1] remoteExecCall ["AIS_System_fnc_moveAIHelper", 2]; + }, [_injured, _helper, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_getCargoIndex.sqf b/source/AIS/System/fn_getCargoIndex.sqf new file mode 100644 index 0000000..4ee11bc --- /dev/null +++ b/source/AIS/System/fn_getCargoIndex.sqf @@ -0,0 +1,45 @@ +/* + * Author: Psycho + + * Get a free cargo seat position for given vehicle. + + * Arguments: + 0: Vehicle (Object) + + * Return value: + [vehicle, cargo index] (ARRAY) (empty Array if nothing found) + */ + +params ["_targetVehicle"]; +private _VehicleIndex = []; + +// check if free cargo seats are avalible +private _allCargoSeats = []; +_allCargoSeats = fullcrew [_targetVehicle, "cargo", true]; +if ( count _allCargoSeats > 0) then { + { + if (isNull (_x select 0)) exitWith { + _VehicleIndex = [_targetVehicle, _x select 2]; + }; + true + } count _allCargoSeats; +}; + +if (count _VehicleIndex > 0) exitWith {_VehicleIndex}; + + +// check if free turret seats are avalible if no cargo seats there +private _allTurretSeats = []; +_VehicleIndex = []; +_allTurretSeats = fullcrew [_targetVehicle, "Turret", true]; +if ( count _allTurretSeats > 0) then { + { + if (isNull (_x select 0)) exitWith { + _VehicleIndex = [_targetVehicle, _x select 2]; + }; + true + } count _allTurretSeats; +}; + + +_VehicleIndex \ No newline at end of file diff --git a/source/AIS/System/fn_getOutMan.sqf b/source/AIS/System/fn_getOutMan.sqf new file mode 100644 index 0000000..ba972e7 --- /dev/null +++ b/source/AIS/System/fn_getOutMan.sqf @@ -0,0 +1,25 @@ +/* + * Author: Psycho + + * Check if a unconscious unit is pulled out of the vehicle by a AI order and set the correct anim-state. Is called by the getOutMan EH. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + - + */ + +params ["_injured"]; + +if (_injured getVariable ["ais_unconscious", false]) then { + if (!(_injured getVariable ["ais_man_pullOut", false])) then { + [_injured, "agonyStart"] remoteExec ["playActionNow", 0, false]; + }; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_handleHeal.sqf b/source/AIS/System/fn_handleHeal.sqf new file mode 100644 index 0000000..aede45d --- /dev/null +++ b/source/AIS/System/fn_handleHeal.sqf @@ -0,0 +1,58 @@ +/* + * Author: Psycho + + * Block the engine heal action during the unit is unconscious. Function is triggered trough the Heal-EH. + --> EH is brocken: did not react like the BI description tell it. Work around: remove all faks and give them back after the process is done. (without fak, no healing) + * Engine healing is also blocked by fn_overrideHealAction. Keep this function cause the other function isnt stackable! + + * Arguments: + 0: Unit (Object) + 1: Healer (Object) + + * Example: + [p1, player] call AIS_System_fnc_handleHeal; + + * Return value: + BOOL - true to block the engine handling, false to do the engine action +*/ + +params ["_injured", "_healer"]; +private _return = false; + +if (_injured getVariable ["ais_unconscious", false]) then { + + // remove FAKS to avoid the damage processing + if (local _healer) then { + [_healer] call AIS_System_fnc_removeFaks; + } else { + [_healer] remoteExec ["[_this select 0] call AIS_System_fnc_removeFaks", _healer, false]; + }; + + + if (isPlayer _healer) then { + _txt = if (_injured getVariable ["ais_stabilized", false]) then { + "First you have to Revive the injured." + } else { + "First you have to Stabilize the injured." + }; + [_txt] remoteExecCall ["AIS_Core_fnc_dynamicText", _healer, false]; + } else { + // we can use the AI handling at this point to start our own revive process... + if (isNull (_injured getVariable ["ais_hasHelper", objNull])) then { + [_healer, _injured] spawn AIS_System_fnc_ReviveAI; + }; + }; + + // give Faks back after healing process + private _startTime = diag_tickTime + 8; + if (local _healer) then { + [{diag_tickTime > (_this select 1)},{[(_this select 0)] call AIS_System_fnc_restoreFaks;},[_healer, _startTime]] call AIS_Core_fnc_waitUntilAndExecute; + } else { + [_healer, _startTime] remoteExec ["[{diag_tickTime > (_this select 1)},{[(_this select 0)] call AIS_System_fnc_restoreFaks;},[_this selct 0, _this selct 1]] call AIS_Core_fnc_waitUntilAndExecute", _healer, false]; + }; + + _return = true; +}; + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_isMedic.sqf b/source/AIS/System/fn_isMedic.sqf new file mode 100644 index 0000000..cbfc2e5 --- /dev/null +++ b/source/AIS/System/fn_isMedic.sqf @@ -0,0 +1,22 @@ +/* + * Author: Psycho + + * Chck if the unit is a medic. Also units which set manually to a medic will be found. (setUnitTrait) + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + + * Example: + player call AIS_System_fnc_isMedic; + */ + + +_healer = _this; +//_isMedic = if (getNumber (configFile >> "CfgVehicles" >> (typeOf _healer) >> "attendant") == 1) then {true} else {false}; +_isMedic = _healer getUnitTrait "Medic"; + + +_isMedic \ No newline at end of file diff --git a/source/AIS/System/fn_keyHandler.sqf b/source/AIS/System/fn_keyHandler.sqf new file mode 100644 index 0000000..4afbc49 --- /dev/null +++ b/source/AIS/System/fn_keyHandler.sqf @@ -0,0 +1,49 @@ +/* + * Author: Psycho + + * unbind some key functions while the player is unconcious. + --> Block the following actions: reload, inventory, weapon change, diary and map, chat, get in/out of a vehicle, throw grenades, open curator interface, eject a vehicle +* Also it handle some special key functions. + --> press "H" for calling help while unconscious + + * Arguments: + 1: Key (Number) + + * Return value: + Bool +*/ + + +private _keyDown = _this select 1; +private _return = false; + +if !(player getVariable ['ais_unconscious', false]) exitWith {false}; + +if (_keyDown isEqualTo 1) then {[] spawn AIS_System_fnc_disableRespawnButton}; // key "Esc" --> disable Respawn Button + +if (_keyDown isEqualTo 35) then {[player] call AIS_System_fnc_callHelp}; // key "H" --> call for Help + + +// vehicle actions +if (!(isNull objectParent player)) then { + //hint format ["%1", _keyDown]; + { + if (_keyDown in (actionKeys _x)) exitWith { + _return = true; + }; + Nil + } count ['CarForward','CarBack','HeliCyclicForward','HeliLeft','HeliRudderLeft','HeliRight','HeliRudderRight','AutoHover','CarFastForward','CarSlowForward','submarineForward','submarineBack','SwitchWeapon']; +}; + +{ + if (_keyDown in (actionKeys _x)) exitWith { + if (AIS_NO_CHAT && {_keyDown in (actionKeys 'Chat')}) then { + ["Chat disabled."] call AIS_Core_fnc_dynamicText; + }; + _return = true; + }; + Nil +} count ['ReloadMagazine','Gear','SwitchWeapon','Diary','DeployWeaponAuto','Chat','Throw','ShowMap','turnIn','turnOut','curatorInterface','Eject']; + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_killed.sqf b/source/AIS/System/fn_killed.sqf new file mode 100644 index 0000000..524adb1 --- /dev/null +++ b/source/AIS/System/fn_killed.sqf @@ -0,0 +1,18 @@ +/* + * Author: Psycho + + * Clean up the unit if they got killed. Is called by the killed EH. + + * Arguments: + 0: Unit (Object) + 1: Killer (Object) + + * Return value: + - +*/ + +params ["_unit", "_killer"]; + +if (!(isNull (_unit getVariable ["ais_DragDrop_Torso", objNull]))) then { + [_unit] call AIS_System_fnc_release; +}; \ No newline at end of file diff --git a/source/AIS/System/fn_loadAIS.sqf b/source/AIS/System/fn_loadAIS.sqf new file mode 100644 index 0000000..75d06c2 --- /dev/null +++ b/source/AIS/System/fn_loadAIS.sqf @@ -0,0 +1,43 @@ +/* + * Author: Psycho + + * Start to init a unit. It's a public function. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + [_unit] call AIS_System_fnc_loadAIS; + */ + +params ["_unit"]; +if (!isNil {_unit getVariable "ais_aisInit"}) exitWith {}; + +if (isServer) then { + + if (local _unit) then { + [_this select 0] call AIS_Core_fnc_aisInitHost; + } else { + _id = owner _unit; + [_unit] remoteExecCall ["AIS_System_fnc_loadAISlocalToPlayer", _id, false]; + }; + +} else { + + if (local _unit) then { + [_unit] call AIS_System_fnc_loadAISlocalToPlayer; + } else { + [[_unit], { + if (isServer) then { + [_this select 0] call AIS_Core_fnc_aisInitHost; + }; + }] remoteExec ["call"]; + }; + +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_loadAISlocalToPlayer.sqf b/source/AIS/System/fn_loadAISlocalToPlayer.sqf new file mode 100644 index 0000000..9b82f86 --- /dev/null +++ b/source/AIS/System/fn_loadAISlocalToPlayer.sqf @@ -0,0 +1,43 @@ +/* + * Author: Psycho + + * Start to init a unit which is local to a player. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + [_unit] call AIS_System_fnc_loadAISlocalToPlayer; + */ + +params ["_unit"]; +if (_unit getVariable ["AIS_noReviveInit", false]) exitWith {}; + +if (!isNil {_unit getVariable "ais_aisInit"}) then { + _unit removeAllEventHandlers "Killed"; + _unit removeAllEventHandlers "Respawn"; + _unit removeAllEventHandlers "HandleHeal"; + [_unit] call AIS_Core_fnc_setVariables; +}; +_unit setVariable ["ais_aisInit", true]; + + +_unit removeAllEventHandlers "handleDamage"; +_unit addEventHandler ["HandleDamage", {_this call AIS_Damage_fnc_handleDamage}]; + +_unit removeAllEventHandlers "Killed"; +_unit addEventHandler ["Killed", {_this call AIS_System_fnc_killed}]; + +_unit removeAllEventHandlers "Respawn"; +if ([_unit] call AIS_Core_fnc_isPlayable) then { + _unit addEventHandler ["Respawn", {_this call AIS_System_fnc_respawn}]; +}; + +_unit removeAllEventHandlers "HandleHeal"; +_unit addEventHandler ["HandleHeal", {_this call AIS_System_fnc_handleHeal}]; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_loadInjured.sqf b/source/AIS/System/fn_loadInjured.sqf new file mode 100644 index 0000000..b1d535c --- /dev/null +++ b/source/AIS/System/fn_loadInjured.sqf @@ -0,0 +1,28 @@ +/* + * Author: Psycho + + * Load a unit into a vehicles cargo or turret seat. + + * Arguments: + 0: Unit (Object) + 1: Vehicle (Object) + + * Return value: + - +*/ + +params ["_unit", "_vehicle"]; + +_injured = _unit getVariable ['ais_DragDrop_Torso', objNull]; +[_unit] call AIS_System_fnc_release; + +_injured setVariable ["ais_man_pullOut", false, true]; + +// move the wounded in the vehicle +[[_injured, _vehicle, 1], {_this call AIS_System_fnc_moveCargoRemote}] remoteExec ["call"]; + +// unconscious animation in cargo seat +[{[(_this select 0), 'unconscious'] remoteExec ["playActionNow", 0, false]}, [_injured]] call AIS_Core_fnc_onNextFrame; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_medEvacArea.sqf b/source/AIS/System/fn_medEvacArea.sqf new file mode 100644 index 0000000..47fa96a --- /dev/null +++ b/source/AIS/System/fn_medEvacArea.sqf @@ -0,0 +1,28 @@ +/* + * Author: Psycho + + * Check Unit if is in range of a medevac object. + + * Arguments: + 0: Unit (Object) + 1: Injured (Object) + + * Return value: + Bool + */ + +params ["_player", "_injured"]; + +private _return = false; +{ + _x params [["_obj", objNull], ["_radius", 0, [0]]]; + if (_return) exitWith {true}; + if (!isNull _obj) then { + if (_radius > 0) then { + if ([_obj, _radius] call AIS_Core_fnc_inRange) exitWith {_return = true}; + }; + }; +} count AIS_MEDEVAC_STATIONS; + + +_return \ No newline at end of file diff --git a/source/AIS/System/fn_moveAIHelper.sqf b/source/AIS/System/fn_moveAIHelper.sqf new file mode 100644 index 0000000..5e40db9 --- /dev/null +++ b/source/AIS/System/fn_moveAIHelper.sqf @@ -0,0 +1,62 @@ +/* + * Author: Psycho + + * Make the AI moving to a injured unit and start the revive. + + * Arguments: + 0: Injured unit (Object) + 1: Helper AI (Object) + + * Return value: + Nothing +*/ + +params ["_injured", "_helper"]; + +// help not longer needed or possible +if ( + !alive _helper || + !alive _injured || + (!(_injured getVariable ["ais_unconscious", false])) || + (_helper getVariable ["ais_unconscious", false]) || + (!isNull (_injured getVariable ["ais_hasHelper", objNull])) +) exitWith { + if (alive _helper) then { + _helper enableAI "AUTOCOMBAT"; + } else { + if (alive _injured && {!isPlayer _injured}) then { + [_injured] call AIS_System_fnc_AIselfCheck; // check if another helper is avalible + }; + }; +}; + +// AI instructions +if (behaviour _helper != "AWARE") then {_helper setBehaviour "AWARE"}; // better "SAFE" ??? +_helper disableAI "AUTOCOMBAT"; +_helper allowFleeing 0; + +if (currentCommand _helper != "MOVE") then { + _helper stop false; + _helper doMove (position (vehicle _injured)); +}; + +// if injured is in vehicle helper wont go that close --> have to increase the shortest distance +_dist = if (!isNull objectParent _injured) then {(sizeOf (typeOf (vehicle _injured)) / 2) + 1} else {3}; + +// start revive if close enough and ready for handling. Otherwise reset and repeat searching loop. +if (_helper distance2D (vehicle _injured) < _dist) exitWith { + if (isNull (_injured getVariable ["ais_hasHelper", objNull])) then { + _helper disableAI "AUTOCOMBAT"; + [_helper, _injured] spawn AIS_System_fnc_ReviveAI; + } else { + _helper enableAI "AUTOCOMBAT"; + [_injured] call AIS_System_fnc_AIselfCheck; + }; +}; + +// if not close enough start the function in a few seconds again +private _acc_time = diag_tickTime + 5; +[{diag_tickTime > (_this select 2)}, {_this call AIS_System_fnc_moveAIHelper}, [_injured, _helper, _acc_time]] call AIS_Core_fnc_waitUntilAndExecute; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_moveCargoRemote.sqf b/source/AIS/System/fn_moveCargoRemote.sqf new file mode 100644 index 0000000..703244b --- /dev/null +++ b/source/AIS/System/fn_moveCargoRemote.sqf @@ -0,0 +1,29 @@ +/* + * Author: Psycho + + * Load a unit into a vehicles cargo or turret seat. Function is everytime called by a player. Checks if the unit is local, if not, use remoteExec. + + * Arguments: + 0: Unit (Object) + 1: Vehicle (Object) + 2: In/Out (Number) // 0 = Out / 1 = In + + * Return value: + - +*/ + +params ["_injured", "_vehicle", "_handling"]; + +private _VehicleIndex = [_vehicle] call AIS_System_fnc_getCargoIndex; + + +if (_handling > 0) then { + _injured assignAsCargoIndex [_vehicle, _VehicleIndex select 1]; + _injured moveInCargo [_vehicle, _VehicleIndex select 1]; +} else { + unassignVehicle _injured; + moveOut _injured; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_overrideHealAction.sqf b/source/AIS/System/fn_overrideHealAction.sqf new file mode 100644 index 0000000..5ad097c --- /dev/null +++ b/source/AIS/System/fn_overrideHealAction.sqf @@ -0,0 +1,35 @@ +/* + * Author: Psycho + + * Override the heal action if the unit is unconscious. + * This is called by a inGameUISetEventHandler. This isnt a stackable EH. This mean it will maybe be overriden by a mod or some 3rd party scripts! + + * Arguments: + 0: Unit (Object) + 1: Unit (Object) + 2: Index (Number) + 3: Action (String) + + * Return value: + Bool - true to block the engine handling, false to do the engine action +*/ + + +params ["_injured", "_caller", "_index", "_action"]; + +private _back = false; +if (_action isEqualTo "HealSoldier") then { + if (_injured getVariable ["ais_unconscious", false]) then { + _txt = if (_injured getVariable ["ais_stabilized", false]) then { + "First you have to Revive the injured." + } else { + "First you have to Stabilize the injured." + }; + _txt call AIS_Core_fnc_dynamicText; + _back = true; + }; + +}; + + +_back \ No newline at end of file diff --git a/source/AIS/System/fn_postinit.sqf b/source/AIS/System/fn_postinit.sqf new file mode 100644 index 0000000..c48216b --- /dev/null +++ b/source/AIS/System/fn_postinit.sqf @@ -0,0 +1,101 @@ +if (isDedicated || !hasInterface) exitWith {}; +if (ais_ace_shutdown) exitWith {diag_log ["AIS: AIS shutdown itself cause ACE mod was detected. ACE and AIS cant work at the same time."]}; +/* +// expample action +_action = [ + "Text", // action text + player, // object which the action is assigned + 2, // distance where action is shown (0 means max distance = 15m) + "true", // condition to show the action + { + my_code // code perform on action + }, + [], // Optional: custom variables run trough + "%1" // Optional: formated text for setUserActionText +] call AIS_Core_fnc_addAction; +*/ + +[ + "First Aid", + player, + 1.5, + "cursorTarget isKindOf 'CAManBase' && {cursorTarget getVariable ['ais_unconscious',false]} && {cursorTarget call AIS_System_fnc_allowRevive}", + { + [player, cursorTarget] spawn AIS_System_fnc_Revive; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + +[ + "Stabilize", + player, + 1.5, + "cursorTarget isKindOf 'CAManBase' && {cursorTarget getVariable ['ais_unconscious',false]} && {cursorTarget call AIS_System_fnc_allowStabilize}", + { + [player, cursorTarget] spawn AIS_System_fnc_Stabilize; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + +[ + "Drag", + player, + 1.8, + "cursorTarget isKindOf 'CAManBase' && {cursorTarget getVariable ['ais_unconscious',false]} && {cursorTarget call AIS_System_fnc_allowDrag}", + { + [player, cursorTarget] call AIS_System_fnc_drag; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + +[ + "Carry", + player, + 0, + "!(isNull (player getVariable ['ais_DragDrop_Torso', objNull])) && {!(player getVariable ['ais_CarryDrop_Torso', false])}", + { + [player] spawn AIS_System_fnc_carry; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + +[ + "Release", + player, + 0, + "!(isNull (player getVariable ['ais_DragDrop_Torso', objNull]))", + { + [player] call AIS_System_fnc_release; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + +[ + "Unload Injured", + player, + 4, + "(cursorTarget isKindOf 'LandVehicle' || cursorTarget isKindOf 'Air') && {alive cursorTarget} && {cursorTarget call AIS_System_fnc_allowPullOut}", + { + [player, cursorTarget] call AIS_System_fnc_unloadInjured; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; + + +[ + "Load Injured", + player, + 4, + "!(isNull (player getVariable ['ais_DragDrop_Torso', objNull])) && {cursorTarget isKindOf 'LandVehicle' || cursorTarget isKindOf 'Air'} && {cursorTarget call AIS_System_fnc_allowPullIn}", + { + [player, cursorTarget] call AIS_System_fnc_loadInjured; + }, + [], + "%1
" +] call AIS_Core_fnc_addAction; \ No newline at end of file diff --git a/source/AIS/System/fn_release.sqf b/source/AIS/System/fn_release.sqf new file mode 100644 index 0000000..4227f07 --- /dev/null +++ b/source/AIS/System/fn_release.sqf @@ -0,0 +1,34 @@ +/* + * Author: Psycho + + * Stop to drag another unit. + + * Arguments: + 0: Unit (Object) + + * Return value: + - +*/ + +params ["_unit"]; +private _target = _unit getVariable "ais_DragDrop_Torso"; +private _pos = getPos _target; + +_unit setVariable ["ais_DragDrop_Torso", objNull]; +_target setVariable ["ais_DragDrop_Player", objNull, true]; +_unit setVariable ["ais_CarryDrop_Torso", false]; + +_target setVariable ["ais_hasHelper", objNull, true]; +_unit playAction "released"; + +detach _unit; +detach _target; + +if (alive _target) then { + [_target, "AinjPpneMstpSnonWrflDb_release"] remoteExec ["switchMove", 0]; + //[_target, _pos] call AIS_Core_fnc_setPosAGLS; + _target setPos _pos; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_removeFaks.sqf b/source/AIS/System/fn_removeFaks.sqf new file mode 100644 index 0000000..f6b9328 --- /dev/null +++ b/source/AIS/System/fn_removeFaks.sqf @@ -0,0 +1,61 @@ +/* + * Author: Alwarren + + * Remove first aid and Medikits + + * Arguments: + 0: Unit (Object) + + * Example: + [player] call AIS_System_fnc_removeFaks; + + * Return value: + BOOL - false if items already stored +*/ + +params ["_unit"]; + +// Count the number of FAK's and Medikits this unit has +_storage = _unit getVariable ["AIS_MedicalStore", [0,0,0,0]]; +_storage params ["_fakUni","_fakVest","_fakBackP","_medK"]; +_numFakUniform = _fakUni; +_numFaksVest = _fakVest; +_numFaksBackpack = _fakBackP; +_numMedi = _medK; + +// Faks from the uniform +{ + if (_x == "FirstAidKit") then { + _numFakUniform = _numFakUniform + 1; + _unit removeItemFromUniform "FirstAidKit"; + }; + nil +} count (uniformItems _unit); + +// Faks from the vest +{ + if (_x == "FirstAidKit") then { + _numFaksVest = _numFaksVest + 1; + _unit removeItemFromVest "FirstAidKit"; + }; + nil +} count (vestItems _unit); + +// Faks and Medikits from the backpack. Kits can only be in backpack, so we don't search for them anywhere else +{ + if (_x == "FirstAidKit") then { + _numFaksBackpack = _numFaksBackpack + 1; + _unit removeItemFromBackpack "FirstAidKit"; + }; + if (_x == "Medikit") then { + _numMedi = _numMedi + 1; + _unit removeItemFromBackpack "Medikit"; + }; + nil +} count (backpackItems _unit); + +// Store the result +_unit setVariable ["AIS_MedicalStore", [_numFakUniform, _numFaksVest, _numFaksBackpack, _numMedi], true]; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_respawn.sqf b/source/AIS/System/fn_respawn.sqf new file mode 100644 index 0000000..189f5f8 --- /dev/null +++ b/source/AIS/System/fn_respawn.sqf @@ -0,0 +1,31 @@ +/* + * Author: Psycho + + * Re-initialize a respawned unit. + + * Arguments: + 0: Unit (Object) + 1: Corpse (Object) + + * Return value: + - +*/ + +params ["_unit", "_corpse"]; + + +_unit setVariable ["ais_unconscious", false, true]; +_unit setVariable ["ais_stabilized", false, true]; +_unit setVariable ["ais_fireDamage", 0]; +_unit setVariable ["AIS_UnitIsDead", false]; +_unit setCaptive false; + +if (isPlayer _unit) then { + if (local player) then {showHud true}; + if (AIS_TOGGLE_RADIO) then { + [true] call AIS_Effects_fnc_toggleRadio; + }; +} else { + _unit stop false; + {_unit enableAI _x; nil} count ["MOVE","TARGET","AUTOTARGET","ANIM"]; +}; \ No newline at end of file diff --git a/source/AIS/System/fn_restoreFaks.sqf b/source/AIS/System/fn_restoreFaks.sqf new file mode 100644 index 0000000..fc2b317 --- /dev/null +++ b/source/AIS/System/fn_restoreFaks.sqf @@ -0,0 +1,33 @@ +/* + * Author: Alwarren + Changed: Psycho + + * Re-Add first aid and Medikits. + + * Arguments: + 0: Unit (Object) + + * Example: + [player] call AIS_System_fnc_restoreFaks; + + * Return value: + - +*/ + +params ["_unit"]; +private _items = _unit getVariable ["AIS_MedicalStore", [0,0,0,0]]; + + +for "_i" from 1 to (_items select 0) do {_unit addItemToUniform "FirstAidKit"}; + +for "_i" from 1 to (_items select 1) do {_unit addItemToVest "FirstAidKit"}; + +for "_i" from 1 to (_items select 2) do {_unit addItemTobackpack "FirstAidKit"}; + +for "_i" from 1 to (_items select 3) do {_unit addItem "Medikit"}; + + +_unit setVariable ["AIS_MedicalStore", [0,0,0,0], true]; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_reveal.sqf b/source/AIS/System/fn_reveal.sqf new file mode 100644 index 0000000..252bae1 --- /dev/null +++ b/source/AIS/System/fn_reveal.sqf @@ -0,0 +1,32 @@ +/* + * Author: Psycho + + * Reveal near units after revive. + + * Arguments: + 0: Revived Unit (Object) + 1: Range (Number) [optional] + + * Return value: + Nothing +*/ + + +params [ + ["_unit", player, [player]], + ["_range", 50, [50]] +]; + +_list = _unit nearEntities ["CAManBase", _range]; +_side = _unit getVariable ["ais_side", civilian]; + +{ + if ((side _x) isEqualTo _side) then { + _unit reveal [_x, 4]; + }; + true + +} count _list; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_secondsToString.sqf b/source/AIS/System/fn_secondsToString.sqf new file mode 100644 index 0000000..f919f19 --- /dev/null +++ b/source/AIS/System/fn_secondsToString.sqf @@ -0,0 +1,23 @@ +/* + * Author: Joris-Jan van 't Land (based on work in fn_timeToString) + * Changed: Psycho (snip out only the needed lines...) + + * Convert seconds to formatted string. + + * Arguments: + _this select 0: time in seconds + + * Return value: + String +*/ + +_sec = _this param [0, 0, [0]]; + +_sec = _sec % 60; +_sec = floor (_sec); +_sec = (if (_sec <= 9) then {"0"} else {""}) + (str _sec); + +_time = format ["%1", _sec]; + + +_time \ No newline at end of file diff --git a/source/AIS/System/fn_setUnconscious.sqf b/source/AIS/System/fn_setUnconscious.sqf new file mode 100644 index 0000000..613de58 --- /dev/null +++ b/source/AIS/System/fn_setUnconscious.sqf @@ -0,0 +1,34 @@ +/* + * Author: Psycho + + * Set the unit in unconcsious state. This is a public function. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + [player] call AIS_System_fnc_setUnconscious; + */ + + +params ["_unit"]; + +if (time <= 0) exitWith { + [ + {time > 0}, + {_this call AIS_System_fnc_setUnconscious}, + [_unit] + ] call AIS_Core_fnc_waitUntilAndExecute; +}; + +if (isPlayer _unit) then { + [_unit] call AIS_System_fnc_unconsciousPlayer +} else { + [_unit] call AIS_System_fnc_unconsciousAI +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_stabilize.sqf b/source/AIS/System/fn_stabilize.sqf new file mode 100644 index 0000000..bc39437 --- /dev/null +++ b/source/AIS/System/fn_stabilize.sqf @@ -0,0 +1,90 @@ +/* + * Author: Psycho + + * Stabilize a unit. A stabilized unit stop to bleed and cant die trough the revive timer. + + * Arguments: + 0: Unit Helper (Object) + 1: Unit wounded (Object) + + * Return value: + - +*/ + +params ["_healer", "_injured"]; + + +_injured setVariable ["ais_hasHelper", _healer, true]; + +//_injured playMove "AinjPpneMstpSnonWrflDnon_rolltoback"; // from AIS fsm +[_injured, "AinjPpneMstpSnonWrflDnon_rolltoback"] remoteExec ["playMove", 0]; + +// switch to primary weapon if possible. Small delay for handling is needed. +if (primaryWeapon _healer != "") then { + _healer switchmove "amovpercmstpsraswrfldnon"; + _healer selectWeapon (primaryWeapon _healer); +}; + +_healer playAction "medicStart"; + +// full heal anim only with primary weapon possible. +ais_animChangeEVH = _healer addEventhandler ["AnimChanged", { + params ["_healer","_anim"]; + if (primaryWeapon _healer isEqualTo "") then { + if (_anim in ["amovpknlmstpsnonwnondnon","amovpknlmstpsraswlnrdnon"]) then { + _healer playActionNow "medicStart"; + }; + }; +}]; + +_offset = [0,0,0]; _dir = 0; +_relpos = _healer worldToModel position _injured; +if (((_healer getDir _injured) - (_injured getDir _healer)) < 0) then {_offset = [-0.2,0.7,0]; _dir = 90} else {_offset = [0.2,0.7,0]; _dir = 270}; + +_injured attachTo [_healer, _offset]; +[_injured, _dir] remoteExec ["setDir", 0, false]; + +[_healer, _injured] call AIS_Effects_fnc_medEquip; +private _duration = [_healer, _injured] call AIS_System_fnc_calculateStabilizeTime; +//hint format ["Stabilize Time Duration: %1", _duration]; // debug + + +[ + "Stabilize the Injured", + _duration, + { + params ["_injured", "_healer"]; + + _injured setVariable ["ais_stabilized", true, true]; + + _healer removeEventHandler ["AnimChanged", ais_animChangeEVH]; + detach _healer; + detach _injured; + + _healer playAction "medicStop"; + + _injured setVariable ["ais_hasHelper", ObjNull, true]; + call AIS_Effects_fnc_garbage; + }, + [_injured, _healer], + { + params ["_injured", "_healer"]; + + _injured setVariable ["ais_hasHelper", ObjNull, true]; + + _healer removeEventHandler ["AnimChanged", ais_animChangeEVH]; + detach _healer; + detach _injured; + + call AIS_Effects_fnc_garbage; + + if (alive _healer) then { + _healer playActionNow "medicStop"; + }; + if (!alive _injured) then {["He is not with us anymore."] call AIS_Core_fnc_dynamicText}; + }, + (!alive _injured || _healer getVariable ["ais_unconscious", false]) +] call AIS_Core_fnc_Progress_ShowBar; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_unconcsiousRemote.sqf b/source/AIS/System/fn_unconcsiousRemote.sqf new file mode 100644 index 0000000..afae54e --- /dev/null +++ b/source/AIS/System/fn_unconcsiousRemote.sqf @@ -0,0 +1,70 @@ +/* + * Author: Psycho + + * Broadcast everything across the network which is needed if a unit fall in agony + + * Arguments: + 0: Unit (Object) + 1: Unconcsious state of the Unit (Bool) + + * Return value: + Nothing + */ + +params [ + ["_unit", objNull, [player]], + ["_is_unoncsious", false, [false]] +]; + +if (isNull _unit) exitWith {diag_log format ["Non existing unit or wrong data type passed. AIS_System_fnc_unconcsiousRemote.sqf"];}; + + +if (_is_unoncsious) then { + [_unit, "agonyStart"] remoteExec ["playActionNow", 0, false]; + //_unit playActionNow "agonyStart"; + + if (local player) then { + _condition = false; + _condition = switch (AIS_SHOW_UNC_MESSAGE_TO) do { + case ("Group") : {_unit in units group player}; + case ("Side") : {side _unit isEqualTo playerSide}; + default {false}; + }; + + if (_condition) then { + [side _unit,"HQ"] sideChat format ["%1 is down and needs help at %2!",name _unit, mapGridPosition _unit]; + }; + + if (AIS_SHOW_UNC_MARKERS && {side _unit isEqualTo playerSide}) then { + _unit call AIS_Effects_fnc_injuredMarker; + }; + }; + +} else { + + [_unit, "agonyStop"] remoteExec ["playActionNow", 0, false]; + //_unit playActionNow "agonyStop"; + + [_unit, 50] call AIS_system_fnc_reveal; + + addSwitchableUnit _unit; + if (ais_reenable_teamswitch) then { + enableTeamswitch true; + }; + + if (isPlayer _unit) then { + if (local player) then { + showHud true; + if (AIS_TOGGLE_RADIO) then { + [true] call AIS_Effects_fnc_toggleRadio; + }; + }; + }; + + if (AIS_SHOW_UNC_MARKERS && {local player}) then { + _unit call AIS_Effects_fnc_removeinjuredMarker; + }; +}; + + +true \ No newline at end of file diff --git a/source/AIS/System/fn_unconsciousAI.sqf b/source/AIS/System/fn_unconsciousAI.sqf new file mode 100644 index 0000000..0ee1306 --- /dev/null +++ b/source/AIS/System/fn_unconsciousAI.sqf @@ -0,0 +1,65 @@ +/* + * Author: Psycho + + * Set the unit in unconcsious state for Non-players. Set all variables and handle things around. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + [unit] call AIS_System_fnc_unconsciousAI; + */ + + +params ["_unit"]; + +// set the variables +_unit setVariable ["ais_unconscious", true, true]; + +// if player drag or carry someone release the body +if (!(isNull (_unit getVariable ["ais_DragDrop_Torso", objNull]))) then { + [_unit] call AIS_System_fnc_release; +}; + +// do some actions for some special situations... +if (count attachedObjects _unit > 0) then { + {detach _x} forEach (attachedObjects _unit); +}; +if (animationState _unit in ["ladderriflestatic", "laddercivilstatic"]) then { + _unit action ["ladderOff", (nearestBuilding _unit)]; +}; + +// animation and other actions across the network to all players +//[_unit, true] remoteExecCall ["AIS_System_fnc_unconcsiousRemote", [-2,0] select hasInterface, false]; +[[_unit, true], { + if (!isDedicated) then { + _this call AIS_System_fnc_unconcsiousRemote; + }; +}] remoteExec ["call"]; + +// AI actions +_unit stop true; +{_unit disableAI _x; nil} count ["MOVE","TARGET","AUTOTARGET","ANIM","AUTOCOMBAT"]; + +// remove medic euqipment from unconscious unit +[_unit] call AIS_System_fnc_removeFaks; + +// random screaming +[_unit, 50] call AIS_Effects_fnc_Scream; + +// set unit as captive +[_unit, true] remoteExec ["setCaptive", 0, false]; + +// countdown for AI's +[_unit] spawn AIS_System_fnc_bloodlossAI; + +// correkt animation if unit get pushed out of a vehicle on other ways except the pull-out action +_unit addEventHandler ["getOutMan", {_this call AIS_System_fnc_getOutMan}]; + +// avoid to switching in while unc +removeSwitchableUnit _unit; + +true \ No newline at end of file diff --git a/source/AIS/System/fn_unconsciousPlayer.sqf b/source/AIS/System/fn_unconsciousPlayer.sqf new file mode 100644 index 0000000..843d448 --- /dev/null +++ b/source/AIS/System/fn_unconsciousPlayer.sqf @@ -0,0 +1,84 @@ +/* + * Author: Psycho + + * Set the unit in unconcsious state for PLAYERS. Set all variables and handle things around. + + * Arguments: + 0: Unit (Object) + + * Return value: + Nothing + +* Exapmle: + [player] call AIS_System_fnc_unconsciousPlayer; + */ + +params ["_unit"]; + +// set the variables +_unit setVariable ["ais_unconscious", true, true]; +_unit setVariable ["ais_CarryDrop_Torso", false]; + +// if player drag or carry someone release the body +if (!(isNull (_unit getVariable ["ais_DragDrop_Torso", objNull]))) then { + [_unit] call AIS_System_fnc_release; +}; + +// do some actions for some special situations... +if (count attachedObjects _unit > 0) then { + {detach _x} forEach (attachedObjects _unit); +}; +if (animationState _unit in ["ladderriflestatic", "laddercivilstatic"]) then { + _unit action ["ladderOff", (nearestBuilding _unit)]; +}; + +// animation and other actions across the network +[_unit, true] remoteExecCall ["AIS_System_fnc_unconcsiousRemote", 0, false]; + + +// camera actions +if (dialog) then {closeDialog 0}; +titleCut ["","BLACK IN", 1.5]; +if (visibleMap) then {openMap false}; +showHud false; +_unit switchCamera "INTERNAL"; +if (sunOrMoon isEqualTo 0) then { + _unit action ["nvGogglesOff", _unit]; +}; + +// remove medic euqipment from unconscious unit +[_unit] call AIS_System_fnc_removeFaks; + +// disable radios +if (AIS_TOGGLE_RADIO) then { + [false] call AIS_Effects_fnc_toggleRadio; +}; + +// random screaming +[_unit, 50] call AIS_Effects_fnc_Scream; + +// set unit as captive +[_unit, true] remoteExec ["setCaptive", 0, false]; +_unit addEventHandler ["fired", { + private _shooter = _this select 0; + [_shooter, false] remoteExec ["setCaptive", 0, false]; +}]; + +// value >= 0.5 break the crawl-feature from agony action! (canMove false) +if ((_unit getHitIndex 10) > 0.49) then { + [{(_this select 0) setHitIndex [10, 0.49]}, [_unit]] call AIS_Core_fnc_onNextFrame; +}; + +// countdown and visual effects +[_unit] call AIS_System_fnc_bloodloss; + +// correkt animation if unit get pushed out of a vehicle on other ways except the pull-out action +_unit addEventHandler ["getOutMan", {_this call AIS_System_fnc_getOutMan}]; + +// disable teamSwitch while unc +if (teamswitchenabled) then { + enableTeamswitch false; + ais_reenable_teamswitch = true; +}; + +true \ No newline at end of file diff --git a/source/AIS/System/fn_unloadInjured.sqf b/source/AIS/System/fn_unloadInjured.sqf new file mode 100644 index 0000000..2c0e840 --- /dev/null +++ b/source/AIS/System/fn_unloadInjured.sqf @@ -0,0 +1,34 @@ +/* + * Author: psycho + + * Pull a injured out of a vehicle + + * Arguments: + 0: Unit (Object) + 1: Vehicle (Object) + + * Return value: + - +*/ + +params ["_unit", "_vehicle"]; + +// get the wounded unit +private _crew = crew _vehicle; +private _injured = objNull; +{ + if (_x getVariable ["ais_unconscious", false]) exitWith {_injured = _x}; + true +} count _crew; + +_injured setVariable ["ais_man_pullOut", true, true]; + +// move the wounded out of the vehicle +[[_injured, _vehicle, 0], {_this call AIS_System_fnc_moveCargoRemote}] remoteExec ["call"]; + +if (_injured call AIS_System_fnc_allowDrag) then { + [{[(_this select 0), (_this select 1)] call AIS_System_fnc_drag}, [_unit,_injured]] call AIS_Core_fnc_onNextFrame; +}; + + +true \ No newline at end of file diff --git a/source/AIS/cfgFunctions.hpp b/source/AIS/cfgFunctions.hpp new file mode 100644 index 0000000..a98a616 --- /dev/null +++ b/source/AIS/cfgFunctions.hpp @@ -0,0 +1,4 @@ +#include "Core\cfgFunctions.hpp" +#include "System\cfgFunctions.hpp" +#include "Effects\cfgFunctions.hpp" +#include "Damage\cfgFunctions.hpp" \ No newline at end of file diff --git a/source/DUWS_CONFIG.sqf b/source/DUWS_CONFIG.sqf new file mode 100644 index 0000000..c6fa6ad --- /dev/null +++ b/source/DUWS_CONFIG.sqf @@ -0,0 +1,225 @@ +// DUWS-R Config + +DUWS_Version = "0.7.0"; //Do not touch + +// Blufor Faction +Blufor_Faction = "BLU_F"; + +// Blufor Soldiers +Blufor_Officer = "B_officer_F"; +Blufor_Squadleader = "B_Soldier_SL_F"; +Blufor_Teamleader = "B_Soldier_TL_F"; +Blufor_Medic = "B_medic_F"; +Blufor_Engineer = "B_engineer_F"; +Blufor_Rifleman = "B_Soldier_F"; +Blufor_Rifleman_Light = "B_Soldier_lite_F"; +Blufor_Rifleman_AT = "B_Soldier_LAT_F"; +Blufor_Marksman = "B_soldier_M_F"; +Blufor_Recon_Scout = "B_recon_F"; +Blufor_Grenadier = "B_Soldier_GL_F"; +Blufor_Autorifleman = "B_soldier_AR_F"; +Blufor_HeavyGunner = "B_HeavyGunner_F"; +Blufor_AT_Specialist = "B_soldier_AT_F"; +Blufor_AA_Specialist = "B_soldier_AA_F"; +Blufor_Pilot = "B_pilot_F"; +Blufor_Heli_Pilot = "B_Helipilot_F"; +Blufor_Crewman = "B_crew_F"; +Blufor_Repair_Specialist = "B_soldier_repair_F"; +Blufor_diver = "B_diver_F"; +Blufor_sniper = "B_sniper_F"; +Blufor_spotter = "B_spotter_F"; +Blufor_Explosive_Specialist = "B_soldier_exp_F"; + +// Blufor Purchasable Units +// Format: ["classname", cost, SF Skill (optional boolean)] +blufor_unit_array = [ + [Blufor_Rifleman, 2], + [Blufor_Grenadier, 3], + [Blufor_Autorifleman, 3], + [Blufor_Rifleman_AT, 3], + [Blufor_Medic, 4], + [Blufor_AA_Specialist, 4], + [Blufor_Repair_Specialist, 4], + [Blufor_AT_Specialist, 4], + [Blufor_diver, 3, true], + [Blufor_Marksman, 3], + [Blufor_sniper, 4, true], + [Blufor_spotter, 3, true], + [Blufor_Explosive_Specialist, 4] +]; + +// Blufor Purchasable Groups +// Format [cost, cfgGroups entry, SF Skill (optional boolean)] +blufor_cfgGroup_array = +[ + [8, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam")], + [16, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad")], + [18, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad_Weapons")], + [12, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam_AT")], + [15, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam_AA")], + [12, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_ReconPatrol"), true], + [20, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_ReconSquad"), true], + [12, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "SpecOps" >> "BUS_DiverTeam"), true], + [8, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_SniperTeam"), true], + [10, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Support" >> "BUS_Support_CLS")], + [28, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Motorized" >> "BUS_MotInf_Team")], + [46, (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Mechanized" >> "BUS_MechInfSquad")] +]; + +// Blufor Vehicles +Blufor_Flag = "Flag_NATO_F"; +Blufor_Helowreck = "Land_Wreck_Heli_Attack_01_F"; // Used for 'Downed Pilot' side mission +Blufor_SupplyCrate = "B_supplyCrate_F"; // Used for ammobox support +Blufor_AA_Static = "B_static_AA_F"; +Blufor_GMG_Static = "B_GMG_01_high_F"; +Blufor_AT_Static = "B_static_AT_F"; +Blufor_HMG_Static = "B_HMG_01_high_F"; +Blufor_Truck_Covered = "B_Truck_01_covered_F"; +Blufor_Truck_Open = "B_TrucK_01_transport_F"; +Blufor_Taxi_Boat = "B_Lifeboat"; +Blufor_Taxi_Helo = "B_Heli_Transport_01_camo_F"; + +// Contents of Ammobox Support +// Format: ["classname", amount] +// classname can be of types: item, weapons, magazine +// For more info, see https://community.bistudio.com/wiki/addItemCargo +Blufor_Ammobox_Contents = +[ + ["30Rnd_65x39_caseless_mag", 70], + ["30Rnd_65x39_caseless_mag_Tracer", 70], + ["100Rnd_65x39_caseless_mag", 70], + ["100Rnd_65x39_caseless_mag_tracer", 70], + ["1Rnd_HE_Grenade_shell", 90], + ["UGL_FlareRed_F", 70], + ["UGL_FlareGreen_F", 70], + ["1Rnd_Smoke_Grenade_shell", 70], + ["1Rnd_SmokeRed_Grenade_shell", 70], + ["1Rnd_SmokeBlue_Grenade_shell", 70], + ["NLAW_F", 70], + ["Chemlight_green", 70] +]; + + +// Blufor Purchasable Vehicles +// Format: ["vehicle", cost] +blufor_vehicle_array = [ + [5, "B_LSV_01_unarmed_F"], + [13, "B_LSV_01_armed_F"], + [16,"B_LSV_01_AT_F"], + [5, "B_MRAP_01_F"], + [18, "B_MRAP_01_hmg_F"], + [25, "B_MRAP_01_gmg_F"], + [35, "B_APC_Wheeled_01_cannon_F"], + [8, "B_Truck_01_covered_F"], + [25, "B_Heli_Light_01_armed_F"], + [45, "B_Heli_Attack_01_F"], + [15, "B_Heli_Light_01_F"], + [12, "B_Heli_Transport_01_F"], + [26, "B_Heli_Transport_03_F"], + [25, "B_APC_Tracked_01_rcws_F"], + [1, "B_Quadbike_01_F"], + [30, "B_APC_Tracked_01_AA_F"], + [40, "B_MBT_01_cannon_F"], + [28, "B_APC_Tracked_01_CRV_F"], + [75, "B_MBT_01_mlrs_F"], + [75, "B_MBT_01_arty_F"], + [45, "B_Plane_CAS_01_F"], + [34, "B_MBT_01_cannon_F"], + [40, "B_MBT_01_TUSK_F"], + [20, "B_UGV_01_rcws_F"], + [15, "B_UAV_02_F"], + [15, "B_UAV_02_CAS_F"], + [60, "B_T_UAV_03_F"], + [40, "B_T_VTOL_01_infantry_F"], + [45, "B_T_VTOL_01_vehicle_F"], + [60, "B_T_VTOL_01_armed_F"], + [50, "B_Plane_Fighter_01_F"], + [60, "B_Plane_Fighter_01_Stealth_F"], + [38, "B_AFV_Wheeled_01_cannon_F"], + [42, "B_AFV_Wheeled_01_up_cannon_F"] +]; + +// Opfor Faction +Opfor_Faction = "OPF_F"; + +// Opfor Soldiers +Opfor_Officer = "O_officer_F"; +Opfor_Squadleader = "O_Soldier_SL_F"; +Opfor_Teamleader = "O_Soldier_TL_F"; +Opfor_Medic = "O_medic_F"; +Opfor_Rifleman = "O_Soldier_F"; +Opfor_Rifleman_Light = "O_Soldier_lite_F"; +Opfor_Rifleman_AT = "O_Soldier_LAT_F"; +Opfor_Marksman = "O_soldier_M_F"; +Opfor_Grenadier = "O_Soldier_GL_F"; +Opfor_Autorifleman = "O_Soldier_AR_F"; +Opfor_HeavyGunner = "O_HeavyGunner_F"; +Opfor_AT_Specialist = "O_Soldier_AT_F"; +Opfor_AA_Specialist = "O_Soldier_AA_F"; +Opfor_Pilot = "O_Pilot_F"; +Opfor_Heli_Pilot = "O_helipilot_F"; +Opfor_Crewman = "O_crew_F"; + +// Opfor Vehicles (Used for objectives) +Opfor_Flag = "Flag_CSAT_F"; +Opfor_Supplycrate = "O_supplyCrate_F"; +Opfor_Quadbike = "O_Quadbike_01_F"; +Opfor_Truck_Covered = "O_Truck_02_covered_F"; +Opfor_Truck_Open = "O_TrucK_02_transport_F"; +Opfor_MRAP = "O_MRAP_02_F"; + +// Opfor Groups +Opfor_WARCOM_Fireteam = (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam"); +Opfor_WARCOM_Infantry_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad"); +Opfor_WARCOM_Weapons_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons"); +Opfor_WARCOM_Mech_Inf_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInfSquad"); +Opfor_WARCOM_Mech_Wpn_Squad = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInf_AT"); + +// Indfor faction +Indfor_Faction = "IND_F"; + +// Civilian faction +Civilian_Faction = "CIV_F"; + +///////Special Operatives/////// +duws_operator_list=[ + [0.35,0.62,0.67,0.48,0.66,0.32,"Scout","Ready","Matthew 'Ghost' Norton","ghost","B_recon_F","H_Shemag_olive_hs",0,0], + [0.57,0.39,0.49,0.28,0.51,0.35,"Rifleman","Ready","Tyler Adams","adams","B_Soldier_F","H_Cap_oli_hs",0,0], + [0.40,0.35,0.42,0.45,0.40,0.62,"LAT Rifleman","Ready","John Campbell","campbell","B_Soldier_LAT2_F","H_HelmetB_camo",0,0], + [0.33,0.29,0.33,0.37,0.41,0.21,"Medic","Ready","Julian 'Jester' Foote","jester","B_medic_F","H_HelmetB_grass",0,0], + [0.58,0.25,0.31,0.39,0.24,0.54,"Machinegunner","Ready","Ryan Armstrong","armstrong","B_CTRG_soldier_AR_A_F","H_Beret_02",0,0], + [0.68,0.22,0.58,0.28,0.31,0.21,"Sniper","Ready","Darnell Sykes","sykes","B_sniper_F","H_Booniehat_khk",0,0], + [0.47,0.33,0.48,0.59,0.55,0.36,"Team leader","Ready","James O'Connor","oconnor","B_Soldier_TL_F","H_MilCap_ocamo",0,0], + [0.45,0.36,0.38,0.31,0.33,0.52,"Grenadier","Ready","Nick 'Viper' Mundy","viper","B_Soldier_GL_F","H_Booniehat_khk_hs",0,0], + [0.31,0.33,0.37,0.36,0.41,0.29,"Engineer","Ready","Martin 'Frost' Moore","frost","B_CTRG_soldier_engineer_exp_F","H_Watchcap_blk",0,0], + [0.40,0.21,0.32,0.39,0.45,0.21,"Medic","Ready","Chris Hawkins","hawkins","B_CTRG_soldier_M_medic_F","H_HelmetB_camo",0,0], + [0.64,0.26,0.55,0.25,0.46,0.31,"Marksman","Ready","Alex Taylor","taylor","B_Soldier_M_F","H_Watchcap_blk",0,0], + [0.35,0.33,0.39,0.38,0.24,0.53,"AT Specialist","Ready","Arnold Patterson","patterson","B_soldier_AT_F","H_HelmetB",0,0], + [0.58,0.40,0.49,0.41,0.24,0.44,"Rifleman","Ready","Marcus Lopez","lopez","B_Soldier_F","H_Booniehat_mcamo",0,0], + [0.54,0.32,0.27,0.39,0.30,0.49,"Machinegunner","Ready","Adam Reynolds","reynolds","B_soldier_AR_F","H_Cap_headphones",0,0], + [0.30,0.40,0.49,0.41,0.24,0.44,"AA Specialist","Ready","Andrew Levine","levine","B_soldier_AA_F","H_HelmetB_camo",0,0], + [0.49,0.35,0.30,0.36,0.44,0.51,"Grenadier","Ready","Hines McKendrick","mckendrick","B_Story_Protagonist_F","H_Cap_tan_specops_US",0,0], + [0.38,0.41,0.42,0.29,0.33,0.36,"Saboteur","Ready","Sean 'Snake' Vincent","snake","B_recon_exp_F","H_MilCap_ocamo",0,0], + [0.45,0.32,0.55,0.66,0.61,0.24,"Squad leader","Ready","Darryl Franklin","franklin","B_Soldier_SL_F","H_Beret_02",0,0], + [0.41,0.45,0.68,0.27,0.30,0.24,"Spotter","Ready","Julian 'Fox' Warren","fox","B_spotter_F","H_Beret_red",0,0], + [0.37,0.41,0.25,0.22,0.29,0.29,"Repair specialist","Ready","Samuel Martinez","martinez","B_soldier_repair_F","H_HelmetB",0,0], + [0.37,0.35,0.47,0.49,0.23,0.55,"AT Rifleman","Ready","Mike 'Stranger' Sanders","stranger","B_CTRG_soldier_GL_LAT_F","H_Booniehat_khk_hs",0,0], + [0.62,0.25,0.57,0.29,0.30,0.27,"Marksman","Ready","Charles Dixon","dixon","B_recon_M_F","H_Shemag_olive_hs",0,0] +]; + +/* +0: aim +1: reflexes +2: spotting +3: courage +4: communications +5: reload speed +6: role +7: status (always "Ready") +8: name +9: CfgIdentity class +10: soldier class +11: hat +12: time before heal +13: available spendable points +*/ diff --git a/source/INIT.sqf b/source/INIT.sqf index 69e3fe8..2058be3 100644 --- a/source/INIT.sqf +++ b/source/INIT.sqf @@ -1,296 +1,2 @@ -diag_log format ["------------------ DUWS-R START ----v0------ player: %1", profileName]; - - -if (isServer) then { nul = [] execVM "serverinit.sqf"; }; -if (isDedicated) exitWith {}; -waitUntil {!isNull player}; - -player allowDamage false; - -persistent_stat_script_init = [] execVM "persistent\persistent_stats_init.sqf"; -waitUntil {scriptDone persistent_stat_script_init}; -execvm "dynamic_music\dyn_music_init.sqf"; - - -#include "dialog\supports_init.hpp" -#include "dialog\squad_number_init.hpp" - -if (hasInterface) then { execVM "misc\gps_marker.sqf";}; -if (!isMultiplayer) then { - getsize_script = [player] execVM "mapsize.sqf"; -}; -staminaEnabled = ["Stamina", false] call BIS_fnc_getParamValue; -if(staminaEnabled == 0) then { - staminaEnabled = false; -} else { - staminaEnabled = true; -}; -// IF MP -if (isMultiplayer) then { - - // Get the variables from the parameters lobby - _revive_activated = ["Revive", 1] call BIS_fnc_getParamValue; - DUWSMP_CP_death_cost = ["DeathPenalty", 1] call BIS_fnc_getParamValue; - //staminaEnabled = ["Stamina", 0] call BIS_fnc_getParamValue; - - /*if(staminaEnabled == 0) then { - staminaEnabled = false; - } else { - staminaEnabled = true; - };*/ - - if (support_armory_available) then { - hq_blu1 addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; - { - _x addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; - } forEach (Array_of_FOBS); - }; - - if (_revive_activated == 1) then {execVM "duws_revive\reviveInit.sqf"}; - - PlayerKilledEH = player addEventHandler ["killed", { - commandpointsblu1 = commandpointsblu1 - DUWSMP_CP_death_cost; - publicVariable "commandpointsblu1"; - }]; - - PlayerBetrayerEH = player addEventHandler ["HandleRating", { - // If playerRating is negative (traitor) then reset to zero - _playerRating = rating (_this select 0); - if (_playerRating < 0) then { - player addRating (0 - _playerRating); - }; - // If final rating is positive, do not modify, else zero. - _rating = _this select 1; - [0,_rating] select ((_playerRating - _rating) > 0); - }]; - - "support_specialized_training_available" addPublicVariableEventHandler {lbSetColor [2103, 11, [0, 1, 0, 1]];}; - "support_armory_available" addPublicVariableEventHandler { - hq_blu1 addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; - { - _x addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; - } forEach (Array_of_FOBS); - lbSetColor [2103, 5, [0, 1, 0, 1]]; - }; - - // change the shown CP for request dialog - "commandpointsblu1" addPublicVariableEventHandler {ctrlSetText [1000, format["%1",commandpointsblu1]]; }; - - // each time there is a new FOB - "Array_of_FOBS" addPublicVariableEventHandler { - if (!fobSwitch) then { - [] execVM "support\FOBreceiveaction.sqf"; - }; - fobSwitch = false; - //Add the FoB to the list of revive locations. - _fobAmount = count Array_of_FOBS; - _fobIndex = _fobAmount - 1; - _createdFOB = Array_of_FOBS select _fobIndex; - - [missionNamespace, _createdFOB] call BIS_fnc_addRespawnPosition; - }; - - if (!isServer) then { - "savegameNumber" addPublicVariableEventHandler {[] execVM "savegameClient.sqf";}; - }; - if (!isServer) then { - "capturedZonesNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_zones_add.sqf";}; // change the shown CP for request dialog - }; - if (!isServer) then { - "finishedMissionsNumber" addPublicVariableEventHandler {[] execVM "persistent\persistent_stats_missions_total.sqf";}; // change the shown CP for request dialog - }; - - player globalChat format ["gamemaster: %1", game_master]; - player globalChat format ["HQ_pos_found_generated: %1", HQ_pos_found_generated]; - - if (!isDedicated && !HQ_pos_found_generated) then { // SERVER INIT - if (((vehiclevarname player) in game_master)) then { - DUWS_host_start = false; - publicVariable "DUWS_host_start"; - waitUntil {time > 0.1}; - getsize_script = [player] execVM "mapsize.sqf"; - DUWS_host_start = true; - publicVariable "DUWS_host_start"; - - // init High Command - _handle = [] execVM "dialog\hc_init.sqf"; - waitUntil {scriptDone getsize_script}; - }; - }; -}; - -if (!isDedicated && !HQ_pos_found_generated) then { - if (((vehiclevarname player) in game_master)) then { - _null = [] execVM "dialog\startup\hq_placement\placement.sqf"; - waitUntil {chosen_hq_placement}; - player globalChat format ["hq_manually_placed: %1", hq_manually_placed]; - player globalChat format ["player_is_choosing_hqpos: %1", player_is_choosing_hqpos]; - // create random HQ - if (!hq_manually_placed && !player_is_choosing_hqpos) then { - player globalChat "lance recherche position..."; - hq_create = [20, 0.015] execVM "initHQ\locatorHQ.sqf"; - waitUntil {scriptDone hq_create}; - }; - }; -}; - -/* -//////// DEBUG LOOP ///////////// -[] spawn { - while {true} do { - hintsilent format["OvercastVar: %1\nFogVar: %2",OvercastVar,FogVar]; - sleep 1; - }; -}; -//////// DEBUG LOOP ///////////// -*/ - -// AMBIANCE LOOP -//_nul = [] execVM "musicloop.sqf"; - -if (isServer) then { - // group cleaning script - clean = [ - 5*60, // seconds to delete dead bodies (0 means don't delete) - 5*60, // seconds to delete dead vehicles (0 means don't delete) - 0, // seconds to delete immobile vehicles (0 means don't delete) - 5*60, // seconds to delete dropped weapons (0 means don't delete) - 0, // seconds to deleted planted explosives (0 means don't delete) - 10*60 // seconds to delete dropped smokes/chemlights (0 means don't delete) - ] execVM 'repetitive_cleanup.sqf'; -}; - -if (hasInterface) then { - // WHEN CLIENT CONNECTS INIT (might need sleep) - waitUntil {isPlayer Player}; - hintsilent "Waiting for the host to find an HQ..."; - waitUntil {HQ_pos_found_generated && time > 0.1}; - player setpos [(getpos hq_blu1 select 0),(getpos hq_blu1 select 1)+10]; - _drawicon = [] execVM "inithq\drawIcon.sqf"; - hintsilent "Waiting for the host to select the campaign parameters..."; - waitUntil {chosen_settings}; - [hq_blu1] execVM "initHQ\HQaddactions.sqf"; - sleep 1; - player setdamage 0; - player allowDamage true; - hintsilent format["Joined game, welcome to %1, %2",worldName,profileName]; - - // init High Command - _handle = [] execVM "dialog\hc_init.sqf"; - [] execVM "dialog\startup\weather_client.sqf"; - - if(!staminaEnabled) then { - player enableStamina false; - }; -}; - -if (!isMultiplayer) then { - _handle = [] execVM "dialog\hc_init.sqf"; -}; - - - - - -// INIT the operative list -execVM "dialog\operative\operator_init.sqf"; - -// Create help for DUWS -_index = player createDiarySubject ["help","DUWS-R Manual"]; -player createDiaryRecord ["help", ["Feedback/bug report", "Internal team members: Use the ""issues"" section to report items."]]; -player createDiaryRecord ["help", ["Export to another island", "How to export to another island:
You just need to take the .pbo file and rename it with the name of the island you want to export the mission to. You don't have anything else to do

Example:
SP_DUWS-R.stratis.pbo >>> SP_DUWS-R.chernarus.pbo"]]; -player createDiaryRecord ["help", ["Credits", "Many thanks goes out to everyone that worked on the original DUWS by kibot!"]]; -player createDiaryRecord ["help", ["Command Points (CP)", "Command points are used to purchase vehicles, units and ask for support (like artillery or save the game outside the base). To obtain Command points, you must capture the enemy controlled zones (red zones on the map) or execute side missions. You also receive 3 command points for each zone you have under your control every 30 minutes."]]; -player createDiaryRecord ["help", ["Army Power (AP)", "Army power represent the strenght of the BLUFOR forces present on the island. By capturing enemy positions and accomplishing side missions, you will add Army Power to your army. The attack waves of the BLUFOR army will become stronger."]]; -player createDiaryRecord ["help", ["Experience", "By accomplishing side missions, capturing zones and islands, you will increase your experience. With experience, you will automatically unlock new abilties. Once you have an ability, a description of this ability will be available in the 'ability' tab in the briefing.
Capturing an island gives you 5 XP
Achieving a side mission: 2 XP
Capturing a zone: 1 XP"]]; -player createDiaryRecord ["help", ["Saving the game", "You can save the game by resting at the base. Just go near the officer and select the action ""Rest"". Note that 6 hours will ellapse during that time. You can also save at any time by giving a SITREP in the support menu (0-8-1). Giving a SITREP does not make you wait, but it will cost you 1 CP for each save."]]; -player createDiaryRecord ["help", ["Repairing/Rearming", "To repair, refuel or rearm a vehicle you need to unlock the ""vehicle refit"" support. Once you have it, you can call the support and your vehicle will be rearmed, repaired and refueled. Note that you must be close to the base to be able to use the vehicle refit."]]; -player createDiaryRecord ["help", ["Support", "During the campaign you may unlock several support options at you HQ. You can access the available support in the radio menu (0-8). Note that calling for support cost CP."]]; -player createDiaryRecord ["help", ["Making a FOB", "After you have captured your first zone, you'll get the ability to establish a FOB for 10 CP. A FOB allows you to rest(save) at remote locations outside the base. Establishing a FOB will also spawn some BLUFOR patrols around it and if there are enemies around it, you will be notified. To establish a FOB, you must make sure the zone around you is clear in a radius of 500 meters. Just go to the support menu and select 'Establish FOB'. A FOB will be deployed to your location."]]; -player createDiaryRecord ["help", ["Side Missions", "You can request a side mission at the officer in the base. Successful side missions will not give any army power to the enemy, but will give you CP and increase your army power."]]; -player createDiaryRecord ["help", ["Requesting units", "To request units, go to the officer at the base and select the action ""Request units""."]]; -player createDiaryRecord ["help", ["Taking the Island", "At the beginning of the game, you are alone with your officer and only a few command points available, but as the war escalates, the BLUFOR HQ will start to launch attacks on enemy zone and will try to retake the island. You can help the main forces by assisting them in capturing the island, or you can also achieve side missions to boost the available assets of your army. It's up to you on how you want to play this campaign."]]; - -// Operatives -_index = player createDiarySubject ["operativehelp","Special operatives"]; -player createDiaryRecord ["operativehelp", ["Skills", "Aiming:
Pretty self explanatory, how well the operative can aim, lead a target, compensante for bullet drop and manage recoil.

Reflexes:
How fast the operator can react to a new threat and stabilize its aim.

Spotting:
The operative ability to spot targets within it's visual or audible range, and how accurately he can spot targets.

Courage:
Affects the morale of subordinates units of the operative, how likely they will flee, depending on what is in front of them and the squad status.

Communications:
How quickly recognized targets are shared with the squad.

Reload speed:
The operator's ability to switch weapon or reload quickly."]]; -player createDiaryRecord ["operativehelp", ["Recruiting operatives", "Operatives can be recruited at the HQ, inside the ""request unit"" menu. When you recruit someone for the first time, you'll have to spend 5 CP. However, once an operative has been already recruited, has been ""injured""(killed) in battle, you can recruit it again for only 2 CP after a delay between 20 and 80 minutes."]]; -player createDiaryRecord ["operativehelp", ["Overview", "You can recruit special operatives that will stay and progress with you for all the duration of the campaign. Some of these mens have special equipment, specialities and skills. Their skills will increase each time a zone is captured or a mission is accomplished, whether they're in your squad or not. However, when an operative is actually in the game, he will gain 10 spendable points wich can be assigned freely in any skill at the operative menu."]]; - -// MP notes -if (isMultiplayer) then { - player createDiaryRecord ["help", ["MP notes", "The CP pool is common for everyone.

While most support unlocks are indivdual, the Armory and the Specialized infantry training are common, and need to be unlocked only once by a single player.

While everybody can rest to heal, only the host can save and skip the time.

Only the host can request side mission and finish them. However, everyone receive the persistent stats and xp bonuses."]]; -}; - -// MP notification -if (isMultiplayer) then { - [] spawn { - waitUntil {time > 5}; - ["info",["MP Mechanics","Check the manual for the specifics of the DUWS-R in MP"]] call bis_fnc_showNotification; - }; -}; - -// create mission victory script //SPAWN BEGIN -[] spawn { - - // CREATE MAIN OBJECTIVE - capture_island_obj = player createSimpleTask ["taskIsland"]; - capture_island_obj setSimpleTaskDescription ["The ennemy is controlling the island, we must take it back! Capture every zone under enemy control and the mission will succeed.
You can let your BLUFOR forces take the island by themselves and help them getting a bigger army by accomplishing side missions. Or you can capture the zones yourself and do all the big work. As the campaign progress, the war will escalate and the armies will get stronger and start to use bigger guns.
To capture a zone, you need to have more units inside the zone than the enemy.

It's up to you on how you want to play this.
Good luck, soldier!","Take the island",""]; - - // WAIT UNTIL ALL ZONES ARE CAPTURED - waitUntil {sleep 1; amount_zones_created > 0}; - waitUntil {sleep 3; (zoneundercontrolblu >= amount_zones_created);}; // Toutes les zones sont capturées - persistent_stat_script_win = [] execVM "persistent\persistent_stats_win.sqf"; - ["TaskSucceeded",["","Island captured!"]] call bis_fnc_showNotification; - capture_island_obj setTaskState "Succeeded"; - sleep 3; - ["island_captured_win",true,true] call BIS_fnc_endMission; -}; - - - -if (mission_DUWS_firstlaunch) then { - waitUntil {chosen_settings}; - sleep 8; - ["info",["Buying troops","Go talk to your commander to buy troops and vehicles with CP"]] call bis_fnc_showNotification; - sleep 2.5; - ["info",["Command points","Acquire more CP by capturing enemy areas or accomplishing side missions"]] call bis_fnc_showNotification; - - sleep 15; - ["info",["RESTING AND HEALING","Save the game and heal by resting at the base"]] call bis_fnc_showNotification; - - sleep 15; - // SITREP - ["sitrepinfo",["SITREP","You can also save the game by giving a SITREP"]] call bis_fnc_showNotification; - - sleep 20; - ["info",["DUWS Manual","Check the manual in the briefing for more info"]] call bis_fnc_showNotification; - - profileNamespace setVariable ["profile_DUWS_firstlaunch", false]; - saveProfileNamespace; -}; - -//Cleanup unused players. -for[{_x = 2},{_x <= 20},{_x = _x + 1}] do { - _thePlayer = missionNamespace getVariable format["player%1", _x]; - if(!isNil("_thePlayer")) then { - if(!isPlayer _thePlayer) then { - deleteVehicle _thePlayer; - }; - }; -}; - - -_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem; - -//Loading player position and gear. -//TODO: Add bought supports. -/* -if(isServer) then -{ - execVM "persistent\missionSpecific\saveFuncs.sqf"; - waitUntil {!isNil "saveFuncsLoaded"}; - - execVM "persistent\missionSpecific\loadAccount.sqf"; -}; -*/ +serverInitHandle = [] spawn duws_fnc_serverInit; +[] spawn duws_fnc_clientInit; \ No newline at end of file diff --git a/source/WARCOM/WARCOM_blu_patrol.sqf b/source/WARCOM/WARCOM_blu_patrol.sqf deleted file mode 100644 index 8cae2fd..0000000 --- a/source/WARCOM/WARCOM_blu_patrol.sqf +++ /dev/null @@ -1,74 +0,0 @@ -_loop = true; - -WARCOM_blu_patrol_type = ""; -diag_log format ["WARCOM_blufor_ap_patrol: %1", WARCOM_blufor_ap]; - -// Type of attack wave -[] spawn { - diag_log "spawn1"; - WARCOM_blu_patrol_type = (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam"); - - waitUntil {sleep 1; WARCOM_blufor_ap>40}; - WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad"); - - waitUntil {sleep 1; WARCOM_blufor_ap>65}; - WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad_Weapons"); - - waitUntil {sleep 1; WARCOM_blufor_ap>100}; - WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Mechanized" >> "BUS_MechInfSquad"); - - waitUntil {sleep 1; WARCOM_blufor_ap>135}; - WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Mechanized" >> "BUS_MechInf_AT"); - - -}; - - - - - - - - - - - -// Attack waves main -[] spawn { - - while {true} do { - if (count WARCOM_zones_controled_by_BLUFOR > 1) then { // make sure blufor is controlling at least 2 zones - sleep 2; - - // find a zone where to spawn OPF wave *** BEGIN - _found = false; - _randomZone = []; - _failSafe = 0; - while {!_found} do { - _randomZone = WARCOM_zones_controled_by_BLUFOR call BIS_fnc_selectRandom; - if (_randomZone distance player > 2000) then {_found=true;}; - sleep 0.2; - // player sidechat format["Failsafe: %1",_failsafe]; - _failSafe = _failSafe + 1; - if (_failsafe > 10) then {sleep 300; _failsafe = 0;} - }; - // find a zone *** end - _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; - _group = [_randomZone, WEST, WARCOM_blu_patrol_type,[],[],WARCOM_blu_ai_skill_range] call BIS_fnc_spawnGroup; - _opf_assault = [_group] execVM "WARCOM\WARCOM_wp_blu_patrol.sqf"; -// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf"; - - // spawn armored - if (WARCOM_blufor_ap>50) then { - ["BLU_F","armored",_randomZone] execVM "WARCOM\random_veh_blu_patrol.sqf"; - }; - - if (WARCOM_blufor_ap>200) then { - ["BLU_F","air",_randomZone] execVM "WARCOM\random_veh_blu_patrol.sqf"; - }; - - }; - sleep (random 1200); // patrol delay - }; -}; - diff --git a/source/WARCOM/WARCOM_opf_patrol.sqf b/source/WARCOM/WARCOM_opf_patrol.sqf deleted file mode 100644 index b52bcd3..0000000 --- a/source/WARCOM/WARCOM_opf_patrol.sqf +++ /dev/null @@ -1,71 +0,0 @@ -_loop = true; - -WARCOM_opf_patrol_type = ""; - -// Type of attack wave -[] spawn { - WARCOM_opf_patrol_type = (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam"); - - waitUntil {sleep 1; WARCOM_opfor_ap>40}; - WARCOM_opf_patrol_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad"); - - waitUntil {sleep 1; WARCOM_opfor_ap>65}; - WARCOM_opf_patrol_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons"); - - waitUntil {sleep 1; WARCOM_opfor_ap>100}; - WARCOM_opf_patrol_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInfSquad"); - - waitUntil {sleep 1; WARCOM_opfor_ap>135}; - WARCOM_opf_patrol_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInf_AT"); - - -}; - - - - - - - - - - - -// Attack waves main -[] spawn { - - while {true} do { - if (count WARCOM_zones_controled_by_OPFOR > 1) then { // make sure opfor is controlling at least 2 zones - sleep 2; - - // find a zone where to spawn OPF wave *** BEGIN - _found = false; - _randomZone = []; - _failSafe = 0; - while {!_found} do { - _randomZone = WARCOM_zones_controled_by_OPFOR call BIS_fnc_selectRandom; - if (_randomZone distance player > 2000) then {_found=true;}; - sleep 0.2; - // player sidechat format["Failsafe: %1",_failsafe]; - _failSafe = _failSafe + 1; - if (_failsafe > 10) then {sleep 300; _failsafe = 0;} - }; - // find a zone *** end - _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; - _group = [_randomZone, EAST, WARCOM_opf_patrol_type,[],[],WARCOM_opf_ai_skill_range] call BIS_fnc_spawnGroup; - _opf_assault = [_group] execVM "WARCOM\WARCOM_wp_opf_patrol.sqf"; -// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf"; - - // spawn armored - if (WARCOM_opfor_ap>50) then { - ["OPF_F","armored",_randomZone] execVM "WARCOM\random_veh_opf_patrol.sqf"; - }; - - if (WARCOM_opfor_ap>200) then { - ["OPF_F","air",_randomZone] execVM "WARCOM\random_veh_opf_patrol.sqf"; - }; - - }; - sleep (random 1200); // patrol delay - }; -}; diff --git a/source/WARCOM/WARCOM_opf_qrf.sqf b/source/WARCOM/WARCOM_opf_qrf.sqf deleted file mode 100644 index a6ecddd..0000000 --- a/source/WARCOM/WARCOM_opf_qrf.sqf +++ /dev/null @@ -1,37 +0,0 @@ -if (!WARCOM_qrf_ready) exitWith {}; -WARCOM_qrf_ready = false; -_attachedUnit = _this select 0; -_unitPos = getpos _attachedUnit; -//hint format["%1",_attachedUnit]; - -// Attack waves main - - if (count WARCOM_zones_controled_by_OPFOR > 0) then { // make sure opfor is controlling at least 1 zones - sleep 2; - - // find a zone where to spawn OPF wave away from player *** BEGIN - _found = false; - _randomZone = []; - _failSafe = 0; - while {!_found} do { - _randomZone = WARCOM_zones_controled_by_OPFOR call BIS_fnc_selectRandom; - if (_randomZone distance player > 2000) then {_found=true;}; - sleep 0.2; - // player sidechat format["Failsafe: %1",_failsafe]; - _failSafe = _failSafe + 1; - if (_failsafe > 10) then {sleep 300; _failsafe = 0;} - }; - // find a zone *** end - _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; - _group = [_randomZone, EAST, WARCOM_opf_patrol_type,[],[],WARCOM_opf_ai_skill_range] call BIS_fnc_spawnGroup; - _opf_assault = [_group,_unitPos] execVM "WARCOM\WARCOM_wp_opf_qrf.sqf"; -// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf"; - - - }; - - - - -sleep 1800; -WARCOM_qrf_ready = true; \ No newline at end of file diff --git a/source/WARCOM/WARCOM_wp_blu_patrol.sqf b/source/WARCOM/WARCOM_wp_blu_patrol.sqf deleted file mode 100644 index 91dab21..0000000 --- a/source/WARCOM/WARCOM_wp_blu_patrol.sqf +++ /dev/null @@ -1,19 +0,0 @@ -_group =_this select 0; - -_group setCombatMode "RED"; - - -{ - _wp = _group addWaypoint [_x, 0]; - _wp setWaypointType "MOVE"; - _wp setWaypointBehaviour "SAFE"; - _wp setWaypointSpeed "LIMITED"; - _wp setWaypointCompletionRadius 40; - _wp setWaypointTimeout [300, 450, 600]; -} -forEach WARCOM_zones_controled_by_BLUFOR; - - _wp1 = _group addWaypoint [getpos leader _group, 0]; - _wp1 setWaypointType "CYCLE"; - _wp1 setWaypointBehaviour "SAFE"; - _wp1 setWaypointSpeed "LIMITED"; diff --git a/source/WARCOM/WARCOM_wp_opf_patrol.sqf b/source/WARCOM/WARCOM_wp_opf_patrol.sqf deleted file mode 100644 index c9333ac..0000000 --- a/source/WARCOM/WARCOM_wp_opf_patrol.sqf +++ /dev/null @@ -1,19 +0,0 @@ -_group =_this select 0; - -_group setCombatMode "RED"; - - -{ - _wp = _group addWaypoint [_x, 0]; - _wp setWaypointType "MOVE"; - _wp setWaypointBehaviour "SAFE"; - _wp setWaypointSpeed "LIMITED"; - _wp setWaypointCompletionRadius 40; - _wp setWaypointTimeout [300, 450, 600]; -} -forEach WARCOM_zones_controled_by_OPFOR; - - _wp1 = _group addWaypoint [getpos leader _group, 0]; - _wp1 setWaypointType "CYCLE"; - _wp1 setWaypointBehaviour "SAFE"; - _wp1 setWaypointSpeed "LIMITED"; diff --git a/source/WARCOM/WARCOM_wp_opf_qrf.sqf b/source/WARCOM/WARCOM_wp_opf_qrf.sqf deleted file mode 100644 index a8d8407..0000000 --- a/source/WARCOM/WARCOM_wp_opf_qrf.sqf +++ /dev/null @@ -1,12 +0,0 @@ -_group =_this select 0; -_unitPos = _this select 1; - -_group setCombatMode "RED"; - - _wp = _group addWaypoint [_unitPos, 0]; - _wp setWaypointType "SAD"; - _wp setWaypointCompletionRadius 40; - _wp setWaypointTimeout [300, 450, 600]; - - - diff --git a/source/WARCOM/random_veh_blu_patrol.sqf b/source/WARCOM/random_veh_blu_patrol.sqf deleted file mode 100644 index 88d7f85..0000000 --- a/source/WARCOM/random_veh_blu_patrol.sqf +++ /dev/null @@ -1,55 +0,0 @@ -//faction = "OPF_F"; faction = "BLU_F"; faction = "IND_F"; faction = "CIV_F"; -//vehicleClass = "Armored" "Car" "Ship" "Static" "Air" -//hasDriver = 1; -//canFloat = 0; - -_faction = _this select 0; -_vehClass = _this select 1; -_position = _this select 2; -_radius = _this select 3; - -_cfgVehicles = configFile >> "CfgVehicles"; -_totalentries = count _cfgVehicles; // GO INTO CFGVEHICLES AND CHECK NUMBER OF ENTRIES -_realentries = _totalentries - 1; -_found = false; - -_foundVeh = ""; -while {!_found} do { -_checked_veh = _cfgVehicles select round (random _realentries); // RANDOMLY SELECT AN ENTRY -_classname = configName _checked_veh; -if (isClass _checked_veh) then { // CHECK IF THE SELECTED ENTRY IS A CLASS -//hintSilent format["%1",_classname]; -sleep 0.005; -_actual_vehclass = getText (_checked_veh >> "vehicleClass"); -_actual_faction = getText (_checked_veh >> "faction"); -_scope = getNumber (_checked_veh >> "scope"); // check if actually present in editor -_simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute - - - if (_actual_vehclass == _vehClass && _actual_faction == _faction && _scope != 0 && _simulation_paracheck != "parachute") exitWith { -// hintSilent format["%1",_classname]; -// _veh = createVehicle [_classname, _position, [], 0, _vehClass]; - _foundVeh = _classname; - _found = true; - }; - }; -}; // --- VEHICLE FOUND --> _foundVeh - -// DETERMINE LA FACTION -_side = EAST; -if(_faction=="BLU_F") then {_side=WEST}; -if(_faction=="OPF_F") then {_side=EAST}; -if(_faction=="IND_F") then {_side=RESISTANCE}; -if(_faction=="CIV_F") then {_side=CIVILIAN}; - -_createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle; - -_vehGroup = _createdVehFnc select 2; -//hint format["%1",_patrolRadius]; -_opf_assault = [_vehGroup] execVM "WARCOM\WARCOM_wp_blu_patrol.sqf"; - -//_crews = _createdVehFnc select 1; // -//_driver = _crews select 0; //DEBUG -//addSwitchableUnit _driver; // - - diff --git a/source/createopfortified.sqf b/source/createopfortified.sqf deleted file mode 100644 index 0f40967..0000000 --- a/source/createopfortified.sqf +++ /dev/null @@ -1,22 +0,0 @@ -_position = _this select 0; - -// hint format["%1",_position]; - -_group = [ - _position, - EAST, [ - "O_Soldier_SL_F", - "O_Soldier_AA_F", - "O_Soldier_AT_F", - "O_Soldier_GL_F", - "O_Soldier_TL_F", - "O_Soldier_AR_F", - "O_Soldier_LAT_F", - "O_Soldier_GL_F"], - [], - [], - opfor_ai_skill] call BIS_fnc_spawnGroup; -[_group, _position] call bis_fnc_taskDefend; - -// ADD QRF eventhandler -_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn QRF_test}]; \ No newline at end of file diff --git a/source/createpatrol.sqf b/source/createpatrol.sqf deleted file mode 100644 index f6e29ca..0000000 --- a/source/createpatrol.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// usage: [position, radius] execvm "createpatrol.sqf" -// radius: 50 for patrol inside and around base, 500 for medium lenght skirmish, 1300 for island - -_position = _this select 0; -_radius = _this select 1; - -_group = [_position, WEST, ["B_Soldier_TL_F","B_Soldier_F"]] call BIS_fnc_spawnGroup; -_patrolRadius = round(_radius/3); -[_group, _position, _patrolRadius] call bis_fnc_taskPatrol; \ No newline at end of file diff --git a/source/debriefing.hpp b/source/debriefing.hpp deleted file mode 100644 index 5bb77f8..0000000 --- a/source/debriefing.hpp +++ /dev/null @@ -1,22 +0,0 @@ -class CfgDebriefing -{ - class island_captured_win - { - title = "Island Captured!"; - subtitle = ""; - description = "You have successfully captured all the zones and destroyed the enemy forces on the island. This island is now under BLUFOR control. Time to take back another island, soldier..."; - pictureBackground = ""; - picture = "\a3\ui_f\data\gui\cfg\hints\UnitType_ca.paa"; - pictureColor[] = {0.0,0,1,1}; - }; - - class officerkilled - { - title = "HQ Officer Killed"; - subtitle = ""; - description = "Your commanding officer has been killed, you are now alone and stranded on the island. You will be evacuated shortly."; - pictureBackground = ""; - picture = "\a3\ui_f\data\gui\cfg\hints\ActionMenu_ca.paa"; - pictureColor[] = {1,0,0,1}; - }; -}; diff --git a/source/description.ext b/source/description.ext index a45f6ca..e771f3a 100644 --- a/source/description.ext +++ b/source/description.ext @@ -10,29 +10,30 @@ respawn = 3; respawnDelay = 4; disabledAI = 1; -#include "debriefing.hpp" -#include "dialog\defines.hpp" -#include "dialog\squad\squadmng.hpp" -#include "dialog\squad\rename\renamesquad.hpp" -#include "dialog\request.hpp" -#include "dialog\fob\fobmanager.hpp" -#include "dialog\info\info.hpp" -#include "dialog\info\reset\reset.hpp" -#include "locations.hpp" -#include "support\support.hpp" -#include "hints.hpp" -#include "dialog\startup\startup.hpp" -#include "dialog\startup\hq_placement\placement.hpp" +#include "includes\debriefing.hpp" +#include "includes\defines.hpp" +#include "includes\squad\squadmng.hpp" +#include "includes\squad\renamesquad.hpp" +#include "includes\request.hpp" +#include "includes\fobmanager.hpp" +#include "includes\info\info.hpp" +#include "includes\info\reset.hpp" +#include "includes\locations.hpp" +#include "includes\support.hpp" +#include "includes\hints.hpp" +#include "includes\startup\startup.hpp" +#include "includes\startup\placement.hpp" #include "sounds\sounds.hpp" -#include "dialog\operative\identities.hpp" -#include "dialog\operative\operative.hpp" -#include "params.hpp" -#include "duws_revive\gui\duws_revive.hpp" +#include "includes\operative\identities.hpp" +#include "includes\operative\operative.hpp" +#include "includes\params.hpp" +#include "includes\CfgFunctions.hpp" +#include "AIS\Effects\BarDlg.hpp" // TAW INIT BEGIN -- #include "taw_vd\GUI.h" -class CfgFunctions +/*class CfgFunctions { - #include "taw_vd\CfgFunctions.hpp" -}; + #include "taw_vd\CfgFunctions.hpp" +};*/ // TAW INIT END -- diff --git a/source/dialog/fob/gui_edit_format.TXT b/source/dialog/fob/gui_edit_format.TXT deleted file mode 100644 index f182fa3..0000000 --- a/source/dialog/fob/gui_edit_format.TXT +++ /dev/null @@ -1,14 +0,0 @@ -/* #Sevoly -$[ - 1.063, - ["azeza",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1800,"mainframe_fobmanager",[2,"FOB Manager",["5 * GUI_GRID_W + GUI_GRID_X","8.5 * GUI_GRID_H + GUI_GRID_Y","29 * GUI_GRID_W","9.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1801,"fob_reinforce_frame",[2,"Reinforce a FOB",["5.5 * GUI_GRID_W + GUI_GRID_X","9.5 * GUI_GRID_H + GUI_GRID_Y","28 * GUI_GRID_W","3 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Send a team from your High Command to reinforce a specific FOB","-1"],[]], - [2101,"reinforce_combo",[2,"",["19.5 * GUI_GRID_W + GUI_GRID_X","10.5 * GUI_GRID_H + GUI_GRID_Y","13.5 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Select a FOB","-1"],[]], - [1600,"reinforce_button",[2,"Send reinforcements",["6.5 * GUI_GRID_W + GUI_GRID_X","10.5 * GUI_GRID_H + GUI_GRID_Y","12 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Send a team from your High Command to reinforce a specific FOB","-1"],[]], - [1802,"frame_fast_travel",[2,"Fast travel",["5.5 * GUI_GRID_W + GUI_GRID_X","13 * GUI_GRID_H + GUI_GRID_Y","28 * GUI_GRID_W","3 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Fast travel between the FOB's and the base","-1"],[]], - [1601,"fast_travel_button",[2,"Fast travel",["6.5 * GUI_GRID_W + GUI_GRID_X","14 * GUI_GRID_H + GUI_GRID_Y","12 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Send a team from your High Command to reinforce a specific FOB","-1"],[]], - [2100,"fast_travel_combo",[2,"",["19.5 * GUI_GRID_W + GUI_GRID_X","14 * GUI_GRID_H + GUI_GRID_Y","13.5 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Select a FOB","-1"],[]], - [1602,"exit_button",[2,"EXIT",["13.5 * GUI_GRID_W + GUI_GRID_X","16.5 * GUI_GRID_H + GUI_GRID_Y","12 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Leave the FOB manager","-1"],[]] -] -*/ diff --git a/source/dialog/info/gui_editor_info.TXT b/source/dialog/info/gui_editor_info.TXT deleted file mode 100644 index eec98d2..0000000 --- a/source/dialog/info/gui_editor_info.TXT +++ /dev/null @@ -1,21 +0,0 @@ -/* #Qezugi -/* #Pitohi -$[ - 1.062, - ["aze",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1800,"infoBackground",[2,"CAMPAIGN INFO",["0 * GUI_GRID_W + GUI_GRID_X","0 * GUI_GRID_H + GUI_GRID_Y","40 * GUI_GRID_W","25 * GUI_GRID_H"],[-1,-1,-1,-1],[0,0,0,0.5],[-1,-1,-1,-1],"","-1"],[]], - [1604,"",[2,"OK",["11.5 * GUI_GRID_W + GUI_GRID_X","23.5 * GUI_GRID_H + GUI_GRID_Y","8 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1806,"zones_captured_total_frame",[2,"Total of zones captured",["1 * GUI_GRID_W + GUI_GRID_X","1 * GUI_GRID_H + GUI_GRID_Y","18.5 * GUI_GRID_W","2 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1803,"",[2,"Side missions completed in total",["20.5 * GUI_GRID_W + GUI_GRID_X","1 * GUI_GRID_H + GUI_GRID_Y","18.5 * GUI_GRID_W","2 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1001,"",[2,"ZUC:XXX",["1 * GUI_GRID_W + GUI_GRID_X","1.5 * GUI_GRID_H + GUI_GRID_Y","18.5 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Total amount of zones you have captured","-1"],[]], - [1004,"missionsuccess",[2,"XXX",["21 * GUI_GRID_W + GUI_GRID_X","1.5 * GUI_GRID_H + GUI_GRID_Y","17 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Total amount of side mission you have completed","-1"],[]], - [1801,"island_captured_frame",[2,"Islands captured",["1 * GUI_GRID_W + GUI_GRID_X","3.5 * GUI_GRID_H + GUI_GRID_Y","18.5 * GUI_GRID_W","6.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1500,"islandscapturedlistbox",[2,"",["1.5 * GUI_GRID_W + GUI_GRID_X","4.5 * GUI_GRID_H + GUI_GRID_Y","17.5 * GUI_GRID_W","5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Islands you have captured","-1"],[]], - [1600,"reset_stats_button",[2,"RESET STATS",["20.5 * GUI_GRID_W + GUI_GRID_X","23.5 * GUI_GRID_H + GUI_GRID_Y","8 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Reset your stats to 0","-1"],[]], - [1802,"frame_player_xp",[2,"(player) total experience",["20.5 * GUI_GRID_W + GUI_GRID_X","3.5 * GUI_GRID_H + GUI_GRID_Y","18.5 * GUI_GRID_W","2 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Experience of the player","-1"],[]], - [1000,"player_experience_text",[2,"XXX",["21 * GUI_GRID_W + GUI_GRID_X","4 * GUI_GRID_H + GUI_GRID_Y","17 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Experience of the player","-1"],[]] -] -*/ - -*/ - diff --git a/source/dialog/info/reset/gui_editor_info.TXT b/source/dialog/info/reset/gui_editor_info.TXT deleted file mode 100644 index 0d54656..0000000 --- a/source/dialog/info/reset/gui_editor_info.TXT +++ /dev/null @@ -1,11 +0,0 @@ -/* #Ceroce -$[ - 1.062, - ["qsdqsdq",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1800,"confirmation_frame",[2,"Confirmation",["6.5 * GUI_GRID_W + GUI_GRID_X","9 * GUI_GRID_H + GUI_GRID_Y","29 * GUI_GRID_W","5.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1000,"confirmation_text",[2,"Are you sure you want to reset all your persistent stats ?",["7 * GUI_GRID_W + GUI_GRID_X","9 * GUI_GRID_H + GUI_GRID_Y","34 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1600,"reset_button",[2,"RESET STATS",["7.5 * GUI_GRID_W + GUI_GRID_X","11.5 * GUI_GRID_H + GUI_GRID_Y","12.5 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1601,"no_button",[2,"KEEP STATS",["22 * GUI_GRID_W + GUI_GRID_X","11.5 * GUI_GRID_H + GUI_GRID_Y","12.5 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]] -] -*/ - diff --git a/source/dialog/operative/operator_init.sqf b/source/dialog/operative/operator_init.sqf deleted file mode 100644 index 10a5d41..0000000 --- a/source/dialog/operative/operator_init.sqf +++ /dev/null @@ -1,150 +0,0 @@ -duws_operator_list=[ - [0.35,0.62,0.67,0.48,0.66,0.32,"Scout","Ready","Matthew 'Ghost' Norton","ghost","B_recon_F","H_Shemag_olive_hs",0,0], - [0.57,0.39,0.49,0.28,0.51,0.35,"Rifleman","Ready","Tyler Adams","adams","B_Soldier_F","H_Cap_oli_hs",0,0], - [0.40,0.35,0.42,0.45,0.40,0.62,"AT Rifleman","Ready","John Campbell","campbell","B_soldier_LAT_F","H_HelmetB_camo",0,0], - [0.33,0.29,0.33,0.37,0.41,0.21,"Medic","Ready","Julian 'Jester' Foote","jester","B_medic_F","H_HelmetB_grass",0,0], - [0.58,0.25,0.31,0.39,0.24,0.54,"Machinegunner","Ready","Ryan Armstrong","armstrong","B_CTRG_soldier_AR_A_F","H_Beret_02",0,0], - [0.68,0.22,0.58,0.28,0.31,0.21,"Sniper","Ready","Darnell Sykes","sykes","B_sniper_F","H_Booniehat_khk",0,0], - [0.47,0.33,0.48,0.59,0.55,0.36,"Team leader","Ready","James O'Connor","oconnor","B_Soldier_TL_F","H_MilCap_ocamo",0,0], - [0.45,0.36,0.38,0.31,0.33,0.52,"Grenadier","Ready","Nick 'Viper' Mundy","viper","B_Soldier_GL_F","H_Booniehat_khk_hs",0,0], - [0.31,0.33,0.37,0.36,0.41,0.29,"Engineer","Ready","Martin 'Frost' Moore","frost","B_CTRG_soldier_engineer_exp_F","H_Watchcap_blk",0,0], - [0.40,0.21,0.32,0.39,0.45,0.21,"Medic","Ready","Chris Hawkins","hawkins","B_CTRG_soldier_M_medic_F","H_HelmetB_camo",0,0], - [0.64,0.26,0.55,0.25,0.46,0.31,"Marksman","Ready","Alex Taylor","taylor","B_soldier_M_F","H_Watchcap_blk",0,0], - [0.35,0.33,0.39,0.38,0.24,0.53,"AT Specialist","Ready","Arnold Patterson","patterson","B_soldier_AT_F","H_HelmetB",0,0], - [0.58,0.40,0.49,0.41,0.24,0.44,"Rifleman","Ready","Marcus Lopez","lopez","B_Soldier_F","H_Booniehat_mcamo",0,0], - [0.54,0.32,0.27,0.39,0.30,0.49,"Machinegunner","Ready","Adam Reynolds","reynolds","B_soldier_AR_F","H_Cap_headphones",0,0], - [0.30,0.40,0.49,0.41,0.24,0.44,"AA Specialist","Ready","Andrew Levine","levine","B_soldier_AA_F","H_HelmetB_camo",0,0], - [0.49,0.35,0.30,0.36,0.44,0.51,"Grenadier","Ready","Hines McKendrick","mckendrick","B_Story_Protagonist_F","H_Cap_tan_specops_US",0,0], - [0.38,0.41,0.42,0.29,0.33,0.36,"Saboteur","Ready","Sean 'Snake' Vincent","snake","B_recon_exp_F","H_MilCap_ocamo",0,0], - [0.45,0.32,0.55,0.66,0.61,0.24,"Squad leader","Ready","Darryl Franklin","franklin","B_Soldier_SL_F","H_Beret_02",0,0], - [0.41,0.45,0.68,0.27,0.30,0.24,"Spotter","Ready","Julian 'Fox' Warren","fox","B_spotter_F","H_Beret_red",0,0], - [0.37,0.41,0.25,0.22,0.29,0.29,"Repair specialist","Ready","Samuel Martinez","martinez","B_soldier_repair_F","H_HelmetB",0,0], - [0.37,0.35,0.47,0.49,0.23,0.55,"AT Rifleman","Ready","Mike 'Stranger' Sanders","stranger","B_CTRG_soldier_GL_LAT_F","H_Booniehat_khk_hs",0,0], - [0.62,0.25,0.57,0.29,0.30,0.27,"Marksman","Ready","Charles Dixon","dixon","B_recon_M_F","H_Shemag_olive_hs",0,0] -]; - -/* -0: aim -1: reflexes -2: spotting -3: courage -4: communications -5: reload speed -6: role -7: status (always "Ready") -8: name -9: CfgIdentity class -10: soldier class -11: hat -12: time before heal -13: available spendable points -*/ - -// init functions for adding skills -DUWS_operator_add_aim = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_aim = _selected_soldier select 0; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_aim >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_aim_new = _selected_soldier_aim + 0.01; // update the variable - _selected_soldier set [0,_selected_soldier_aim_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; - -DUWS_operator_add_reflexes = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_reflexes = _selected_soldier select 1; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_reflexes >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_reflexes_new = _selected_soldier_reflexes + 0.01; // update the variable - _selected_soldier set [1,_selected_soldier_reflexes_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; - -DUWS_operator_add_spotting = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_spotting = _selected_soldier select 2; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_spotting >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_spotting_new = _selected_soldier_spotting + 0.01; // update the variable - _selected_soldier set [2,_selected_soldier_spotting_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; - -DUWS_operator_add_courage = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_courage = _selected_soldier select 3; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_courage >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_courage_new = _selected_soldier_courage + 0.01; // update the variable - _selected_soldier set [3,_selected_soldier_courage_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; - -DUWS_operator_add_comms = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_comms = _selected_soldier select 4; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_comms >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_comms_new = _selected_soldier_comms + 0.01; // update the variable - _selected_soldier set [4,_selected_soldier_comms_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; - -DUWS_operator_add_reload = { - _selected_index = lbCurSel 1500; - _selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index - - _selected_soldier_reload = _selected_soldier select 5; - _selected_soldier_points = _selected_soldier select 13; - if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; - if (_selected_soldier_reload >= 1) exitWith {hint "This stat is already at the maximum"}; - - _selected_soldier_reload_new = _selected_soldier_reload + 0.01; // update the variable - _selected_soldier set [5,_selected_soldier_reload_new]; - - _selected_soldier_pts_new = _selected_soldier_points - 1; - _selected_soldier set [13,_selected_soldier_pts_new]; - [] execVM 'dialog\operative\LBselected.sqf'; - hint "New stats will be applied at the next deployment of this operative"; -}; \ No newline at end of file diff --git a/source/dialog/request_vehicle.sqf b/source/dialog/request_vehicle.sqf deleted file mode 100644 index a58b992..0000000 --- a/source/dialog/request_vehicle.sqf +++ /dev/null @@ -1,135 +0,0 @@ -diag_log "DUWS-R: dialog/request_vehicle.sqf running..."; - -_index = lbCurSel 2102; - -//findEmptyPosition example -_spawnPos = (getpos hq_blu1) findEmptyPosition [20, 70]; -_spawnPos = [(_spawnPos select 0)+30, _spawnPos select 1]; - -vehic = nil; - -switch (_index) do { - case 0: { // Small Truck 1 - [4, "I_G_Offroad_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 1: { // Small Truck 2 - [6, "I_G_Van_01_transport_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 2: { // Prowler Unarmed - [5, "B_T_LSV_01_unarmed_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 3: { // Prowler Armed - [13, "B_T_LSV_01_armed_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 4: { // Hunter Unarmed - [5, "B_MRAP_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 5: { // Hunter HMG - [18, "B_MRAP_01_hmg_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 6: { // Hunter GMG - [25, "B_MRAP_01_gmg_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 7: { // Marshall - [35, "B_APC_Wheeled_01_cannon_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 8: { //HEMETT Transport Covered - [8, "B_Truck_01_covered_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 9: { // Pawnee - [25, "B_Heli_Light_01_armed_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 10: { // Blackfoot - [45, "B_Heli_Attack_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 11: { // HummingBird - [15, "B_Heli_Light_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 12: { // M-900 Civ. - [12, "C_Heli_Light_01_civil_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 13: { // Taru Empty - [18, "O_Heli_Transport_04_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 14: { // GhostHawk - [22, "B_Heli_Transport_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 15: { // Huron - [26, "B_Heli_Transport_03_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 16: { // Panther IFV - [25, "B_APC_Tracked_01_rcws_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 17: { // ATV Quad - [1, "B_Quadbike_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 18: { // Cheetah AA - [30, "B_APC_Tracked_01_AA_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 19: { // Slammer - [40, "B_MBT_01_cannon_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 20: { // Bobcat - [28, "B_APC_Tracked_01_CRV_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 21: { // SF SUV - [2, "C_Offroad_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 22: { // MLRS Artillery - [75, "B_MBT_01_mlrs_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 23: { // Scorcher Artillery - [75, "B_MBT_01_arty_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 24: { // Fuel Truck (van) - [10, "B_G_Van_01_fuel_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 25: { // Wipeout CAS - [45, "B_Plane_CAS_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 26: { // Slammer Urban Purpose - [40, "B_MBT_01_TUSK_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 27: { // Stomper RCWS - [20, "B_UGV_01_rcws_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 28: { // Stomper Scout - [10, "B_UGV_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 29: { // Greyhawk ATG - [15, "B_UAV_02_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 30: { // Greyhawk CAS - [15, "B_UAV_02_CAS_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 31: { // MQ-12 Falcon - [60, "B_T_UAV_03_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 32: { // Darter UAV - [5, "B_UAV_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 33: { // Blackfish (Infantry) - [40, "B_T_VTOL_01_infantry_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 34: { // Blackfish (Vehicle) - [45, "B_T_VTOL_01_vehicle_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 35: { // Blackfish (Armed) - [60, "B_T_VTOL_01_armed_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 36: { //WASP - [50, "B_Plane_Fighter_01_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 37: { //WASP (Stealth) - [60, "B_Plane_Fighter_01_Stealth_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 38: { //Rhino (Stealth) - [38, "B_AFV_Wheeled_01_cannon_F"] execVM "dialog\spawnVehicle.sqf"; - }; - case 39: { //Rhino UP (Stealth) - [42, "B_AFV_Wheeled_01_up_cannon_F"] execVM "dialog\spawnVehicle.sqf"; - }; -}; -vehic = nil; -publicVariable "commandpointsblu1"; -//hint format["index: %1",_index]; diff --git a/source/dialog/squad/dialog_editor.TXT b/source/dialog/squad/dialog_editor.TXT deleted file mode 100644 index e4d220d..0000000 --- a/source/dialog/squad/dialog_editor.TXT +++ /dev/null @@ -1,13 +0,0 @@ -/* #Tunama -$[ - 1.062, - ["azeazeaze",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1800,"squadmng_mainframe",[2,"SQUAD MANAGER",["0.04 * GUI_GRID_W + GUI_GRID_X","8.02 * GUI_GRID_H + GUI_GRID_Y","40 * GUI_GRID_W","17 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1801,"dismiss_frame",[2,"Add squad members to High Command",["0.5 * GUI_GRID_W + GUI_GRID_X","9 * GUI_GRID_H + GUI_GRID_Y","39 * GUI_GRID_W","5.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1600,"dismissbutton",[2,"Add yellow team to High Command control",["8.5 * GUI_GRID_W + GUI_GRID_X","13 * GUI_GRID_H + GUI_GRID_Y","24.5 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Add the squad members under your control with High Command","-1"],[]], - [1000,"dismiss_txt_info",[2,"Dismiss the squad members under the yellow team of your squad and add them under you control with High Command",["1 * GUI_GRID_W + GUI_GRID_X","10 * GUI_GRID_H + GUI_GRID_Y","38 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1802,"HCdismiss_frame",[2,"Add High Command squad directly under your control",["0.5 * GUI_GRID_W + GUI_GRID_X","15 * GUI_GRID_H + GUI_GRID_Y","39 * GUI_GRID_W","5.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1001,"dismissHC_txt",[2,"Dismiss a squad from the High Command and add the units directly under your control. Once you have clicked the button, you'll have 10 seconds to select a squad. Then, this squad will be dismissed and all units added directly under your control.",["1 * GUI_GRID_W + GUI_GRID_X","16 * GUI_GRID_H + GUI_GRID_Y","38 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1601,"dismissHC_button",[2,"Put units of selected HC squad under your command",["8.5 * GUI_GRID_W + GUI_GRID_X","19 * GUI_GRID_H + GUI_GRID_Y","24.5 * GUI_GRID_W","1 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Dismiss a HC squad and add the units under your direct control","-1"],[]] -] -*/ diff --git a/source/dialog/squad/rename/rename_gui_editor.TXT b/source/dialog/squad/rename/rename_gui_editor.TXT deleted file mode 100644 index 4e3d582..0000000 --- a/source/dialog/squad/rename/rename_gui_editor.TXT +++ /dev/null @@ -1,9 +0,0 @@ -/* #Miwysa -$[ - 1.062, - ["rename",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1800,"renameHCmainframe",[2,"Enter new name",["5 * GUI_GRID_W + GUI_GRID_X","12 * GUI_GRID_H + GUI_GRID_Y","30 * GUI_GRID_W","5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Enter the new name of the selected HC squad","-1"],[]], - [1400,"editbox_rename",[2,"",["5.5 * GUI_GRID_W + GUI_GRID_X","13 * GUI_GRID_H + GUI_GRID_Y","29 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"Enter the new name of the selected HC squad","-1"],[]], - [1600,"confirm_button",[2,"Confirm",["10 * GUI_GRID_W + GUI_GRID_X","15 * GUI_GRID_H + GUI_GRID_Y","19 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]] -] -*/ diff --git a/source/dialog/startup/startup_closed.sqf b/source/dialog/startup/startup_closed.sqf deleted file mode 100644 index 17a60c8..0000000 --- a/source/dialog/startup/startup_closed.sqf +++ /dev/null @@ -1,2 +0,0 @@ -if (chosen_settings) exitWith {}; -_null = [] execVM "dialog\startup\startup.sqf"; \ No newline at end of file diff --git a/source/duws_revive/exitMenu.sqf b/source/duws_revive/exitMenu.sqf deleted file mode 100644 index aff1f55..0000000 --- a/source/duws_revive/exitMenu.sqf +++ /dev/null @@ -1 +0,0 @@ -if (DUWS_player_injured) then {_handle = createDialog "duws_revive_menu"}; \ No newline at end of file diff --git a/source/duws_revive/get_loadout.sqf b/source/duws_revive/get_loadout.sqf deleted file mode 100644 index 15166e9..0000000 --- a/source/duws_revive/get_loadout.sqf +++ /dev/null @@ -1,265 +0,0 @@ -/* - - AUTHOR: aeroson - NAME: get_loadout.sqf - VERSION: 3.3 - - DOWNLOAD & PARTICIPATE: - https://github.com/aeroson/a3-loadout - http://forums.bistudio.com/showthread.php?148577-GET-SET-Loadout-(saves-and-loads-pretty-much-everything) - - DESCRIPTION: - These scripts allows you set/get (load/save)all of the unit's gear, including: - uniform, vest, backpack, contents of it, all quiped items, all three weapons with their attachments, currently loaded magazines and number of ammo in magazines - Useful for saving/loading loadouts. - Ideal for revive scripts where you have to set exactly the same loadout to newly created unit. - Uses workaround with placeholders to add vest/backpack items, so items stay where you put them. - - PARAMETER(S): - 0 : target unit - 1 : (optional) array of options, default [] : ["ammo"] will save ammo count of partially emptied magazines - - RETURNS: - Array : array of strings/arrays containing target unit's loadout, to be used by fnc_set_loadout.sqf - - addAction support: - Saves player's loadout into global var loadout - -*/ - -private ["_target","_options","_saveMagsAmmo","_onFoot","_currentWeapon","_currentMode","_isFlashlightOn","_isIRLaserOn","_loadedMagazines","_saveWeapon","_getMagsAmmo","_magazinesName","_magazinesAmmo","_backPackItems","_assignedItems","_data"]; - -_options = []; - -// addAction support -if(count _this < 4) then { - #define PARAM_START private ["_PARAM_INDEX"]; _PARAM_INDEX=0; - #define PARAM_REQ(A) if (count _this <= _PARAM_INDEX) exitWith { systemChat format["required param '%1' not supplied in file:'%2' at line:%3", #A ,__FILE__,__LINE__]; }; A = _this select _PARAM_INDEX; _PARAM_INDEX=_PARAM_INDEX+1; - #define PARAM(A,B) A = B; if (count _this > _PARAM_INDEX) then { A = _this select _PARAM_INDEX; }; _PARAM_INDEX=_PARAM_INDEX+1; - PARAM_START - PARAM_REQ(_target) - PARAM(_options,[]) -} else { - _target = player; -}; - -_saveMagsAmmo = "ammo" in _options; -_onFoot = vehicle _target == _target; - -_currentWeapon = ""; -_currentMode = ""; -_isFlashlightOn = false; -_isIRLaserOn = false; - -// save weapon mode and muzzle -if(_onFoot) then { - _currentWeapon = currentMuzzle _target; - _currentMode = currentWeaponMode _target; - _isFlashlightOn = _target isFlashlightOn _currentWeapon; - _isIRLaserOn = _target isIRLaserOn _currentWeapon; -} else { - _currentWeapon = currentWeapon _target; -}; - -// save loaded magazines /+ loaded magazines ammo count -_loadedMagazines = []; - -// universal weapon saving -_saveWeapon = { - private ["_weapon","_magazines","_magazine","_muzzles"]; - _weapon = _this select 0; - _magazines = []; - if(_weapon != "") then { - _target selectWeapon _weapon; - _magazine = currentMagazine _target; - if(_saveMagsAmmo && _onFoot) then { - _magazine = [_magazine, _target ammo _weapon]; - }; - _magazines = [_magazine]; - _muzzles = configFile>>"CfgWeapons">>_weapon>>"muzzles"; - if(isArray(_muzzles)) then { - { // add one mag for each muzzle - if (_x != "this") then { - _target selectWeapon _x; - _magazine = currentMagazine _target; - if(_saveMagsAmmo) then { - _magazine = [_magazine, _target ammo _x]; - }; - _magazines set [count _magazines, _magazine]; - }; - } forEach getArray(_muzzles); - }; - }; - _loadedMagazines set [count _loadedMagazines, _magazines]; -}; - -[primaryWeapon _target] call _saveWeapon; -[handgunWeapon _target] call _saveWeapon; -[secondaryWeapon _target] call _saveWeapon; - -_getMagsAmmo = { // default function with _saveMagsAmmo == false - _this select 0; -}; - -if(_saveMagsAmmo) then { - // fill following 2 arrays with magazine name and current ammo in it - _magazinesName = []; - _magazinesAmmo = []; - { - private ["_name","_ammo","_ammoCountIndex","_ammoCurrent","_ammoFull","_readingAmmoFull"]; - scopeName "a"; - _name = []; - _ammoCurrent = []; - _ammoFull = []; - _readingAmmoFull = false; - _x = toArray _x; - _ammoCountIndex = count _x - 1; - while { _ammoCountIndex>0 && (_x select _ammoCountIndex)!=40 } do { - _ammoCountIndex = _ammoCountIndex - 1; - }; - { - if(_forEachIndex != _ammoCountIndex) then { - if(_forEachIndex < _ammoCountIndex) then { - _name set [count _name, _x]; - } else { - if(_x==47) then { - _readingAmmoFull = true; - } else { - if(!_readingAmmoFull) then { - _ammoCurrent set [count _ammoCurrent, _x]; - } else { - if(_x==41) then { - breakTo "a"; - } else { - _ammoFull set [count _ammoFull, _x]; - }; - }; - }; - }; - }; - } forEach _x; - if !([_ammoCurrent,_ammoFull] call BIS_fnc_areEqual) then { - _magazinesName set [count _magazinesName, toString(_name)]; - _magazinesAmmo set [count _magazinesAmmo, parseNumber(toString(_ammoCurrent))]; - }; - } forEach magazinesDetail player; - - // check if input array contains magazine, if it does, find it in magazinesDetail and change _x to [_x, ammo count] - _getMagsAmmo = { - private ["_items","_index"]; - _items = _this select 0; - { - _name = getText(configFile >> "cfgMagazines" >> _x >> "displayName"); - if(_name!="") then { - _index = _magazinesName find _name; - if(_index != -1) then { - _items set [_forEachIndex, [_x, _magazinesAmmo select _index]]; - _magazinesName set [_index, -1]; - _magazinesAmmo set [_index, -1]; - _magazinesName = _magazinesName - [-1]; - _magazinesAmmo = _magazinesAmmo - [-1]; - }; - } - } forEach _items; - _items; - }; - -}; - -// get backpack items -_cargo = getbackpackcargo (unitbackpack _target); -_backpacks = []; -{ - for "_i" from 1 to ((_cargo select 1) select _foreachindex) do { - _backpacks set [count _backpacks, _x]; - }; -} foreach (_cargo select 0); -_backPackItems = (backpackitems _target) + _backpacks; - -// get assigned items -_assignedItems = assignedItems _target; -_headgear = headgear _target; -_goggles = goggles _target; -if((_headgear != "") && !(_headgear in _assignedItems)) then { - _assignedItems set [count _assignedItems, _headgear]; -}; -if((_goggles != "") && !(_goggles in _assignedItems)) then { - _assignedItems set [count _assignedItems, _goggles]; -}; - -// get magazines of all assigned items -_magazines = []; -{ - _target selectWeapon _x; - if(currentWeapon _target==_x) then { - _magazine = currentMagazine _target; - if(_magazine != "") then { - _magazines set[count _magazines, _magazine]; - }; - }; -} forEach _assignedItems; -_loadedMagazines set [3, _magazines]; - -// select back originaly selected weapon and mode -if(vehicle _target == _target) then { - if(_currentWeapon != "" && _currentMode != "") then { - _muzzles = 0; - while{ (_currentWeapon != currentMuzzle _target || _currentMode != currentWeaponMode _target ) && _muzzles < 200 } do { - _target action ["SWITCHWEAPON", _target, _target, _muzzles]; - _muzzles = _muzzles + 1; - }; - if(_isFlashlightOn) then { - _target action ["GunLightOn"]; - } else { - _target action ["GunLightOff"]; - }; - if(_isIRLaserOn) then { - _target action ["IRLaserOn"]; - } else { - _target action ["IRLaserOff"]; - }; - }; -} else { - _currentMode = ""; -}; -if(_currentMode == "") then { - if(_currentWeapon=="") then { - _target action ["SWITCHWEAPON", _target, _target, 0]; - } else { - _target selectWeapon _currentWeapon; - }; -}; - -_data = [ - _assignedItems, //0 - - primaryWeapon _target, //1 - primaryWeaponItems _target, //2 - - handgunWeapon _target, //3 - handgunItems _target, //4 - - secondaryWeapon _target, //5 - secondaryWeaponItems _target, //6 - - uniform _target, //7 - [uniformItems _target] call _getMagsAmmo, //8 - - vest _target, //9 - [vestItems _target] call _getMagsAmmo, //10 - - backpack _target, //11 - [_backPackItems] call _getMagsAmmo, //12 - - _loadedMagazines, //13 (optional) - _currentWeapon, //14 (optional) - _currentMode //15 (optional) -]; - -// addAction support -if(count _this < 4) then { - _data; -} else { - loadout = _data; - //playSound3D ["A3\Sounds_F\sfx\ZoomOut.wav", _target]; -}; diff --git a/source/duws_revive/gui/duws_revive.hpp b/source/duws_revive/gui/duws_revive.hpp deleted file mode 100644 index b8f4182..0000000 --- a/source/duws_revive/gui/duws_revive.hpp +++ /dev/null @@ -1,37 +0,0 @@ -class duws_revive_menu -{ - idd = -1; - movingenable = false; - onUnload = "_nul = execVM ""duws_revive\exitMenu.sqf"""; //UI event handler -// onLoad = "_this call FRAME_01_Load"; - -class controls -{ -//////////////////////////////////////////////////////// -// GUI EDITOR OUTPUT START -//////////////////////////////////////////////////////// - -class duws_death_waiting_txt: RscText -{ - idc = 1000; - text = "You are waiting to be revived..."; //--- ToDo: Localize; - x = 13 * GUI_GRID_W + GUI_GRID_X; - y = 2 * GUI_GRID_H + GUI_GRID_Y; - w = 15 * GUI_GRID_W; - h = 2.5 * GUI_GRID_H; -}; -class duws_death_respawn: RscButton -{ - idc = 1600; - text = "Respawn"; //--- ToDo: Localize; - x = 14.5 * GUI_GRID_W + GUI_GRID_X; - y = 5.5 * GUI_GRID_H + GUI_GRID_Y; - w = 11 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; - action = "_derp = [] execVM 'duws_revive\respawnClicked.sqf'"; -}; -//////////////////////////////////////////////////////// -// GUI EDITOR OUTPUT END -//////////////////////////////////////////////////////// -}; -}; \ No newline at end of file diff --git a/source/duws_revive/gui/guieditorformat.TXT b/source/duws_revive/gui/guieditorformat.TXT deleted file mode 100644 index 732d4c7..0000000 --- a/source/duws_revive/gui/guieditorformat.TXT +++ /dev/null @@ -1,8 +0,0 @@ -/* #Zoxome -$[ - 1.063, - ["respawn",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0], - [1000,"duws_death_waiting_txt",[2,"You are waiting to be revived...",["13 * GUI_GRID_W + GUI_GRID_X","2 * GUI_GRID_H + GUI_GRID_Y","15 * GUI_GRID_W","2.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]], - [1600,"duws_death_respawn",[2,"Respawn",["14.5 * GUI_GRID_W + GUI_GRID_X","5.5 * GUI_GRID_H + GUI_GRID_Y","11 * GUI_GRID_W","1.5 * GUI_GRID_H"],[-1,-1,-1,-1],[-1,-1,-1,-1],[-1,-1,-1,-1],"","-1"],[]] -] -*/ diff --git a/source/duws_revive/onKilled.sqf b/source/duws_revive/onKilled.sqf deleted file mode 100644 index 45aa33f..0000000 --- a/source/duws_revive/onKilled.sqf +++ /dev/null @@ -1,16 +0,0 @@ -_killedPlayer = _this select 0; -_corpse = _this select 1; - -_deathPos = getpos _corpse; -deletevehicle _corpse; -player allowdamage false; -player setpos _deathPos; -[player,"DUWS_sync_animinjured"] spawn BIS_fnc_mp; -[player,saved_loadout] spawn setLoadout; - -DUWS_player_injured = true; - - _handle = createDialog "duws_revive_menu"; - waitUntil {dialog}; - - [player,"DUWS_revive_addaction"] spawn BIS_fnc_MP; \ No newline at end of file diff --git a/source/duws_revive/playerRevived.sqf b/source/duws_revive/playerRevived.sqf deleted file mode 100644 index 6f02bc7..0000000 --- a/source/duws_revive/playerRevived.sqf +++ /dev/null @@ -1,6 +0,0 @@ -_injured_player = _this select 0; - - -[player,"DUWS_sync_animhealing"] spawn BIS_fnc_MP; -sleep 5; -[_injured_player,"DUWS_revive_revived"] spawn BIS_fnc_MP; diff --git a/source/duws_revive/respawnClicked.sqf b/source/duws_revive/respawnClicked.sqf deleted file mode 100644 index c640c58..0000000 --- a/source/duws_revive/respawnClicked.sqf +++ /dev/null @@ -1,15 +0,0 @@ -_handle = [player,"DUWS_revive_respawned"] spawn BIS_fnc_MP; -waituntil {scriptdone _handle}; - -DUWS_player_injured = false; -[player,"DUWS_sync_animgood"] spawn BIS_fnc_mp; -player setpos [getpos hq_blu1 select 0, (getpos hq_blu1 select 1)+10]; -player allowdamage true; - -if(!staminaEnabled) then { - player enableStamina false; -}; - -_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem; - -closedialog 0; diff --git a/source/duws_revive/reviveInit.sqf b/source/duws_revive/reviveInit.sqf deleted file mode 100644 index 6ccc568..0000000 --- a/source/duws_revive/reviveInit.sqf +++ /dev/null @@ -1,54 +0,0 @@ -DUWS_PlayerRespawnReviveEH = player addEventHandler ["respawn", {_this execVM "duws_revive\onKilled.sqf"}]; -DUWS_player_injured = false; - -DUWS_revive_addaction = { - if (!DUWS_player_injured) then { - _this addaction ["Revive","duws_revive\playerRevived.sqf", "", 0, true, true, "", "((_target distance _this) < 3"]; - }; -}; - -DUWS_revive_respawned = { - if (!DUWS_player_injured) then { - //removeAllActions _this; - }; -}; - -DUWS_revive_revived = { - if (_this == player) then { - DUWS_player_injured = false; - [player,"DUWS_sync_animgood"] spawn BIS_fnc_mp; - player allowdamage true; - commandpointsblu1 = commandpointsblu1 + DUWSMP_CP_death_cost; - publicvariable "commandpointsblu1"; - closedialog 0; - _handle = [player,"DUWS_revive_respawned"] spawn BIS_fnc_MP; - }; -}; - -DUWS_sync_animinjured = { - _this switchmove "acts_InjuredLookingRifle02"; - }; - - -DUWS_sync_animgood = { - _this switchmove "AmovPpneMstpSnonWnonDnon"; - }; - -DUWS_sync_animhealing = { - _this switchmove "AinvPknlMstpSlayWpstDnon_medic"; - }; - - -// Compile scripts -getLoadout = compile preprocessFileLineNumbers 'duws_revive\get_loadout.sqf'; -setLoadout = compile preprocessFileLineNumbers 'duws_revive\set_loadout.sqf'; - -// Save loadout every 5 seconds -[] spawn { - while{true} do { - if(alive player) then { - saved_loadout = [player] call getLoadout; - }; - sleep 5; - }; -}; diff --git a/source/duws_revive/set_loadout.sqf b/source/duws_revive/set_loadout.sqf deleted file mode 100644 index e09ba83..0000000 --- a/source/duws_revive/set_loadout.sqf +++ /dev/null @@ -1,359 +0,0 @@ -/* - - AUTHOR: aeroson - NAME: set_loadout.sqf - VERSION: 4.1 - - DOWNLOAD & PARTICIPATE: - https://github.com/aeroson/a3-loadout - http://forums.bistudio.com/showthread.php?148577-GET-SET-Loadout-(saves-and-loads-pretty-much-everything) - - DESCRIPTION: - These scripts allows you set/get (load/save)all of the unit's gear, including: - uniform, vest, backpack, contents of it, all quiped items, all three weapons with their attachments, currently loaded magazines and number of ammo in magazines - Useful for saving/loading loadouts. - Ideal for revive scripts where you have to set exactly the same loadout to newly created unit. - Uses workaround with placeholders to add vest/backpack items, so items stay where you put them. - - PARAMETER(S): - 0 : target unit - 1 : array of strings/arrays containing desired target unit's loadout, obtained from fnc_get_loadout.sqf - 2 : (optional) array of options, default [] : ["ammo"] will allow loading of partially emptied magazines, otherwise magazines will be full - - addAction support: - Sets player's loadout from global var loadout - -*/ - -private ["_target","_options","_loadMagsAmmo","_data","_loadedMagazines","_placeholderCount","_add","_outfit","_addWeapon","_addPrimary","_addHandgun","_addSecondary","_addOrder","_currentWeapon","_currentMode"]; - -_options = []; - -// addAction support -if(count _this < 4) then { - #define PARAM_START private ["_PARAM_INDEX"]; _PARAM_INDEX=0; - #define PARAM_REQ(A) if (count _this <= _PARAM_INDEX) exitWith { systemChat format["required param '%1' not supplied in file:'%2' at line:%3", #A ,__FILE__,__LINE__]; }; A = _this select _PARAM_INDEX; _PARAM_INDEX=_PARAM_INDEX+1; - #define PARAM(A,B) A = B; if (count _this > _PARAM_INDEX) then { A = _this select _PARAM_INDEX; }; _PARAM_INDEX=_PARAM_INDEX+1; - PARAM_START - PARAM_REQ(_target) - PARAM_REQ(_data) - PARAM(_options,[]) -} else { - _target = player; - _data = loadout; - //playSound3D ["A3\Sounds_F\sfx\ZoomIn.wav", _target]; -}; - -if(isNil{_data}) exitWith { - systemChat "you are trying to set/load empty loadout"; -}; -if(count _data < 13) exitWith { - systemChat "you are trying to set/load corrupted loadout"; -}; - -#define QUOTE(A) #A -#define EL(A,B) ((A) select (B)) -#define _THIS(A) EL(_this,A) - -// placeholders -#define PLACEHOLDER_BACKPACK QUOTE(B_Kitbag_mcamo) // any backpack with capacity>0 -#define PLACEHOLDER_ITEM QUOTE(ItemWatch) // item placeholder should be smallest item possible - -_loadMagsAmmo = "ammo" in _options; -_loadedMagazines = []; -if(count _data > 13) then { - if(typeName(_data select 13)=="ARRAY") then { - _loadedMagazines = _data select 13; - }; -}; - -_currentWeapon = ""; -if(count _data > 14) then { - _currentWeapon = _data select 14; -}; -_currentMode = ""; -if(count _data > 15) then { - _currentMode = _data select 15; -}; - -_placeholderCount = 0; - -// basic add function intended for use with uniform and vest -_add = { - private ["_target","_item"]; - _target = _this select 0; - _item = _this select 1; - if(typename _item == "ARRAY") then { - if(_item select 0 != "") then { - if(_loadMagsAmmo) then { - _target addMagazine _item; - } else { - _target addMagazine (_item select 0); - }; - }; - } else { - if(_item != "") then { - if(isClass(configFile>>"CfgMagazines">>_item)) then { - _target addMagazine _item; - } else { - if(isClass(configFile>>"CfgWeapons">>_item>>"WeaponSlotsInfo") && getNumber(configFile>>"CfgWeapons">>_item>>"showempty")==1) then { - _target addWeapon _item; - } else { - _target addItem _item; - }; - }; - }; - }; -}; - -// remove clothes to prevent incorrect mag loading -removeUniform _target; -removeVest _target; -removeBackpack _target; - -_outfit = PLACEHOLDER_BACKPACK; // we need to add items somewhere before we can assign them -_target addBackpack _outfit; -clearAllItemsFromBackpack _target; -removeAllAssignedItems _target; - -// add loaded magazines of assigned items -if(count _loadedMagazines>=3) then { - { - [_target,_x] call _add; - } forEach (_loadedMagazines select 3); -}; - -// add assigned items -{ - [_target,_x] call _add; - _target assignItem _x; -} forEach (_data select 0); - -// universal add weapon to hands -_addWeapon = { - private ["_weapon","_magazines","_muzzles"]; - clearAllItemsFromBackpack _target; - _target removeWeapon ([] call _THIS(0)); - _weapon = _data select _THIS(1); - if(_weapon != "") then { - if(isClass(configFile>>"CfgWeapons">>_weapon)) then { - if (_currentWeapon == "") then { - _currentWeapon = _weapon; - }; - if(count _loadedMagazines > 0) then { - _magazines = _loadedMagazines select _THIS(5); // get loaded magazines from saved loadout - if(typename _magazines != "ARRAY") then { // backwards compatibility, make sure _magazines is array - if(_magazines=="") then { - _magazines = []; - } else { - _magazines = [_magazines]; - }; - }; - } else { - _magazines = [getArray(configFile>>"CfgWeapons">>_weapon>>"magazines") select 0]; // generate weapon magazine - _muzzles = configFile>>"CfgWeapons">>_weapon>>"muzzles"; - if(isArray(_muzzles)) then { // generate magazine for each muzzle - { - if (_x != "this") then { - _magazines set [count _magazines, toLower(getArray(configFile>>"CfgWeapons">>_weapon>>_x>>"magazines") select 0)]; - }; - } forEach getArray(_muzzles); - }; - }; - { - [_target, _x] call _add; - } forEach _magazines; // add magazines - _target addWeapon _weapon; - { - if(_x!="" && !(_x in ([] call _THIS(3)))) then { - _x call _THIS(4); - }; - } forEach (_data select (1+_THIS(1))); // add weapon items - } else { - systemchat format["%1 %2 doesn't exist",_THIS(2),_weapon]; - if (_currentWeapon == _weapon) then { - _currentWeapon = ""; - _currentMode = ""; - }; - }; - }; -}; - -// add primary weapon, add primary weapon loaded magazine, add primary weapon items -_addPrimary = { - [ - { primaryWeapon _target }, // 0 // get current weapon - 1, // 1 //weapon classname index in _data - "primary", // 2 // weapon debug type - { primaryWeaponItems _target }, // 3 // weapon items - { _target addPrimaryWeaponItem _this }, // 4 // add weapon item - 0 // 5 // index in _loadedMagazines - ] call _addWeapon; -}; - -// add handgun weapon, add handgun weapon loaded magazine, add handgun weapon items -_addHandgun = { - [ - { handgunWeapon _target }, // 0 // get current weapon - 3, // 1 //weapon classname index in _data - "handgun", // 2 // weapon debug type - { handgunItems _target }, // 3 // weapon items - { _target addHandgunItem _this }, // 4 // add weapon item - 1 // 5 // index in _loadedMagazines - ] call _addWeapon; -}; - -// add secondary weapon, add secondary weapon loaded magazine, add secondary weapon items -_addSecondary = { - [ - { secondaryWeapon _target }, // 0 // get current weapon - 5, // 1 //weapon classname index in _data in _data - "secondary", // 2 // weapon debug type - { secondaryWeaponItems _target }, // 3 // weapon items - { _target addSecondaryWeaponItem _this }, // 4 // add weapon item - 2 // 5 // index in _loadedMagazines - ] call _addWeapon; -}; - - -// first added weapon is selected, order add functions to firstly add currently selected weapon -_addOrder=[_addPrimary,_addHandgun,_addSecondary]; -if(_currentWeapon!="") then { - _addOrder = switch _currentWeapon do { - case (_data select 3): {[_addHandgun,_addPrimary,_addSecondary]}; - case (_data select 5): {[_addSecondary,_addPrimary,_addHandgun]}; - default {_addOrder}; - }; -}; -{ - [] call _x; -} forEach _addOrder; - -// select weapon and firing mode -if(vehicle _target == _target && _currentWeapon != "" && _currentMode != "") then { - _muzzles = 0; - while { (_currentWeapon != currentMuzzle _target || _currentMode != currentWeaponMode _target ) && _muzzles < 100 } do { - _target action ["SWITCHWEAPON", _target, _target, _muzzles]; - _muzzles = _muzzles + 1; - }; - if(_muzzles >= 100) then { - systemchat format["mode %1 for %2 doesn't exist", _currentMode, _currentWeapon]; - _currentMode = ""; - }; -} else { - _currentMode = ""; -}; -if(_currentMode == "" && _currentWeapon != "") then { - _target selectWeapon _currentWeapon; -}; - -clearAllItemsFromBackpack _target; - -// add uniform, add uniform items and fill uniform with item placeholders -_outfit = _data select 7; -if(_outfit != "") then { - if(isClass(configFile>>"CfgWeapons">>_outfit)) then { - _target addUniform _outfit; - _target addItem PLACEHOLDER_ITEM; - if(loadUniform _target > 0) then { - _placeholderCount = _placeholderCount + 1; - { - [_target,_x] call _add; - } forEach (_data select 8); - while{true} do { - _loadBeforeAdd = loadUniform _target; - _target addItem PLACEHOLDER_ITEM; - if(loadUniform _target == _loadBeforeAdd) exitWith {}; - _placeholderCount = _placeholderCount + 1; - }; - }; - } else { - systemchat format["uniform %1 doesn't exist",_outfit]; - }; -}; - -// add vest, add vest items and fill vest with item placeholders -_outfit = _data select 9; -if(_outfit != "") then { - if(isClass(configFile>>"CfgWeapons">>_outfit)) then { - _target addVest _outfit; - _target addItem PLACEHOLDER_ITEM; - if(loadVest _target > 0) then { - _placeholderCount = _placeholderCount + 1; - { - [_target,_x] call _add; - } forEach (_data select 10); - while{true} do { - _loadBeforeAdd = loadVest _target; - _target addItem PLACEHOLDER_ITEM; - if(loadVest _target == _loadBeforeAdd) exitWith {}; - _placeholderCount = _placeholderCount + 1; - }; - }; - } else { - systemchat format["vest %1 doesn't exist",_outfit]; - }; -}; - -// more complex add function intended for use with backpack -_add = { - private ["_target","_item"]; - _target = _this select 0; - _item = _this select 1; - if(typename _item == "ARRAY") then { - if(_item select 0 != "") then { - if(_loadMagsAmmo) then { - _target addMagazine _item; - } else { - _target addMagazine (_item select 0); - }; - }; - } else { - if(isClass(configFile>>"CfgMagazines">>_item)) then { - (unitBackpack _target) addMagazineCargo [_item,1]; - } else { - if(_item != "") then { - if(getNumber(configFile>>"CfgVehicles">>_item>>"isbackpack")==1) then { - (unitBackpack _target) addBackpackCargo [_item,1]; - } else { - if(isClass(configFile>>"CfgWeapons">>_item>>"WeaponSlotsInfo") && getNumber(configFile>>"CfgWeapons">>_item>>"showempty")==1) then { - (unitBackpack _target) addWeaponCargo [_item,1]; - } else { - _target addItem _item; - }; - }; - }; - }; - }; -}; - -// add backpack and add backpack items -removeBackpack _target; -_outfit = _data select 11; -if(_outfit != "") then { - if(getNumber(configFile>>"CfgVehicles">>_outfit>>"isbackpack")==1) then { - _target addBackpack _outfit; - clearAllItemsFromBackpack _target; - _target addItem PLACEHOLDER_ITEM; - _placeholderCount = _placeholderCount + 1; - if(loadBackpack _target > 0) then { - { - [_target, _x] call _add; - } forEach (_data select 12); - }; - } else { - systemchat format["backpack %1 doesn't exist",_outfit]; - }; -}; - -// remove item placeholders -for "_i" from 1 to _placeholderCount do { - _target removeItem PLACEHOLDER_ITEM; -}; - - -// make loadout visible fix? -if(vehicle _target == _target) then { - //_target switchMove (getArray(configFile>>"CfgMovesMaleSdr">>"States">>animationState player>>"ConnectTo") select 0); - _target setPosATL (getPosATL _target); -}; diff --git a/source/fnc_test.Sqf b/source/fnc_test.Sqf deleted file mode 100644 index d919f6e..0000000 --- a/source/fnc_test.Sqf +++ /dev/null @@ -1,39 +0,0 @@ -//// --------------- taken from locatorflat QUI MARCHE --- FUNCTION -_foundSafePos = _this select 0; -_radius = _this select 1; -_varname = _this select 2; -_array_exist = true; -_found_dist_away = true; - - -if (isnil (format["%1",_varname])) then call compile format["%1" = [[-99999,-99999,-99999]; _array_exist = true;],_varname]; - - // check if the array of zones already exist. If not, give him at least 1 location with impossible value and tell that the array was NOT existing - -_kibot_distances_array = []; - - for [{_t=1}, {_t<=count _varname}, {_t=_t+1}] do // for each element of the array of positions - { - _kibot_pos_array_missionPos_index = _t-1; // get the index of the element - _kibot_distances_array = _kibot_distances_array +[(_varname select _kibot_pos_array_missionPos_index) distance (_foundSafePos)]; //compare the distance of the given pos with other pos in pos array and add it into an array of all the compared distance --> an array of distances is obtained - }; - - for [{_t=1}, {_t<=count _kibot_distances_array}, {_t=_t+1}] do // for each element of the array of distances we just generated... - { - _kibot_distances_array_index = _t-1; // get the index of the tested element - _check = (_kibot_distances_array select _kibot_distances_array_index); // select the element we just took the index so we can check them - hint format["%1",_kibot_distances_array]; - if (_check < _radius) then { // check the distances contained the distances array 1 by 1. If a distance is inferior to defined value, this is a no go. - _found_dist_away = false; // If no zone is under 1500 meters, tell it to this variable - }; - }; - -// if a distance has been found, add the position to the array of pos, because it's a valid pos. -if (_found_dist_away) then { -call compile format["%1 = %1 + [%2],_varname,_foundsafepos]; -true -} -else -{ -false -} \ No newline at end of file diff --git a/source/WARCOM/WARCOM_blu_assault.sqf b/source/functions/WARCOM/fn_WARCOM_blu_assault.sqf similarity index 83% rename from source/WARCOM/WARCOM_blu_assault.sqf rename to source/functions/WARCOM/fn_WARCOM_blu_assault.sqf index d651ac8..9bc9b98 100644 --- a/source/WARCOM/WARCOM_blu_assault.sqf +++ b/source/functions/WARCOM/fn_WARCOM_blu_assault.sqf @@ -5,8 +5,8 @@ WARCOM_blu_attack_wave_avalaible = false; // Type of attack wave [] spawn { - //WARCOM_blu_attack_wave_type = ["B_Soldier_TL_F","B_Soldier_F"]; - diag_log format ["WARCOM_blufor_ap_assault: %1", WARCOM_blufor_ap]; + //WARCOM_blu_attack_wave_type = [Blufor_Teamleader,Blufor_Rifleman]; + diag_log format ["WARCOM_blufor_ap_assault: %1", WARCOM_blufor_ap]; waitUntil {sleep 1; WARCOM_blufor_ap>=10}; [West,"HQ"] sidechat "This is HQ, BLUFOR troops just arrived on the island, we'll soon be able to push through the enemy lines"; WARCOM_blu_attack_wave_avalaible = true; @@ -44,11 +44,11 @@ WARCOM_blu_attack_wave_avalaible = false; while {true} do { sleep 30; _group = [WARCOM_blu_hq_pos, WEST, WARCOM_blu_attack_wave_type,[],[],blufor_ai_skill] call BIS_fnc_spawnGroup; - _TFname = [1] call compile preprocessFile "random_name.sqf"; + _TFname = [1] call duws_fnc_random_name; [West,"HQ"] sidechat format["This is HQ, We are sending Task Force %1, we will try to push as far as possible in enemy territory",_TFname]; - _blu_assault = [_group] execVM "WARCOM\WARCOM_wp.sqf"; - _blu_assault = [_group,_TFname] execVM "WARCOM\WARCOM_gps_marker.sqf"; + _blu_assault = [_group] call duws_fnc_WARCOM_wp; + _blu_assault = [_group,_TFname] spawn duws_fnc_WARCOM_gps_marker; sleep (WARCOM_blu_attack_delay + random 1200); diff --git a/source/functions/WARCOM/fn_WARCOM_blu_patrol.sqf b/source/functions/WARCOM/fn_WARCOM_blu_patrol.sqf new file mode 100644 index 0000000..2123da1 --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_blu_patrol.sqf @@ -0,0 +1,74 @@ +_loop = true; + +WARCOM_blu_patrol_type = ""; +diag_log format ["WARCOM_blufor_ap_patrol: %1", WARCOM_blufor_ap]; + +// Type of attack wave +[] spawn { + diag_log "spawn1"; + WARCOM_blu_patrol_type = (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam"); + + waitUntil {sleep 1; WARCOM_blufor_ap>40}; + WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad"); + + waitUntil {sleep 1; WARCOM_blufor_ap>65}; + WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad_Weapons"); + + waitUntil {sleep 1; WARCOM_blufor_ap>100}; + WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Mechanized" >> "BUS_MechInfSquad"); + + waitUntil {sleep 1; WARCOM_blufor_ap>135}; + WARCOM_blu_patrol_type = (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Mechanized" >> "BUS_MechInf_AT"); + + +}; + + + + + + + + + + + +// Attack waves main +[] spawn { + + while {true} do { + if (count WARCOM_zones_controled_by_BLUFOR > 1) then { // make sure blufor is controlling at least 2 zones + sleep 2; + + // find a zone where to spawn OPF wave *** BEGIN + _found = false; + _randomZone = []; + _failSafe = 0; + while {!_found} do { + _randomZone = WARCOM_zones_controled_by_BLUFOR call BIS_fnc_selectRandom; + if (_randomZone distance player > 2000) then {_found=true;}; + sleep 0.2; + // player sidechat format["Failsafe: %1",_failsafe]; + _failSafe = _failSafe + 1; + if (_failsafe > 10) then {sleep 300; _failsafe = 0;} + }; + // find a zone *** end + _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; + _group = [_randomZone, WEST, WARCOM_blu_patrol_type,[],[],WARCOM_blu_ai_skill_range] call BIS_fnc_spawnGroup; + [_group] call duws_fnc_WARCOM_wp_blu_patrol; +// [_group,"derp"] spawn duws_fnc_WARCOM_gps_marker; + + // spawn armored + if (WARCOM_blufor_ap>50) then { + ["BLU_F","armored",_randomZone] spawn duws_fnc_random_veh_blu_patrol ; + }; + + if (WARCOM_blufor_ap>200) then { + ["BLU_F","air",_randomZone] spawn duws_fnc_random_veh_blu_patrol ; + }; + + }; + sleep (random 1200); // patrol delay + }; +}; + diff --git a/source/WARCOM/WARCOM_gps_marker.sqf b/source/functions/WARCOM/fn_WARCOM_gps_marker.sqf similarity index 85% rename from source/WARCOM/WARCOM_gps_marker.sqf rename to source/functions/WARCOM/fn_WARCOM_gps_marker.sqf index f63865c..0351c51 100644 --- a/source/WARCOM/WARCOM_gps_marker.sqf +++ b/source/functions/WARCOM/fn_WARCOM_gps_marker.sqf @@ -1,9 +1,5 @@ -_group = _this select 0; -_TFname = _this select 1; +params ["_group","_TFname"]; -[_group,_TFname] spawn { -_group = _this select 0; -_TFname = _this select 1; _loop = true; @@ -17,7 +13,7 @@ str(_markername) setMarkerColor "ColorBlue"; str(_markername) setMarkerText format["TF %1",_TFname]; WARCOM_marker_num = WARCOM_marker_num + 1; - while {_loop} do { +while {_loop} do { _units_alive = {alive _x }count units _group; if (_units_alive<=0) exitWith { // IF ALL DEAD, EXIT. str(_markername) setMarkerColor "ColorRed"; @@ -29,10 +25,8 @@ WARCOM_marker_num = WARCOM_marker_num + 1; _leader = leader _group; str(_markername) setMarkerPos getpos _leader; sleep 4; - }; - - }; + // fin du script \ No newline at end of file diff --git a/source/WARCOM/WARCOM_init.sqf b/source/functions/WARCOM/fn_WARCOM_init.sqf similarity index 70% rename from source/WARCOM/WARCOM_init.sqf rename to source/functions/WARCOM/fn_WARCOM_init.sqf index 073e179..fde2eca 100644 --- a/source/WARCOM/WARCOM_init.sqf +++ b/source/functions/WARCOM/fn_WARCOM_init.sqf @@ -1,4 +1,4 @@ -// _handle = [[zones],posHQblu,posHQop,blufor AP,opfor AP, blu attack delay, blu skill range, opfor skill range, opf attack delay] execVM "WARCOM\WARCOM_init.sqf" +// _handle = [[zones],posHQblu,posHQop,blufor AP,opfor AP, blu attack delay, blu skill range, opfor skill range, opf attack delay] call duws_fnc_WARCOM_init // | | | | | | // array of arrays | array | number | // array number number @@ -6,15 +6,18 @@ player globalchat "Initializing WARCOM..."; WARCOM_init_done = false; -_array_of_zones_total =_this select 0; -_blu_hq_pos =_this select 1; -_op_hq_pos =_this select 2; -_blufor_ap =_this select 3; -_opfor_ap =_this select 4; -_blu_attack_delay =_this select 5; -_blu_ai_skill_range =_this select 6; -_opfor_ai_skill = _this select 7; -_opfor_assault_delay = _this select 8; +params +[ +"_array_of_zones_total", +"_blu_hq_pos", +"_op_hq_pos", +"_blufor_ap", +"_opfor_ap", +"_blu_attack_delay", +"_blu_ai_skill_range", +"_opfor_ai_skill", +"_opfor_assault_delay" +]; // INIT VARIABLES WARCOM_blu_hq_pos = [_blu_hq_pos select 0, (_blu_hq_pos select 1) + 16]; @@ -45,24 +48,20 @@ WARCOM_zones_controled_by_OPFOR = [] + _WARCOM_zones_controled_by_OPFOR; // Init BLU patrols diag_log "Init BLU patrols"; -_blu_patrol = [] execVM "WARCOM\WARCOM_blu_patrol.sqf"; -//waitUntil {scriptDone _blu_patrol}; +[] call duws_fnc_WARCOM_blu_patrol; // Init OPF patrols diag_log "Init OPF patrols"; -_opf_patrol = [] execVM "WARCOM\WARCOM_opf_patrol.sqf"; -//waitUntil {scriptDone _opf_patrol}; +[] call duws_fnc_WARCOM_opf_patrol; // Initialize the BLU attack waves diag_log "Initialize the BLU attack waves"; -_blu_assault = [] execVM "WARCOM\WARCOM_blu_assault.sqf"; -//waitUntil {scriptDone _blu_assault}; +[] call duws_fnc_WARCOM_blu_assault; // Init the OPF attack waves diag_log "Init the OPF attack waves"; -_opf_assault = [] execVM "WARCOM\WARCOM_opf_assault.sqf"; -//waitUntil {scriptDone _opf_assault}; +[] call duws_fnc_WARCOM_opf_assault; diff --git a/source/WARCOM/WARCOM_opf_assault.sqf b/source/functions/WARCOM/fn_WARCOM_opf_assault.sqf similarity index 65% rename from source/WARCOM/WARCOM_opf_assault.sqf rename to source/functions/WARCOM/fn_WARCOM_opf_assault.sqf index 6b122c9..f7ae630 100644 --- a/source/WARCOM/WARCOM_opf_assault.sqf +++ b/source/functions/WARCOM/fn_WARCOM_opf_assault.sqf @@ -8,19 +8,19 @@ WARCOM_opf_attack_wave_avalaible = false; waitUntil {sleep 1; WARCOM_opfor_ap>=10}; WARCOM_opf_attack_wave_avalaible = true; - WARCOM_opf_attack_wave_type = (configFile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam"); + WARCOM_opf_attack_wave_type = Opfor_WARCOM_Fireteam; waitUntil {sleep 1; WARCOM_opfor_ap>40}; - WARCOM_opf_attack_wave_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad"); + WARCOM_opf_attack_wave_type = Opfor_WARCOM_Infantry_Squad; waitUntil {sleep 1; WARCOM_opfor_ap>65}; - WARCOM_opf_attack_wave_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad_Weapons"); + WARCOM_opf_attack_wave_type = Opfor_WARCOM_Weapons_Squad; waitUntil {sleep 1; WARCOM_opfor_ap>100}; - WARCOM_opf_attack_wave_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInfSquad"); + WARCOM_opf_attack_wave_type = Opfor_WARCOM_Mech_Inf_Squad; waitUntil {sleep 1; WARCOM_opfor_ap>135}; - WARCOM_opf_attack_wave_type = (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Mechanized" >> "OIA_MechInf_AT"); + WARCOM_opf_attack_wave_type = Opfor_WARCOM_Mech_Wpn_Squad; }; @@ -58,8 +58,8 @@ WARCOM_opf_attack_wave_avalaible = false; _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; _group = [_randomZone, EAST, WARCOM_opf_attack_wave_type,[],[],WARCOM_opf_ai_skill_range] call BIS_fnc_spawnGroup; - _opf_assault = [_group,_randomZone] execVM "WARCOM\WARCOM_wp_opf.sqf"; -// _blu_assault = [_group,"derp"] execVM "WARCOM\WARCOM_gps_marker.sqf"; + [_group,_randomZone] call duws_fnc_WARCOM_wp_opf; +// [_group,"derp"] spawn duws_fnc_WARCOM_gps_marker; sleep (WARCOM_opf_attack_delay + random 1200); diff --git a/source/functions/WARCOM/fn_WARCOM_opf_patrol.sqf b/source/functions/WARCOM/fn_WARCOM_opf_patrol.sqf new file mode 100644 index 0000000..1c6d92d --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_opf_patrol.sqf @@ -0,0 +1,71 @@ +_loop = true; + +WARCOM_opf_patrol_type = ""; + +// Type of attack wave +[] spawn { + WARCOM_opf_patrol_type = Opfor_WARCOM_Fireteam; + + waitUntil {sleep 1; WARCOM_opfor_ap>40}; + WARCOM_opf_patrol_type = Opfor_WARCOM_Infantry_Squad; + + waitUntil {sleep 1; WARCOM_opfor_ap>65}; + WARCOM_opf_patrol_type = Opfor_WARCOM_Weapons_Squad; + + waitUntil {sleep 1; WARCOM_opfor_ap>100}; + WARCOM_opf_patrol_type = Opfor_WARCOM_Mech_Inf_Squad; + + waitUntil {sleep 1; WARCOM_opfor_ap>135}; + WARCOM_opf_patrol_type = Opfor_WARCOM_Mech_Wpn_Squad; + + +}; + + + + + + + + + + + +// Attack waves main +[] spawn { + + while {true} do { + if (count WARCOM_zones_controled_by_OPFOR > 1) then { // make sure opfor is controlling at least 2 zones + sleep 2; + + // find a zone where to spawn OPF wave *** BEGIN + _found = false; + _randomZone = []; + _failSafe = 0; + while {!_found} do { + _randomZone = WARCOM_zones_controled_by_OPFOR call BIS_fnc_selectRandom; + if (_randomZone distance player > 2000) then {_found=true;}; + sleep 0.2; + // player sidechat format["Failsafe: %1",_failsafe]; + _failSafe = _failSafe + 1; + if (_failsafe > 10) then {sleep 300; _failsafe = 0;} + }; + // find a zone *** end + _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; + _group = [_randomZone, EAST, WARCOM_opf_patrol_type,[],[],WARCOM_opf_ai_skill_range] call BIS_fnc_spawnGroup; + [_group] call duws_fnc_WARCOM_wp_opf_patrol; +// [_group,"derp"] spawn duws_fnc_WARCOM_gps_marker; + + // spawn armored + if (WARCOM_opfor_ap>50) then { + [opfor_Faction,"armored",_randomZone] spawn duws_fnc_random_veh_opf_patrol ; + }; + + if (WARCOM_opfor_ap>200) then { + [opfor_Faction,"air",_randomZone] spawn duws_fnc_random_veh_opf_patrol ; + }; + + }; + sleep (random 1200); // patrol delay + }; +}; diff --git a/source/functions/WARCOM/fn_WARCOM_opf_qrf.sqf b/source/functions/WARCOM/fn_WARCOM_opf_qrf.sqf new file mode 100644 index 0000000..3bbed8a --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_opf_qrf.sqf @@ -0,0 +1,39 @@ +if (!WARCOM_qrf_ready) exitWith {}; +WARCOM_qrf_ready = false; +params ["_attachedUnit"]; +_unitPos = getpos _attachedUnit; +//hint format["%1",_attachedUnit]; + +// Attack waves main + +if (count WARCOM_zones_controled_by_OPFOR > 0) then { // make sure opfor is controlling at least 1 zones + sleep 2; + + // find a zone where to spawn OPF wave away from player *** BEGIN + _found = false; + _randomZone = []; + _failSafe = 0; + while {!_found} do { + _randomZone = WARCOM_zones_controled_by_OPFOR call BIS_fnc_selectRandom; + if (_randomZone distance player > 2000) then {_found=true;}; + sleep 0.2; + //player sidechat format["Failsafe: %1",_failsafe]; + _failSafe = _failSafe + 1; + if (_failsafe > 10) then + { + sleep 300; + _failsafe = 0; + }; + }; + // find a zone *** end + _randomZone = [(_randomZone select 0)+40,_randomZone select 1]; + _group = [_randomZone, EAST, WARCOM_opf_patrol_type,[],[],WARCOM_opf_ai_skill_range] call BIS_fnc_spawnGroup; + [_group,_unitPos] call duws_fnc_WARCOM_wp_opf_qrf; + //[_group,"derp"] spawn duws_fnc_WARCOM_gps_marker; +}; + + + + +sleep 1800; +WARCOM_qrf_ready = true; \ No newline at end of file diff --git a/source/WARCOM/WARCOM_wp.sqf b/source/functions/WARCOM/fn_WARCOM_wp.sqf similarity index 56% rename from source/WARCOM/WARCOM_wp.sqf rename to source/functions/WARCOM/fn_WARCOM_wp.sqf index f34190b..3ce724c 100644 --- a/source/WARCOM/WARCOM_wp.sqf +++ b/source/functions/WARCOM/fn_WARCOM_wp.sqf @@ -1,12 +1,12 @@ -_group =_this select 0; +params ["_group"]; _group setCombatMode "RED"; { _wp = _group addWaypoint [_x, 0]; _wp setWaypointType "SAD"; - _wp setWaypointCompletionRadius 40; - _wp setWaypointTimeout [300, 450, 600]; + _wp setWaypointCompletionRadius 40; + _wp setWaypointTimeout [300, 450, 600]; } forEach WARCOM_createdZones; diff --git a/source/functions/WARCOM/fn_WARCOM_wp_blu_patrol.sqf b/source/functions/WARCOM/fn_WARCOM_wp_blu_patrol.sqf new file mode 100644 index 0000000..29f1064 --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_wp_blu_patrol.sqf @@ -0,0 +1,19 @@ +params ["_group"]; + +_group setCombatMode "RED"; + + +{ + _wp = _group addWaypoint [_x, 0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "SAFE"; + _wp setWaypointSpeed "LIMITED"; + _wp setWaypointCompletionRadius 40; + _wp setWaypointTimeout [300, 450, 600]; +} +forEach WARCOM_zones_controled_by_BLUFOR; + + _wp1 = _group addWaypoint [getpos leader _group, 0]; + _wp1 setWaypointType "CYCLE"; + _wp1 setWaypointBehaviour "SAFE"; + _wp1 setWaypointSpeed "LIMITED"; diff --git a/source/WARCOM/WARCOM_wp_opf.sqf b/source/functions/WARCOM/fn_WARCOM_wp_opf.sqf similarity index 78% rename from source/WARCOM/WARCOM_wp_opf.sqf rename to source/functions/WARCOM/fn_WARCOM_wp_opf.sqf index 9bea8de..ec74e8a 100644 --- a/source/WARCOM/WARCOM_wp_opf.sqf +++ b/source/functions/WARCOM/fn_WARCOM_wp_opf.sqf @@ -1,4 +1,4 @@ -_group =_this select 0; +params ["_group"]; _group setCombatMode "RED"; @@ -14,8 +14,8 @@ if (count WARCOM_zones_controled_by_BLUFOR == 0) exitWith { { _wp = _group addWaypoint [_x, 0]; _wp setWaypointType "SAD"; - _wp setWaypointCompletionRadius 40; - _wp setWaypointTimeout [300, 450, 600]; + _wp setWaypointCompletionRadius 40; + _wp setWaypointTimeout [300, 450, 600]; } forEach WARCOM_zones_controled_by_BLUFOR; diff --git a/source/functions/WARCOM/fn_WARCOM_wp_opf_patrol.sqf b/source/functions/WARCOM/fn_WARCOM_wp_opf_patrol.sqf new file mode 100644 index 0000000..9909245 --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_wp_opf_patrol.sqf @@ -0,0 +1,19 @@ +params ["_group"]; + +_group setCombatMode "RED"; + + +{ + _wp = _group addWaypoint [_x, 0]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "SAFE"; + _wp setWaypointSpeed "LIMITED"; + _wp setWaypointCompletionRadius 40; + _wp setWaypointTimeout [300, 450, 600]; +} +forEach WARCOM_zones_controled_by_OPFOR; + + _wp1 = _group addWaypoint [getpos leader _group, 0]; + _wp1 setWaypointType "CYCLE"; + _wp1 setWaypointBehaviour "SAFE"; + _wp1 setWaypointSpeed "LIMITED"; diff --git a/source/functions/WARCOM/fn_WARCOM_wp_opf_qrf.sqf b/source/functions/WARCOM/fn_WARCOM_wp_opf_qrf.sqf new file mode 100644 index 0000000..7c4e5f8 --- /dev/null +++ b/source/functions/WARCOM/fn_WARCOM_wp_opf_qrf.sqf @@ -0,0 +1,11 @@ +params ["_group","_unitPos"]; + +_group setCombatMode "RED"; + + _wp = _group addWaypoint [_unitPos, 0]; + _wp setWaypointType "SAD"; + _wp setWaypointCompletionRadius 40; + _wp setWaypointTimeout [300, 450, 600]; + + + diff --git a/source/WARCOM/random_veh_opf_patrol.sqf b/source/functions/WARCOM/fn_random_veh_blu_patrol.sqf similarity index 88% rename from source/WARCOM/random_veh_opf_patrol.sqf rename to source/functions/WARCOM/fn_random_veh_blu_patrol.sqf index ab8628e..f0c7e48 100644 --- a/source/WARCOM/random_veh_opf_patrol.sqf +++ b/source/functions/WARCOM/fn_random_veh_blu_patrol.sqf @@ -3,10 +3,7 @@ //hasDriver = 1; //canFloat = 0; -_faction = _this select 0; -_vehClass = _this select 1; -_position = _this select 2; -_radius = _this select 3; +params ["_faction","_vehClass","_position","_radius"]; _cfgVehicles = configFile >> "CfgVehicles"; _totalentries = count _cfgVehicles; // GO INTO CFGVEHICLES AND CHECK NUMBER OF ENTRIES @@ -38,7 +35,7 @@ _simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not // DETERMINE LA FACTION _side = EAST; if(_faction=="BLU_F") then {_side=WEST}; -if(_faction=="OPF_F") then {_side=EAST}; +if(_faction==Opfor_Faction) then {_side=EAST}; if(_faction=="IND_F") then {_side=RESISTANCE}; if(_faction=="CIV_F") then {_side=CIVILIAN}; @@ -46,7 +43,7 @@ _createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle; _vehGroup = _createdVehFnc select 2; //hint format["%1",_patrolRadius]; -_opf_assault = [_vehGroup] execVM "WARCOM\WARCOM_wp_opf_patrol.sqf"; +[_vehGroup] call duws_fnc_WARCOM_wp_blu_patrol; //_crews = _createdVehFnc select 1; // //_driver = _crews select 0; //DEBUG diff --git a/source/functions/WARCOM/fn_random_veh_opf_patrol.sqf b/source/functions/WARCOM/fn_random_veh_opf_patrol.sqf new file mode 100644 index 0000000..999037a --- /dev/null +++ b/source/functions/WARCOM/fn_random_veh_opf_patrol.sqf @@ -0,0 +1,60 @@ +//faction = "OPF_F"; faction = "BLU_F"; faction = "IND_F"; faction = "CIV_F"; +//vehicleClass = "Armored" "Car" "Ship" "Static" "Air" +//hasDriver = 1; +//canFloat = 0; + +params ["_faction","_vehClass","_position","_radius"]; + +_cfgVehicles = configFile >> "CfgVehicles"; +_totalentries = count _cfgVehicles; // GO INTO CFGVEHICLES AND CHECK NUMBER OF ENTRIES +_realentries = _totalentries - 1; +_found = false; + +_foundVeh = ""; +while {!_found} do { + // RANDOMLY SELECT AN ENTRY + _checked_veh = _cfgVehicles select round (random _realentries); + _classname = configName _checked_veh; + + // CHECK IF THE SELECTED ENTRY IS A CLASS + if (isClass _checked_veh) then { + //hintSilent format["%1",_classname]; + sleep 0.005; + _actual_vehclass = getText (_checked_veh >> "vehicleClass"); + _actual_faction = getText (_checked_veh >> "faction"); + _scope = getNumber (_checked_veh >> "scope"); // check if actually present in editor + _simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute + _artilleryScanner = getNumber (_checked_veh >> "artilleryScanner"); //Check if it is an artillery unit + + if (_actual_vehclass == _vehClass + && _actual_faction == _faction + && _scope != 0 + && _simulation_paracheck != "parachute" + && _artilleryScanner == 0) exitWith { + + //hintSilent format["%1",_classname]; + //_veh = createVehicle [_classname, _position, [], 0, _vehClass]; + _foundVeh = _classname; + _found = true; + }; + }; +};// --- VEHICLE FOUND --> _foundVeh + +// DETERMINE LA FACTION +_side = EAST; +if(_faction == Blufor_Faction) then {_side=WEST}; +if(_faction == Opfor_Faction) then {_side=EAST}; +if(_faction == Indfor_Faction) then {_side=RESISTANCE}; +if(_faction == Civilian_Faction) then {_side=CIVILIAN}; + +_createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle; + +_vehGroup = _createdVehFnc select 2; +//hint format["%1",_patrolRadius]; +[_vehGroup] call duws_fnc_WARCOM_wp_opf_patrol; + +//_crews = _createdVehFnc select 1; // +//_driver = _crews select 0; //DEBUG +//addSwitchableUnit _driver; // + + diff --git a/source/dialog/fob/fast_travel.sqf b/source/functions/fob/fn_fast_travel.sqf similarity index 100% rename from source/dialog/fob/fast_travel.sqf rename to source/functions/fob/fn_fast_travel.sqf diff --git a/source/dialog/fob/fobmanageropen.sqf b/source/functions/fob/fn_fobmanageropen.sqf similarity index 100% rename from source/dialog/fob/fobmanageropen.sqf rename to source/functions/fob/fn_fobmanageropen.sqf diff --git a/source/sounds/radiochatter.sqf b/source/functions/fob/fn_radiochatter.sqf similarity index 90% rename from source/sounds/radiochatter.sqf rename to source/functions/fob/fn_radiochatter.sqf index d1f1d2f..951fadf 100644 --- a/source/sounds/radiochatter.sqf +++ b/source/functions/fob/fn_radiochatter.sqf @@ -1,4 +1,4 @@ -_object = _this select 0; +params ["_object"]; _arrayOfSounds = ["radiochatter2", "radiochatter4"]; diff --git a/source/dialog/fob/reinforce.sqf b/source/functions/fob/fn_reinforce.sqf similarity index 100% rename from source/dialog/fob/reinforce.sqf rename to source/functions/fob/fn_reinforce.sqf diff --git a/source/bisArsenal.sqf b/source/functions/generic/fn_bisArsenal.sqf similarity index 100% rename from source/bisArsenal.sqf rename to source/functions/generic/fn_bisArsenal.sqf diff --git a/source/captured.sqf b/source/functions/generic/fn_captured.sqf similarity index 84% rename from source/captured.sqf rename to source/functions/generic/fn_captured.sqf index 016ab6c..c92e618 100644 --- a/source/captured.sqf +++ b/source/functions/generic/fn_captured.sqf @@ -1,8 +1,4 @@ -_place = _this select 0; -_points = _this select 1; -_markername = _this select 2; -_markername2 = _this select 3; -_triggerPos = _this select 4; +params ["_place","_points","_markername","_markername2","_triggerPos"]; amount_zones_captured = amount_zones_captured + 1; publicVariable "amount_zones_captured"; @@ -38,7 +34,7 @@ WARCOM_blufor_ap = WARCOM_blufor_ap + _points; publicVariable "WARCOM_blufor_ap"; // ADD PERSISTENT STAT -_addzone = [] execVM "persistent\persistent_stats_zones_add.sqf"; +_addzone = [] call duws_fnc_persistent_stats_zones_add; // MODIFY MARKER ICON str(_markername) setMarkerColor "ColorGreen"; @@ -56,4 +52,4 @@ call compile format["_trg = trigger%1%2",round (_triggerPos select 0),round (_tr //// MAKE THE TRIGGER CAPTURABLE FOR OPFOR _trg setTriggerActivation["EAST SEIZED","PRESENT",true]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] execvm 'zonescap\opfor_cap.sqf'",_place,_points,_markername,_markername2,_triggerPos], ""]; \ No newline at end of file +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] call duws_fnc_opfor_cap",_place,_points,_markername,_markername2,_triggerPos], ""]; \ No newline at end of file diff --git a/source/dialog/convertCPtoAP.sqf b/source/functions/generic/fn_convertCPtoAP.sqf similarity index 100% rename from source/dialog/convertCPtoAP.sqf rename to source/functions/generic/fn_convertCPtoAP.sqf diff --git a/source/functions/generic/fn_createopfortified.sqf b/source/functions/generic/fn_createopfortified.sqf new file mode 100644 index 0000000..18e2c47 --- /dev/null +++ b/source/functions/generic/fn_createopfortified.sqf @@ -0,0 +1,22 @@ +params ["_position"]; + +// hint format["%1",_position]; + +_group = [ + _position, + EAST, [ + Opfor_Squadleader, + Opfor_AA_Specialist, + Opfor_AT_Specialist, + Opfor_Grenadier, + Opfor_Teamleader, + Opfor_Autorifleman, + Opfor_Rifleman_AT, + Opfor_Grenadier], + [], + [], + opfor_ai_skill] call BIS_fnc_spawnGroup; +[_group, _position] call bis_fnc_taskDefend; + +// ADD QRF eventhandler +_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn duws_fnc_WARCOM_opf_qrf}]; \ No newline at end of file diff --git a/source/createoppatrol.sqf b/source/functions/generic/fn_createoppatrol.sqf similarity index 62% rename from source/createoppatrol.sqf rename to source/functions/generic/fn_createoppatrol.sqf index 2cc4eae..e850145 100644 --- a/source/createoppatrol.sqf +++ b/source/functions/generic/fn_createoppatrol.sqf @@ -1,12 +1,11 @@ -// usage: [position, radius] execvm "createoppatrol.sqf" + // radius: 50 for patrol inside and around base, 500 for medium lenght skirmish, 1300 for island -_position = _this select 0; -_radius = _this select 1; +params ["_position","_radius"]; // hint format["%1",_position]; -_group = [_position, EAST, ["O_Soldier_F","O_Soldier_F"],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; +_group = [_position, EAST, [Opfor_Teamleader,Opfor_Rifleman],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; _patrolRadius = round(_radius/2); [_group, _position, _patrolradius] call bis_fnc_taskPatrol; @@ -14,4 +13,4 @@ _patrolRadius = round(_radius/2); //player globalchat format["%1",_skill]; // ADD QRF eventhandler -_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn QRF_test}]; \ No newline at end of file +_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn duws_fnc_WARCOM_opf_qrf}]; \ No newline at end of file diff --git a/source/createopteam.sqf b/source/functions/generic/fn_createopteam.sqf similarity index 53% rename from source/createopteam.sqf rename to source/functions/generic/fn_createopteam.sqf index fab4c3d..0e4090a 100644 --- a/source/createopteam.sqf +++ b/source/functions/generic/fn_createopteam.sqf @@ -1,14 +1,13 @@ -// usage: [position, radius] execvm "createoppatrol.sqf" + // radius: 50 for patrol inside and around base, 500 for medium lenght skirmish, 1300 for island -_position = _this select 0; -_radius = _this select 1; +params["_position","_radius"]; // hint format["%1",_position]; -_group = [_position, EAST, ["O_Soldier_TL_F","O_Soldier_AR_F","O_Soldier_LAT_F","O_Soldier_GL_F"],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; +_group = [_position, EAST, [Opfor_Teamleader,Opfor_Autorifleman,Opfor_Rifleman_AT,Opfor_Grenadier],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; _patrolRadius = round(_radius/2); [_group, _position, _patrolradius] call bis_fnc_taskPatrol; // ADD QRF eventhandler -_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn QRF_test}]; \ No newline at end of file +_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn duws_fnc_WARCOM_opf_qrf}]; \ No newline at end of file diff --git a/source/createopwpteam.sqf b/source/functions/generic/fn_createopwpteam.sqf similarity index 60% rename from source/createopwpteam.sqf rename to source/functions/generic/fn_createopwpteam.sqf index 45b863e..bdf9d59 100644 --- a/source/createopwpteam.sqf +++ b/source/functions/generic/fn_createopwpteam.sqf @@ -1,16 +1,15 @@ -// usage: [position, radius] execvm "createoppatrol.sqf" + // radius: 50 for patrol inside and around base, 500 for medium lenght skirmish, 1300 for island -_position = _this select 0; -_radius = _this select 1; +params ["_position","_radius"]; // hint format["%1",_position]; -_group = [_position, EAST, ["O_Soldier_TL_F","O_Soldier_AA_F","O_Soldier_AT_F"],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; +_group = [_position, EAST, [Opfor_Teamleader,Opfor_AA_Specialist,Opfor_AT_Specialist],[],[],opfor_ai_skill] call BIS_fnc_spawnGroup; _patrolRadius = round(_radius/2); [_group, _position, _patrolradius] call bis_fnc_taskPatrol; //_skill = skill leader _group; //player globalchat format["%1",_skill]; // ADD QRF eventhandler -_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn QRF_test}]; \ No newline at end of file +_EH = leader _group addEventHandler ["Fired", {[_this select 0] spawn duws_fnc_WARCOM_opf_qrf}]; \ No newline at end of file diff --git a/source/functions/generic/fn_createpatrol.sqf b/source/functions/generic/fn_createpatrol.sqf new file mode 100644 index 0000000..cbc8df7 --- /dev/null +++ b/source/functions/generic/fn_createpatrol.sqf @@ -0,0 +1,8 @@ + +// radius: 50 for patrol inside and around base, 500 for medium lenght skirmish, 1300 for island + +params ["_position","_radius"]; + +_group = [_position, WEST, [Blufor_Teamleader,Blufor_Rifleman]] call BIS_fnc_spawnGroup; +_patrolRadius = round(_radius/3); +[_group, _position, _patrolRadius] call bis_fnc_taskPatrol; \ No newline at end of file diff --git a/source/dynamic_music/dyn_music_init.sqf b/source/functions/generic/fn_dyn_music_init.sqf similarity index 64% rename from source/dynamic_music/dyn_music_init.sqf rename to source/functions/generic/fn_dyn_music_init.sqf index ad83d1b..0cf6d31 100644 --- a/source/dynamic_music/dyn_music_init.sqf +++ b/source/functions/generic/fn_dyn_music_init.sqf @@ -14,16 +14,16 @@ deleteVehicle _trg; if (!_enemypresent) then { - player addEventHandler ["FiredNear", {[] spawn DUWS_dynmusic_firednear}]; - } + player addEventHandler ["FiredNear", {[] spawn DUWS_dynmusic_firednear}]; + } else - { + { - _random_music = DUWS_dynmusic_firednear_list call BIS_fnc_selectRandom; - playmusic _random_music; + _random_music = DUWS_dynmusic_firednear_list call BIS_fnc_selectRandom; + playmusic _random_music; - sleep 300; - player addEventHandler ["FiredNear", {[] spawn DUWS_dynmusic_firednear}]; - }; + sleep 300; + player addEventHandler ["FiredNear", {[] spawn DUWS_dynmusic_firednear}]; + }; }; diff --git a/source/dynamic_menu.sqf b/source/functions/generic/fn_dynamic_menu.sqf similarity index 80% rename from source/dynamic_menu.sqf rename to source/functions/generic/fn_dynamic_menu.sqf index 18c30d0..b3e35e8 100644 --- a/source/dynamic_menu.sqf +++ b/source/functions/generic/fn_dynamic_menu.sqf @@ -13,6 +13,10 @@ Returns: - Nil - */ + +/* +DUWS note: This is available as a function! [params] call duws_fnc_dynamic_menu +*/ menuItemFormatter = { format [ "[""%1"", [%2], """", -5, [[""expression"", ""%3""]], ""1"", ""%4""]", @@ -36,7 +40,7 @@ _transportItems = []; //Offensive Submenu checks if(support_mortar_available) then { - _text = ["Mortar (2 CP)", 2, '_null = [8, 50, 5, 3, 2, 2, ""grenade""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter; + _text = ["Mortar (2 CP)", 2, '_null = [8, 50, 5, 3, 2, 2, ""grenade""] spawn duws_fnc_mapclickarty', 1] call menuItemFormatter; _offensiveItems pushBack _text; } else { _text = ["Mortar (N/A)", 2, "", 0] call menuItemFormatter; @@ -44,7 +48,7 @@ if(support_mortar_available) then { }; if(support_arty_available) then { - _text = ["Artillery Strike (4 CP)", 3, '_null = [6, 100, 8, 3, 1, 4, ""R_80mm_HE""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter; + _text = ["Artillery Strike (4 CP)", 3, '_null = [6, 100, 8, 3, 1, 4, ""R_80mm_HE""] spawn duws_fnc_mapclickarty', 1] call menuItemFormatter; _offensiveItems pushBack _text; } else { _text = ["Artillery Strike (N/A)", 3, "", 0] call menuItemFormatter; @@ -52,7 +56,7 @@ if(support_arty_available) then { }; if(support_cluster_available) then { - _text = ["Cluster Bomb (6 CP)", 4, '_null = [1, 250, 1, 90, 1, 6, ""grenade""] execVM ""support\cluster\mapclickcluster.sqf""', 1] call menuItemFormatter; + _text = ["Cluster Bomb (6 CP)", 4, '_null = [1, 250, 1, 90, 1, 6, ""grenade""] spawn duws_fnc_cluster', 1] call menuItemFormatter; _offensiveItems pushBack _text; } else { _text = ["Cluster Bomb (N/A)", 4, "", 0] call menuItemFormatter; @@ -60,7 +64,7 @@ if(support_cluster_available) then { }; if(support_jdam_available) then { - _text = ["JDAM Strike (1 CP)", 5, '_null = [1, 2, 1, 1, 3, 1, ""Bo_Mk82""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter; + _text = ["JDAM Strike (1 CP)", 5, '_null = [1, 2, 1, 1, 3, 1, ""Bo_Mk82""] spawn duws_fnc_mapclickarty', 1] call menuItemFormatter; _offensiveItems pushBack _text; } else { _text = ["JDAM (N/A)", 5, "", 0] call menuItemFormatter; @@ -79,7 +83,7 @@ call _myCode; //Logistics Submenu Checks if(support_supplydrop_available) then { - _text = ["Supply Drop (2 CP)", 2, '_null = [player] execVM ""support\ammobox.sqf""', 1] call menuItemFormatter; + _text = ["Supply Drop (2 CP)", 2, '_null = [player] spawn duws_fnc_ammobox', 1] call menuItemFormatter; _logisticsItems pushBack _text; } else { _text = ["Supply Drop ((N/A)", 2, '', 0] call menuItemFormatter; @@ -87,7 +91,7 @@ if(support_supplydrop_available) then { }; if(support_paradrop_available) then { - _text = ["Airborne troops (25 CP)", 3, '_null = [player] execVM ""support\paradrop.sqf""', 1] call menuItemFormatter; + _text = ["Airborne troops (25 CP)", 3, '_null = [player] spawn duws_fnc_paradrop', 1] call menuItemFormatter; _logisticsItems pushBack _text; } else { _text = ["Airborne troops (N/A)", 3, '', 0] call menuItemFormatter; @@ -95,7 +99,7 @@ if(support_paradrop_available) then { }; if(support_uav_recon_available) then { - _text = ["UAV Recon (3 CP)", 4, '_null = [player] execVM ""support\mapclickuav.sqf""', 1] call menuItemFormatter; + _text = ["UAV Recon (3 CP)", 4, '_null = [player] spawn duws_fnc_mapclickuav', 1] call menuItemFormatter; _logisticsItems pushBack _text; } else { _text = ["UAV Recon (N/A)", 4, '', 0] call menuItemFormatter; @@ -103,7 +107,7 @@ if(support_uav_recon_available) then { }; if(support_veh_refit_available) then { - _text = ["Vehicle Refit (2 CP)", 5, '_null = [player] execVM ""support\veh_refit.sqf""', 1] call menuItemFormatter; + _text = ["Vehicle Refit (2 CP)", 5, '_null = [player] call duws_fnc_veh_refit', 1] call menuItemFormatter; _logisticsItems pushBack _text; } else { _text = ["Vehicle Refit (N/A)", 5, '', 0] call menuItemFormatter; @@ -122,7 +126,7 @@ call _myCode; //Transport Submenu check if(support_helotaxi_available) then { - _text = ["Helicopter taxi(1 CP)", 2, '_nill = [getpos player,50] execVM ""support\taxi\helotaxi.sqf""', 1] call menuItemFormatter; + _text = ["Helicopter taxi(1 CP)", 2, '_nill = [getpos player,50] spawn duws_fnc_heloTaxi', 1] call menuItemFormatter; _transportItems pushBack _text; } else { _text = ["Helicopter taxi(N/A)", 2, '', 0] call menuItemFormatter; @@ -130,7 +134,7 @@ if(support_helotaxi_available) then { }; if(support_boattaxi_available) then { - _text = ["Boat taxi (1 CP)", 3, '_null = [getpos player,10] execVM ""support\taxi\boattaxi.sqf""', 1] call menuItemFormatter; + _text = ["Boat taxi (1 CP)", 3, '_null = [getpos player,10] spawn duws_fnc_boatTaxi', 1] call menuItemFormatter; _transportItems pushBack _text; } else { _text = ["Boat taxi (N/A)", 3, '', 0] call menuItemFormatter; @@ -151,8 +155,8 @@ call _myCode; //Construct and show Support Menu root supportMenu = [ - ["Support Menu",false], - ["Offensive", [2], "#USER:offensive_SubMenu", -5, [["expression", ""]], "1", "1"], + ["Support Menu",false], + ["Offensive", [2], "#USER:offensive_SubMenu", -5, [["expression", ""]], "1", "1"], ["Logistics", [3], "#USER:logistic_SubMenu", -5, [["expression", ""]], "1", "1"], ["Transport", [4], "#USER:transport_SubMenu", -5, [["expression", ""]], "1", "1"] ]; diff --git a/source/enterlocation.sqf b/source/functions/generic/fn_enterlocation.sqf similarity index 74% rename from source/enterlocation.sqf rename to source/functions/generic/fn_enterlocation.sqf index 5d5f732..1850978 100644 --- a/source/enterlocation.sqf +++ b/source/functions/generic/fn_enterlocation.sqf @@ -1,5 +1,4 @@ -_place = _this select 0; -_trigger = _this select 1; +params ["_place","_trigger"]; sleep 0.5; diff --git a/source/dialog/hc_init.sqf b/source/functions/generic/fn_hc_init.sqf similarity index 100% rename from source/dialog/hc_init.sqf rename to source/functions/generic/fn_hc_init.sqf diff --git a/source/mapsize.sqf b/source/functions/generic/fn_mapsize.sqf similarity index 95% rename from source/mapsize.sqf rename to source/functions/generic/fn_mapsize.sqf index a4fc71c..8a76d3d 100644 --- a/source/mapsize.sqf +++ b/source/functions/generic/fn_mapsize.sqf @@ -1,5 +1,4 @@ -_unit = _this select 0; -_debug = _this select 1; +params ["_unit","_debug"]; private ["_grid_size"]; disableserialization; diff --git a/source/musicloop.sqf b/source/functions/generic/fn_musicloop.sqf similarity index 100% rename from source/musicloop.sqf rename to source/functions/generic/fn_musicloop.sqf diff --git a/source/random_name.sqf b/source/functions/generic/fn_random_name.sqf similarity index 99% rename from source/random_name.sqf rename to source/functions/generic/fn_random_name.sqf index f0ebb25..3e0f439 100644 --- a/source/random_name.sqf +++ b/source/functions/generic/fn_random_name.sqf @@ -1,4 +1,4 @@ -_length = _this select 0; +params ["_length"]; _operation = "Operation "; _first = "--blank--"; diff --git a/source/random_veh.sqf b/source/functions/generic/fn_random_veh.sqf similarity index 70% rename from source/random_veh.sqf rename to source/functions/generic/fn_random_veh.sqf index 827311a..a011220 100644 --- a/source/random_veh.sqf +++ b/source/functions/generic/fn_random_veh.sqf @@ -3,10 +3,7 @@ //hasDriver = 1; //canFloat = 0; -_faction = _this select 0; -_vehClass = _this select 1; -_position = _this select 2; -_radius = _this select 3; +params ["_faction","_vehClass","_position","_radius"]; _cfgVehicles = configFile >> "CfgVehicles"; _totalentries = count _cfgVehicles; // GO INTO CFGVEHICLES AND CHECK NUMBER OF ENTRIES @@ -27,27 +24,28 @@ while {!_found} do { _actual_faction = getText (_checked_veh >> "faction"); _scope = getNumber (_checked_veh >> "scope"); // check if actually present in editor _simulation_paracheck = getText (_checked_veh >> "simulation"); // check if not a parachute + _artilleryScanner = getNumber (_checked_veh >> "artilleryScanner"); //Check if it is an artillery unit - if (_actual_vehclass == _vehClass - && _actual_faction == _faction - && _scope != 0 - && _simulation_paracheck != "parachute" - && _classname != "O_MBT_02_arty_F") exitWith { + if (_actual_vehclass == _vehClass + && _actual_faction == _faction + && _scope != 0 + && _simulation_paracheck != "parachute" + && _artilleryScanner == 0) exitWith { //hintSilent format["%1",_classname]; //_veh = createVehicle [_classname, _position, [], 0, _vehClass]; _foundVeh = _classname; _found = true; }; - }; + }; };// --- VEHICLE FOUND --> _foundVeh -// DETERMINE LA FACTION -_side = EAST; -if(_faction=="BLU_F") then {_side=WEST}; -if(_faction=="OPF_F") then {_side=EAST}; -if(_faction=="IND_F") then {_side=RESISTANCE}; -if(_faction=="CIV_F") then {_side=CIVILIAN}; +// DETERMINE FACTION +_side = EAST; +if(_faction == Blufor_Faction) then {_side=WEST}; +if(_faction == Opfor_Faction) then {_side=EAST}; +if(_faction == Indfor_Faction) then {_side=RESISTANCE}; +if(_faction == Civilian_Faction) then {_side=CIVILIAN}; _createdVehFnc = [_position,0,_foundVeh,_side] call bis_fnc_spawnvehicle; @@ -58,4 +56,4 @@ _patrolRadius = round(_radius/2); //_crews = _createdVehFnc select 1; // //_driver = _crews select 0; //DEBUG -//addSwitchableUnit _driver; // \ No newline at end of file +//addSwitchableUnit _driver; // diff --git a/source/dialog/request.sqf b/source/functions/generic/fn_request.sqf similarity index 86% rename from source/dialog/request.sqf rename to source/functions/generic/fn_request.sqf index 767d737..2bb3c5b 100644 --- a/source/dialog/request.sqf +++ b/source/functions/generic/fn_request.sqf @@ -5,7 +5,7 @@ ctrlSetText [1001, format["%1",zoneundercontrolblu]]; ctrlSetText [1002, format["%1",WARCOM_blufor_ap]]; // UNITS -_index = lbAdd [2100, "Rifleman(2CP)"]; // 0 +/*_index = lbAdd [2100, "Rifleman(2CP)"]; // 0 _index = lbAdd [2100, "Grenadier(3CP)"]; // 1 _index = lbAdd [2100, "Automatic Rifleman(3CP)"]; // 2 _index = lbAdd [2100, "AT Rifleman(3CP)"]; // 3 @@ -15,14 +15,21 @@ _index = lbAdd [2100, "Repair Specialist(4CP)"]; // 6 _index = lbAdd [2100, "AT Specialist(4CP)"]; // 7 _index = lbAdd [2100, "SF Diver(3CP)"]; // 8 _index = lbAdd [2100, "Marksman(3CP)"]; // 9 -_index = lbAdd [2100, "Sniper(4CP)"]; // 10 +_index = lbAdd [2100, "Sniper(4CP)"]; // 10 _index = lbAdd [2100, "Spotter(3CP)"]; // 11 -_index = lbAdd [2100, "Explosive specialist(4CP)"]; // 12 +_index = lbAdd [2100, "Explosive specialist(4CP)"]; // 12*/ + +{ + _unit = _x select 0; + _cost = _x select 1; + _displayName = getText (configfile >> "CfgVehicles" >> _unit >> "displayName"); + lbAdd [2100, format ["%1 (%2 CP)",_displayName,_cost]]; +} forEach blufor_unit_array; lbSetCurSel [2100, 0]; // SQUADS -_index0 = lbAdd [2101, "Fireteam(8CP)"]; // 0 +/*_index0 = lbAdd [2101, "Fireteam(8CP)"]; // 0 _index0 = lbAdd [2101, "Rifle Squad(16CP)"]; // 1 _index0 = lbAdd [2101, "Weapons Squad(18CP)"]; // 2 _index0 = lbAdd [2101, "AT Team(12CP)"]; // 3 @@ -33,11 +40,18 @@ _index0 = lbAdd [2101, "Divers Team(12CP)"]; // 7 _index0 = lbAdd [2101, "Sniper Team(8CP)"]; // 8 _index0 = lbAdd [2101, "Medical Team(10CP)"]; // 9 _index0 = lbAdd [2101, "Motorized scouts(28CP)"]; // 10 -_index0 = lbAdd [2101, "Mechanized squad(46CP)"]; // 11 +_index0 = lbAdd [2101, "Mechanized squad(46CP)"]; // 11*/ +{ + _cfgGroup = _x select 1; + _cost = _x select 0; + _displayName = [_cfgGroup, "name"] call BIS_fnc_returnConfigEntry; + lbAdd [2101, format ["%1 (%2 CP)",_displayName,_cost]]; +} forEach blufor_cfgGroup_array; + lbSetCurSel [2101, 0]; // VEHICLES -_index1 = lbAdd [2102, "Small Transport Truck 1 (seats 6 - 4CP)"]; // 0 +/*_index1 = lbAdd [2102, "Small Transport Truck 1 (seats 6 - 4CP)"]; // 0 _index1 = lbAdd [2102, "Small Transport Truck 2 (seats 9 - 6CP)"]; // 1 _index1 = lbAdd [2102, "Prowler Unarmed (5CP)"]; // 2 _index1 = lbAdd [2102, "Prowler Armed (13CP)"]; // 3 @@ -76,7 +90,14 @@ _index1 = lbAdd [2102, "Blackfish Armed (60CP)"]; // 35 _index1 = lbAdd [2102, "Black Wasp II (50CP)"]; // 36 _index1 = lbAdd [2102, "Black Wasp II (Stealth) (60CP)"]; // 37 _index1 = lbAdd [2102, "Rhino MGS (40CP)"]; // 38 -_index1 = lbAdd [2102, "Rhino MGS UP (42CP)"]; // 39 +_index1 = lbAdd [2102, "Rhino MGS UP (42CP)"]; // 39*/ +{ + _vehicle = _x select 1; + _cost = _x select 0; + _displayName = getText (configfile >> "CfgVehicles" >> _vehicle >> "displayName"); + lbAdd [2102, format ["%1 (%2 CP)",_displayName,_cost]]; +} forEach blufor_vehicle_array; + lbSetCurSel [2102, 0]; // Supports !!! CHECK TO ADD AT INIT diff --git a/source/dialog/request_squad.sqf b/source/functions/generic/fn_request_squad.sqf similarity index 99% rename from source/dialog/request_squad.sqf rename to source/functions/generic/fn_request_squad.sqf index b559cd4..349664e 100644 --- a/source/dialog/request_squad.sqf +++ b/source/functions/generic/fn_request_squad.sqf @@ -6,8 +6,10 @@ _index = lbCurSel 2101; _spawnPos = [getpos hq_blu1, 80, 250, 20, 0, 20, 0] call BIS_fnc_findSafePos; _spawnPos = [(_spawnPos select 0)+15, _spawnPos select 1]; -switch (_index) do -{ +switch (_index) do requestGroupCases; + + +/*{ case 0: { _cost = 8; _grouptype = (configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam"); @@ -188,5 +190,5 @@ switch (_index) do hint "Not enough command points"; }; }; -}; +};*/ publicVariable "commandpointsblu1"; diff --git a/source/dialog/request_support.sqf b/source/functions/generic/fn_request_support.sqf similarity index 97% rename from source/dialog/request_support.sqf rename to source/functions/generic/fn_request_support.sqf index ffdf307..7951a65 100644 --- a/source/dialog/request_support.sqf +++ b/source/functions/generic/fn_request_support.sqf @@ -83,9 +83,9 @@ switch (_index2) do { ctrlSetText [1000, format["%1",commandpointsblu1]]; lbSetColor [2103, index_support_armory, [0, 1, 0, 1]]; support_armory_available = true; - hq_blu1 addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; + hq_blu1 addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; { - _x addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; + _x addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; } forEach (Array_of_FOBS); playSound "loadgun"; @@ -103,7 +103,7 @@ switch (_index2) do { if (!support_PFLIR_available) then { commandpointsblu1 = commandpointsblu1 - 20; ctrlSetText [1000, format["%1",commandpointsblu1]]; - pFLIRenable = player addaction ["Activate FLIR","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]; + pFLIRenable = player addaction ["Activate FLIR",{_this spawn duws_fnc_livefeed},"", 0,false,true,"","_target == _this"]; lbSetColor [2103, index_support_pFLIR, [0, 1, 0, 1]]; support_pflir_available = true; playSound "loadgun"; diff --git a/source/dialog/request_unit.sqf b/source/functions/generic/fn_request_unit.sqf similarity index 81% rename from source/dialog/request_unit.sqf rename to source/functions/generic/fn_request_unit.sqf index 6f545ed..d50c260 100644 --- a/source/dialog/request_unit.sqf +++ b/source/functions/generic/fn_request_unit.sqf @@ -4,14 +4,16 @@ _skill = (blufor_ai_skill select 0)+0.2; _skillSF = (blufor_ai_skill select 0)+0.5; _spawnpos = [(getpos hq_blu1 select 0)-8, (getpos hq_blu1 select 1)-3.5]; -switch (_index) do { +switch (_index) do requestUnitCases; + +/*{ case 0: { if (commandpointsblu1 >= 2) then { hint "Unit ready !"; commandpointsblu1 = commandpointsblu1 - 2; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_Soldier_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Rifleman createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -22,7 +24,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_Soldier_GL_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Grenadier createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -33,7 +35,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_Soldier_AR_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Autorifleman createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -44,7 +46,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_Soldier_LAT_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Rifleman_AT createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -55,7 +57,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_medic_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Medic createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -66,7 +68,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_soldier_AA_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_AA_Specialist createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -77,7 +79,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_soldier_repair_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Repair_Specialist createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -88,7 +90,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_soldier_AT_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_AT_Specialist createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -99,7 +101,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_diver_F" createUnit [_spawnpos, _group, "", _skillSF, "private"] ; + Blufor_diver createUnit [_spawnpos, _group, "", _skillSF, "private"] ; } else { hint "Not enough command points"; }; @@ -110,7 +112,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_soldier_M_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Marksman createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; @@ -121,7 +123,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_sniper_F" createUnit [_spawnpos, _group, "", _skillSF, "private"] ; + Blufor_sniper createUnit [_spawnpos, _group, "", _skillSF, "private"] ; } else { hint "Not enough command points"; }; @@ -132,7 +134,7 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 3; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_spotter_F" createUnit [_spawnpos, _group, "", _skillSF, "private"] ; + Blufor_spotter createUnit [_spawnpos, _group, "", _skillSF, "private"] ; } else { hint "Not enough command points"; }; @@ -143,12 +145,12 @@ switch (_index) do { commandpointsblu1 = commandpointsblu1 - 4; ctrlSetText [1000, format["%1",commandpointsblu1]]; _group = group player ; - "B_soldier_exp_F" createUnit [_spawnpos, _group, "", _skill, "private"] ; + Blufor_Explosive_Specialist createUnit [_spawnpos, _group, "", _skill, "private"] ; } else { hint "Not enough command points"; }; }; -}; +};*/ //hint format["AI skill: %1",_skill]; publicVariable "commandpointsblu1"; diff --git a/source/functions/generic/fn_request_vehicle.sqf b/source/functions/generic/fn_request_vehicle.sqf new file mode 100644 index 0000000..9da87f4 --- /dev/null +++ b/source/functions/generic/fn_request_vehicle.sqf @@ -0,0 +1,137 @@ +diag_log "DUWS-R: dialog/request_vehicle.sqf running..."; + +_index = lbCurSel 2102; + +//findEmptyPosition example +_spawnPos = (getpos hq_blu1) findEmptyPosition [20, 70]; +_spawnPos = [(_spawnPos select 0)+30, _spawnPos select 1]; + +vehic = nil; + +switch (_index) do requestVehicleCases; + +/*{ + case 0: { // Small Truck 1 + [4, "I_G_Offroad_01_F"] call duws_fnc_spawnVehicle; + }; + case 1: { // Small Truck 2 + [6, "I_G_Van_01_transport_F"] call duws_fnc_spawnVehicle; + }; + case 2: { // Prowler Unarmed + [5, "B_T_LSV_01_unarmed_F"] call duws_fnc_spawnVehicle; + }; + case 3: { // Prowler Armed + [13, "B_T_LSV_01_armed_F"] call duws_fnc_spawnVehicle; + }; + case 4: { // Hunter Unarmed + [5, "B_MRAP_01_F"] call duws_fnc_spawnVehicle; + }; + case 5: { // Hunter HMG + [18, "B_MRAP_01_hmg_F"] call duws_fnc_spawnVehicle; + }; + case 6: { // Hunter GMG + [25, "B_MRAP_01_gmg_F"] call duws_fnc_spawnVehicle; + }; + case 7: { // Marshall + [35, "B_APC_Wheeled_01_cannon_F"] call duws_fnc_spawnVehicle; + }; + case 8: { //HEMETT Transport Covered + [8, Blufor_Truck_Covered] call duws_fnc_spawnVehicle; + }; + case 9: { // Pawnee + [25, "B_Heli_Light_01_armed_F"] call duws_fnc_spawnVehicle; + }; + case 10: { // Blackfoot + [45, "B_Heli_Attack_01_F"] call duws_fnc_spawnVehicle; + }; + case 11: { // HummingBird + [15, "B_Heli_Light_01_F"] call duws_fnc_spawnVehicle; + }; + case 12: { // M-900 Civ. + [12, "C_Heli_Light_01_civil_F"] call duws_fnc_spawnVehicle; + }; + case 13: { // Taru Empty + [18, "O_Heli_Transport_04_F"] call duws_fnc_spawnVehicle; + }; + case 14: { // GhostHawk + [22, "B_Heli_Transport_01_F"] call duws_fnc_spawnVehicle; + }; + case 15: { // Huron + [26, "B_Heli_Transport_03_F"] call duws_fnc_spawnVehicle; + }; + case 16: { // Panther IFV + [25, "B_APC_Tracked_01_rcws_F"] call duws_fnc_spawnVehicle; + }; + case 17: { // ATV Quad + [1, "B_Quadbike_01_F"] call duws_fnc_spawnVehicle; + }; + case 18: { // Cheetah AA + [30, "B_APC_Tracked_01_AA_F"] call duws_fnc_spawnVehicle; + }; + case 19: { // Slammer + [40, "B_MBT_01_cannon_F"] call duws_fnc_spawnVehicle; + }; + case 20: { // Bobcat + [28, "B_APC_Tracked_01_CRV_F"] call duws_fnc_spawnVehicle; + }; + case 21: { // SF SUV + [2, "C_Offroad_01_F"] call duws_fnc_spawnVehicle; + }; + case 22: { // MLRS Artillery + [75, "B_MBT_01_mlrs_F"] call duws_fnc_spawnVehicle; + }; + case 23: { // Scorcher Artillery + [75, "B_MBT_01_arty_F"] call duws_fnc_spawnVehicle; + }; + case 24: { // Fuel Truck (van) + [10, "B_G_Van_01_fuel_F"] call duws_fnc_spawnVehicle; + }; + case 25: { // Wipeout CAS + [45, "B_Plane_CAS_01_F"] call duws_fnc_spawnVehicle; + }; + case 26: { // Slammer Urban Purpose + [40, "B_MBT_01_TUSK_F"] call duws_fnc_spawnVehicle; + }; + case 27: { // Stomper RCWS + [20, "B_UGV_01_rcws_F"] call duws_fnc_spawnVehicle; + }; + case 28: { // Stomper Scout + [10, "B_UGV_01_F"] call duws_fnc_spawnVehicle; + }; + case 29: { // Greyhawk ATG + [15, "B_UAV_02_F"] call duws_fnc_spawnVehicle; + }; + case 30: { // Greyhawk CAS + [15, "B_UAV_02_CAS_F"] call duws_fnc_spawnVehicle; + }; + case 31: { // MQ-12 Falcon + [60, "B_T_UAV_03_F"] call duws_fnc_spawnVehicle; + }; + case 32: { // Darter UAV + [5, "B_UAV_01_F"] call duws_fnc_spawnVehicle; + }; + case 33: { // Blackfish (Infantry) + [40, "B_T_VTOL_01_infantry_F"] call duws_fnc_spawnVehicle; + }; + case 34: { // Blackfish (Vehicle) + [45, "B_T_VTOL_01_vehicle_F"] call duws_fnc_spawnVehicle; + }; + case 35: { // Blackfish (Armed) + [60, "B_T_VTOL_01_armed_F"] call duws_fnc_spawnVehicle; + }; + case 36: { //WASP + [50, "B_Plane_Fighter_01_F"] call duws_fnc_spawnVehicle; + }; + case 37: { //WASP (Stealth) + [60, "B_Plane_Fighter_01_Stealth_F"] call duws_fnc_spawnVehicle; + }; + case 38: { //Rhino (Stealth) + [38, "B_AFV_Wheeled_01_cannon_F"] call duws_fnc_spawnVehicle; + }; + case 39: { //Rhino UP (Stealth) + [42, "B_AFV_Wheeled_01_up_cannon_F"] call duws_fnc_spawnVehicle; + }; +};*/ +vehic = nil; +publicVariable "commandpointsblu1"; +//hint format["index: %1",_index]; diff --git a/source/savegame.sqf b/source/functions/generic/fn_savegame.sqf similarity index 78% rename from source/savegame.sqf rename to source/functions/generic/fn_savegame.sqf index e24ff57..f7341b4 100644 --- a/source/savegame.sqf +++ b/source/functions/generic/fn_savegame.sqf @@ -3,7 +3,7 @@ player setdammage 0; if (isServer) then { - skiptime 6; + [6, true, true] call BIS_fnc_setDate; sleep 0.3; saveGame; @@ -12,5 +12,5 @@ if (isServer) then { publicVariable "savegameNumber"; sleep 2; - [] execVM "misc\bottom_right_message.sqf"; -}; \ No newline at end of file + [] call duws_fnc_bottom_right_message; +}; diff --git a/source/functions/generic/fn_savegameClient.sqf b/source/functions/generic/fn_savegameClient.sqf new file mode 100644 index 0000000..61784c0 --- /dev/null +++ b/source/functions/generic/fn_savegameClient.sqf @@ -0,0 +1,4 @@ +[6, true, true] call BIS_fnc_setDate; +player setdammage 0; +{_x setdammage 0} forEach units group player; +hint "You and your squad members have been fully healed"; diff --git a/source/dialog/spawnVehicle.sqf b/source/functions/generic/fn_spawnVehicle.sqf similarity index 95% rename from source/dialog/spawnVehicle.sqf rename to source/functions/generic/fn_spawnVehicle.sqf index 6a3edf2..860ad32 100644 --- a/source/dialog/spawnVehicle.sqf +++ b/source/functions/generic/fn_spawnVehicle.sqf @@ -1,5 +1,4 @@ -_requiredPoints = _this select 0; -_vehicleType = _this select 1; +params ["_requiredPoints","_vehicleType"]; if (commandpointsblu1 >= _requiredPoints) then { commandpointsblu1 = commandpointsblu1 - _requiredPoints; diff --git a/source/functions/generic/fn_zones_bonus.sqf b/source/functions/generic/fn_zones_bonus.sqf new file mode 100644 index 0000000..94ca4aa --- /dev/null +++ b/source/functions/generic/fn_zones_bonus.sqf @@ -0,0 +1,7 @@ +waitUntil {zoneundercontrolblu >= 1}; +sleep 20; +[player,"fob_support"] remoteExecCall ["BIS_fnc_addCommMenuItem", 0, true]; +//_sitrep = [player,"fob_support"] call BIS_fnc_addCommMenuItem; +["info",["Establishing a FOB","Check the briefing for more info (RTI Manual)"]] remoteExecCall ["bis_fnc_showNotification", 0, true]; +//["info",["Establishing a FOB","Check the briefing for more info (RTI Manual)"]] call bis_fnc_showNotification; +sleep 2; \ No newline at end of file diff --git a/source/zonesundercontrol.sqf b/source/functions/generic/fn_zonesundercontrol.sqf similarity index 100% rename from source/zonesundercontrol.sqf rename to source/functions/generic/fn_zonesundercontrol.sqf diff --git a/source/dialog/info/info.sqf b/source/functions/info/fn_info.sqf similarity index 100% rename from source/dialog/info/info.sqf rename to source/functions/info/fn_info.sqf diff --git a/source/initHQ/BluHQinit.sqf b/source/functions/initHQ/fn_BluHQinit.sqf similarity index 70% rename from source/initHQ/BluHQinit.sqf rename to source/functions/initHQ/fn_BluHQinit.sqf index bbce22a..9bc9670 100644 --- a/source/initHQ/BluHQinit.sqf +++ b/source/functions/initHQ/fn_BluHQinit.sqf @@ -1,4 +1,5 @@ -_hqblu = _this select 0; +params ["_hqblu"]; + blu_hq_created = true; PosOfBLUHQ = _hqblu; publicVariable "PosOfBLUHQ"; @@ -22,7 +23,7 @@ _trg5=createTrigger["EmptyDetector",_hqblu]; _trg5 triggerAttachVehicle [player]; _trg5 setTriggerArea[100,100,0,false]; _trg5 setTriggerActivation["VEHICLE","PRESENT",true]; -_trg5 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocation.sqf'",'Main Base'], ""]; +_trg5 setTriggerStatements["this", format["[""%1"",thislist] spawn duws_fnc_enterlocation",'Main Base'], ""]; // warning trigger when an enemy approaches the camp _trgWarning=createTrigger["EmptyDetector",_hqblu]; @@ -32,36 +33,27 @@ _trgWarning setTriggerStatements["this","[west, ""PAPA_BEAR""] sidechat 'This is // CREATE THE OFFICER _group = createGroup west; -_hq = _group createUnit ["b_officer_f",(getmarkerpos str(blu_hq_markername)), [], 0, "FORM"]; +_hq = _group createUnit [Blufor_Officer,(getmarkerpos str(blu_hq_markername)), [], 0, "FORM"]; hq_blu1 = _hq; publicVariable "hq_blu1"; -_hq setpos [_hqblu select 0, _hqblu select 1, 0.59]; +_hq setpos [_hqblu select 0, _hqblu select 1, 0.59]; _hq disableAI "AUTOTARGET"; -_hq setdir 0; +_hq disableAI "MOVE"; removeallweapons _hq; -_hq switchMove "acts_StandingSpeakingUnarmed"; -_handle = [_hq] execVM "sounds\radiochatter.sqf"; +[_hq] spawn duws_fnc_commanderAnim; +_hq setdir 270; +_handle = [_hq] spawn duws_fnc_radiochatter; //_drawicon = [] execVM "inithq\drawIcon.sqf"; // create the icon //GUARDS -_handle = [(getpos hq_blu1), _hq] execVM "initHQ\guards.sqf"; +_handle = [(getpos hq_blu1), _hq] call duws_fnc_guards; //STATIC DEFENSES -_handle = [(getpos hq_blu1), _hq] execVM "initHQ\fortify.sqf"; - -// IF THE OFFICER IS DEAD -- BEGIN OF "SPAWN" -[_hq] spawn { - _hq = _this select 0; - waitUntil {sleep 1;!alive _hq}; - _hq switchMove "AidlPercMstpSnonWnonDnon01"; - ["TaskFailed",["","Your commanding officer has been killed"]] call bis_fnc_showNotification; - sleep 6; - ["officerkilled",false,true] call BIS_fnc_endMission; -}; +_handle = [(getpos hq_blu1), _hq] spawn duws_fnc_fortify; //CREATE PATROL -_handle = [getpos hq_blu1] execVM "initHQ\guardsHQ.sqf"; -_handle = [getpos hq_blu1] execVM "initHQ\guardsHQ.sqf"; +[getpos hq_blu1, 40] call duws_fnc_guardsHQ; +[getpos hq_blu1, 60] call duws_fnc_guardsHQ; // IF THE OFFICER IS DEAD -- End OF "SPAWN" @@ -81,13 +73,13 @@ if (!zones_manually_placed) then { // SHOW THE STARTUP MENU if (!zones_created) then { sleep 0.1; - _nill = [] execVM "dialog\startup\startup.sqf"; + [] spawn duws_fnc_startup; waitUntil {chosen_settings}; // WAIT UNTIL THE PLAYER HAS CHOSEN THE SETTINGS }; // WEATHER INIT if (dynamic_weather_enable) then { - _weather_script = [] execVM "dialog\startup\weather.sqf"; + _weather_script = [] spawn duws_fnc_weather; }; // CALL ZONES GENERATION @@ -109,4 +101,4 @@ if (debugmode) exitWith {}; if (isServer) then { _sitrep = [player,"sitrep"] call BIS_fnc_addCommMenuItem; -}; \ No newline at end of file +}; diff --git a/source/functions/initHQ/fn_HQaddactions.sqf b/source/functions/initHQ/fn_HQaddactions.sqf new file mode 100644 index 0000000..783a826 --- /dev/null +++ b/source/functions/initHQ/fn_HQaddactions.sqf @@ -0,0 +1,15 @@ +params ["_hq"]; + +_hq addaction ["Player stats",duws_fnc_info, "", 0, true, true, "", "_this == player"]; +_hq addaction ["Request units",{_this call duws_fnc_request}, "", 0, true, true, "", "_this == player"]; +_hq addaction ["Squad manager",duws_fnc_squadmng, "", 0, true, true, "", "_this == player"]; +_hq addaction ["FOB manager",duws_fnc_fobmanageropen, "", 0, true, true, "", "_this == player"]; +if (isServer) then { + _hq addaction ["Rest (wait/save)", duws_fnc_savegame, "", 0, true, true, "", "_this == player"]; +}; + +if (!isServer) then { + _hq addaction ["Rest",duws_fnc_savegameClient, "", 0, true, true, "", "_this == player"]; +}; + +_hq addaction ["RESET SQUAD LEADER",{[] call duws_fnc_groupReset}, "", 0, true, true, "", "_this == player"]; diff --git a/source/functions/initHQ/fn_commanderAnim.sqf b/source/functions/initHQ/fn_commanderAnim.sqf new file mode 100644 index 0000000..707574f --- /dev/null +++ b/source/functions/initHQ/fn_commanderAnim.sqf @@ -0,0 +1,6 @@ +params ["_unit"]; +private _animations = ["HubBriefing_lookAround1","HubBriefing_lookAround2","HubBriefing_scratch","HubBriefing_stretch","HubBriefing_talkAround","HubBriefing_think"]; +while {alive _unit} do { + _unit switchMove selectRandom _animations; + sleep 15; +}; \ No newline at end of file diff --git a/source/initHQ/drawIcon.sqf b/source/functions/initHQ/fn_drawIcon.sqf similarity index 59% rename from source/initHQ/drawIcon.sqf rename to source/functions/initHQ/fn_drawIcon.sqf index cd8ce68..56667ef 100644 --- a/source/initHQ/drawIcon.sqf +++ b/source/functions/initHQ/fn_drawIcon.sqf @@ -1,10 +1,9 @@ -DUWS_draw_icon_fnc = compile preprocessFile "initHQ\drawIconFnc.sqf"; while {alive hq_blu1} do { waitUntil {sleep 2; player distance hq_blu1 < 15}; - _addStackedEHfnc = ["draw_hq_icon", "onEachFrame", "DUWS_draw_icon_fnc"] call BIS_fnc_addStackedEventHandler; + _addStackedEHfnc = ["draw_hq_icon", "onEachFrame", "duws_fnc_drawIconFnc"] call BIS_fnc_addStackedEventHandler; sleep 0.1; - + waitUntil {sleep 0.2; player distance hq_blu1 > 15}; _removeStackedEHfnc = [_addStackedEHfnc, "onEachFrame"] call BIS_fnc_removeStackedEventHandler; onEachFrame {}; diff --git a/source/initHQ/drawIconFnc.sqf b/source/functions/initHQ/fn_drawIconFnc.sqf similarity index 100% rename from source/initHQ/drawIconFnc.sqf rename to source/functions/initHQ/fn_drawIconFnc.sqf diff --git a/source/initHQ/fobmanager.sqf b/source/functions/initHQ/fn_fobmanager.sqf similarity index 97% rename from source/initHQ/fobmanager.sqf rename to source/functions/initHQ/fn_fobmanager.sqf index a46c9e5..8d0e4d0 100644 --- a/source/initHQ/fobmanager.sqf +++ b/source/functions/initHQ/fn_fobmanager.sqf @@ -22,7 +22,7 @@ _index = -1; _fob_fobname = "FOB " + _fobname; _actual_array = [_fobpos, - {_handle = [_fobpos] execVM "initHQ\teleport.sqf";}, + {[_fobpos] call duws_fnc_teleport;}, _fob_fobname, format["Fast travel to %1",_fob_fobname], "", diff --git a/source/initHQ/fortify.sqf b/source/functions/initHQ/fn_fortify.sqf similarity index 77% rename from source/initHQ/fortify.sqf rename to source/functions/initHQ/fn_fortify.sqf index 683b280..e9eedab 100644 --- a/source/initHQ/fortify.sqf +++ b/source/functions/initHQ/fn_fortify.sqf @@ -1,52 +1,51 @@ -_centerPos = _this select 0; -_hq = _this select 1; +params ["_centerPos","_hq"]; _groupGuard = createGroup WEST; // AA on the roof -_aaPod = createVehicle ["B_static_AA_F", [0,0,0], [], 0, "NONE"]; +_aaPod = createVehicle [Blufor_AA_Static, [0,0,0], [], 0, "NONE"]; _aaPod allowdamage false; _aaPod setdamage 0; _aaPod setpos [_centerPos select 0, _centerPos select 1,(_centerPos select 2)+3.109]; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 moveinGunner _aaPod; // GMG -_gl1Pod = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_gl1Pod = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _gl1Pod allowdamage false; _gl1Pod setdamage 0; _gl1Pod setpos [(_centerPos select 0)-7, (_centerPos select 1)+5.5]; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 moveinGunner _gl1Pod; // AT -_atPod1 = createVehicle ["B_static_AT_F", [0,0,0], [], 0, "NONE"]; +_atPod1 = createVehicle [Blufor_AT_Static, [0,0,0], [], 0, "NONE"]; _atPod1 setpos [(_centerPos select 0)-7, (_centerPos select 1)-8]; _atPod1 allowdamage false; _atPod1 setdamage 0; _atPod1 setdir 215; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 moveinGunner _atPod1; // HMG -_atPod2 = createVehicle ["B_HMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod2 = createVehicle [Blufor_HMG_Static, [0,0,0], [], 0, "NONE"]; _atPod2 allowdamage false; _atPod2 setdamage 0; _atPod2 setpos [(_centerPos select 0)+8, (_centerPos select 1)-7]; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 moveinGunner _atPod2; // GMG -_atPod3 = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod3 = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _atPod3 allowdamage false; _atPod3 setdamage 0; _atPod3 setpos [(_centerPos select 0)+7, (_centerPos select 1)+8]; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 moveinGunner _atPod3; // LIGHTS @@ -112,4 +111,4 @@ _light8 allowdamage true; _light9 allowdamage true; -_hq addAction ["Replace Defences (20CP)", "initHQ\refortify.sqf", [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _hq], 0, true, true, "", "_this == player"]; \ No newline at end of file +_hq addAction ["Replace Defences (20CP)", {_this call duws_fnc_refortify}, [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _hq], 0, true, true, "", "_this == player"]; \ No newline at end of file diff --git a/source/initHQ/fortifyFOB.sqf b/source/functions/initHQ/fn_fortifyFOB.sqf similarity index 72% rename from source/initHQ/fortifyFOB.sqf rename to source/functions/initHQ/fn_fortifyFOB.sqf index 8916fba..99c7f58 100644 --- a/source/initHQ/fortifyFOB.sqf +++ b/source/functions/initHQ/fn_fortifyFOB.sqf @@ -1,7 +1,7 @@ -_centerPos = (_this select 3) select 0; -_actionID = _this select 2; -_object = _this select 0; -_fob = (_this select 3) select 1; +params ["_object","_caller","_actionId", "_arguments"]; + +_centerPos = _arguments select 0; +_fob = _arguments select 1; aliveAllUnits = {alive _x} count allunits; if (commandpointsblu1 < 4) exitWith {hint "You don't have enough Command Points"}; @@ -17,49 +17,49 @@ playSound "loadgun"; _groupGuard = createGroup WEST; // AA on the roof -_aaPod = createVehicle ["B_static_AA_F", [0,0,0], [], 0, "NONE"]; +_aaPod = createVehicle [Blufor_AA_Static, [0,0,0], [], 0, "NONE"]; _aaPod allowdamage false; _aaPod setdamage 0; _aaPod setpos [_centerPos select 0, _centerPos select 1,(_centerPos select 2)+3.109]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _aaPod; // GMG -_gl1Pod = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_gl1Pod = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _gl1Pod allowdamage false; _gl1Pod setdamage 0; _gl1Pod setpos [(_centerPos select 0)-7, (_centerPos select 1)+5.5]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _gl1Pod; // AT -_atPod1 = createVehicle ["B_static_AT_F", [0,0,0], [], 0, "NONE"]; +_atPod1 = createVehicle [Blufor_AT_Static, [0,0,0], [], 0, "NONE"]; _atPod1 setpos [(_centerPos select 0)-7, (_centerPos select 1)-8]; _atPod1 allowdamage false; _atPod1 setdamage 0; _atPod1 setdir 215; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod1; // HMG -_atPod2 = createVehicle ["B_HMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod2 = createVehicle [Blufor_HMG_Static, [0,0,0], [], 0, "NONE"]; _atPod2 allowdamage false; _atPod2 setdamage 0; _atPod2 setpos [(_centerPos select 0)+8, (_centerPos select 1)-7]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod2; // GMG -_atPod3 = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod3 = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _atPod3 allowdamage false; _atPod3 setdamage 0; _atPod3 setpos [(_centerPos select 0)+7, (_centerPos select 1)+8]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod3; // LIGHTS @@ -100,4 +100,4 @@ _light3 allowdamage true; _light4 allowdamage true; _light5 allowdamage true; -_fob addAction ["Replace FOB Defences (15CP)", "initHQ\refortifyFOB.sqf", [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _fob], 0, true, true, "", "_this == player"]; \ No newline at end of file +_fob addAction ["Replace FOB Defences (15CP)", {_this call duws_fnc_refortifyFOB}, [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _fob], 0, true, true, "", "_this == player"]; \ No newline at end of file diff --git a/source/initHQ/fortifyFOB2.sqf b/source/functions/initHQ/fn_fortifyFOB2.sqf similarity index 71% rename from source/initHQ/fortifyFOB2.sqf rename to source/functions/initHQ/fn_fortifyFOB2.sqf index e7c0960..23dfa72 100644 --- a/source/initHQ/fortifyFOB2.sqf +++ b/source/functions/initHQ/fn_fortifyFOB2.sqf @@ -1,52 +1,54 @@ +params ["_centerPos","_fob"]; + _centerPos = _this select 0; _fob = _this select 1; _groupGuard = createGroup WEST; // AA on the roof -_aaPod = createVehicle ["B_static_AA_F", [0,0,0], [], 0, "NONE"]; +_aaPod = createVehicle [Blufor_AA_Static, [0,0,0], [], 0, "NONE"]; _aaPod allowdamage false; _aaPod setdamage 0; _aaPod setpos [_centerPos select 0, _centerPos select 1,(_centerPos select 2)+3.109]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _aaPod; // GMG -_gl1Pod = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_gl1Pod = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _gl1Pod allowdamage false; _gl1Pod setdamage 0; _gl1Pod setpos [(_centerPos select 0)-7, (_centerPos select 1)+5.5]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _gl1Pod; // AT -_atPod1 = createVehicle ["B_static_AT_F", [0,0,0], [], 0, "NONE"]; +_atPod1 = createVehicle [Blufor_AT_Static, [0,0,0], [], 0, "NONE"]; _atPod1 setpos [(_centerPos select 0)-7, (_centerPos select 1)-8]; _atPod1 allowdamage false; _atPod1 setdamage 0; _atPod1 setdir 215; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod1; // HMG -_atPod2 = createVehicle ["B_HMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod2 = createVehicle [Blufor_HMG_Static, [0,0,0], [], 0, "NONE"]; _atPod2 allowdamage false; _atPod2 setdamage 0; _atPod2 setpos [(_centerPos select 0)+8, (_centerPos select 1)-7]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod2; // GMG -_atPod3 = createVehicle ["B_GMG_01_high_F", [0,0,0], [], 0, "NONE"]; +_atPod3 = createVehicle [Blufor_GMG_Static, [0,0,0], [], 0, "NONE"]; _atPod3 allowdamage false; _atPod3 setdamage 0; _atPod3 setpos [(_centerPos select 0)+7, (_centerPos select 1)+8]; -_fobGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_fobGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _fobGuard1 moveinGunner _atPod3; // LIGHTS @@ -87,4 +89,4 @@ _light3 allowdamage true; _light4 allowdamage true; _light5 allowdamage true; -_fob addAction ["Replace FOB Defences (15CP)", "initHQ\refortifyFOB.sqf", [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _fob], 0, true, true, "", "_this == player"]; \ No newline at end of file +_fob addAction ["Replace FOB Defences (15CP)", {_this call duws_fnc_refortifyFOB}, [_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _fob], 0, true, true, "", "_this == player"]; \ No newline at end of file diff --git a/source/initHQ/guards.sqf b/source/functions/initHQ/fn_guards.sqf similarity index 69% rename from source/initHQ/guards.sqf rename to source/functions/initHQ/fn_guards.sqf index df75393..d7cb57c 100644 --- a/source/initHQ/guards.sqf +++ b/source/functions/initHQ/fn_guards.sqf @@ -1,31 +1,30 @@ -_centerPos = _this select 0; -_hq = _this select 1; +params ["_centerPos","_hq"]; // Create the guards _groupGuard = createGroup WEST; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-1.6]; _hqGuard1 setdir 270; [_hqGuard1,"STAND","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard2 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard2 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard2 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-4.7]; _hqGuard2 setdir 270; [_hqGuard2,"STAND_IA","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard3 = _groupGuard createUnit ["B_Soldier_TL_F", _centerPos, [], 0, "FORM"]; +_hqGuard3 = _groupGuard createUnit [Blufor_Teamleader, _centerPos, [], 0, "FORM"]; _hqGuard3 setpos [(_centerPos select 0), (_centerPos select 1)-7.58]; _hqGuard3 setdir 180; [_hqGuard3,"LEAN","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard4 = _groupGuard createUnit ["B_Soldier_LAT_F", _centerPos, [], 0, "FORM"]; +_hqGuard4 = _groupGuard createUnit [Blufor_Rifleman_AT, _centerPos, [], 0, "FORM"]; _hqGuard4 setpos [(_centerPos select 0), (_centerPos select 1)-9]; _hqGuard4 setdir 0; [_hqGuard4,"STAND","FULL"] call BIS_fnc_ambientAnimCombat; // patrolling guard _groupPatrol = createGroup WEST; -_hqGuard5 = _groupPatrol createUnit ["B_Soldier_GL_F", _centerPos, [], 0, "FORM"]; +_hqGuard5 = _groupPatrol createUnit [Blufor_Grenadier, _centerPos, [], 0, "FORM"]; _hqGuard5 setpos [(_centerPos select 0)+10, (_centerPos select 1)+10]; _groupPatrol setCombatMode "YELLOW"; @@ -37,19 +36,19 @@ _wp setWaypointSpeed "LIMITED"; _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)+10], 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; - +_wp setWaypointSpeed "LIMITED"; + _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)-10], 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; +_wp setWaypointSpeed "LIMITED"; _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)-10], 0]; _wp setWaypointType "MOVE"; - + _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)+10], 0]; _wp setWaypointType "CYCLE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; -_hq addAction ["Replace Guards (20CP)", "initHQ\reguard.sqf", [_groupGuard, _groupPatrol, _centerPos, _hq], 0, true, true, "", "_this == player"]; \ No newline at end of file +_hq addAction ["Replace Guards (20CP)", {_this call DUWS_fnc_reguard}, [_groupGuard, _groupPatrol, _centerPos, _hq], 0, true, true, "", "_this == player"]; diff --git a/source/initHQ/guardsFOB.sqf b/source/functions/initHQ/fn_guardsFOB.sqf similarity index 71% rename from source/initHQ/guardsFOB.sqf rename to source/functions/initHQ/fn_guardsFOB.sqf index 5db39aa..e1c66df 100644 --- a/source/initHQ/guardsFOB.sqf +++ b/source/functions/initHQ/fn_guardsFOB.sqf @@ -1,32 +1,32 @@ -_centerPos = _this select 0; -_fob = _this select 1; -_size = 500; +params ["_centerPos","_fob","_size"]; + +if (isnil _size) then {_size = 500}; // Create the guards _groupGuard = createGroup WEST; -_hqGuard1 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard1 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard1 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-1.6]; _hqGuard1 setdir 270; [_hqGuard1,"STAND","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard2 = _groupGuard createUnit ["B_Soldier_F", _centerPos, [], 0, "FORM"]; +_hqGuard2 = _groupGuard createUnit [Blufor_Rifleman, _centerPos, [], 0, "FORM"]; _hqGuard2 setpos [(_centerPos select 0)-6.5, (_centerPos select 1)-4.7]; _hqGuard2 setdir 270; [_hqGuard2,"WATCH","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard3 = _groupGuard createUnit ["B_Soldier_TL_F", _centerPos, [], 0, "FORM"]; +_hqGuard3 = _groupGuard createUnit [Blufor_Teamleader, _centerPos, [], 0, "FORM"]; _hqGuard3 setpos [(_centerPos select 0), (_centerPos select 1)-7.58]; _hqGuard3 setdir 180; [_hqGuard3,"LEAN","FULL"] call BIS_fnc_ambientAnimCombat; -_hqGuard4 = _groupGuard createUnit ["B_Soldier_LAT_F", _centerPos, [], 0, "FORM"]; +_hqGuard4 = _groupGuard createUnit [Blufor_Rifleman_AT, _centerPos, [], 0, "FORM"]; _hqGuard4 setpos [(_centerPos select 0), (_centerPos select 1)-9]; _hqGuard4 setdir 0; [_hqGuard4,"STAND","FULL"] call BIS_fnc_ambientAnimCombat; // patrolling guard _groupPatrol = createGroup WEST; -_hqGuard5 = _groupPatrol createUnit ["B_Soldier_GL_F", _centerPos, [], 0, "FORM"]; +_hqGuard5 = _groupPatrol createUnit [Blufor_Grenadier, _centerPos, [], 0, "FORM"]; _hqGuard5 setpos [(_centerPos select 0)+10, (_centerPos select 1)+10]; _groupPatrol setCombatMode "YELLOW"; @@ -38,12 +38,12 @@ _wp setWaypointSpeed "LIMITED"; _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)+10], 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; +_wp setWaypointSpeed "LIMITED"; _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-10, (_centerPos select 1)-10], 0]; _wp setWaypointType "MOVE"; _wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; +_wp setWaypointSpeed "LIMITED"; _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+10, (_centerPos select 1)-10], 0]; _wp setWaypointType "MOVE"; @@ -53,4 +53,4 @@ _wp setWaypointType "CYCLE"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointSpeed "LIMITED"; -_fob addAction ["Replace Guards (15CP)", "initHQ\reguardFOB.sqf", [_groupGuard, _groupPatrol, _centerPos, _fob], 0, true, true, "", "_this == player"]; \ No newline at end of file +_fob addAction ["Replace Guards (15CP)", {_this call DUWS_fnc_reguardFOB}, [_groupGuard, _groupPatrol, _centerPos, _fob], 0, true, true, "", "_this == player"]; diff --git a/source/functions/initHQ/fn_guardsHQ.sqf b/source/functions/initHQ/fn_guardsHQ.sqf new file mode 100644 index 0000000..83197c1 --- /dev/null +++ b/source/functions/initHQ/fn_guardsHQ.sqf @@ -0,0 +1,34 @@ +params ["_centerPos", "_distance"]; + +// patrolling guard +_groupPatrol = [ [(_centerPos select 0)+_distance, (_centerPos select 1)+_distance], WEST, [Blufor_Rifleman,Blufor_Rifleman,Blufor_AT_Specialist,Blufor_Engineer,Blufor_Medic,Blufor_Recon_Scout,Blufor_AT_Specialist,Blufor_AA_Specialist],[],[],[0.6,0.8,0.7]] call BIS_fnc_spawnGroup; + +_groupPatrol setCombatMode "YELLOW"; +_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+_distance, (_centerPos select 1)+_distance], 0]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "SAFE"; +_wp setWaypointSpeed "LIMITED"; + +_wp = _groupPatrol addWaypoint [[(_centerPos select 0)-_distance, (_centerPos select 1)+_distance], 0]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "SAFE"; +_wp setWaypointSpeed "LIMITED"; + +_wp = _groupPatrol addWaypoint [[(_centerPos select 0)-_distance, (_centerPos select 1)-_distance], 0]; +_wp setWaypointType "MOVE"; +_wp setWaypointBehaviour "SAFE"; +_wp setWaypointSpeed "LIMITED"; + +_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+_distance, (_centerPos select 1)-_distance], 0]; +_wp setWaypointType "MOVE"; + +_wp = _groupPatrol addWaypoint [[(_centerPos select 0)+_distance, (_centerPos select 1)+_distance], 0]; +_wp setWaypointType "CYCLE"; +_wp setWaypointBehaviour "SAFE"; +_wp setWaypointSpeed "LIMITED"; + +// ADD Infinite Ammo eventhandler +{ + _x addEventHandler ["Fired",{(_this select 0) setvehicleammo 1}]; + _x addEventHandler ["HandleDamage", {false}]; +} forEach (units _groupPatrol); diff --git a/source/initHQ/hq_radioloop.sqf b/source/functions/initHQ/fn_hq_radioloop.sqf similarity index 97% rename from source/initHQ/hq_radioloop.sqf rename to source/functions/initHQ/fn_hq_radioloop.sqf index 6a69ab5..cc1369a 100644 --- a/source/initHQ/hq_radioloop.sqf +++ b/source/functions/initHQ/fn_hq_radioloop.sqf @@ -1,4 +1,4 @@ -_object = _this select 0; +params ["_object"]; _music_list = [ "RadioAmbient1", "RadioAmbient2", diff --git a/source/initHQ/locatorhq.sqf b/source/functions/initHQ/fn_locatorhq.sqf similarity index 86% rename from source/initHQ/locatorhq.sqf rename to source/functions/initHQ/fn_locatorhq.sqf index a0b928d..e3cfc8e 100644 --- a/source/initHQ/locatorhq.sqf +++ b/source/functions/initHQ/fn_locatorhq.sqf @@ -6,4 +6,4 @@ while {!_found} do { if (_foundSafePos select 0 != 0 && _foundSafePos select 1 != 0) then {_found=true;}; }; player globalChat format ["foundSafePos: %1", _foundSafePos]; -_handle = [_foundSafePos] execVM "initHQ\bluHQinit.sqf"; \ No newline at end of file +_handle = [_foundSafePos] spawn duws_fnc_BluHQinit; \ No newline at end of file diff --git a/source/initHQ/refortify.sqf b/source/functions/initHQ/fn_refortify.sqf similarity index 63% rename from source/initHQ/refortify.sqf rename to source/functions/initHQ/fn_refortify.sqf index 8ef299a..f14f5ea 100644 --- a/source/initHQ/refortify.sqf +++ b/source/functions/initHQ/fn_refortify.sqf @@ -1,10 +1,12 @@ -_aaPod = (_this select 3) select 0; -_gl1Pod = (_this select 3) select 1; -_atPod1 = (_this select 3) select 2; -_atPod2 = (_this select 3) select 3; -_atPod3 = (_this select 3) select 4; -_centerPos = (_this select 3) select 5; -_hq = (_this select 3) select 6; +params ["_target", "_caller", "_actionId", "_arguments"]; + +_aaPod = _arguments select 0; +_gl1Pod = _arguments select 1; +_atPod1 = _arguments select 2; +_atPod2 = _arguments select 3; +_atPod3 = _arguments select 4; +_centerPos = _arguments select 5; +_hq = _arguments select 6; if (commandpointsblu1>20) then { commandpointsblu1 = commandpointsblu1 - 20; @@ -19,7 +21,7 @@ if (commandpointsblu1>20) then { {deletevehicle _x} foreach crew _atPod3 + [_atPod3]; (_this select 0) removeaction (_this select 2); - 0 = [_centerPos, _hq] execvm "initHQ\fortify.sqf"; + 0 = [_centerPos, _hq] spawn duws_fnc_fortify; } else { hint "Not enough Command Points (20CP required)"; }; \ No newline at end of file diff --git a/source/initHQ/refortifyFOB.sqf b/source/functions/initHQ/fn_refortifyFOB.sqf similarity index 62% rename from source/initHQ/refortifyFOB.sqf rename to source/functions/initHQ/fn_refortifyFOB.sqf index b07001d..9c12f64 100644 --- a/source/initHQ/refortifyFOB.sqf +++ b/source/functions/initHQ/fn_refortifyFOB.sqf @@ -1,10 +1,12 @@ -_aaPod = (_this select 3) select 0; -_gl1Pod = (_this select 3) select 1; -_atPod1 = (_this select 3) select 2; -_atPod2 = (_this select 3) select 3; -_atPod3 = (_this select 3) select 4; -_centerPos = (_this select 3) select 5; -_fob = (_this select 3) select 6; +params ["_target", "_caller", "_actionId", "_arguments"]; + +_aaPod = _arguments select 0; +_gl1Pod = _arguments select 1; +_atPod1 = _arguments select 2; +_atPod2 = _arguments select 3; +_atPod3 = _arguments select 4; +_centerPos = _arguments select 5; +_fob = _arguments select 6; if (commandpointsblu1>15) then { commandpointsblu1 = commandpointsblu1 - 15; @@ -19,7 +21,7 @@ if (commandpointsblu1>15) then { {deletevehicle _x} foreach crew _atPod3 + [_atPod3]; (_this select 0) removeaction (_this select 2); - 0 = [_centerPos, _fob] execvm "initHQ\fortifyFOB2.sqf"; + 0 = [_centerPos, _fob] spawn duws_fnc_fortifyFOB2; } else { hint "Not enough Command Points (15CP required)"; }; \ No newline at end of file diff --git a/source/initHQ/reguard.sqf b/source/functions/initHQ/fn_reguard.sqf similarity index 60% rename from source/initHQ/reguard.sqf rename to source/functions/initHQ/fn_reguard.sqf index 5fe3205..f34b54c 100644 --- a/source/initHQ/reguard.sqf +++ b/source/functions/initHQ/fn_reguard.sqf @@ -1,7 +1,9 @@ -_groupGuard = (_this select 3) select 0; -_groupPatrol = (_this select 3) select 1; -_centerPos = (_this select 3) select 2; -_hq = (_this select 3) select 3; +params ["_object","_caller","_actionId", "_arguments"]; + +_groupGuard = _arguments select 0; +_groupPatrol = _arguments select 1; +_centerPos = _arguments select 2; +_hq = _arguments select 3; if (commandpointsblu1>20) then { commandpointsblu1 = commandpointsblu1 - 20; @@ -13,7 +15,7 @@ if (commandpointsblu1>20) then { {deletevehicle _x} foreach units _groupPatrol; (_this select 0) removeaction (_this select 2); - 0 = [_centerPos, _hq] execvm "initHQ\guards.sqf"; + 0 = [_centerPos, _hq] call duws_fnc_guards; } else { hint "Not enough Command Points (20CP required)"; }; \ No newline at end of file diff --git a/source/initHQ/reguardFOB.sqf b/source/functions/initHQ/fn_reguardFOB.sqf similarity index 60% rename from source/initHQ/reguardFOB.sqf rename to source/functions/initHQ/fn_reguardFOB.sqf index 115653c..e2d18cd 100644 --- a/source/initHQ/reguardFOB.sqf +++ b/source/functions/initHQ/fn_reguardFOB.sqf @@ -1,7 +1,9 @@ -_groupGuard = (_this select 3) select 0; -_groupPatrol = (_this select 3) select 1; -_centerPos = (_this select 3) select 2; -_fob = (_this select 3) select 3; +params ["_object","_caller","_actionId", "_arguments"]; + +_groupGuard = _arguments select 0; +_groupPatrol = _arguments select 1; +_centerPos = _arguments select 2; +_fob = _arguments select 3; if (commandpointsblu1>15) then { commandpointsblu1 = commandpointsblu1 - 15; @@ -13,7 +15,7 @@ if (commandpointsblu1>15) then { {deletevehicle _x} foreach units _groupPatrol; (_this select 0) removeaction (_this select 2); - _handle = [_centerPos, _fob] execVM "initHQ\guardsFOB.sqf"; + [_centerPos, _fob] call duws_fnc_guardsFOB; } else { hint "Not enough Command Points (15CP required)"; }; \ No newline at end of file diff --git a/source/initHQ/teleport.sqf b/source/functions/initHQ/fn_teleport.sqf similarity index 65% rename from source/initHQ/teleport.sqf rename to source/functions/initHQ/fn_teleport.sqf index fcb25dd..c291cef 100644 --- a/source/initHQ/teleport.sqf +++ b/source/functions/initHQ/fn_teleport.sqf @@ -1,4 +1,4 @@ -_fobpos = _this select 0; +params ["_fobpos"]; player setpos _fobpos; hint format["%1",_fobpos]; \ No newline at end of file diff --git a/source/functions/initMission/fn_clientInit.sqf b/source/functions/initMission/fn_clientInit.sqf new file mode 100644 index 0000000..8372d5d --- /dev/null +++ b/source/functions/initMission/fn_clientInit.sqf @@ -0,0 +1,262 @@ +diag_log format ["------------------ DUWS-R START ----v0------ player: %1", profileName]; + + +if (isDedicated) exitWith {}; +waitUntil {!isNull player}; + +player allowDamage false; + +[] call duws_fnc_persistent_stats_init; + + +#include "..\..\includes\supports_init.hpp" +#include "..\..\includes\squad_number_init.hpp" + +if (hasInterface) then {[] spawn duws_fnc_gps_marker;}; +if (!isMultiplayer) then { + getsize_script = [player] spawn duws_fnc_mapsize; +}; +staminaEnabled = ["Stamina", false] call BIS_fnc_getParamValue; +if(staminaEnabled == 0) then { + staminaEnabled = false; +} else { + staminaEnabled = true; +}; +// IF MP +if (isMultiplayer) then { + + // Get the variables from the parameters lobby + _revive_activated = ["Revive", 1] call BIS_fnc_getParamValue; + DUWSMP_CP_death_cost = ["DeathPenalty", 1] call BIS_fnc_getParamValue; + //staminaEnabled = ["Stamina", 0] call BIS_fnc_getParamValue; + + /*if(staminaEnabled == 0) then { + staminaEnabled = false; + } else { + staminaEnabled = true; + };*/ + + if (support_armory_available) then { + hq_blu1 addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; + { + _x addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; + } forEach (Array_of_FOBS); + }; + + PlayerKilledEH = player addEventHandler ["killed", { + commandpointsblu1 = commandpointsblu1 - DUWSMP_CP_death_cost; + publicVariable "commandpointsblu1"; + }]; + + PlayerBetrayerEH = player addEventHandler ["HandleRating", { + // If playerRating is negative (traitor) then reset to zero + _playerRating = rating (_this select 0); + if (_playerRating < 0) then { + player addRating (0 - _playerRating); + }; + // If final rating is positive, do not modify, else zero. + _rating = _this select 1; + [0,_rating] select ((_playerRating - _rating) > 0); + }]; + + "support_specialized_training_available" addPublicVariableEventHandler {lbSetColor [2103, 11, [0, 1, 0, 1]];}; + "support_armory_available" addPublicVariableEventHandler { + hq_blu1 addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; + { + _x addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; + } forEach (Array_of_FOBS); + lbSetColor [2103, 5, [0, 1, 0, 1]]; + }; + + // change the shown CP for request dialog + "commandpointsblu1" addPublicVariableEventHandler {ctrlSetText [1000, format["%1",commandpointsblu1]]; }; + + // each time there is a new FOB + "Array_of_FOBS" addPublicVariableEventHandler { + if (!fobSwitch) then { + [] spawn duws_fnc_FOBreceiveaction; + }; + fobSwitch = false; + //Add the FoB to the list of revive locations. + _fobAmount = count Array_of_FOBS; + _fobIndex = _fobAmount - 1; + _createdFOB = Array_of_FOBS select _fobIndex; + + [missionNamespace, _createdFOB] call BIS_fnc_addRespawnPosition; + }; + + if (!isServer) then { + "savegameNumber" addPublicVariableEventHandler {[] spawn duws_fnc_savegameClient}; + }; + if (!isServer) then { + "capturedZonesNumber" addPublicVariableEventHandler {[] call duws_fnc_persistent_stats_zones_add;}; // change the shown CP for request dialog + }; + if (!isServer) then { + "finishedMissionsNumber" addPublicVariableEventHandler {[] call duws_fnc_persistent_stats_missions_total;}; // change the shown CP for request dialog + }; + + player globalChat format ["gamemaster: %1", game_master]; + player globalChat format ["HQ_pos_found_generated: %1", HQ_pos_found_generated]; + + if (!isDedicated && !HQ_pos_found_generated) then { // SERVER INIT + if (((vehiclevarname player) in game_master)) then { + DUWS_host_start = false; + publicVariable "DUWS_host_start"; + waitUntil {time > 0.1}; + getsize_script = [player] spawn duws_fnc_mapsize; + DUWS_host_start = true; + publicVariable "DUWS_host_start"; + + // init High Command + [] call duws_fnc_hc_init; + waitUntil {scriptDone getsize_script}; + }; + }; +}; + +if (!isDedicated && !HQ_pos_found_generated) then { + if (((vehiclevarname player) in game_master)) then { + [] spawn duws_fnc_placement; + waitUntil {chosen_hq_placement}; + player globalChat format ["hq_manually_placed: %1", hq_manually_placed]; + player globalChat format ["player_is_choosing_hqpos: %1", player_is_choosing_hqpos]; + // create random HQ + if (!hq_manually_placed && !player_is_choosing_hqpos) then { + player globalChat "lance recherche position..."; + hq_create = [20, 0.015] spawn duws_fnc_locatorhq; + waitUntil {scriptDone hq_create}; + }; + }; +}; + +/* +//////// DEBUG LOOP ///////////// +[] spawn { + while {true} do { + hintsilent format["OvercastVar: %1\nFogVar: %2",OvercastVar,FogVar]; + sleep 1; + }; +}; +//////// DEBUG LOOP ///////////// +*/ + +// AMBIANCE LOOP +//_nul = [] execVM "musicloop.sqf"; + +if (hasInterface) then { + // WHEN CLIENT CONNECTS INIT (might need sleep) + waitUntil {isPlayer Player}; + hintsilent "Waiting for the host to find an HQ..."; + waitUntil {HQ_pos_found_generated && time > 0.1}; + player setpos [(getpos hq_blu1 select 0),(getpos hq_blu1 select 1)+10]; + _drawicon = [] spawn duws_fnc_drawIcon; + hintsilent "Waiting for the host to select the campaign parameters..."; + waitUntil {chosen_settings}; + [hq_blu1] call duws_fnc_HQaddactions; + sleep 1; + player setdamage 0; + player allowDamage true; + hintsilent format["Joined game, welcome to %1, %2",worldName,profileName]; + + // init High Command + [] call duws_fnc_hc_init; + [] spawn duws_fnc_weather_client; + + // process purchasable units + [] call duws_fnc_processUnitConfig; + [] call duws_fnc_processVehicleConfig; + [] call duws_fnc_processGroupConfig; + + if(!staminaEnabled) then { + player enableStamina false; + }; +}; + +if (!isMultiplayer) then { + [] call duws_fnc_hc_init; +}; + +// Create help for DUWS +_index = player createDiarySubject ["help","DUWS-R Manual"]; +player createDiaryRecord ["help", ["Feedback/bug report", "Internal team members: Use the ""issues"" section to report items."]]; +player createDiaryRecord ["help", ["Export to another island", "How to export to another island:
You just need to take the .pbo file and rename it with the name of the island you want to export the mission to. You don't have anything else to do

Example:
SP_DUWS-R.stratis.pbo >>> SP_DUWS-R.chernarus.pbo"]]; +player createDiaryRecord ["help", ["Credits", "Many thanks goes out to everyone that worked on the original DUWS by kibot!"]]; +player createDiaryRecord ["help", ["Command Points (CP)", "Command points are used to purchase vehicles, units and ask for support (like artillery or save the game outside the base). To obtain Command points, you must capture the enemy controlled zones (red zones on the map) or execute side missions. You also receive 3 command points for each zone you have under your control every 30 minutes."]]; +player createDiaryRecord ["help", ["Army Power (AP)", "Army power represent the strenght of the BLUFOR forces present on the island. By capturing enemy positions and accomplishing side missions, you will add Army Power to your army. The attack waves of the BLUFOR army will become stronger."]]; +player createDiaryRecord ["help", ["Experience", "By accomplishing side missions, capturing zones and islands, you will increase your experience. With experience, you will automatically unlock new abilties. Once you have an ability, a description of this ability will be available in the 'ability' tab in the briefing.
Capturing an island gives you 5 XP
Achieving a side mission: 2 XP
Capturing a zone: 1 XP"]]; +player createDiaryRecord ["help", ["Saving the game", "You can save the game by resting at the base. Just go near the officer and select the action ""Rest"". Note that 6 hours will ellapse during that time. You can also save at any time by giving a SITREP in the support menu (0-8-1). Giving a SITREP does not make you wait, but it will cost you 1 CP for each save."]]; +player createDiaryRecord ["help", ["Repairing/Rearming", "To repair, refuel or rearm a vehicle you need to unlock the ""vehicle refit"" support. Once you have it, you can call the support and your vehicle will be rearmed, repaired and refueled. Note that you must be close to the base to be able to use the vehicle refit."]]; +player createDiaryRecord ["help", ["Support", "During the campaign you may unlock several support options at you HQ. You can access the available support in the radio menu (0-8). Note that calling for support cost CP."]]; +player createDiaryRecord ["help", ["Making a FOB", "After you have captured your first zone, you'll get the ability to establish a FOB for 10 CP. A FOB allows you to rest(save) at remote locations outside the base. Establishing a FOB will also spawn some BLUFOR patrols around it and if there are enemies around it, you will be notified. To establish a FOB, you must make sure the zone around you is clear in a radius of 500 meters. Just go to the support menu and select 'Establish FOB'. A FOB will be deployed to your location."]]; +player createDiaryRecord ["help", ["Side Missions", "You can request a side mission at the officer in the base. Successful side missions will not give any army power to the enemy, but will give you CP and increase your army power."]]; +player createDiaryRecord ["help", ["Requesting units", "To request units, go to the officer at the base and select the action ""Request units""."]]; +player createDiaryRecord ["help", ["Taking the Island", "At the beginning of the game, you are alone with your officer and only a few command points available, but as the war escalates, the BLUFOR HQ will start to launch attacks on enemy zone and will try to retake the island. You can help the main forces by assisting them in capturing the island, or you can also achieve side missions to boost the available assets of your army. It's up to you on how you want to play this campaign."]]; + +// Operatives +_index = player createDiarySubject ["operativehelp","Special operatives"]; +player createDiaryRecord ["operativehelp", ["Skills", "Aiming:
Pretty self explanatory, how well the operative can aim, lead a target, compensante for bullet drop and manage recoil.

Reflexes:
How fast the operator can react to a new threat and stabilize its aim.

Spotting:
The operative ability to spot targets within it's visual or audible range, and how accurately he can spot targets.

Courage:
Affects the morale of subordinates units of the operative, how likely they will flee, depending on what is in front of them and the squad status.

Communications:
How quickly recognized targets are shared with the squad.

Reload speed:
The operator's ability to switch weapon or reload quickly."]]; +player createDiaryRecord ["operativehelp", ["Recruiting operatives", "Operatives can be recruited at the HQ, inside the ""request unit"" menu. When you recruit someone for the first time, you'll have to spend 5 CP. However, once an operative has been already recruited, has been ""injured""(killed) in battle, you can recruit it again for only 2 CP after a delay between 20 and 80 minutes."]]; +player createDiaryRecord ["operativehelp", ["Overview", "You can recruit special operatives that will stay and progress with you for all the duration of the campaign. Some of these mens have special equipment, specialities and skills. Their skills will increase each time a zone is captured or a mission is accomplished, whether they're in your squad or not. However, when an operative is actually in the game, he will gain 10 spendable points wich can be assigned freely in any skill at the operative menu."]]; + +// MP notes +if (isMultiplayer) then { + player createDiaryRecord ["help", ["MP notes", "The CP pool is common for everyone.

While most support unlocks are indivdual, the Armory and the Specialized infantry training are common, and need to be unlocked only once by a single player.

While everybody can rest to heal, only the host can save and skip the time.

Only the host can request side mission and finish them. However, everyone receive the persistent stats and xp bonuses."]]; +}; + +// MP notification +if (isMultiplayer) then { + [] spawn { + waitUntil {time > 5}; + ["info",["MP Mechanics","Check the manual for the specifics of the DUWS-R in MP"]] call bis_fnc_showNotification; + }; +}; + +// Generate main task +capture_island_obj = player createSimpleTask ["taskIsland"]; +capture_island_obj setSimpleTaskDescription ["The ennemy is controlling the island, we must take it back! Capture every zone under enemy control and the mission will succeed.
You can let your BLUFOR forces take the island by themselves and help them getting a bigger army by accomplishing side missions. Or you can capture the zones yourself and do all the big work. As the campaign progress, the war will escalate and the armies will get stronger and start to use bigger guns.
To capture a zone, you need to have more units inside the zone than the enemy.

It's up to you on how you want to play this.
Good luck, soldier!","Take the island",""]; + +if (mission_DUWS_firstlaunch) then { + waitUntil {chosen_settings}; + sleep 8; + ["info",["Buying troops","Go talk to your commander to buy troops and vehicles with CP"]] call bis_fnc_showNotification; + sleep 2.5; + ["info",["Command points","Acquire more CP by capturing enemy areas or accomplishing side missions"]] call bis_fnc_showNotification; + + sleep 15; + ["info",["RESTING AND HEALING","Save the game and heal by resting at the base"]] call bis_fnc_showNotification; + + sleep 15; + // SITREP + ["sitrepinfo",["SITREP","You can also save the game by giving a SITREP"]] call bis_fnc_showNotification; + + sleep 20; + ["info",["DUWS Manual","Check the manual in the briefing for more info"]] call bis_fnc_showNotification; + + profileNamespace setVariable ["profile_DUWS_firstlaunch", false]; + saveProfileNamespace; +}; + +//Cleanup unused players. +for[{_x = 2},{_x <= 20},{_x = _x + 1}] do { + _thePlayer = missionNamespace getVariable format["player%1", _x]; + if(!isNil("_thePlayer")) then { + if(!isPlayer _thePlayer) then { + deleteVehicle _thePlayer; + }; + }; +}; + + +_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem; + +//Loading player position and gear. +//TODO: Add bought supports. +/* +if(isServer) then +{ + execVM "persistent\missionSpecific\saveFuncs.sqf"; + waitUntil {!isNil "saveFuncsLoaded"}; + + execVM "persistent\missionSpecific\loadAccount.sqf"; +}; +*/ diff --git a/source/functions/initMission/fn_processGroupConfig.sqf b/source/functions/initMission/fn_processGroupConfig.sqf new file mode 100644 index 0000000..7345e29 --- /dev/null +++ b/source/functions/initMission/fn_processGroupConfig.sqf @@ -0,0 +1,30 @@ +private _request_group_cases_string = ""; +private _skillSF = [0.9,1]; +private _skill = blufor_ai_skill; + +{ + _cfgGroup = _x select 1; + _cost = _x select 0; + _indexNumber = blufor_cfgGroup_array find _x; + _request_group_cases_string = _request_group_cases_string + format [' + case %1: { + if (commandpointsblu1 >= %2) then { + commandpointsblu1 = commandpointsblu1 - %2; + ctrlSetText [1000, str commandpointsblu1]; + _group = group player ; + _group = [_spawnPos, WEST, %3, [], [], %4] call BIS_fnc_spawnGroup; + player hcsetgroup [_group,""]; + hint "Squad ready !\nAccess it with [L.CTRL - SPACE]"; + } else { + hint "Not enough command points"; + }; + }; + ', + _indexNumber, + _cost, + [[[_cfgGroup], ""] call BIS_fnc_configPath, "", true] call BIS_fnc_configPath, + if (!isnil "_skillBoolean" && {_skillBoolean}) then {_skillSF} else {_skill}]; +} +forEach blufor_cfgGroup_array; + +requestGroupCases = compileFinal _request_group_cases_string; \ No newline at end of file diff --git a/source/functions/initMission/fn_processUnitConfig.sqf b/source/functions/initMission/fn_processUnitConfig.sqf new file mode 100644 index 0000000..b249162 --- /dev/null +++ b/source/functions/initMission/fn_processUnitConfig.sqf @@ -0,0 +1,26 @@ +private _request_unit_cases_string = ""; +private _skillSF = (blufor_ai_skill select 0) + 0.5; +private _skill = (blufor_ai_skill select 0) + 0.2; + +{ + _unit = _x select 0; + _cost = _x select 1; + _skillBoolean = _x select 2; + _indexNumber = blufor_unit_array find _x; + _request_unit_cases_string = _request_unit_cases_string + format [' + case %1: { + if (commandpointsblu1 >= %2) then { + hint "Unit ready !"; + commandpointsblu1 = commandpointsblu1 - %2; + ctrlSetText [1000, str commandpointsblu1]; + _group = group player ; + "%3" createUnit [_spawnpos, _group, "", %4, "private"] ; + } else { + hint "Not enough command points"; + }; + }; + ',_indexNumber, _cost, _unit, if (!isnil "_skillBoolean" && {_skillBoolean}) then {_skillSF} else {_skill}]; +} +forEach blufor_unit_array; + +requestUnitCases = compileFinal _request_unit_cases_string; \ No newline at end of file diff --git a/source/functions/initMission/fn_processVehicleConfig.sqf b/source/functions/initMission/fn_processVehicleConfig.sqf new file mode 100644 index 0000000..684bee5 --- /dev/null +++ b/source/functions/initMission/fn_processVehicleConfig.sqf @@ -0,0 +1,16 @@ +//Dynamically creates cases for duws_fnc_request + +private _request_vehicle_cases_string = ""; + +{ + _vehicle = _x select 0; + _cost = _x select 1; + _indexNumber = blufor_vehicle_array find _x; + _request_vehicle_cases_string = _request_vehicle_cases_string + format [' + case %1: { + [%2,"%3"] call duws_fnc_spawnVehicle; + }; + ',_indexNumber, _vehicle, _cost]; +} foreach blufor_vehicle_array; + +requestVehicleCases = compileFinal _request_vehicle_cases_string; \ No newline at end of file diff --git a/source/serverinit.sqf b/source/functions/initMission/fn_serverInit.sqf similarity index 75% rename from source/serverinit.sqf rename to source/functions/initMission/fn_serverInit.sqf index 37677a2..58351fa 100644 --- a/source/serverinit.sqf +++ b/source/functions/initMission/fn_serverInit.sqf @@ -1,237 +1,227 @@ -if (!isServer) exitWith {}; - - -////////////////////////////////////////////////////// -// HOW TO MANUALLY CREATE THE MISSION: -// 1)YOU MUST PLACE THE HQ LOCATION -// 2)DEFINE THE CAPTURABLE ZONES -// -- YOU CAN ALSO JUST PUT A HQ SOMEWHERE AND LET THE ZONES BEING RANDOMLY GENERATED -// -- YOU MUST PLACE MANUALLY THE HQ IF YOU ARE ALREADY PLACING THE ZONES BY HAND -// 3) DONT FORGET TO DEFINE THE VARIABLES BELOW. If you are ONLY placing the HQ by hand, you just need to put "hq_manually_placed" to -// "true" instead of "false". If you are also placing the zones by hand, make "zones_manually_placed" to "true". -///////////////////////////////////////////////////////////// -// 1) In the gamelogic, for the HQ( !! MAKE ONLY ONE HQ !!): _null=[getpos this] execVM "initHQ\BluHQinit.sqf" -// -// 2) In the init of gamelogic, to create a capturable enemy zone: -// _null = ["zone name",pts awarded upon capture, zone radius,getpos this,false/true,false/true] execvm "createzone.sqf"; -// "zone name": name of the zone -// pts awarded upon capture: points you earn when you capture the zone. Also the amount of points of army power you take and receive -// from the enemy after capture -// zone radius: how large the zone is -// getpos this: It's the position of the zone. The gamelogic actually. You don't have to modify this. -// false/true: if the zone is fortified or not. If the zone is fortified, there will be a bit more enemies and they will be maning -// static defences if there are any -// false/true: if the zone is selecting randomly a prefab base. Prefab is selected according to the zone radius. The bigger the zone, -// the bigger the prefab asset will be chosen. -// -// EXAMPLE, in the init of a gamelogic you have placed on the map: -// _null=["OP Xander",20,200,getpos this,true,false] execvm "initZones\createzone.sqf" -// -// 3) Define these variables: - -// choose between "tropical" - "arid" - "temperate" - "temperate_cold" - "mediterranean" -if (isNil "weather_type") then {weather_type = "tropical";};publicVariable "weather_type"; -// set the skill range of ennemy AI -if (isNil "opfor_ai_skill") then {opfor_ai_skill = [0.1,0.3];};publicVariable "opfor_ai_skill"; -// set the skill range of friendly AI, from 0 to 1 (0 being completely dumb) -if (isNil "blufor_ai_skill") then {blufor_ai_skill = [0.4,0.7];};publicVariable "blufor_ai_skill"; - -// you must specify if you have manually placed HQ or not. false = HQ is randomly placed, true = you have manually placed the HQ -hq_manually_placed = false;publicVariable "hq_manually_placed"; -// you must specify if you have manually placed the zones or not. false = zones are randomly generated, true = you have manually placed the zones -zones_manually_placed = false;publicVariable "zones_manually_placed"; -zones_max_dist_from_hq = 7500;publicVariable "zones_max_dist_from_hq"; -dynamic_weather_enable = true;publicVariable "dynamic_weather_enable"; -manually_chosen = false;publicVariable "manually_chosen"; - -if (isNil "enable_fast_travel") then { enable_fast_travel = true; };publicVariable "enable_fast_travel"; -// chopper taxi (support) will fast travel (teleport) or not -if (isNil "enableChopperFastTravel") then { enableChopperFastTravel = true; };publicVariable "enableChopperFastTravel"; -// Starting CP -if (isNil "commandpointsblu1") then { commandpointsblu1 = 20; };publicVariable "commandpointsblu1"; -// STARTING ARMY POWER -if (isNil "blufor_ap") then {blufor_ap = 0;};publicVariable "blufor_ap"; -opfor_ap = 0; - - -/////////////////////////////////////////////////////// -// initialise variables -////////////////////////////////////////////////////// -// MOST OF THE VALUES ARE BEING OVERWRITTEN BY PLAYER INPUT AT THE BEGINNING -////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////// -debugmode = false; // Debug mode, kind of obsolete -/// ------------- VALUES UNDER THIS ARE OVERWRITTEN -zones_number = 9; // Number of capturables zones to create (when zones are created randomly) -zones_spacing = 1200; // minimum space between 2 zones (in meters) // SOON OBSOLETE -zones_max_radius = 1000; // Determine the maximum radius a generated zone can have -zones_min_radius = 200; // Determine the minium radius a generated zone can have. SHOULD NOT BE UNDER 200. - -/////////////////////////////////////////////////////// -// This mission will have a harder time generating stuff if a lot of the terrain of the island is sloped, meaning that valid locations -// will be harder/take longer to find (side missions, mission init). -// Keep that in mind when tweaking the zones amount/radius value. -///////////////////////////////////////////////////////// -// preprocess the qrf file for the EH -QRF_test = compile preprocessFile "WARCOM\WARCOM_opf_qrf.sqf"; - - -// nber of missions succes(!!dont touch!!) -missions_success = 0;publicVariable "missions_success"; - -zones_created = false;publicVariable "zones_created"; -blu_hq_created = false;publicVariable "blu_hq_created"; -can_get_mission = true;publicVariable "can_get_mission"; -failsafe_zones_not_found = false;publicVariable "failsafe_zones_not_found"; -createcenter sideLogic; -LogicGroup = createGroup SideLogic;publicVariable "LogicGroup"; -locator_hq_actived = false;publicVariable "locator_hq_actived"; -op_zones_index = 0;publicVariable "op_zones_index"; -clientisSync = false;publicVariable "clientisSync"; -fobSwitch = false;publicVariable "fobSwitch"; -player_is_choosing_hqpos = false;publicVariable "player_is_choosing_hqpos"; - -if (isNil "amount_zones_created") then { - amount_zones_created = 0; -}; - -publicVariable "amount_zones_created"; - -if (isNil "HQ_pos_found_generated") then { - HQ_pos_found_generated = false; -}; - -publicVariable "HQ_pos_found_generated"; - -if (isNil "chosen_settings") then { - chosen_settings = false; -}; - -publicVariable "chosen_settings"; - -if (isNil "chosen_hq_placement") then { - chosen_hq_placement = false; -}; - -publicVariable "chosen_hq_placement"; - -if (isNil "zoneundercontrolblu") then { - zoneundercontrolblu = 0; -}; - -publicVariable "zoneundercontrolblu"; - -if (isNil "amount_zones_captured") then { - amount_zones_captured = 0; -}; - -publicVariable "amount_zones_captured"; - -if (isNil "savegameNumber") then { - savegameNumber = 0; -}; - -publicVariable "savegameNumber"; - -if (isNil "capturedZonesNumber") then { - capturedZonesNumber = 0; -}; - -publicVariable "capturedZonesNumber"; - -if (isNil "finishedMissionsNumber") then { - finishedMissionsNumber = 0; -}; - -publicVariable "finishedMissionsNumber"; - -if (isNil "OvercastVar") then { - OvercastVar = 0; -}; - -publicVariable "OvercastVar"; - -if (isNil "FogVar") then { - FogVar = 0; -}; - -publicVariable "FogVar"; - -if (isNil "createzone_server") then { - createzone_server = false; -}; - -publicVariable "createzone_server"; - -if (isNil "mission_number_of_zones_captured") then { - mission_number_of_zones_captured = 0; -}; - -publicVariable "mission_number_of_zones_captured"; - -// this is a special one (if/else) -if (isNil "Array_of_FOBS") then { - // if the player is sp or server or no fobs have been created - Array_of_FOBS = []; -} -else /// JIP for the client -{ - { - [_x] execVM "support\FOBactions.sqf"; - } forEach Array_of_FOBS; -}; - -if (isNil "Array_of_FOBname") then { - Array_of_FOBname = []; -}; - -publicVariable "Array_of_FOBS"; -publicVariable "Array_of_FOBname"; - -game_master = ["player1"];publicVariable "game_master"; - - waitUntil {chosen_settings && createzone_server}; - - if (!manually_chosen) then { - if (!zones_created) then { // CHECK IF ZONES ARE PLACED, IF NOT EXECUTE locatorZonesV1.sqf - _zones_create = [50, 0.2] execVM "initZones\locatorZonesV1.sqf"; // CHECK IF ZONES HAVE ALREADY BEEN PLACED - }; - } else { - if (!zones_created) then { // CHECK IF ZONES ARE PLACED, IF NOT EXECUTE locatorZonesV1.sqf - _zones_create = {[50,0.2] execVM "initZones\locatorZonesV2.sqf"} remoteExec ["bis_fnc_spawn", game_master select 0]; // CHECK IF ZONES HAVE ALREADY BEEN PLACED - }; - }; - -//FIX ME: Execution Order requires zone bonus and reward be before WARCOM INIT - if (isServer) then { - // initialise the ressources per zone bonus - _basepoint = [] execVM "zonesundercontrol.sqf"; - }; - - // init the bonuses you get when capturing zones - _basepoint = [] execVM "zones_bonus.sqf"; - -waitUntil { !isNil "serv_zones_array" }; -diag_log format ["serv_zones_array: %1", serv_zones_array]; -_warcom_init = [serv_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] execVM "WARCOM\WARCOM_init.sqf"; // 2700 is 40 mins -waitUntil {scriptDone _warcom_init}; - -if (isServer) then { - // group cleaning script - 0 = [ - 60*60, // seconds to delete dead bodies (0 means don't delete) - 60*60, // seconds to delete dead vehicles (0 means don't delete) - 60*60, // seconds to delete dropped weapons (0 means don't delete) - 0, // seconds to deleted planted explosives (0 means don't delete) - 60*60 // seconds to delete dropped smokes/chemlights (0 means don't delete) - ] execVM 'repetitive_cleanup.sqf'; -}; - - - -if (zones_manually_placed) then { - waitUntil {!isNil ("Array_of_OPFOR_zones")}; - sleep 1; - _warcom_init = [Array_of_OPFOR_zones, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 1500] execVM "WARCOM\WARCOM_init.sqf"; -}; +if (!isServer) exitWith {}; + + +////////////////////////////////////////////////////// +// HOW TO MANUALLY CREATE THE MISSION: +// 1)YOU MUST PLACE THE HQ LOCATION +// 2)DEFINE THE CAPTURABLE ZONES +// -- YOU CAN ALSO JUST PUT A HQ SOMEWHERE AND LET THE ZONES BEING RANDOMLY GENERATED +// -- YOU MUST PLACE MANUALLY THE HQ IF YOU ARE ALREADY PLACING THE ZONES BY HAND +// 3) DONT FORGET TO DEFINE THE VARIABLES BELOW. If you are ONLY placing the HQ by hand, you just need to put "hq_manually_placed" to +// "true" instead of "false". If you are also placing the zones by hand, make "zones_manually_placed" to "true". +///////////////////////////////////////////////////////////// +// 1) In the gamelogic, for the HQ( !! MAKE ONLY ONE HQ !!): _null=[getpos this] execVM "initHQ\BluHQinit.sqf" +// +// 2) In the init of gamelogic, to create a capturable enemy zone: +// _null = ["zone name",pts awarded upon capture, zone radius,getpos this,false/true,false/true] execvm "createzone.sqf"; +// "zone name": name of the zone +// pts awarded upon capture: points you earn when you capture the zone. Also the amount of points of army power you take and receive +// from the enemy after capture +// zone radius: how large the zone is +// getpos this: It's the position of the zone. The gamelogic actually. You don't have to modify this. +// false/true: if the zone is fortified or not. If the zone is fortified, there will be a bit more enemies and they will be maning +// static defences if there are any +// false/true: if the zone is selecting randomly a prefab base. Prefab is selected according to the zone radius. The bigger the zone, +// the bigger the prefab asset will be chosen. +// +// EXAMPLE, in the init of a gamelogic you have placed on the map: +// _null=["OP Xander",20,200,getpos this,true,false] execvm "initZones\createzone.sqf" +// +// Note, this has been moved to the functions library! +// use '_null=["OP Xander",20,200,getpos this,true,false] spawn duws_fnc_createzone' instead! +// +// 3) Define these variables: + +// choose between "tropical" - "arid" - "temperate" - "temperate_cold" - "mediterranean" +if (isNil "weather_type") then {weather_type = "tropical";};publicVariable "weather_type"; +// set the skill range of ennemy AI +if (isNil "opfor_ai_skill") then {opfor_ai_skill = [0.1,0.3];};publicVariable "opfor_ai_skill"; +// set the skill range of friendly AI, from 0 to 1 (0 being completely dumb) +if (isNil "blufor_ai_skill") then {blufor_ai_skill = [0.4,0.7];};publicVariable "blufor_ai_skill"; + +// you must specify if you have manually placed HQ or not. false = HQ is randomly placed, true = you have manually placed the HQ +hq_manually_placed = false;publicVariable "hq_manually_placed"; +// you must specify if you have manually placed the zones or not. false = zones are randomly generated, true = you have manually placed the zones +zones_manually_placed = false;publicVariable "zones_manually_placed"; +zones_max_dist_from_hq = 7500;publicVariable "zones_max_dist_from_hq"; +dynamic_weather_enable = true;publicVariable "dynamic_weather_enable"; +manually_chosen = false;publicVariable "manually_chosen"; + +if (isNil "enable_fast_travel") then { enable_fast_travel = true; };publicVariable "enable_fast_travel"; +// chopper taxi (support) will fast travel (teleport) or not +if (isNil "enableChopperFastTravel") then { enableChopperFastTravel = true; };publicVariable "enableChopperFastTravel"; +// Starting CP +if (isNil "commandpointsblu1") then { commandpointsblu1 = 20; };publicVariable "commandpointsblu1"; +// STARTING ARMY POWER +if (isNil "blufor_ap") then {blufor_ap = 0;};publicVariable "blufor_ap"; +opfor_ap = 0; + + +/////////////////////////////////////////////////////// +// initialise variables +////////////////////////////////////////////////////// +// MOST OF THE VALUES ARE BEING OVERWRITTEN BY PLAYER INPUT AT THE BEGINNING +////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////// +debugmode = false; // Debug mode, kind of obsolete +/// ------------- VALUES UNDER THIS ARE OVERWRITTEN +zones_number = 9; // Number of capturables zones to create (when zones are created randomly) +zones_spacing = 1200; // minimum space between 2 zones (in meters) // SOON OBSOLETE +zones_max_radius = 1000; // Determine the maximum radius a generated zone can have +zones_min_radius = 200; // Determine the minium radius a generated zone can have. SHOULD NOT BE UNDER 200. + +/////////////////////////////////////////////////////// +// This mission will have a harder time generating stuff if a lot of the terrain of the island is sloped, meaning that valid locations +// will be harder/take longer to find (side missions, mission init). +// Keep that in mind when tweaking the zones amount/radius value. +///////////////////////////////////////////////////////// + + +// nber of missions succes(!!dont touch!!) +missions_success = 0;publicVariable "missions_success"; + +zones_created = false;publicVariable "zones_created"; +blu_hq_created = false;publicVariable "blu_hq_created"; +can_get_mission = true;publicVariable "can_get_mission"; +failsafe_zones_not_found = false;publicVariable "failsafe_zones_not_found"; +createcenter sideLogic; +LogicGroup = createGroup SideLogic;publicVariable "LogicGroup"; +locator_hq_actived = false;publicVariable "locator_hq_actived"; +op_zones_index = 0;publicVariable "op_zones_index"; +clientisSync = false;publicVariable "clientisSync"; +fobSwitch = false;publicVariable "fobSwitch"; +player_is_choosing_hqpos = false;publicVariable "player_is_choosing_hqpos"; + +if (isNil "amount_zones_created") then { + amount_zones_created = 0; +}; + +publicVariable "amount_zones_created"; + +if (isNil "HQ_pos_found_generated") then { + HQ_pos_found_generated = false; +}; + +publicVariable "HQ_pos_found_generated"; + +if (isNil "chosen_settings") then { + chosen_settings = false; +}; + +publicVariable "chosen_settings"; + +if (isNil "chosen_hq_placement") then { + chosen_hq_placement = false; +}; + +publicVariable "chosen_hq_placement"; + +if (isNil "zoneundercontrolblu") then { + zoneundercontrolblu = 0; +}; + +publicVariable "zoneundercontrolblu"; + +if (isNil "amount_zones_captured") then { + amount_zones_captured = 0; +}; + +publicVariable "amount_zones_captured"; + +if (isNil "savegameNumber") then { + savegameNumber = 0; +}; + +publicVariable "savegameNumber"; + +if (isNil "capturedZonesNumber") then { + capturedZonesNumber = 0; +}; + +publicVariable "capturedZonesNumber"; + +if (isNil "finishedMissionsNumber") then { + finishedMissionsNumber = 0; +}; + +publicVariable "finishedMissionsNumber"; + +if (isNil "OvercastVar") then { + OvercastVar = 0; +}; + +publicVariable "OvercastVar"; + +if (isNil "FogVar") then { + FogVar = 0; +}; + +publicVariable "FogVar"; + +if (isNil "createzone_server") then { + createzone_server = false; +}; + +publicVariable "createzone_server"; + +if (isNil "mission_number_of_zones_captured") then { + mission_number_of_zones_captured = 0; +}; + +publicVariable "mission_number_of_zones_captured"; + +// this is a special one (if/else) +if (isNil "Array_of_FOBS") then { + // if the player is sp or server or no fobs have been created + Array_of_FOBS = []; +} +else /// JIP for the client +{ + { + [_x] call duws_fnc_FOBactions; + } forEach Array_of_FOBS; +}; + +if (isNil "Array_of_FOBname") then { + Array_of_FOBname = []; +}; + +publicVariable "Array_of_FOBS"; +publicVariable "Array_of_FOBname"; + +game_master = ["player1"];publicVariable "game_master"; + + waitUntil {chosen_settings && createzone_server}; + + if (!manually_chosen) then { + if (!zones_created) then { // CHECK IF ZONES ARE PLACED, IF NOT EXECUTE locatorZonesV1.sqf + _zones_create = [50, 0.2] spawn duws_fnc_locatorzonesV1; // CHECK IF ZONES HAVE ALREADY BEEN PLACED + }; + } else { + if (!zones_created) then { // CHECK IF ZONES ARE PLACED, IF NOT EXECUTE locatorZonesV1.sqf + _zones_create = {[50,0.2] spawn duws_fnc_locatorzonesV2} remoteExec ["bis_fnc_spawn", game_master select 0]; // CHECK IF ZONES HAVE ALREADY BEEN PLACED + }; + }; + +//FIX ME: Execution Order requires zone bonus and reward be before WARCOM INIT + if (isServer) then { + // initialise the ressources per zone bonus + _basepoint = [] spawn duws_fnc_zonesundercontrol; + }; + + // init the bonuses you get when capturing zones + _basepoint = [] spawn duws_fnc_zones_bonus; + +// Mission ending handler +missionEndHandle = [] spawn duws_fnc_endconditions; + +waitUntil { !isNil "serv_zones_array" }; +diag_log format ["serv_zones_array: %1", serv_zones_array]; +[serv_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] call duws_fnc_WARCOM_init; // 2700 is 40 mins + +if (zones_manually_placed) then { + waitUntil {!isNil ("Array_of_OPFOR_zones")}; + sleep 1; + _warcom_init = [Array_of_OPFOR_zones, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 1500] call duws_fnc_WARCOM_init; +}; diff --git a/source/functions/initZones/fn_createzone.sqf b/source/functions/initZones/fn_createzone.sqf new file mode 100644 index 0000000..82bed32 --- /dev/null +++ b/source/functions/initZones/fn_createzone.sqf @@ -0,0 +1,240 @@ +// _trg = ["Outpost Airbase",5,50,getpos this,true] spawn duws_fnc_createzone; +// Name of the place,pts,radius,position,fortified/not +// + +params ["_place","_points","_size","_trigger","_fortified","_prefab"]; + +amount_zones_created = amount_zones_created + 1; +publicVariable "amount_zones_created"; +zones_created = true; // Tell that at least 1 zone is created + +// Add the zone to the array of zones (need for manual placement of zones and WARCOM) +if (isNil ("Array_of_OPFOR_zones")) then {Array_of_OPFOR_zones = [];}; +Array_of_OPFOR_zones = Array_of_OPFOR_zones + [_trigger]; + +// CREATE MARKER (ICON) +_markername = format["%1%2",round(_trigger select 0),round(_trigger select 1)]; // Define marker name +//hint _markername; +_markerstr = createMarker [str(_markername),_trigger]; +_markerstr setMarkerShape "ICON"; +str(_markername) setMarkerType "hd_objective"; +str(_markername) setMarkerColor "ColorRed"; +str(_markername) setMarkerText _place; +str(_markername) setMarkerSize [0, 0]; + +// CREATE MARKER (ELLIPSE ZONE) +_markername2 = format["%1%2ellipse",round(_trigger select 0),round(_trigger select 1)]; // Define marker name +//hint _markername2; +_markerstr2 = createMarker [str(_markername2),_trigger]; +_markerstr2 setMarkerShape "ELLIPSE"; +str(_markername2) setMarkerBrush "SolidBorder"; +str(_markername2) setMarkerColor "ColorRed"; +str(_markername2) setMarkerSize [_size, _size]; +str(_markername2) setMarkerAlpha 0.1; + + + +// CREATE ZONE CAPTURABLE TRIGGER +_trg=createTrigger["EmptyDetector",_trigger]; +_trg setTriggerArea[_size,_size,0,false]; +_trg setTriggerActivation["WEST SEIZED","PRESENT",false]; +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] spawn duws_fnc_captured",_place,_points,_markername,_markername2,_trigger], ""]; +_trg setTriggerTimeout [30, 60, 300, true ]; +// CREATE VARNAME FOR ZONE TRIGGER --> use the pos of the trigger +_triggerName = format["trigger%1%2",round (_trigger select 0),round (_trigger select 1)]; +call compile format["%1 = _trg",_triggerName]; + + + + + + + + + +// CREATE PREFAB +if (_prefab) then { +_array_of_prefabs = [["Command Outpost", true, duws_fnc_site_commandOP], +["Vehicle Refit Station", false, duws_fnc_site_vehfittingstation], +["Research Bunker", true, duws_fnc_site_researchBunker], +["Recon Outpost", true, duws_fnc_site_reconOutpost], +["Power Relay", true, duws_fnc_site_powerRelay], +["Com. Station", true, duws_fnc_site_CommStation], +["Outpost", true, duws_fnc_site_outpost1], +["Outpost", true, duws_fnc_site_outpost2], +["Barracks", true, duws_fnc_site_Barracks], +["Research Station", false, duws_fnc_site_researchStation], +["Camp Site", false, duws_fnc_site_campsite]]; + +_amount_of_prefabs = count _array_of_prefabs; +_indexedAmount = _amount_of_prefabs - 1; +_dice = round random _indexedAmount; + +_prefab_array = _array_of_prefabs select _dice; +_place = _prefab_array select 0; +_fortified = _prefab_array select 1; +_function = _prefab_array select 2; + +_prefab_create = [_trigger] spawn _function; +str(_markername) setMarkerText _place; +}; + + + +// CREATE ZONE NOTIFICATION TRIGGER +_trg2=createTrigger["EmptyDetector",_trigger]; +_trg2 triggerAttachVehicle [player]; +_trg2 setTriggerArea[_size,_size,0,false]; +_trg2 setTriggerActivation["VEHICLE","PRESENT",true]; +_trg2 setTriggerStatements["this", format["[""%1"",thislist] spawn duws_fnc_enterlocation",_place], ""]; + + + + + + + + + + + + + + + + + + +// move the spawn location, or units get stuck +_fortifiedspawn = _trigger; +_trigger = [(_trigger select 0)+40,_trigger select 1]; + + +// CREATE OPFOR. HEAVY CLUSTERFUCK INCOMING. +// Check if fortified is true +if (_fortified) then +{ + [_fortifiedspawn] call duws_fnc_createopfortified; + sleep 2; +}; + +// Check if radius is 100m or smaller => create 2 patrols then exit the script +if (_size < 101) exitWith +{ + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; +}; +// Check if radius is 250m-100m => create 2 patrols and 1 fireteam then exit the script +if (_size < 251) exitWith +{ + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; +}; +// Check if radius is 250m-500m => create 2 patrols and 2 fireteams then exit the script +if (_size < 501) exitWith +{ + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; +}; +if (_size <= 1000) exitWith +{ + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +}; +if (_size <= 1500) exitWith +{ +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +waitUntil {scriptDone _vehcreate}; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +}; +if (_size <= 2000) exitWith +{ +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +waitUntil {scriptDone _vehcreate}; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; +}; +if (_size <= 3000) exitWith +{ + _vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; + waitUntil {scriptDone _vehcreate}; + + _vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; + waitUntil {scriptDone _vehcreate}; + + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; +}; + +// IF NOT IN PARAMETERS (TOO BIG ZONE) +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +waitUntil {scriptDone _vehcreate}; + +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; +waitUntil {scriptDone _vehcreate}; + + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopwpteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createoppatrol; + [_trigger, _size] call duws_fnc_createopteam; + [_trigger, _size] call duws_fnc_createoppatrol; + + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; + \ No newline at end of file diff --git a/source/initZones/createzonebackup.sqf b/source/functions/initZones/fn_createzonebackup.sqf similarity index 52% rename from source/initZones/createzonebackup.sqf rename to source/functions/initZones/fn_createzonebackup.sqf index 6df3903..c10bf22 100644 --- a/source/initZones/createzonebackup.sqf +++ b/source/functions/initZones/fn_createzonebackup.sqf @@ -1,13 +1,8 @@ -// _trg = ["Outpost Airbase",5,50,getpos this,true] execvm "createzone.sqf"; -// Name of the place,pts,radius,position,fortified/not +// _trg = ["Outpost Airbase",5,50,getpos this,true] spawn duws_fnc_createzonebackup; +// Name of the place,pts,radius,position,fortified/not // -_place = _this select 0; -_points = _this select 1; -_size = _this select 2; -_trigger = _this select 3; -_fortified = _this select 4; -_prefab = _this select 5; +params ["_place","_points","_size","_trigger","_fortified","_prefab"]; amount_zones_created = amount_zones_created + 1; publicVariable "amount_zones_created"; @@ -43,7 +38,7 @@ str(_markername2) setMarkerAlpha 0.1; _trg=createTrigger["EmptyDetector",_trigger]; _trg setTriggerArea[_size,_size,0,false]; _trg setTriggerActivation["WEST SEIZED","PRESENT",false]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] execvm 'captured.sqf'",_place,_points,_markername,_markername2,_trigger], ""]; +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] spawn duws_fnc_captured'",_place,_points,_markername,_markername2,_trigger], ""]; _trg setTriggerTimeout [30, 60, 300, true ]; // CREATE VARNAME FOR ZONE TRIGGER --> use the pos of the trigger _triggerName = format["trigger%1%2",round (_trigger select 0),round (_trigger select 1)]; @@ -91,7 +86,7 @@ _trg2=createTrigger["EmptyDetector",_trigger]; _trg2 triggerAttachVehicle [player]; _trg2 setTriggerArea[_size,_size,0,false]; _trg2 setTriggerActivation["VEHICLE","PRESENT",true]; -_trg2 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocation.sqf'",_place], ""]; +_trg2 setTriggerStatements["this", format["[""%1"",thislist] spawn duws_fnc_enterlocation",_place], ""]; @@ -119,194 +114,194 @@ _trigger = [(_trigger select 0)+40,_trigger select 1]; // Check if fortified is true if (_fortified) then { - [_fortifiedspawn] execvm "createopfortified.sqf"; + [_fortifiedspawn] call duws_fnc_createopfortified; sleep 2; }; // Check if radius is 100m or smaller => create 2 patrols then exit the script if (_size < 101) exitWith { - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; }; // Check if radius is 250m-100m => create 2 patrols and 1 fireteam then exit the script if (_size < 251) exitWith { - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; }; // Check if radius is 250m-500m => create 2 patrols and 2 fireteams then exit the script if (_size < 501) exitWith { - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; }; if (_size <= 1000) exitWith { - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 10; - ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; + [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; }; if (_size <= 1500) exitWith { -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 10+(random 3); - ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; + [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; }; if (_size <= 2000) exitWith { -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 10+(random 3); - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; }; if (_size <= 3000) exitWith { -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 10+(random 3); - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; }; // IF NOT IN PARAMETERS (TOO BIG ZONE) -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; +_vehcreate = [opfor_Faction,"armored",_trigger,_size] spawn duws_fnc_random_veh; waitUntil {scriptDone _vehcreate}; sleep 10; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopwpteam.sqf"; + [_trigger, _size] call duws_fnc_createopwpteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [_trigger, _size] execvm "createopteam.sqf"; + [_trigger, _size] call duws_fnc_createopteam; sleep 3; - [_trigger, _size] execvm "createoppatrol.sqf"; + [_trigger, _size] call duws_fnc_createoppatrol; sleep 10+(random 3); - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; + [opfor_Faction,"air",_trigger,_size] spawn duws_fnc_random_veh; \ No newline at end of file diff --git a/source/initZones/locatorzonesV1.sqf b/source/functions/initZones/fn_locatorzonesV1.sqf similarity index 84% rename from source/initZones/locatorzonesV1.sqf rename to source/functions/initZones/fn_locatorzonesV1.sqf index 28fc51f..81ee60a 100644 --- a/source/initZones/locatorzonesV1.sqf +++ b/source/functions/initZones/fn_locatorzonesV1.sqf @@ -1,5 +1,5 @@ -_radius = _this select 0; -_diff = _this select 1; +params ["_radius","_diff"]; + _infinite_failsafe_loop = true; @@ -46,18 +46,18 @@ while {!_found} do }; // END OF FAILSAFE EXECUTION, RESET OVER. - _Posfound = false; - _posDeMeilleurTruc = []; - while {!_Posfound} do { - _posDeMeilleurTruc = [center_of_map, 0,half_of_map,5,0,0.1,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; - if (_posDeMeilleurTruc select 0 != 0 && _posDeMeilleurTruc select 1 != 0) then {_Posfound=true;}; - }; - _playerDistance = _posDeMeilleurTruc distance hq_blu1; - - - - - + _Posfound = false; + _posDeMeilleurTruc = []; + while {!_Posfound} do { + _posDeMeilleurTruc = [center_of_map, 0,half_of_map,5,0,0.1,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; + if (_posDeMeilleurTruc select 0 != 0 && _posDeMeilleurTruc select 1 != 0) then {_Posfound=true;}; + }; + _playerDistance = _posDeMeilleurTruc distance hq_blu1; + + + + + if (_playerDistance>(zones_max_radius + 500) && (hq_blu1 distance _posDeMeilleurTruc)<=zones_max_dist_from_hq) then { // VERIFIE SI ELOIGNE DU JOUEUR ET REGARDE LA DISTANCE DES AUTRES ZONES. REGARDE AUSSI LA DISTANCE PAR RAPPORT AU QG @@ -85,13 +85,13 @@ while {!_found} do if (_found_distance) then { _missionPos = [round(_missionPos select 0),round(_missionPos select 1)]; - _generatezonescript = [format["Zone %1",_i],_points_zone,_zone_radius,_MissionPos,_fortified,true] execvm "initZones\createzone.sqf"; + _generatezonescript = [format["Zone %1",_i],_points_zone,_zone_radius,_MissionPos,_fortified,true] spawn duws_fnc_createzone; _found=true; _zones_array = _zones_array + [_MissionPos]; player globalChat format["Zone location #%1 found !",_i]; - player globalChat format["Generating zone #%1",_i]; - //waituntil {scriptdone _generatezonescript}; + player globalChat format["Generating zone #%1",_i]; + //waituntil {scriptdone _generatezonescript}; }; // END OF THIRD LOOP }; // END SECOND LOOP }; // END WHILE LOOP --- LOCATION FOUND @@ -103,7 +103,7 @@ player globalChat format["All zones found. Welcome to %1, %2",_worldName,profile hint format["Campaign generated\nzones: %1\nmaximum radius: %2m\nminimum radius: %3m\nmax. distance from HQ: %4m\n\nIf you experience performance issues, restart the mission and try reducing the amount of zones/and or their radius",zones_number,zones_max_radius,zones_min_radius,zones_max_dist_from_hq]; [] spawn { sleep 20; -[] execVM "misc\bottom_right_message.sqf"; +[] call duws_fnc_bottom_right_message; }; @@ -113,7 +113,7 @@ _zones_array = [_zones_array, 0] call BIS_fnc_removeIndex; //player globalchat format["%1",_zones_array]; serv_zones_array = [] + _zones_array; publicVariable "serv_zones_array"; -//_warcom_init = [_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] execVM "WARCOM\WARCOM_init.sqf"; // 2700 is 40 mins +//_warcom_init = [_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] call duws_fnc_WARCOM_init; // 2700 is 40 mins //waitUntil {scriptDone _warcom_init}; savegame; sleep 1; diff --git a/source/initZones/locatorzonesV1_backup.sqf b/source/functions/initZones/fn_locatorzonesV1_backup.sqf similarity index 94% rename from source/initZones/locatorzonesV1_backup.sqf rename to source/functions/initZones/fn_locatorzonesV1_backup.sqf index 772f68a..084e060 100644 --- a/source/initZones/locatorzonesV1_backup.sqf +++ b/source/functions/initZones/fn_locatorzonesV1_backup.sqf @@ -1,5 +1,5 @@ -_radius = _this select 0; -_diff = _this select 1; +params ["_radius","_diff"]; + _infinite_failsafe_loop = true; @@ -122,7 +122,7 @@ while {!_found} do if (_found_distance) then { _missionPos = [round(_missionPos select 0),round(_missionPos select 1),round(_missionPos select 2)]; - _null = [format["Zone %1",_i],_points_zone,_zone_radius,_MissionPos,_fortified] execvm "initZones\createzone.sqf"; + _null = [format["Zone %1",_i],_points_zone,_zone_radius,_MissionPos,_fortified] spawn duws_fnc_createzone; _found=true; _zones_array = _zones_array + [_MissionPos]; @@ -139,8 +139,7 @@ player globalChat format["All zones found. Welcome to %1, %2",_worldName,profile _zones_array = [_zones_array, 0] call BIS_fnc_removeIndex; //player globalchat format["%1",_zones_array]; -_warcom_init = [_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 1500] execVM "WARCOM\WARCOM_init.sqf"; // 2700 is 40 mins -waitUntil {scriptDone _warcom_init}; +[_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 1500] call duws_fnc_WARCOM_init; // 2700 is 40 mins sleep 0.1; savegame; diff --git a/source/initZones/locatorzonesV2.sqf b/source/functions/initZones/fn_locatorzonesV2.sqf similarity index 67% rename from source/initZones/locatorzonesV2.sqf rename to source/functions/initZones/fn_locatorzonesV2.sqf index 6f28423..dcdeba5 100644 --- a/source/initZones/locatorzonesV2.sqf +++ b/source/functions/initZones/fn_locatorzonesV2.sqf @@ -1,17 +1,15 @@ -_radius = _this select 0; -_diff = _this select 1; +params ["_radius","_diff"]; [["The zones are being generated
Please wait for mission initialization to complete..."]] spawn BIS_fnc_typeText; -[[{player globalChat "DO NOT USE ACTION MENU UNTIL MISSION INITIALIZATION IS COMPLETE"}],"BIS_fnc_Spawn",true,false] call BIS_fnc_MP; -[[{hint "DO NOT USE ACTION MENU UNTIL MISSION INITIALIZATION IS COMPLETE"}],"BIS_fnc_Spawn",true,false] call BIS_fnc_MP; - +"DO NOT USE ACTION MENU UNTIL MISSION INITIALIZATION IS COMPLETE" remoteExec ["systemChat"]; +"DO NOT USE ACTION MENU UNTIL MISSION INITIALIZATION IS COMPLETE" remoteExec ["hint"]; // ON WATER ? >> FLAT ? >> DISTANCE BETWEEN ZONES ? >> OK ! _worldName = getText(configFile >> "cfgWorlds" >> worldName >> "description"); _fortified = false; -openMap [true, true]; +openMap [true, true]; hint "Click somewhere on the island to place enemy zones"; _zones_array = [[-9999,-9999,-9999]]; for [{_i=1}, {_i<=zones_number}, {_i=_i+1}] do // BEGIN "FOR" LOOP -- @@ -22,13 +20,13 @@ for [{_i=1}, {_i<=zones_number}, {_i=_i+1}] do // BEGIN "FOR" LOOP -- _points_zone = 0; while {_zone_radius<=zones_min_radius} do { _random_zones_max_radius = random zones_max_radius; - _zone_radius = round _random_zones_max_radius; + _zone_radius = round _random_zones_max_radius; _points_zone = round (_zone_radius/10); }; - + while {!_found} do { clicked = false; - OnMapSingleClick "ClickedPos = _pos; clicked = true;"; + OnMapSingleClick "ClickedPos = _pos; clicked = true;"; _found_distance = false; _missionPos = []; @@ -50,9 +48,9 @@ for [{_i=1}, {_i<=zones_number}, {_i=_i+1}] do // BEGIN "FOR" LOOP -- if (_found_distance) then { _missionPos = [round(_missionPos select 0),round(_missionPos select 1)]; - _generatezonescript = [format["Zone %1",_i],_points_zone,_zone_radius,_missionPos,_fortified,true] execvm "initZones\createzone.sqf"; + _generatezonescript = [format["Zone %1",_i],_points_zone,_zone_radius,_missionPos,_fortified,true] spawn duws_fnc_createzone; _found = true; - _zones_array = _zones_array + [_missionPos]; + _zones_array = _zones_array + [_missionPos]; player globalChat format["Zone location #%1 found !",_i]; player globalChat format["Generating zone #%1",_i]; @@ -61,18 +59,18 @@ for [{_i=1}, {_i<=zones_number}, {_i=_i+1}] do // BEGIN "FOR" LOOP -- }; }; -openMap [false, false]; - +openMap [false, false]; + //hintSilent format["All zones found\nWelcome to %1\nHave fun !\nDUWS by kibot",_worldName]; player globalChat format["All zones found. Welcome to %1, %2",_worldName,profileName]; //hint format["MISSION INITIALIZATION COMPLETE!\nCampaign generated\nzones: %1\nmaximum radius: %2m\nminimum radius: %3m\nmax. distance from HQ: %4m\n\nIf you experience performance issues, restart the mission and try reducing the amount of zones/and or their radius",zones_number,zones_max_radius,zones_min_radius,zones_max_dist_from_hq]; -[[{player globalChat "MISSION INITIALIZATION COMPLETE!"}],"BIS_fnc_Spawn",true,false] call BIS_fnc_MP; -[[{hint format["MISSION INITIALIZATION COMPLETE!\nCampaign generated\nzones: %1\nmaximum radius: %2m\nminimum radius: %3m\nmax. distance from HQ: %4m\n\nIf you experience performance issues, restart the mission and try reducing the amount of zones/and or their radius",zones_number,zones_max_radius,zones_min_radius,zones_max_dist_from_hq]}],"BIS_fnc_Spawn",true,false] call BIS_fnc_MP; +"MISSION INITIALIZATION COMPLETE!" remoteExec ["systemChat"]; +(format["MISSION INITIALIZATION COMPLETE!\nCampaign generated\nzones: %1\nmaximum radius: %2m\nminimum radius: %3m\nmax. distance from HQ: %4m\n\nIf you experience performance issues, restart the mission and try reducing the amount of zones/and or their radius",zones_number,zones_max_radius,zones_min_radius,zones_max_dist_from_hq]) remoteExecCall ["hint"]; [] spawn { sleep 9; - [] execVM "misc\bottom_right_message.sqf"; + [] call duws_fnc_bottom_right_message; }; @@ -80,14 +78,13 @@ player globalChat format["All zones found. Welcome to %1, %2",_worldName,profile _zones_array = [_zones_array, 0] call BIS_fnc_removeIndex; //player globalchat format["%1",_zones_array]; -_warcom_init = [_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] execVM "WARCOM\WARCOM_init.sqf"; // 2700 is 40 mins -waitUntil {scriptDone _warcom_init}; +[_zones_array, getpos hq_blu1, [0,0,0], blufor_ap, opfor_ap, 2700,blufor_ai_skill,opfor_ai_skill, 2000] call duws_fnc_WARCOM_init; // 2700 is 40 mins sleep 0.1; -execVM "utilities\autoSave.sqf"; +[] spawn duws_fnc_autoSave; sleep 1; -[[format["MISSION INITIALIZATION COMPLETE!
Campaign generated
Welcome to %1, %2",_worldName,profilename]]] spawn BIS_fnc_typeText; +[[format["MISSION INITIALIZATION COMPLETE!
Campaign generated
Welcome to %1, %2",_worldName,profilename]]] spawn BIS_fnc_typeText; playMusic ["EventTrack01a_F_EPA", 0]; if (debugmode) exitWith {}; diff --git a/source/functions/misc/fn_bottom_right_message.sqf b/source/functions/misc/fn_bottom_right_message.sqf new file mode 100644 index 0000000..d0ade44 --- /dev/null +++ b/source/functions/misc/fn_bottom_right_message.sqf @@ -0,0 +1,221 @@ +/* + Author: Jiri Wainar + + Description: + Display OSD with location, time and possibly some other campaign related info. + + Parameter(s): + _this select 0: array (optional) - position (default: player's position) + _this select 1: array (optional) - date in format [_year,_month,_day,_hour,_min] (default: current date) + + Example: + [] call BIS_fnc_camp_showOSD; + + Returns: + - nothing - +*/ + +private["_fn_getSector"]; + +_fn_getSector = +{ + private["_map","_posX","_posY","_gridX","_gridY","_secWidth","_secHeight"]; + private["_bottomLeftX","_bottomLeftY","_topRightX","_topRightY"]; + + _map = toLower worldName; + + if !(_map in ["altis","stratis"]) exitWith + { + -1 + }; + + if (_map == "stratis") then + { + _bottomLeftX = 1302; + _bottomLeftY = 230; + _topRightX = 6825; + _topRightY = 7810; + } + else + { + _bottomLeftX = 1765; + _bottomLeftY = 4639; + _topRightX = 28624; + _topRightY = 26008; + }; + + _posX = _this select 0; + _posY = _this select 1; + + //check if player is outside the map grid + if !(_posX > _bottomLeftX && _posX < _topRightX && _posY > _bottomLeftY && _posY < _topRightY) exitWith + { + 0 + }; + + //offset player pos to [0,0] + _posX = _posX - _bottomLeftX; + _posY = _posY - _bottomLeftY; + + _secWidth = (_topRightX - _bottomLeftX)/3; + _secHeight = (_topRightY - _bottomLeftY)/3; + + _gridX = floor (_posX/_secWidth); + _gridY = floor (_posY/_secHeight); + + ((_gridY * 3) + _gridX + 1) +}; + + +private["_position","_date","_output","_showDate","_showLocation","_showMap"]; +private["_tLoc","_tMap","_tDate","_tTime","_tTimeH","_tTimeM","_tDay","_tMonth","_tYear"]; + +_showDate = true; + + +_position = [_this, 0, getPos player, [[]]] call BIS_fnc_param; +_date = [_this, 1, date, [[]]] call BIS_fnc_param; +_tMap = [_this, 2, "auto", [""]] call BIS_fnc_param; +_tLoc = [_this, 3, "auto", [""]] call BIS_fnc_param; + +if (_tMap != "") then +{ + _showMap = true; +} +else +{ + _showMap = false; +}; + +if (_tLoc != "") then +{ + _showLocation = true; +} +else +{ + _showLocation = false; +}; + +//get map text +if (_showMap && _tMap == "auto") then +{ + private["_sector","_map","_template"]; + + _sector = _position call _fn_getSector; + + if (_sector == -1) then + { + ["Map not recognized! Only 'Altis' and 'Stratis' are supported."] call BIS_fnc_error; + + _showMap = false; + _showLocation = false; + }; + + _map = gettext (configfile >> "cfgworlds" >> worldname >> "description"); + + _template = switch (_sector) do + { + case 1: {localize "STR_A3_SectorNorthWest"}; + case 2: {localize "STR_A3_SectorSouth"}; + case 3: {localize "STR_A3_SectorSouthEast"}; + case 4: {localize "STR_A3_SectorWest"}; + case 5: {localize "STR_A3_SectorCentral"}; + case 6: {localize "STR_A3_SectorEast"}; + case 7: {localize "STR_A3_SectorNorthWest"}; + case 8: {localize "STR_A3_SectorNorth"}; + case 9: {localize "STR_A3_SectorNorthEast"}; + + default + { + _showLocation = false; + + //hardcoded for Stratis and Altis only + if (worldname == "Stratis") then + { + localize "STR_A3_NearStratis" + } + else + { + localize "STR_A3_NearAltis" + }; + }; + }; + + _tMap = format[_template,_map]; +}; + +//get current location text +if (_showLocation && _tLoc == "auto") then +{ + private["_locations","_loc"]; + + _locations = nearestLocations [getPos player, ["NameCity","NameCityCapital","NameLocal","NameMarine","NameVillage"], 500]; + + //filter-out locations without names + { + if (text _x == "") then + { + locations set [_forEachIndex, objNull]; + }; + } + forEach _locations; _locations = _locations - [objNull]; + + if (count _locations > 0) then + { + _loc = _locations select 0; + + if ((getPos player) in _loc) then + { + _tLoc = text _loc; + } + else + { + _tLoc = format[localize "STR_A3_NearLocation", text _loc]; //tolocalize: "Poblíž lokace %1" + }; + } + else + { + _tLoc = ""; + _showLocation = false; + }; +}; + +//get daytime data +_tYear = _date select 0; +_tMonth = _date select 1; +_tDay = _date select 2; + +if (_tMonth < 10) then {_tMonth = format["0%1",_tMonth]}; +if (_tDay < 10) then {_tDay = format["0%1",_tDay]}; + +//get date text +_tDate = format["%1-%2-%3",_tYear,_tMonth,_tDay]; + +//get time text +_tTimeH = _date select 3; +_tTimeM = _date select 4; + +if (_tTimeH < 10) then {_tTimeH = format["0%1",_tTimeH]}; +if (_tTimeM < 10) then {_tTimeM = format["0%1",_tTimeM]}; + +_tTime = format["%1:%2",_tTimeH,_tTimeM]; + + +//sum the output params & print it +_output = +[ + [_tDate,"%1",0], + [_tTime,"%1
",5] +]; + +if (_showLocation) then +{ + _output = _output + [[toUpper _tLoc,"%1
",5]]; +}; + +if (_showMap) then +{ + _output = _output + [[_tMap,"%1
",30]]; +}; + +[_output,-safezoneX,0.85,"%1"] spawn BIS_fnc_typeText; \ No newline at end of file diff --git a/source/functions/misc/fn_gps_marker.sqf b/source/functions/misc/fn_gps_marker.sqf new file mode 100644 index 0000000..db4c033 --- /dev/null +++ b/source/functions/misc/fn_gps_marker.sqf @@ -0,0 +1,33 @@ +_player_has_gps = false; +private ["_markername"]; + +while {true} do { + + while {!_player_has_gps} do { + _number = assignedItems player find "ItemGPS"; + if (_number != -1 && !_player_has_gps) then { // Check if player has a gps assigned, if yes create marker + _markername = format["gps%1%2%3",round (getpos player select 0),round (getpos player select 1),round (random 10000)]; // --START CREATE MARKER-- + _markerstr = createMarker [str(_markername), getpos player]; + _markerstr setMarkerShape "ICON"; + str(_markername) setMarkerType "mil_arrow2"; + str(_markername) setMarkerColor "ColorGreen"; + str(_markername) setMarkerSize [0.3, 0.5]; + str(_markername) setMarkerText format["%1",profileName]; + _player_dir = getDir player; + str(_markername) setmarkerdir _player_dir; + _player_has_gps = true; + }; // --END CREATE MARKER-- + sleep 3; + }; + + + while {_player_has_gps} do { + _player_dir = getDir player; + str(_markername) setmarkerdir _player_dir; + str(_markername) setMarkerPos getpos player; + _number = assignedItems player find "ItemGPS"; + if (_number == -1) then {_player_has_gps = false; deletemarker str(_markername)}; + sleep 0.7; + }; +sleep 0.2; +}; \ No newline at end of file diff --git a/source/missions/missions/destroy/mission.sqf b/source/functions/missions/fn_destroy_mission.sqf similarity index 84% rename from source/missions/missions/destroy/mission.sqf rename to source/functions/missions/fn_destroy_mission.sqf index 384bab6..dbc5fbc 100644 --- a/source/missions/missions/destroy/mission.sqf +++ b/source/functions/missions/fn_destroy_mission.sqf @@ -1,4 +1,5 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; + // define random pos AROUND SOLDIERS. spawn markers at random. _radius = 400; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -21,7 +22,7 @@ _markerstr2 setMarkerShape "ELLIPSE"; str(_markername2) setMarkerBrush "SolidBorder"; str(_markername2) setMarkerColor "ColorOPFOR"; str(_markername2) setMarkerSize [_radius, _radius]; -str(_markername2) setMarkerAlpha 0.3; +str(_markername2) setMarkerAlpha 0.3; // CREATE TOWER _tower = "Land_TTowerBig_1_F" createVehicle (_missionpos); @@ -35,23 +36,23 @@ _tower setVectorUp [0,0,1]; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername)); //NEW //test1 -[west, "_taskhandle", ["taskDestroy.", "We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["taskDestroy.", "We have detected a large amount of enemy trasmissions coming from this area. This is probably caused by a radio tower used by the enemy forces on the island. Destroy the tower. Be sure to take some satchels, which you can find in the armory. Armory can be unlocked at the HQ.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; // CREATE PATROLS sleep 1; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createopteam.sqf"; +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createopteam; // MISSION COMPLETED -- ATTENDRE QUE LA TOUR SOIT KO -waitUntil {sleep 1; !alive _tower}; +waitUntil {sleep 1; !alive _tower}; // remove markers deleteMarker str(_markername2); @@ -61,8 +62,8 @@ deleteMarker str(_markername); //player removeSimpleTask _taskhandle; //NEW -[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; - +["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; + // Give cookies (bonus & notifications) reward = (30 * cp_reward_multiplier); ["TaskSucceeded",["",_mission_name]] call bis_fnc_showNotification; @@ -75,7 +76,7 @@ finishedMissionsNumber = finishedMissionsNumber + 1; publicVariable "finishedMissionsNumber"; publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/missions/missionTimer.sqf b/source/functions/missions/fn_missionTimer.sqf similarity index 100% rename from source/missions/missionTimer.sqf rename to source/functions/missions/fn_missionTimer.sqf diff --git a/source/missions/missions/pilot/mission.sqf b/source/functions/missions/fn_pilot_mission.sqf similarity index 76% rename from source/missions/missions/pilot/mission.sqf rename to source/functions/missions/fn_pilot_mission.sqf index 497e0ae..726b082 100644 --- a/source/missions/missions/pilot/mission.sqf +++ b/source/functions/missions/fn_pilot_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; _initpos = getpos hq_blu1; // define random pos AROUND TARGET. spawn markers at random. _radius = 175; @@ -27,17 +27,17 @@ str(_markername2) setMarkerAlpha 0.5; // CREATE PATROLS sleep 1; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createopteam.sqf"; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createopteam; // CREATE WRECK -_choppa = "Land_Wreck_Heli_Attack_01_F" createVehicle (_missionpos); +_choppa = Blufor_Helowreck createVehicle (_missionpos); _group = createGroup west; // CREATE PILOT -_pilot = _group createUnit ["B_Helipilot_F", [_missionpos select 0, (_missionpos select 1)+2], [], 0, "FORM"]; -_pilot setcaptive true; +_pilot = _group createUnit [Blufor_Heli_Pilot, [_missionpos select 0, (_missionpos select 1)+2], [], 0, "FORM"]; +_pilot setcaptive true; _pilot switchMove "acts_CrouchingIdleRifle01"; // TASK AND NOTIFICATION @@ -46,10 +46,10 @@ _pilot switchMove "acts_CrouchingIdleRifle01"; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername));/ if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; -[west, "_taskhandle", ["taskPilot.", "One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["One of our AH-99 helicopters has been downed somewhere around this area. We have reports that the pilot is still alive. You must find him and bring him back to base.", "Downed Pilot", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; @@ -62,7 +62,7 @@ if (!(alive _pilot)) exitWith { deleteMarker str(_markername); //player removeSimpleTask _taskhandle; - [["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; + ["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; ["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification; }; @@ -81,7 +81,7 @@ if (!(alive _pilot)) exitWith { deleteMarker str(_markername); //player removeSimpleTask _taskhandle; - [["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; + ["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; ["TaskFailed",["","The pilot is dead"]] call bis_fnc_showNotification; }; @@ -107,7 +107,7 @@ commandpointsblu1 = commandpointsblu1 + reward; publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; missions_success = missions_success + 1; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/missions/missions/rescue/mission.sqf b/source/functions/missions/fn_rescue_mission.sqf similarity index 69% rename from source/missions/missions/rescue/mission.sqf rename to source/functions/missions/fn_rescue_mission.sqf index 6ffcb96..03a92e9 100644 --- a/source/missions/missions/rescue/mission.sqf +++ b/source/functions/missions/fn_rescue_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; // define random pos AROUND SOLDIERS. spawn markers at random. _radius = 125; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -30,9 +30,9 @@ _soldier3 = format ["s3%1%2",round(_MissionPos select 0),round(_Missionpos selec _group = createGroup west; -"b_soldier_tl_f" createUnit [[(_missionpos select 0)+(random 10),(_missionpos select 1)+(random 10)], _group,format["this setcaptive true; this switchMove ""acts_InjuredCoughRifle02""; %1 = this",_soldier1]]; -"B_Soldier_F" createUnit [[(_missionpos select 0),(_missionpos select 1)], _group,format["this setcaptive true; this switchMove ""acts_InjuredLookingRifle02""; %1 = this",_soldier2]]; -"B_Soldier_ar_F" createUnit [[(_missionpos select 0)+(random 5),(_missionpos select 1)+(random 5)], _group,format["this setcaptive true; this switchMove ""acts_InjuredLookingRifle03""; %1 = this",_soldier3]]; +Blufor_Teamleader createUnit [[(_missionpos select 0)+(random 10),(_missionpos select 1)+(random 10)], _group,format["this setcaptive true; this switchMove ""acts_InjuredCoughRifle02""; %1 = this",_soldier1]]; +Blufor_Rifleman createUnit [[(_missionpos select 0),(_missionpos select 1)], _group,format["this setcaptive true; this switchMove ""acts_InjuredLookingRifle02""; %1 = this",_soldier2]]; +Blufor_Autorifleman createUnit [[(_missionpos select 0)+(random 5),(_missionpos select 1)+(random 5)], _group,format["this setcaptive true; this switchMove ""acts_InjuredLookingRifle03""; %1 = this",_soldier3]]; // END CREATE SOLDIERS // TASK AND NOTIFICATION @@ -43,10 +43,10 @@ _VARtaskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_ //_taskhandle setSimpleTaskDescription ["One of our patrols has been ambushed and requires immediate assistance",_mission_name,""]; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername)); -[west, "_taskhandle", ["taskRescue.", "One of our patrols has been ambushed and requires immediate assistance", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["One of our patrols has been ambushed and requires immediate assistance", "Ambushed Patrol", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; @@ -57,11 +57,11 @@ call compile format ["%1 = _taskhandle",_VARtaskgeneratedName]; // create variab _trg=createTrigger["EmptyDetector",_MissionPos]; _trg setTriggerArea[25,25,0,false]; _trg setTriggerActivation["WEST","PRESENT",false]; -_trg setTriggerStatements["this",format["[""%1"",%2,%3,%4,%5,""%6"",this] execvm ""missions\missions\rescue\success.sqf""",_markername,_soldier1,_soldier2,_soldier3,_MissionPos,_markername2], ""]; +_trg setTriggerStatements["this",format["[""%1"",%2,%3,%4,%5,""%6"",this] spawn duws_fnc_rescue_success",_markername,_soldier1,_soldier2,_soldier3,_MissionPos,_markername2], ""]; _trg setTriggerTimeout [10, 10, 10, true ]; // CREATE OPFOR PATROLS sleep 1; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; diff --git a/source/missions/missions/rescue/success.sqf b/source/functions/missions/fn_rescue_success.sqf similarity index 76% rename from source/missions/missions/rescue/success.sqf rename to source/functions/missions/fn_rescue_success.sqf index 20f381a..5585487 100644 --- a/source/missions/missions/rescue/success.sqf +++ b/source/functions/missions/fn_rescue_success.sqf @@ -1,10 +1,4 @@ -_markername = _this select 0; -_sol1 = _this select 1; -_sol2 = _this select 2; -_sol3 = _this select 3; -_MissionPos = _this select 4; -_markername2 = _this select 5; -_trg = _this select 6; +params ["_markername","_sol1","_sol2","_sol3","_MissionPos","_markername2","_trg"]; // remove markers deleteMarker str(_markername2); @@ -15,7 +9,7 @@ _taskgeneratedName = format ["rescue%1%2",round(_MissionPos select 0),round(_Mis call compile format["_task = %1",_taskgeneratedname]; // recall variable and inject it into handle //player removeSimpleTask _task; -[["_task", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; +["_task", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; // IF SOLDIERS DEAD if (!(alive _sol1) && !(alive _sol2) && !(alive _sol3)) exitWith { @@ -30,7 +24,7 @@ _sol1 switchMove "AmovPpneMstpSnonWnonDnon"; _sol2 switchMove "AmovPpneMstpSnonWnonDnon"; _sol3 switchMove "AmovPpneMstpSnonWnonDnon"; [_sol1, _sol2, _sol3] joinSilent player; -titleText ["Thanks for the rescue, we'll be fighting with you from now on, lead the way!", "PLAIN DOWN"]; +titleText ["Thanks for the rescue, we'll be fighting with you from now on, lead the way!", "PLAIN DOWN"]; sleep 5; @@ -45,7 +39,7 @@ commandpointsblu1 = commandpointsblu1 + reward; WARCOM_blufor_ap = WARCOM_blufor_ap + 15; publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; \ No newline at end of file +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/missions/missions/sabotage/mission.sqf b/source/functions/missions/fn_sabotage_mission.sqf similarity index 72% rename from source/missions/missions/sabotage/mission.sqf rename to source/functions/missions/fn_sabotage_mission.sqf index a4470c7..03ba7fc 100644 --- a/source/missions/missions/sabotage/mission.sqf +++ b/source/functions/missions/fn_sabotage_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; // define random pos AROUND SOLDIERS. spawn markers at random. _radius = 150; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -21,12 +21,12 @@ _markerstr2 setMarkerShape "ELLIPSE"; str(_markername2) setMarkerBrush "SolidBorder"; str(_markername2) setMarkerColor "ColorBrown"; str(_markername2) setMarkerSize [_radius, _radius]; -str(_markername2) setMarkerAlpha 0.3; +str(_markername2) setMarkerAlpha 0.3; -// create TOWER +// create TOWER _tower = createVehicle ["Land_dp_transformer_F", _MissionPos, [], 0, "NONE"]; _tower addEventHandler ["HandleDamage", {0}]; -_tower addaction ["Sabotage", "missions\missions\sabotage\success.sqf",[_missionPos,_mission_name,_markername,_markername2]]; +_tower addaction ["Sabotage", {_this call duws_fnc_sabotage_success;},[_missionPos,_mission_name,_markername,_markername2]]; // TASK AND NOTIFICATION _VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task @@ -35,10 +35,10 @@ _VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round( //_taskhandle setSimpleTaskDescription ["The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.",_mission_name,""]; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername)); -[west, "_taskhandle", ["taskSabot.", "The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies."], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.", "Sabotage"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; @@ -47,8 +47,8 @@ call compile format ["%1 = _taskhandle",_VARtaskgeneratedName]; // create variab // CREATE OPFOR PATROLS sleep 1; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target sleep 10; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target \ No newline at end of file +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target diff --git a/source/missions/missions/sabotage/success.sqf b/source/functions/missions/fn_sabotage_success.sqf similarity index 83% rename from source/missions/missions/sabotage/success.sqf rename to source/functions/missions/fn_sabotage_success.sqf index 6acc93d..a28807a 100644 --- a/source/missions/missions/sabotage/success.sqf +++ b/source/functions/missions/fn_sabotage_success.sqf @@ -3,7 +3,7 @@ _missionPos = _arguments select 0; _mission_name = _arguments select 1; _markername = _arguments select 2; _markername2 = _arguments select 3; - + _action = _this select 2; _object = _this select 0; @@ -17,7 +17,7 @@ call compile format["_taskhandle = %1",_VARtaskgeneratedName]; // recall variabl _object removeAction _action; //player removeSimpleTask _taskhandle; -[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; +["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; deleteMarker str(_markername2); deleteMarker str(_markername); @@ -33,7 +33,7 @@ publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; finishedMissionsNumber = finishedMissionsNumber + 1; publicVariable "finishedMissionsNumber"; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; \ No newline at end of file +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/missions/missions/steal/mission.sqf b/source/functions/missions/fn_steal_mission.sqf similarity index 70% rename from source/missions/missions/steal/mission.sqf rename to source/functions/missions/fn_steal_mission.sqf index 876ccfe..1ed35c5 100644 --- a/source/missions/missions/steal/mission.sqf +++ b/source/functions/missions/fn_steal_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; // define random pos AROUND SOLDIERS. spawn markers at random. _radius = 200; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -24,14 +24,14 @@ _markerstr2 setMarkerShape "ELLIPSE"; str(_markername2) setMarkerBrush "SolidBorder"; str(_markername2) setMarkerColor "Color3_FD_F"; str(_markername2) setMarkerSize [_radius, _radius]; -str(_markername2) setMarkerAlpha 0.3; +str(_markername2) setMarkerAlpha 0.3; // CREATE TRUCK & CRATES -_truck1 = "O_Truck_02_transport_F" createVehicle (_missionpos); +_truck1 = Opfor_Truck_Open createVehicle (_missionpos); -_box1 = "O_supplyCrate_F" createVehicle (_missionpos); -_box2 = "O_supplyCrate_F" createVehicle (_missionpos); -_box3 = "O_supplyCrate_F" createVehicle (_missionpos); +_box1 = Opfor_Supplycrate createVehicle (_missionpos); +_box2 = Opfor_Supplycrate createVehicle (_missionpos); +_box3 = Opfor_Supplycrate createVehicle (_missionpos); _box1 attachTo [_truck1,[0,0.2,-0.8]]; _box1 setDir 90; @@ -47,35 +47,35 @@ _box3 setdir 180; //_taskhandle = player createSimpleTask ["taskSteal"]; //_taskhandle setSimpleTaskDescription ["An enemy truck full of supplies has been spotted in the area. Find it and bring it back to the base in one piece.",_mission_name,""]; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername)); -[west, "_taskhandle", ["taskSteal.", "An enemy truck full of supplies has been spotted in the area. Find it and bring it back to the base in one piece.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["An enemy truck full of supplies has been spotted in the area. Find it and bring it back to the base in one piece.", "Grand Theft", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; // CREATE PATROLS sleep 1; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createopteam.sqf"; +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createopteam; _group = createGroup east; -_unit = _group createUnit ["O_Soldier_SL_F", _missionpos, [], 0, "FORM"]; -_unit = _group createUnit ["O_Soldier_LAT_F", _missionpos, [], 0, "FORM"]; -_unit = _group createUnit ["O_soldier_F", _missionpos, [], 0, "FORM"]; +_unit = _group createUnit [Opfor_Squadleader, _missionpos, [], 0, "FORM"]; +_unit = _group createUnit [Opfor_Rifleman_AT, _missionpos, [], 0, "FORM"]; +_unit = _group createUnit [Opfor_Rifleman, _missionpos, [], 0, "FORM"]; -// MISSION COMPLETED -- ATTENDRE QUE LE CAMION SOIT ARRIVE A LA BASE OU DETRUIT -waitUntil {sleep 2; ((getdammage _truck1)>0.95 OR (_truck1 distance _initpos)<50)}; +// MISSION COMPLETED -- ATTENDRE QUE LE CAMION SOIT ARRIVE A LA BASE OU DETRUIT +waitUntil {sleep 2; ((getdammage _truck1)>0.95 OR (_truck1 distance _initpos)<50)}; // remove markers deleteMarker str(_markername2); deleteMarker str(_markername); //player removeSimpleTask _taskhandle; -[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; +["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; if (getdammage _truck1>0.95) exitWith { ["TaskFailed",["","The enemy convoy is destroyed"]] call bis_fnc_showNotification; @@ -83,7 +83,7 @@ if (getdammage _truck1>0.95) exitWith { // IF THE MISSION IS COMPLETE hint "Unloading the truck..."; - + // Give cookies (bonus & notifications) reward = (25 * cp_reward_multiplier); ["TaskSucceeded",["",_mission_name]] call bis_fnc_showNotification; @@ -96,10 +96,10 @@ publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; finishedMissionsNumber = finishedMissionsNumber + 1; publicVariable "finishedMissionsNumber"; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; +_addmission = [] call duws_fnc_persistent_stats_missions_total; sleep 2; deleteVehicle _box3; diff --git a/source/missions/stratmap.sqf b/source/functions/missions/fn_stratmap.sqf similarity index 85% rename from source/missions/stratmap.sqf rename to source/functions/missions/fn_stratmap.sqf index 329b404..6fa13d8 100644 --- a/source/missions/stratmap.sqf +++ b/source/functions/missions/fn_stratmap.sqf @@ -61,12 +61,12 @@ while {_counter < 6;} do { case 0: { // mission RESCUE //add the mission into the strat map _radius = 300; - MissionNameCase0 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase0 = [0] call duws_fnc_random_name; PosOfCase0Mission = _foundSafepos; _missionArray = [ [(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase0Mission] execVM "missions\missions\rescue\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase0Mission] spawn duws_fnc_rescue_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase0, "A friendly patrol has been ambushed and needs to be rescued in this area", "", @@ -79,12 +79,12 @@ while {_counter < 6;} do { case 1: { // mission STEAL //add the mission into the strat map _radius = 300; - MissionNameCase1 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase1 = [0] call duws_fnc_random_name; PosOfCase1Mission = _foundSafepos; _missionArray = [ [(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase1Mission] execVM "missions\missions\steal\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase1Mission] spawn duws_fnc_steal_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase1, "An enemy truck full of supplies is stuck somewhere here. Find it and bring it back to base safely.", "", @@ -98,12 +98,12 @@ while {_counter < 6;} do { case 2: { // mission TARGET //add the mission into the strat map _radius = 300; - MissionNameCase2 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase2 = [0] call duws_fnc_random_name; PosOfCase2Mission = _foundSafepos; _missionArray = [ [(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase2Mission] execVM "missions\missions\target\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase2Mission] spawn duws_fnc_target_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase2, "Our intel has reported a high value target around this area, probably an officer. Find him and kill him.", "", @@ -116,12 +116,12 @@ while {_counter < 6;} do { case 3: { // mission DESTROY //add the mission into the strat map _radius = 300; - MissionNameCase3 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase3 = [0] call duws_fnc_random_name; PosOfCase3Mission = _foundSafepos; _missionArray = [ [(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase3Mission] execVM "missions\missions\destroy\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase3Mission] spawn duws_fnc_destroy_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase3, "A major military infrastructure has been detected around this area. You must destroy it.", "", @@ -135,11 +135,11 @@ while {_counter < 6;} do { case 4: { // mission PILOT //add the mission into the strat map _radius = 300; - MissionNameCase4 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase4 = [0] call duws_fnc_random_name; PosOfCase4Mission = _foundSafepos; _missionArray = [[(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase4Mission] execVM "missions\missions\pilot\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase4Mission] spawn duws_fnc_pilot_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase4, "One of our aircraft has been downed somewhere around this position. You must find the pilot and bring it back to base safely.", "", @@ -153,12 +153,12 @@ while {_counter < 6;} do { case 5: { // mission SABOTAGE //add the mission into the strat map _radius = 300; - MissionNameCase5 = [0] call compile preprocessFile "random_name.sqf"; + MissionNameCase5 = [0] call duws_fnc_random_name; PosOfCase5Mission = _foundSafepos; _missionArray = [ [(_foundSafepos select 0)+(random _radius)-(random _radius),(_foundSafepos select 1)+(random _radius)-(random _radius)], - {_handle = [PosOfCase5Mission] execVM "missions\missions\sabotage\mission.sqf"; _handle = execVM "missions\missionTimer.sqf"}, + {_handle = [PosOfCase5Mission] spawn duws_fnc_sabotage_mission; _handle = [] spawn duws_fnc_missionTimer}, MissionNameCase5, "The enemy is using a power supply near this location. We need to sabotage this power supply in order to know where their main infrastructures are.", "", diff --git a/source/missions/missions/target/mission.sqf b/source/functions/missions/fn_target_mission.sqf similarity index 69% rename from source/missions/missions/target/mission.sqf rename to source/functions/missions/fn_target_mission.sqf index f0aac6d..0508204 100644 --- a/source/missions/missions/target/mission.sqf +++ b/source/functions/missions/fn_target_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; // define random pos AROUND TARGET. spawn markers at random. _radius = 175; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -26,25 +26,25 @@ str(_markername2) setMarkerAlpha 0.5; // CREATE PATROLS sleep 1; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createopteam.sqf"; -"O_MRAP_02_F" createVehicle ([(_missionpos select 0)+(random 10),(_missionpos select 1)+(random 10)]); +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createopteam; +Opfor_MRAP createVehicle ([(_missionpos select 0)+(random 10),(_missionpos select 1)+(random 10)]); _group = createGroup east; -_target = _group createUnit ["O_officer_F", _missionpos, [], 0, "FORM"]; -_unit = _group createUnit ["O_soldier_F", _missionpos, [], 0, "FORM"]; -_unit = _group createUnit ["O_soldier_F", _missionpos, [], 0, "FORM"]; +_target = _group createUnit [Opfor_Officer, _missionpos, [], 0, "FORM"]; +_unit = _group createUnit [Opfor_Rifleman, _missionpos, [], 0, "FORM"]; +_unit = _group createUnit [Opfor_Rifleman, _missionpos, [], 0, "FORM"]; // TASK AND NOTIFICATION //_taskhandle = player createSimpleTask ["taskTarget"]; //_taskhandle setSimpleTaskDescription ["A high enemy target has been spotted somewhere in this location. Hunt him down.",_mission_name,""]; //_taskhandle setSimpleTaskDestination (getMarkerPos str(_markername)); -[west, "_taskhandle", ["taskDestroy.", "A high enemy target has been spotted somewhere in this location. Hunt him down.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; +[west, "_taskhandle", ["A high ranking enemy target has been spotted somewhere in this location. Hunt him down.", "High Value Target", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; @@ -56,7 +56,7 @@ deleteMarker str(_markername2); deleteMarker str(_markername); //player removeSimpleTask _taskhandle; -[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; +["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; sleep 1; @@ -72,7 +72,7 @@ publicVariable "commandpointsblu1"; publicVariable "WARCOM_blufor_ap"; finishedMissionsNumber = finishedMissionsNumber + 1; publicVariable "finishedMissionsNumber"; -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; \ No newline at end of file +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/missions/missions/underwater/mission.sqf b/source/functions/missions/fn_underwater_mission.sqf similarity index 83% rename from source/missions/missions/underwater/mission.sqf rename to source/functions/missions/fn_underwater_mission.sqf index 9bbf4e0..9af59f2 100644 --- a/source/missions/missions/underwater/mission.sqf +++ b/source/functions/missions/fn_underwater_mission.sqf @@ -1,4 +1,4 @@ -_MissionPos = _this select 0; +params ["_MissionPos"]; // define random pos AROUND SOLDIERS. spawn markers at random. _radius = 150; _randompos = [(_missionpos select 0)+(random _radius)-(random _radius), (_missionpos select 1)+(random _radius)-(random _radius)]; @@ -25,7 +25,7 @@ str(_markername2) setMarkerAlpha 0.3; // create TOWER _tower = createVehicle ["Land_dp_transformer_F", _MissionPos, [], 0, "NONE"]; -_tower addaction ["Sabotage", "missions\missions\sabotage\success.sqf",[_missionPos,_mission_name,_markername,_markername2]]; +_tower addaction ["Sabotage", {_this call duws_fnc_sabotage_success;},[_missionPos,_mission_name,_markername,_markername2]]; // TASK AND NOTIFICATION _VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round(_Missionpos select 1)]; // generate variable name for task @@ -37,7 +37,7 @@ _VARtaskgeneratedName = format["tsksabot%1%2",round(_MissionPos select 0),round( [west, "_taskhandle", ["taskDestroy.", "The enemy is using a power supply somewhere in this area. We need you to find it and sabotage it. It will allow us to have a bit of better intel on our enemies.", "(getMarkerPos str(_markername)"], objNull, true] call BIS_fnc_taskCreate; if (!ismultiplayer) then { - execVM "utilities\autoSave.sqf"; + [] spawn duws_fnc_autoSave; }; ["TaskAssigned",["",_mission_name]] call bis_fnc_showNotification; @@ -47,8 +47,8 @@ call compile format ["%1 = _taskhandle",_VARtaskgeneratedName]; // create variab // CREATE OPFOR PATROLS sleep 1; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_randompos, _radius] execvm "createoppatrol.sqf"; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target +[_randompos, _radius] call duws_fnc_createoppatrol; +[_randompos, _radius] call duws_fnc_createoppatrol; +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target sleep 10; -[_missionpos, 15] execvm "createoppatrol.sqf"; // <-- around target \ No newline at end of file +[_missionpos, 15] call duws_fnc_createoppatrol; // <-- around target \ No newline at end of file diff --git a/source/missions/missions/underwater/success.sqf b/source/functions/missions/fn_underwater_success.sqf similarity index 88% rename from source/missions/missions/underwater/success.sqf rename to source/functions/missions/fn_underwater_success.sqf index a0330f0..22c14c4 100644 --- a/source/missions/missions/underwater/success.sqf +++ b/source/functions/missions/fn_underwater_success.sqf @@ -20,7 +20,7 @@ call compile format["_taskhandle = %1",_VARtaskgeneratedName]; _object removeAction _action; //player removeSimpleTask _taskhandle; -[["_taskhandle", "WEST"],"BIS_fnc_deleteTask", true, true] call BIS_fnc_MP; +["_taskhandle", "WEST"] remoteExecCall ["BIS_fnc_deleteTask", 0, true]; deleteMarker str(_markername2); deleteMarker str(_markername); @@ -38,4 +38,4 @@ finishedMissionsNumber = finishedMissionsNumber + 1; publicVariable "finishedMissionsNumber"; // ADD PERSISTENT STAT -_addmission = [] execVM "persistent\persistent_stats_missions_total.sqf"; \ No newline at end of file +_addmission = [] call duws_fnc_persistent_stats_missions_total; diff --git a/source/dialog/operative/lbselected.sqf b/source/functions/operative/fn_lbselected.sqf similarity index 92% rename from source/dialog/operative/lbselected.sqf rename to source/functions/operative/fn_lbselected.sqf index f227e71..f6deaaa 100644 --- a/source/dialog/operative/lbselected.sqf +++ b/source/functions/operative/fn_lbselected.sqf @@ -28,7 +28,7 @@ _selected_soldier_status = _selected_soldier select 7; switch (_selected_soldier_status) do { case "Ready": { - buttonSetAction [1601, "execVM 'dialog\operative\operator_recruit.sqf'"]; + buttonSetAction [1601, "[] spawn duws_fnc_operator_recruit"]; ctrlSetText [1601, "DEPLOY (5 CP)"]; }; case "Injured": { @@ -40,7 +40,7 @@ switch (_selected_soldier_status) do ctrlSetText [1601, "ALREADY DEPLOYED"]; }; case "Healed": { - buttonSetAction [1601, "execVM 'dialog\operative\operator_recruit.sqf'"]; + buttonSetAction [1601, "[] spawn duws_fnc_operator_recruit"]; ctrlSetText [1601, "REDEPLOY (2 CP)"]; }; }; \ No newline at end of file diff --git a/source/dialog/operative/operative_mission_complete.sqf b/source/functions/operative/fn_operative_mission_complete.sqf similarity index 100% rename from source/dialog/operative/operative_mission_complete.sqf rename to source/functions/operative/fn_operative_mission_complete.sqf diff --git a/source/functions/operative/fn_operator_add_aim.sqf b/source/functions/operative/fn_operator_add_aim.sqf new file mode 100644 index 0000000..dfb6e40 --- /dev/null +++ b/source/functions/operative/fn_operator_add_aim.sqf @@ -0,0 +1,16 @@ + +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_aim = _selected_soldier select 0; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_aim >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_aim_new = _selected_soldier_aim + 0.01; // update the variable +_selected_soldier set [0,_selected_soldier_aim_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; \ No newline at end of file diff --git a/source/functions/operative/fn_operator_add_comms.sqf b/source/functions/operative/fn_operator_add_comms.sqf new file mode 100644 index 0000000..ff9ff00 --- /dev/null +++ b/source/functions/operative/fn_operator_add_comms.sqf @@ -0,0 +1,15 @@ +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_comms = _selected_soldier select 4; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_comms >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_comms_new = _selected_soldier_comms + 0.01; // update the variable +_selected_soldier set [4,_selected_soldier_comms_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; \ No newline at end of file diff --git a/source/functions/operative/fn_operator_add_courage.sqf b/source/functions/operative/fn_operator_add_courage.sqf new file mode 100644 index 0000000..5cd500b --- /dev/null +++ b/source/functions/operative/fn_operator_add_courage.sqf @@ -0,0 +1,15 @@ +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_courage = _selected_soldier select 3; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_courage >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_courage_new = _selected_soldier_courage + 0.01; // update the variable +_selected_soldier set [3,_selected_soldier_courage_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; \ No newline at end of file diff --git a/source/functions/operative/fn_operator_add_reflexes.sqf b/source/functions/operative/fn_operator_add_reflexes.sqf new file mode 100644 index 0000000..98bb578 --- /dev/null +++ b/source/functions/operative/fn_operator_add_reflexes.sqf @@ -0,0 +1,15 @@ +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_reflexes = _selected_soldier select 1; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_reflexes >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_reflexes_new = _selected_soldier_reflexes + 0.01; // update the variable +_selected_soldier set [1,_selected_soldier_reflexes_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; \ No newline at end of file diff --git a/source/functions/operative/fn_operator_add_reload.sqf b/source/functions/operative/fn_operator_add_reload.sqf new file mode 100644 index 0000000..e1714c4 --- /dev/null +++ b/source/functions/operative/fn_operator_add_reload.sqf @@ -0,0 +1,15 @@ +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_reload = _selected_soldier select 5; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_reload >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_reload_new = _selected_soldier_reload + 0.01; // update the variable +_selected_soldier set [5,_selected_soldier_reload_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; \ No newline at end of file diff --git a/source/functions/operative/fn_operator_add_spotting.sqf b/source/functions/operative/fn_operator_add_spotting.sqf new file mode 100644 index 0000000..c546046 --- /dev/null +++ b/source/functions/operative/fn_operator_add_spotting.sqf @@ -0,0 +1,16 @@ + +_selected_index = lbCurSel 1500; +_selected_soldier = duws_operator_list select _selected_index; // get the selected soldier from the array of soldier using the selected index + +_selected_soldier_spotting = _selected_soldier select 2; +_selected_soldier_points = _selected_soldier select 13; +if (_selected_soldier_points <= 0) exitWith {hint "You have no points available"}; +if (_selected_soldier_spotting >= 1) exitWith {hint "This stat is already at the maximum"}; + +_selected_soldier_spotting_new = _selected_soldier_spotting + 0.01; // update the variable +_selected_soldier set [2,_selected_soldier_spotting_new]; + +_selected_soldier_pts_new = _selected_soldier_points - 1; +_selected_soldier set [13,_selected_soldier_pts_new]; +[] call duws_fnc_lbselected; +hint "New stats will be applied at the next deployment of this operative"; diff --git a/source/dialog/operative/operator_open.sqf b/source/functions/operative/fn_operator_open.sqf similarity index 100% rename from source/dialog/operative/operator_open.sqf rename to source/functions/operative/fn_operator_open.sqf diff --git a/source/dialog/operative/operator_recruit.sqf b/source/functions/operative/fn_operator_recruit.sqf similarity index 98% rename from source/dialog/operative/operator_recruit.sqf rename to source/functions/operative/fn_operator_recruit.sqf index e6ec3c7..4671c0c 100644 --- a/source/dialog/operative/operator_recruit.sqf +++ b/source/functions/operative/fn_operator_recruit.sqf @@ -53,7 +53,7 @@ duws_operator_list select lbCurSel 1500 set [7,"Operating"]; ctrlSetText [1013, format["%1",_selected_soldier_status]]; buttonSetAction [1601, "hint ""This operative is already active in this theatre of operation"""]; -ctrlSetText [1601, "ALREADY DEPLOYED"]; +ctrlSetText [1601, "ALREADY DEPLOYED"]; // wait until the operator is dead waitUntil {sleep 2; !alive _soldier}; diff --git a/source/functions/pFLIR/fn_livefeed.sqf b/source/functions/pFLIR/fn_livefeed.sqf new file mode 100644 index 0000000..8320922 --- /dev/null +++ b/source/functions/pFLIR/fn_livefeed.sqf @@ -0,0 +1,76 @@ +// pFLIRenable = player addaction ["Activate FLIR",duws_fnc_livefeed,"", 0,false,true,"","_target == _this"]; + +// pflir aim +trucPIPtarget = "Land_Sack_F" createVehicle ([0,0,0]); // PAS OUBLIER DE SUPPRIMER LE TRUC +trucPIPtarget attachTo [player,[0,2000,1]]; +trucPIPtarget hideobject true; + +// pflir camera creation +_lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed; +BIS_liveFeed attachTo [player,[0,1,1]]; +BIS_liveFeed camPrepareFOV 0.2; +BIS_liveFeed camCommitPrepared 0; + +pFlirActivated = true; +player removeEventHandler ["respawn",PlayerKilledEH3]; +player removeAction pFlirEnable; + + +// Stance management init +_actualStance = stance player; +switch (_actualStance) do +{ + case "STAND": + { + BIS_liveFeed attachTo [player,[0,1,1.68]]; + trucPIPtarget attachTo [player,[0,2000,1.68]]; + }; + + case "CROUCH": + { + BIS_liveFeed attachTo [player,[0,1,0.85]]; + trucPIPtarget attachTo [player,[0,2000,0.85]]; + }; + + case "PRONE": + { + BIS_liveFeed attachTo [player,[0,1,0.25]]; + trucPIPtarget attachTo [player,[0,2000,0.25]]; + }; + +}; + +// add action to disable FLIR +sleep 1; + +pFLIRdisable = player addaction ["Deactivate FLIR",duws_fnc_livefeedexit,"", 0,false,true,"","_target == _this"]; +PlayerKilledEH2 = player addEventHandler ["killed", duws_fnc_livefeedexit]; //removes screen from hud + + + +while {pFlirActivated} do { +waitUntil {(_actualStance != stance player) or !pFlirActivated}; +if (!pFlirActivated) exitWith {}; + _actualStance = stance player; + switch (_actualStance) do + { + case "STAND": + { + BIS_liveFeed attachTo [player,[0,1,1.68]]; + trucPIPtarget attachTo [player,[0,2000,1.68]]; + }; + + case "CROUCH": + { + BIS_liveFeed attachTo [player,[0,1,0.85]]; + trucPIPtarget attachTo [player,[0,2000,0.85]]; + }; + + case "PRONE": + { + BIS_liveFeed attachTo [player,[0,1,0.25]]; + trucPIPtarget attachTo [player,[0,2000,0.25]]; + }; + + }; +}; diff --git a/source/functions/pFLIR/fn_livefeed1.sqf b/source/functions/pFLIR/fn_livefeed1.sqf new file mode 100644 index 0000000..7bb8375 --- /dev/null +++ b/source/functions/pFLIR/fn_livefeed1.sqf @@ -0,0 +1,76 @@ +// pFLIRenable = player addaction ["Activate FLIR",duws_fnc_livefeed1,"", 0,false,true,"","_target == _this"]; + +// pflir aim +trucPIPtarget = "Land_Sack_F" createVehicle ([0,0,0]); // PAS OUBLIER DE SUPPRIMER LE TRUC +trucPIPtarget attachTo [player,[0,2000,1]]; +trucPIPtarget hideobject true; + +// pflir camera creation +_lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed; +BIS_liveFeed attachTo [player,[0,1,1]]; +BIS_liveFeed camPrepareFOV 0.2; +BIS_liveFeed camCommitPrepared 0; + +pFlirActivated = true; +player removeEventHandler ["respawn",PlayerRespawnEH2]; +player removeAction pFLIRenable; + + +// Stance management init +_actualStance = stance player; +switch (_actualStance) do +{ + case "STAND": + { + BIS_liveFeed attachTo [player,[0,1,1.68]]; + trucPIPtarget attachTo [player,[0,2000,1.68]]; + }; + + case "CROUCH": + { + BIS_liveFeed attachTo [player,[0,1,0.85]]; + trucPIPtarget attachTo [player,[0,2000,0.85]]; + }; + + case "PRONE": + { + BIS_liveFeed attachTo [player,[0,1,0.25]]; + trucPIPtarget attachTo [player,[0,2000,0.25]]; + }; + +}; + +// add action to disable FLIR +sleep 1; + +pFLIRdisable = player addaction ["Deactivate FLIR",duws_fnc_livefeedexit,"", 0,false,true,"","_target == _this"]; +PlayerKilledEH2 = player addEventHandler ["killed", {[] spawn duws_fnc_livefeedexit}]; //removes screen from hud + + + +while {pFlirActivated} do { +waitUntil {(_actualStance != stance player) or !pFlirActivated}; +if (!pFlirActivated) exitWith {}; + _actualStance = stance player; + switch (_actualStance) do + { + case "STAND": + { + BIS_liveFeed attachTo [player,[0,1,1.68]]; + trucPIPtarget attachTo [player,[0,2000,1.68]]; + }; + + case "CROUCH": + { + BIS_liveFeed attachTo [player,[0,1,0.85]]; + trucPIPtarget attachTo [player,[0,2000,0.85]]; + }; + + case "PRONE": + { + BIS_liveFeed attachTo [player,[0,1,0.25]]; + trucPIPtarget attachTo [player,[0,2000,0.25]]; + }; + + }; +}; diff --git a/source/pFLIR/livefeedexit.sqf b/source/functions/pFLIR/fn_livefeedexit.sqf similarity index 60% rename from source/pFLIR/livefeedexit.sqf rename to source/functions/pFLIR/fn_livefeedexit.sqf index b7673c9..d18df87 100644 --- a/source/pFLIR/livefeedexit.sqf +++ b/source/functions/pFLIR/fn_livefeedexit.sqf @@ -8,8 +8,8 @@ player removeEventHandler ["killed",PlayerKilledEH2]; sleep 2; -waitUntil {alive player}; -pFLIRenable = player addaction ["Enable FLIR","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]; //original last line in script +waitUntil {alive player}; +pFLIRenable = player addaction ["Enable FLIR",duws_fnc_livefeed,"", 0,false,true,"","_target == _this"]; //original last line in script -PlayerKilledEH3 = player addEventHandler ["respawn",{player addaction ["Enable FLIR","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]}]; +PlayerKilledEH3 = player addEventHandler ["respawn",{player addaction ["Enable FLIR",duws_fnc_livefeed,"", 0,false,true,"","_target == _this"]}]; diff --git a/source/persistent/experience/experience_ability_check.sqf b/source/functions/persistent/fn_experience_ability_check.sqf similarity index 85% rename from source/persistent/experience/experience_ability_check.sqf rename to source/functions/persistent/fn_experience_ability_check.sqf index fda5aa9..a620d98 100644 --- a/source/persistent/experience/experience_ability_check.sqf +++ b/source/functions/persistent/fn_experience_ability_check.sqf @@ -1,7 +1,7 @@ // Abilities based on the players accumulated experience is enabled here. waitUntil {sleep 2; experience_total>=5}; -_handle = [player] execVM "persistent\experience\experience_ability_stamina.sqf"; +_handle = [player] spawn duws_fnc_experience_ability_stamina; ["new_ability",["New ability: Enhanced Conditioning","Boost your endurance, evade and escape enemies"]] call bis_fnc_showNotification; ["new_ability",["Abilities","More info on abilities inside the briefing"]] call bis_fnc_showNotification; _index = player createDiarySubject ["abilities_info","Abilities"]; @@ -11,47 +11,47 @@ player createDiaryRecord ["abilities_info", ["Enhanced Conditioning", "=15}; if (!isMultiplayer) then { - _handle = [player] execVM "persistent\experience\experience_ability_slowtime.sqf"; + _handle = [player] spawn duws_fnc_experience_ability_slowtime; ["new_ability",["New ability: Quick Reflexes","Slow down time, take your shot"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Quick Reflexes", "Cooldown: 5 minutes
Description:
When activated through the radio menu, the time is slowed down for around 12 seconds, allowing you to clear rooms, compound or kill in a brief amount of time a group of enemies."]]; } else { // Place holder until a new skill can be thought up. :-) - _handle = [player] execVM "persistent\experience\experience_ability_logistic.sqf"; + _handle = [player] spawn duws_fnc_experience_ability_logistic; ["new_ability",["New ability: Logistic Support","They're sending lots of resources your way"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Logistic Support", "Cooldown: 15 minutes (passive)
Description:
This passive ability gives you +1 command point every 15 minutes."]]; }; waitUntil {sleep 2; experience_total>=25}; -_handle = [player] execVM "persistent\experience\experience_ability_heal.sqf"; +_handle = [player] spawn duws_fnc_experience_ability_heal; ["new_ability",["New ability: Field Surgery","You are really hard to kill, you know that ?"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Field Surgery", "Cooldown: 20 minutes
Description:
When activated through the radio menu, you will be fully healed after a short period of time"]]; waitUntil {sleep 2; experience_total>=30}; -_handle = [player] execVM "persistent\experience\experience_ability_fieldcomm.sqf"; +_handle = [player] spawn duws_fnc_experience_ability_fieldcomm; ["new_ability",["New ability: Field Commander","Leading the way"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Field Commander", "Cooldown: N/A
Description:
You can now access the squad manager when you want."]]; waitUntil {sleep 2; experience_total>=35}; -_handle = [player] execVM "persistent\experience\experience_ability_warrior.sqf"; +_handle = [player] spawn duws_fnc_experience_ability_warrior; ["new_ability",["New ability: Veteran Instinct","I think I saw someone around this corner..."]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Veteran Instinct", "Cooldown: 10 minutes
Description:
When activated through the radio menu, for 60 seconds you will know if the zone in a radius of 50 meters around you is clear of enemies or not."]]; waitUntil {sleep 2; experience_total>=45}; -_handle = [player] execVM "persistent\experience\experience_ability_refit.sqf"; +_handle = [player] spawn duws_fnc_experience_ability_refit; ["new_ability",["New ability: Field Repair","Did someone say MacGyver ?"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Field Repair", "Cooldown: 1 hour
Description:
When activated through the radio menu, the vehicle in which you are inside will be repaired, and a little bit of fuel added."]]; waitUntil {sleep 2; experience_total>=55}; if (!isMultiplayer) then { - _handle = [player] execVM "persistent\experience\experience_ability_logistic.sqf"; + _handle = [player] spawn duws_fnc_experience_ability_logistic; ["new_ability",["New ability: Logistic Support","They're sending lots of ressources your way"]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Logistic Support", "Cooldown: 15 minutes (passive)
Description:
This passive ability gives you +1 command point every 15 minutes."]]; } else { - _handle = [player] execVM "persistent\experience\experience_ability_logistic_boost.sqf"; + _handle = [player] spawn duws_fnc_experience_ability_logistic_boost; ["new_ability",["New ability: Logistic Boost","We are committed to winning."]] call bis_fnc_showNotification; player createDiaryRecord ["abilities_info", ["Logistic Boost", "Cooldown: 30 minutes (passive)
Description:
This passive ability gives you +5 command point every 30 minutes."]]; }; \ No newline at end of file diff --git a/source/functions/persistent/fn_experience_ability_fieldcomm.sqf b/source/functions/persistent/fn_experience_ability_fieldcomm.sqf new file mode 100644 index 0000000..da792da --- /dev/null +++ b/source/functions/persistent/fn_experience_ability_fieldcomm.sqf @@ -0,0 +1,6 @@ +player addaction ["Squad manager",duws_fnc_squadmng, "", 0, true, true, "", "_this == player"]; + + + + + diff --git a/source/persistent/experience/experience_ability_heal.sqf b/source/functions/persistent/fn_experience_ability_heal.sqf similarity index 96% rename from source/persistent/experience/experience_ability_heal.sqf rename to source/functions/persistent/fn_experience_ability_heal.sqf index bc7fc37..7b58994 100644 --- a/source/persistent/experience/experience_ability_heal.sqf +++ b/source/functions/persistent/fn_experience_ability_heal.sqf @@ -27,7 +27,7 @@ deleteVehicle _trg; titleText [format["%1, patching you up...",_ability_name], "PLAIN DOWN"]; /// ----- ABILITY IS ACTIVATED - player playmove "AinvPknlMstpSlayWrflDnon_medic"; + player playmove "AinvPknlMstpSlayWrflDnon_medic"; sleep 4; player setdamage 0; /// ---- ABILITY IS ACTIVATED diff --git a/source/persistent/experience/experience_ability_logistic.sqf b/source/functions/persistent/fn_experience_ability_logistic.sqf similarity index 100% rename from source/persistent/experience/experience_ability_logistic.sqf rename to source/functions/persistent/fn_experience_ability_logistic.sqf diff --git a/source/persistent/experience/experience_ability_logistic_boost.sqf b/source/functions/persistent/fn_experience_ability_logistic_boost.sqf similarity index 100% rename from source/persistent/experience/experience_ability_logistic_boost.sqf rename to source/functions/persistent/fn_experience_ability_logistic_boost.sqf diff --git a/source/persistent/experience/experience_ability_refit.sqf b/source/functions/persistent/fn_experience_ability_refit.sqf similarity index 96% rename from source/persistent/experience/experience_ability_refit.sqf rename to source/functions/persistent/fn_experience_ability_refit.sqf index be1a3f0..504b803 100644 --- a/source/persistent/experience/experience_ability_refit.sqf +++ b/source/functions/persistent/fn_experience_ability_refit.sqf @@ -30,8 +30,8 @@ deleteVehicle _trg; titleText [format["%1 activated, the vehicle is being fixed...",_ability_name], "PLAIN DOWN"]; /// ----- ABILITY IS ACTIVATED sleep 10; - _actualFuel = fuel _veh; - _veh setFuel (_actualFuel + 0.1); + _actualFuel = fuel _veh; + _veh setFuel (_actualFuel + 0.1); _veh setdamage 0; /// ---- ABILITY IS ACTIVATED titleText [format["%1 done\nCooldown: 1 hour",_ability_name,_cooldown], "PLAIN DOWN"]; diff --git a/source/persistent/experience/experience_ability_slowtime.sqf b/source/functions/persistent/fn_experience_ability_slowtime.sqf similarity index 100% rename from source/persistent/experience/experience_ability_slowtime.sqf rename to source/functions/persistent/fn_experience_ability_slowtime.sqf diff --git a/source/persistent/experience/experience_ability_stamina.sqf b/source/functions/persistent/fn_experience_ability_stamina.sqf similarity index 100% rename from source/persistent/experience/experience_ability_stamina.sqf rename to source/functions/persistent/fn_experience_ability_stamina.sqf diff --git a/source/persistent/experience/experience_ability_warrior.sqf b/source/functions/persistent/fn_experience_ability_warrior.sqf similarity index 100% rename from source/persistent/experience/experience_ability_warrior.sqf rename to source/functions/persistent/fn_experience_ability_warrior.sqf diff --git a/source/persistent/experience/experience_init.sqf b/source/functions/persistent/fn_experience_init.sqf similarity index 85% rename from source/persistent/experience/experience_init.sqf rename to source/functions/persistent/fn_experience_init.sqf index db774cd..0a8fb29 100644 --- a/source/persistent/experience/experience_init.sqf +++ b/source/functions/persistent/fn_experience_init.sqf @@ -16,4 +16,4 @@ experience_total = experience_missions + experience_zones + experience_islands; }; }; -_handle = [] execVM "persistent\experience\experience_ability_check.sqf" // lance le script de check de l'xp. \ No newline at end of file +[] spawn duws_fnc_experience_ability_check // lance le script de check de l'xp. \ No newline at end of file diff --git a/source/persistent/persistent_stats_init.sqf b/source/functions/persistent/fn_persistent_stats_init.sqf similarity index 95% rename from source/persistent/persistent_stats_init.sqf rename to source/functions/persistent/fn_persistent_stats_init.sqf index 96af581..6fdb938 100644 --- a/source/persistent/persistent_stats_init.sqf +++ b/source/functions/persistent/fn_persistent_stats_init.sqf @@ -41,5 +41,4 @@ mission_DUWS_firstlaunch = profileNamespace getVariable "profile_DUWS_firstlaunc // Lance l'init de l'xp -_handle = [] execVM "persistent\experience\experience_init.sqf"; -waitUntil {scriptDone _handle}; +[] call duws_fnc_experience_init; diff --git a/source/persistent/persistent_stats_missions_total.sqf b/source/functions/persistent/fn_persistent_stats_missions_total.sqf similarity index 61% rename from source/persistent/persistent_stats_missions_total.sqf rename to source/functions/persistent/fn_persistent_stats_missions_total.sqf index b782919..72a965c 100644 --- a/source/persistent/persistent_stats_missions_total.sqf +++ b/source/functions/persistent/fn_persistent_stats_missions_total.sqf @@ -4,9 +4,9 @@ profileNamespace setVariable ["profile_number_of_missions_done", mission_number_ saveProfileNamespace; // sauvegarde le profil if (isMultiplayer) then { - if (isServer) then { - finishedMissionsNumber = finishedMissionsNumber + 1; - publicVariable "finishedMissionsNumber"; - }; - }; - \ No newline at end of file + if (isServer) then { + finishedMissionsNumber = finishedMissionsNumber + 1; + publicVariable "finishedMissionsNumber"; + }; + }; + \ No newline at end of file diff --git a/source/persistent/persistent_stats_reset.sqf b/source/functions/persistent/fn_persistent_stats_reset.sqf similarity index 100% rename from source/persistent/persistent_stats_reset.sqf rename to source/functions/persistent/fn_persistent_stats_reset.sqf diff --git a/source/persistent/persistent_stats_win.sqf b/source/functions/persistent/fn_persistent_stats_win.sqf similarity index 100% rename from source/persistent/persistent_stats_win.sqf rename to source/functions/persistent/fn_persistent_stats_win.sqf diff --git a/source/persistent/persistent_stats_zones_add.sqf b/source/functions/persistent/fn_persistent_stats_zones_add.sqf similarity index 63% rename from source/persistent/persistent_stats_zones_add.sqf rename to source/functions/persistent/fn_persistent_stats_zones_add.sqf index eba0d2c..735abd0 100644 --- a/source/persistent/persistent_stats_zones_add.sqf +++ b/source/functions/persistent/fn_persistent_stats_zones_add.sqf @@ -4,9 +4,9 @@ profileNamespace setVariable ["profile_number_of_zones_captured", mission_number saveProfileNamespace; // sauvegarde le profil if (isMultiplayer) then { - if (isServer) then { - capturedZonesNumber = capturedZonesNumber + 1; - publicVariable "capturedZonesNumber"; - }; - }; - \ No newline at end of file + if (isServer) then { + capturedZonesNumber = capturedZonesNumber + 1; + publicVariable "capturedZonesNumber"; + }; + }; + \ No newline at end of file diff --git a/source/initZones/prefabs/Barracks.sqf b/source/functions/prefabs/fn_site_Barracks.sqf similarity index 100% rename from source/initZones/prefabs/Barracks.sqf rename to source/functions/prefabs/fn_site_Barracks.sqf diff --git a/source/initZones/prefabs/CommStation.sqf b/source/functions/prefabs/fn_site_CommStation.sqf similarity index 100% rename from source/initZones/prefabs/CommStation.sqf rename to source/functions/prefabs/fn_site_CommStation.sqf diff --git a/source/initZones/prefabs/campsite.sqf b/source/functions/prefabs/fn_site_campsite.sqf similarity index 98% rename from source/initZones/prefabs/campsite.sqf rename to source/functions/prefabs/fn_site_campsite.sqf index 139e82e..3d3ab5f 100644 --- a/source/initZones/prefabs/campsite.sqf +++ b/source/functions/prefabs/fn_site_campsite.sqf @@ -215,7 +215,7 @@ _this setPos [(1820.2357)-_centerX+_centerSpawnX, (5625.1577)-_centerY+_centerSp _vehicle_34 = objNull; if (true) then { -_this = createVehicle ["B_G_Offroad_01_armed_F", [1818.2542, 5619.2583, 0.090222724], [], 0, "CAN_COLLIDE"]; +_this = createVehicle ["Land_Wreck_Ural_F", [1818.2542, 5619.2583, 0.090222724], [], 0, "CAN_COLLIDE"]; _vehicle_34 = _this; _this setDir 197.77122; _this setPos [(1818.2542)-_centerX+_centerSpawnX, (5619.2583)-_centerY+_centerSpawnY, 0.090222724]; @@ -233,7 +233,7 @@ _this setPos [(1814.3376)-_centerX+_centerSpawnX, (5622.2422)-_centerY+_centerSp _vehicle_39 = objNull; if (true) then { -_this = createVehicle ["O_Quadbike_01_F", [1818.0513, 5627.2832, 0.11207256], [], 0, "CAN_COLLIDE"]; +_this = createVehicle [Opfor_Quadbike, [1818.0513, 5627.2832, 0.11207256], [], 0, "CAN_COLLIDE"]; _vehicle_39 = _this; _this setDir 211.33353; _this setPos [(1818.0513)-_centerX+_centerSpawnX, (5627.2832)-_centerY+_centerSpawnY, 0.11207256]; diff --git a/source/initZones/prefabs/commandOP.sqf b/source/functions/prefabs/fn_site_commandOP.sqf similarity index 99% rename from source/initZones/prefabs/commandOP.sqf rename to source/functions/prefabs/fn_site_commandOP.sqf index 96204b6..1c67c1a 100644 --- a/source/initZones/prefabs/commandOP.sqf +++ b/source/functions/prefabs/fn_site_commandOP.sqf @@ -445,7 +445,7 @@ if (true) then _vehicle_159 = objNull; if (true) then { - _this = createVehicle ["O_supplyCrate_F", [1799.2623, 5582.4023, 9.5367432e-007], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Supplycrate, [1799.2623, 5582.4023, 9.5367432e-007], [], 0, "CAN_COLLIDE"]; _vehicle_159 = _this; _this setDir 103.3849; _this setPos [(1799.2623)-_centerX+_centerSpawnX, (5582.4023)-_centerY+_centerSpawnY, 9.5367432e-007]; @@ -578,7 +578,7 @@ if (true) then _vehicle_204 = objNull; if (true) then { - _this = createVehicle ["O_supplyCrate_F", [1809.151, 5571.9531, 1.9073486e-006], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Supplycrate, [1809.151, 5571.9531, 1.9073486e-006], [], 0, "CAN_COLLIDE"]; _vehicle_204 = _this; _this setDir 135.43332; _this setPos [(1809.151)-_centerX+_centerSpawnX, (5571.9531)-_centerY+_centerSpawnY, 1.9073486e-006]; @@ -587,7 +587,7 @@ if (true) then _vehicle_207 = objNull; if (true) then { - _this = createVehicle ["O_supplyCrate_F", [1810.049, 5570.918, 6.1988831e-006], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Supplycrate, [1810.049, 5570.918, 6.1988831e-006], [], 0, "CAN_COLLIDE"]; _vehicle_207 = _this; _this setDir 118.68628; _this setPos [(1810.049)-_centerX+_centerSpawnX, (5570.918)-_centerY+_centerSpawnY, 6.1988831e-006]; diff --git a/source/initZones/prefabs/outpost1.sqf b/source/functions/prefabs/fn_site_outpost1.sqf similarity index 100% rename from source/initZones/prefabs/outpost1.sqf rename to source/functions/prefabs/fn_site_outpost1.sqf diff --git a/source/initZones/prefabs/outpost2.sqf b/source/functions/prefabs/fn_site_outpost2.sqf similarity index 100% rename from source/initZones/prefabs/outpost2.sqf rename to source/functions/prefabs/fn_site_outpost2.sqf diff --git a/source/initZones/prefabs/powerRelay.sqf b/source/functions/prefabs/fn_site_powerRelay.sqf similarity index 98% rename from source/initZones/prefabs/powerRelay.sqf rename to source/functions/prefabs/fn_site_powerRelay.sqf index 2f05c08..38e04bb 100644 --- a/source/initZones/prefabs/powerRelay.sqf +++ b/source/functions/prefabs/fn_site_powerRelay.sqf @@ -182,7 +182,7 @@ if (true) then _vehicle_74 = objNull; if (true) then { - _this = createVehicle ["O_Truck_02_covered_F", [1810.3815, 5620.46], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Truck_Covered, [1810.3815, 5620.46], [], 0, "CAN_COLLIDE"]; _vehicle_74 = _this; _this setDir 3.5739508; _this setPos [(1810.3815)-_centerX+_centerSpawnX, (5620.46)-_centerY+_centerSpawnY]; diff --git a/source/initZones/prefabs/reconOutpost.sqf b/source/functions/prefabs/fn_site_reconOutpost.sqf similarity index 100% rename from source/initZones/prefabs/reconOutpost.sqf rename to source/functions/prefabs/fn_site_reconOutpost.sqf diff --git a/source/initZones/prefabs/researchBunker.sqf b/source/functions/prefabs/fn_site_researchBunker.sqf similarity index 100% rename from source/initZones/prefabs/researchBunker.sqf rename to source/functions/prefabs/fn_site_researchBunker.sqf diff --git a/source/initZones/prefabs/researchStation.sqf b/source/functions/prefabs/fn_site_researchStation.sqf similarity index 100% rename from source/initZones/prefabs/researchStation.sqf rename to source/functions/prefabs/fn_site_researchStation.sqf diff --git a/source/initZones/prefabs/vehfittingstation.sqf b/source/functions/prefabs/fn_site_vehfittingstation.sqf similarity index 97% rename from source/initZones/prefabs/vehfittingstation.sqf rename to source/functions/prefabs/fn_site_vehfittingstation.sqf index 5968b64..85e342a 100644 --- a/source/initZones/prefabs/vehfittingstation.sqf +++ b/source/functions/prefabs/fn_site_vehfittingstation.sqf @@ -117,7 +117,7 @@ if (true) then _vehicle_105 = objNull; if (true) then { - _this = createVehicle ["O_Truck_02_transport_F", [1802.9224, 5576.1797, 1.0490417e-005], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Truck_Open, [1802.9224, 5576.1797, 1.0490417e-005], [], 0, "CAN_COLLIDE"]; _vehicle_105 = _this; _this setDir 187.68138; _this setPos [(1802.9224)-_centerX+_centerSpawnX, (5576.1797)-_centerY+_centerSpawnY, 1.0490417e-005]; @@ -126,7 +126,7 @@ if (true) then _vehicle_107 = objNull; if (true) then { - _this = createVehicle ["O_Truck_02_covered_F", [1802.2045, 5585.0039, 8.5830688e-006], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Truck_Covered, [1802.2045, 5585.0039, 8.5830688e-006], [], 0, "CAN_COLLIDE"]; _vehicle_107 = _this; _this setDir 141.58446; _this setPos [(1802.2045)-_centerX+_centerSpawnX, (5585.0039)-_centerY+_centerSpawnY, 8.5830688e-006]; @@ -364,7 +364,7 @@ if (true) then _vehicle_183 = objNull; if (true) then { - _this = createVehicle ["O_supplyCrate_F", [1805.4933, 5574.2349, 1.3851749], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_Supplycrate, [1805.4933, 5574.2349, 1.3851749], [], 0, "CAN_COLLIDE"]; _vehicle_183 = _this; _this setDir 64.2202; _this setPos [(1805.4933)-_centerX+_centerSpawnX, (5574.2349)-_centerY+_centerSpawnY, 1.3851749]; @@ -373,7 +373,7 @@ if (true) then _vehicle_184 = objNull; if (true) then { - _this = createVehicle ["O_MRAP_02_F", [1816.5087, 5582.4043], [], 0, "CAN_COLLIDE"]; + _this = createVehicle [Opfor_MRAP, [1816.5087, 5582.4043], [], 0, "CAN_COLLIDE"]; _vehicle_184 = _this; _this setDir -9.1138811; _this setPos [(1816.5087)-_centerX+_centerSpawnX, (5582.4043)-_centerY+_centerSpawnY]; diff --git a/source/initZones/old/createzone.sqf b/source/functions/prefabs/old/createzone.sqf similarity index 72% rename from source/initZones/old/createzone.sqf rename to source/functions/prefabs/old/createzone.sqf index 28939bc..6c5837d 100644 --- a/source/initZones/old/createzone.sqf +++ b/source/functions/prefabs/old/createzone.sqf @@ -1,6 +1,7 @@ // _trg = ["Outpost Airbase",5,50,this,true] execvm "createzone.sqf"; // Name of the place,pts,radius,this,fortified/not // +// New usage: _trg = ["Outpost Airbase",5,50,this,true] spawn duws_fnc_createzone _place = _this select 0; _points = _this select 1; @@ -52,7 +53,7 @@ str(_markername2) setMarkerAlpha 0.1; _trg=createTrigger["EmptyDetector",getPos _trigger]; _trg setTriggerArea[_size,_size,0,false]; _trg setTriggerActivation["WEST SEIZED","PRESENT",false]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4""] execvm 'captured.sqf'",_place,_points,_markername,_markername2], ""]; +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4""] spawn duws_fnc_captured",_place,_points,_markername,_markername2], ""]; _trg setTriggerTimeout [30, 60, 300, true ]; // hint format["""%1"",%2",_place,_points]; @@ -62,52 +63,52 @@ _trg2=createTrigger["EmptyDetector",getPos _trigger]; _trg2 triggerAttachVehicle [player1]; _trg2 setTriggerArea[_size,_size,0,false]; _trg2 setTriggerActivation["VEHICLE","PRESENT",true]; -_trg2 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocation.sqf'",_place], ""]; +_trg2 setTriggerStatements["this", format["[""%1"",thislist] spawn duws_fnc_enterlocation",_place], ""]; // CREATE OPFOR. HEAVY CLUSTERFUCK INCOMING. // Check if fortified is true if (_fortified) then { - [getpos _trigger] execvm "createopfortified.sqf"; + [getpos _trigger] call duws_fnc_createopfortified; sleep 2; }; // Check if radius is 100m or smaller => create 2 patrols then exit the script if (_size < 101) exitWith { - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; }; // Check if radius is 250m-100m => create 2 patrols and 1 fireteam then exit the script if (_size < 251) exitWith { - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [getpos _trigger, _size] execvm "createopteam.sqf"; + [getpos _trigger, _size] call duws_fnc_createopteam }; // Check if radius is 250m-500m => create 2 patrols and 2 fireteams then exit the script if (_size < 501) exitWith { - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [getpos _trigger, _size] execvm "createopteam.sqf"; + [getpos _trigger, _size] call duws_fnc_createopteam sleep 3; - [getpos _trigger, _size] execvm "createopteam.sqf"; + [getpos _trigger, _size] call duws_fnc_createopteam }; // if superior to 500m: 3 ft 3 patrols - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep (random 3); - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [getpos _trigger, _size] execvm "createoppatrol.sqf"; + [getpos _trigger, _size] call duws_fnc_createoppatrol; sleep 2+(random 3); - [getpos _trigger, _size] execvm "createopteam.sqf"; + [getpos _trigger, _size] call duws_fnc_createopteam sleep 3; - [getpos _trigger, _size] execvm "createopteam.sqf"; + [getpos _trigger, _size] call duws_fnc_createopteam sleep 3; - [getpos _trigger, _size] execvm "createopteam.sqf"; \ No newline at end of file + [getpos _trigger, _size] call duws_fnc_createopteam \ No newline at end of file diff --git a/source/initZones/old/locatorzones.sqf b/source/functions/prefabs/old/locatorzones.sqf similarity index 82% rename from source/initZones/old/locatorzones.sqf rename to source/functions/prefabs/old/locatorzones.sqf index 895cab8..e3596af 100644 --- a/source/initZones/old/locatorzones.sqf +++ b/source/functions/prefabs/old/locatorzones.sqf @@ -29,7 +29,7 @@ for [{_i=1}, {_i<=zones_number}, {_i=_i+1}] do // BEGIN "FOR" LOOP -- while {!_found} do { - _truc = "B_Truck_01_covered_F" createVehicle ([0,0,0]); + _truc = Blufor_Truck_Covered createVehicle ([0,0,0]); _posX = random _mapSize ; _posY = random _mapSize ; @@ -40,15 +40,15 @@ while {!_found} do _posDeTrucZ = _posDeTruc select 2; sleep 0.1; if (_posDeTrucZ > 0) then { // SI AU DESSUS DE L'EAU - _meilleurTruc = "B_Truck_01_covered_F" createVehicle (_posDeTruc); // Reference truck + _meilleurTruc = Blufor_Truck_Covered createVehicle (_posDeTruc); // Reference truck _posDeMeilleurTruc = getPos _meilleurTruc; _playerDistance = _posDeMeilleurTruc distance player; deleteVehicle _meilleurTruc; - _trucX = "B_Truck_01_covered_F" createVehicle ([(_posDeMeilleurTruc select 0)+_radius, _posDeMeilleurTruc select 1, _posDeMeilleurTruc select 2]); - _trucY = "B_Truck_01_covered_F" createVehicle ([_posDeMeilleurTruc select 0, (_posDeMeilleurTruc select 1)+_radius, _posDeMeilleurTruc select 2]); - _truc_X = "B_Truck_01_covered_F" createVehicle ([(_posDeMeilleurTruc select 0)-_radius, _posDeMeilleurTruc select 1, _posDeMeilleurTruc select 2]); - _truc_Y = "B_Truck_01_covered_F" createVehicle ([_posDeMeilleurTruc select 0, (_posDeMeilleurTruc select 1)-_radius, _posDeMeilleurTruc select 2]); + _trucX = Blufor_Truck_Covered createVehicle ([(_posDeMeilleurTruc select 0)+_radius, _posDeMeilleurTruc select 1, _posDeMeilleurTruc select 2]); + _trucY = Blufor_Truck_Covered createVehicle ([_posDeMeilleurTruc select 0, (_posDeMeilleurTruc select 1)+_radius, _posDeMeilleurTruc select 2]); + _truc_X = Blufor_Truck_Covered createVehicle ([(_posDeMeilleurTruc select 0)-_radius, _posDeMeilleurTruc select 1, _posDeMeilleurTruc select 2]); + _truc_Y = Blufor_Truck_Covered createVehicle ([_posDeMeilleurTruc select 0, (_posDeMeilleurTruc select 1)-_radius, _posDeMeilleurTruc select 2]); _posTrucX = getpos _trucX; _posTrucY = getpos _trucY; @@ -99,7 +99,7 @@ while {!_found} do if (_found_distance) then { - _null = [format["Zone %1",_i],_points,_zone_radius,_MissionPos,_fortified] execvm "initZones\createzone.sqf"; + _null = [format["Zone %1",_i],_points,_zone_radius,_MissionPos,_fortified] spawn duws_fnc_createzone; _found=true; _zones_array = _zones_array + [_MissionPos]; // hintSilent format["Zone location #%1 found !",_i]; diff --git a/source/initZones/prefabs/regex.TXT b/source/functions/prefabs/regex.TXT similarity index 100% rename from source/initZones/prefabs/regex.TXT rename to source/functions/prefabs/regex.TXT diff --git a/source/dialog/squad/copyloadout.sqf b/source/functions/squad/fn_copyloadout.sqf similarity index 100% rename from source/dialog/squad/copyloadout.sqf rename to source/functions/squad/fn_copyloadout.sqf diff --git a/source/dialog/squad/dismiss.sqf b/source/functions/squad/fn_dismiss.sqf similarity index 100% rename from source/dialog/squad/dismiss.sqf rename to source/functions/squad/fn_dismiss.sqf diff --git a/source/dialog/squad/dismissHC.sqf b/source/functions/squad/fn_dismissHC.sqf similarity index 100% rename from source/dialog/squad/dismissHC.sqf rename to source/functions/squad/fn_dismissHC.sqf diff --git a/source/dialog/squad/rename/renamesquad.sqf b/source/functions/squad/fn_renamesquad.sqf similarity index 100% rename from source/dialog/squad/rename/renamesquad.sqf rename to source/functions/squad/fn_renamesquad.sqf diff --git a/source/dialog/squad/squadmng.sqf b/source/functions/squad/fn_squadmng.sqf similarity index 100% rename from source/dialog/squad/squadmng.sqf rename to source/functions/squad/fn_squadmng.sqf diff --git a/source/functions/startup/fn_endconditions.sqf b/source/functions/startup/fn_endconditions.sqf new file mode 100644 index 0000000..bf4cb4e --- /dev/null +++ b/source/functions/startup/fn_endconditions.sqf @@ -0,0 +1,27 @@ +waitUntil {!isNil "hq_blu1"}; + +// End mission if HQ unit is killed +hq_blu1 spawn { + waitUntil {time > 1}; + _this addMPEventHandler ["MPKilled", + { + [] spawn + { + ["TaskFailed",["","Your commanding officer has been killed"]] call bis_fnc_showNotification; + sleep 6; + ["officerkilled",false,true] call BIS_fnc_endMission; + }; + }]; +}; + +waitUntil {!isNil "amount_zones_created" && {amount_zones_created > 0}}; + +// WAIT UNTIL ALL ZONES ARE CAPTURED +waitUntil {sleep 3; (zoneundercontrolblu >= amount_zones_created);}; // Toutes les zones sont capturées +{ + persistent_stat_script_win = [] call duws_fnc_persistent_stats_win; + ["TaskSucceeded",["","Island captured!"]] call bis_fnc_showNotification; + capture_island_obj setTaskState "Succeeded"; + sleep 3; + ["island_captured_win",true,true] call BIS_fnc_endMission; +} remoteExecCall ["BIS_fnc_spawn", 0, true]; diff --git a/source/dialog/startup/hq_placement/manual.sqf b/source/functions/startup/fn_manual.sqf similarity index 92% rename from source/dialog/startup/hq_placement/manual.sqf rename to source/functions/startup/fn_manual.sqf index 0512072..59aa0f6 100644 --- a/source/dialog/startup/hq_placement/manual.sqf +++ b/source/functions/startup/fn_manual.sqf @@ -22,7 +22,7 @@ while {true} do { hint "Valid pos, creating HQ"; openMap [false, false]; chosen_hq_placement = true; - _handle = [_foundPickupPos] execVM "initHQ\bluHQinit.sqf"; + [_foundPickupPos] spawn duws_fnc_BluHQinit; }; }; diff --git a/source/dialog/startup/hq_placement/placement.sqf b/source/functions/startup/fn_placement.sqf similarity index 100% rename from source/dialog/startup/hq_placement/placement.sqf rename to source/functions/startup/fn_placement.sqf diff --git a/source/dialog/startup/hq_placement/placement_closed.sqf b/source/functions/startup/fn_placement_closed.sqf similarity index 51% rename from source/dialog/startup/hq_placement/placement_closed.sqf rename to source/functions/startup/fn_placement_closed.sqf index 632aaf0..0cf4219 100644 --- a/source/dialog/startup/hq_placement/placement_closed.sqf +++ b/source/functions/startup/fn_placement_closed.sqf @@ -1,2 +1,2 @@ if (chosen_hq_placement or player_is_choosing_hqpos) exitWith {}; -_null = [] execVM "dialog\startup\hq_placement\placement.sqf"; \ No newline at end of file +[] spawn duws_fnc_placement; \ No newline at end of file diff --git a/source/dialog/startup/hq_placement/random.sqf b/source/functions/startup/fn_random.sqf similarity index 100% rename from source/dialog/startup/hq_placement/random.sqf rename to source/functions/startup/fn_random.sqf diff --git a/source/dialog/startup/startup.sqf b/source/functions/startup/fn_startup.sqf similarity index 100% rename from source/dialog/startup/startup.sqf rename to source/functions/startup/fn_startup.sqf diff --git a/source/functions/startup/fn_startup_closed.sqf b/source/functions/startup/fn_startup_closed.sqf new file mode 100644 index 0000000..7d7932e --- /dev/null +++ b/source/functions/startup/fn_startup_closed.sqf @@ -0,0 +1,2 @@ +if (chosen_settings) exitWith {}; +[] spawn duws_fnc_startup; \ No newline at end of file diff --git a/source/dialog/startup/startup_common.sqf b/source/functions/startup/fn_startup_common.sqf similarity index 100% rename from source/dialog/startup/startup_common.sqf rename to source/functions/startup/fn_startup_common.sqf diff --git a/source/dialog/startup/startup_manual_start.sqf b/source/functions/startup/fn_startup_manual_start.sqf similarity index 86% rename from source/dialog/startup/startup_manual_start.sqf rename to source/functions/startup/fn_startup_manual_start.sqf index ff6df28..4682e21 100644 --- a/source/dialog/startup/startup_manual_start.sqf +++ b/source/functions/startup/fn_startup_manual_start.sqf @@ -1,5 +1,4 @@ -_handle = [] execVM "dialog\startup\startup_common.sqf"; -waitUntil {scriptDone _handle}; +[] call duws_fnc_startup_common; manually_chosen = true; publicVariable "manually_chosen"; diff --git a/source/dialog/startup/startup_random_start.sqf b/source/functions/startup/fn_startup_random_start.sqf similarity index 84% rename from source/dialog/startup/startup_random_start.sqf rename to source/functions/startup/fn_startup_random_start.sqf index 260c663..de04f3d 100644 --- a/source/dialog/startup/startup_random_start.sqf +++ b/source/functions/startup/fn_startup_random_start.sqf @@ -1,5 +1,4 @@ -startup_common = [] execVM "dialog\startup\startup_common.sqf"; -waitUntil {scriptDone startup_common}; +[] call duws_fnc_startup_common; manually_chosen = false; publicVariable "manually_chosen"; diff --git a/source/dialog/startup/weather.sqf b/source/functions/startup/fn_weather.sqf similarity index 99% rename from source/dialog/startup/weather.sqf rename to source/functions/startup/fn_weather.sqf index 4175237..f9c5401 100644 --- a/source/dialog/startup/weather.sqf +++ b/source/functions/startup/fn_weather.sqf @@ -19,7 +19,7 @@ _weather_loop = true; if (isMultiplayer) then { - _handle = [] execVM "dialog\startup\weather_broadcast.sqf"; + _handle = [] spawn duws_fnc_weather_broadcast; }; switch (weather_type) do { diff --git a/source/dialog/startup/weather_broadcast.sqf b/source/functions/startup/fn_weather_broadcast.sqf similarity index 100% rename from source/dialog/startup/weather_broadcast.sqf rename to source/functions/startup/fn_weather_broadcast.sqf diff --git a/source/dialog/startup/weather_client.sqf b/source/functions/startup/fn_weather_client.sqf similarity index 100% rename from source/dialog/startup/weather_client.sqf rename to source/functions/startup/fn_weather_client.sqf diff --git a/source/support/cluster/cluster.sqf b/source/functions/support/cluster/fn_cluster.sqf similarity index 96% rename from source/support/cluster/cluster.sqf rename to source/functions/support/cluster/fn_cluster.sqf index 9289204..bc739ee 100644 --- a/source/support/cluster/cluster.sqf +++ b/source/functions/support/cluster/fn_cluster.sqf @@ -46,10 +46,10 @@ _trg5 setTriggerStatements["this","", ""]; // create unit for comms _group = createGroup west; -_unit = _group createUnit ["B_Soldier_SL_F", [0,0,0], [], 0, "FORM"]; +_unit = _group createUnit [Blufor_Squadleader, [0,0,0], [], 0, "FORM"]; _unit allowDamage false; // generate randomname -_fobname = [1] call compile preprocessFile "random_name.sqf"; +_fobname = [1] call duws_fnc_random_name; _random1 = round random 9; _random2 = round random 9; diff --git a/source/support/cluster/mapclickcluster.sqf b/source/functions/support/cluster/fn_mapclickcluster.sqf similarity index 85% rename from source/support/cluster/mapclickcluster.sqf rename to source/functions/support/cluster/fn_mapclickcluster.sqf index 00998c3..fdcc443 100644 --- a/source/support/cluster/mapclickcluster.sqf +++ b/source/functions/support/cluster/fn_mapclickcluster.sqf @@ -16,7 +16,7 @@ _this select 6 - STRING - Ammo type used for salvos Usage: - _null = [1, 250, 1, 90, 1, 6, 'grenade'] execVM 'support\cluster\mapclickcluster.sqf'; + _null = [1, 250, 1, 90, 1, 6, 'grenade'] spawn duws_fnc_mapclickcluster; Returns: - Nil - @@ -39,7 +39,9 @@ if (commandpointsblu1<_cost) exitWith { }; hint "Click on your map to give the coordinates or wait 60 seconds to cancel the strike"; -OnMapSingleClick format["_null = [_pos,%2,%3,%4,%5,%6,%7,'%8'] execVM 'support\cluster\cluster.sqf';clicked=true;onMapSingleClick ''",_pos,_salvos,_radius,_interval,_rps,_supportype,_cost,_ammotype]; +OnMapSingleClick format["_null = [_pos,%2,%3,%4,%5,%6,%7,'%8'] spawn duws_fnc_cluster; +clicked=true; +onMapSingleClick ''",_pos,_salvos,_radius,_interval,_rps,_supportype,_cost,_ammotype]; // TIMER while {_timer>0 AND !clicked} do { diff --git a/source/functions/support/fn_FOBactions.sqf b/source/functions/support/fn_FOBactions.sqf new file mode 100644 index 0000000..10bf546 --- /dev/null +++ b/source/functions/support/fn_FOBactions.sqf @@ -0,0 +1,17 @@ +params ["_fob"]; + +_fob addaction ["Player stats",duws_fnc_info, "", 0, true, true, "", "_this == player"]; +_fob addaction ["Request ammobox drop(2CP)",duws_fnc_fob_ammobox, "", 0, true, true, "", "_this == player"]; + +if (support_armory_available) then { + _fob addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; +}; + +_fob addaction ["Squad manager",duws_fnc_squadmng, "", 0, true, true, "", "_this == player"]; +_fob addaction ["FOB manager",duws_fnc_fobmanageropen, "", 0, true, true, "", "_this == player"]; + +if (isServer) then { + _fob addaction ["Rest (wait/save)",duws_fnc_savegame, "", 0, true, true, "", "_this == player"]; +} else { + _fob addaction ["Rest", duws_fnc_savegameClient, "", 0, true, true, "", "_this == player"]; +}; diff --git a/source/functions/support/fn_FOBreceiveaction.sqf b/source/functions/support/fn_FOBreceiveaction.sqf new file mode 100644 index 0000000..01d3148 --- /dev/null +++ b/source/functions/support/fn_FOBreceiveaction.sqf @@ -0,0 +1,6 @@ + sleep 10; + _fobAmount = count Array_of_FOBS; + _fobIndex = _fobAmount - 1; + _createdFOB = Array_of_FOBS select _fobIndex; +// hint format["fobIndex: %1\ncreatedFOB: %2\nArray: %3",_fobIndex,_createdFOB,Array_of_FOBS]; + [_createdFOB] call duws_fnc_FOBactions; \ No newline at end of file diff --git a/source/support/ammobox.sqf b/source/functions/support/fn_ammobox.sqf similarity index 52% rename from source/support/ammobox.sqf rename to source/functions/support/fn_ammobox.sqf index c7c2614..b4adf4f 100644 --- a/source/support/ammobox.sqf +++ b/source/functions/support/fn_ammobox.sqf @@ -3,7 +3,7 @@ Author: Kibot - Description: + Description: Air-deploys a NATO ammobox with a parachute at a assigned location. Parameter(s): @@ -12,11 +12,11 @@ Usage: _scriptHandle = [player] execVM 'ammobox.sqf'; - Returns: + Returns: - Nil - */ -_target = _this select 0; +params ["_target"]; _location = getpos _target; @@ -32,25 +32,19 @@ hint "A supply crate has been dropped near your location"; _parachute = "Steerable_Parachute_F" CreateVehicle _location; _parachute setPos [_location select 0, _location select 1, (_location select 2)+100]; // Create the supply crate -_ammo = "B_supplyCrate_F" CreateVehicle [_location select 0,_location select 1,(_location select 2)+50]; +_ammo = Blufor_SupplyCrate CreateVehicle [_location select 0,_location select 1,(_location select 2)+50]; _ammo attachTo [_parachute,[0,0,0]]; -_ammo addMagazineCargo ["30Rnd_65x39_caseless_mag", 70]; -_ammo addMagazineCargo ["30Rnd_65x39_caseless_mag_Tracer", 70]; -_ammo addMagazineCargo ["100Rnd_65x39_caseless_mag", 70]; -_ammo addMagazineCargo ["100Rnd_65x39_caseless_mag_tracer", 70]; -_ammo addMagazineCargo ["1Rnd_HE_Grenade_shell", 90]; -_ammo addMagazineCargo ["UGL_FlareRed_F", 70]; -_ammo addMagazineCargo ["UGL_FlareGreen_F", 70]; -_ammo addMagazineCargo ["1Rnd_Smoke_Grenade_shell", 70]; -_ammo addMagazineCargo ["1Rnd_SmokeRed_Grenade_shell", 70]; -_ammo addMagazineCargo ["1Rnd_SmokeBlue_Grenade_shell", 70]; -_ammo addMagazineCargo ["NLAW_F", 70]; -_ammo addMagazineCargo ["Chemlight_green", 70]; +{ + _ammo addItemCargo _x; +} forEach Blufor_Ammobox_Contents; _ammo addBackpackCargo ["B_AssaultPack_khk",10]; -if (support_armory_available) then {[[_ammo,["Armory","bisArsenal.sqf",[], 0, false, false, "", "_this distance _target < 4"]],"addAction",true,true] call BIS_fnc_MP;}; +if (support_armory_available) then +{ + [_ammo,["Armory",{[] call duws_fnc_bisArsenal},[], 0, false, false, "", "_this distance _target < 4"]] remoteExecCall ["addAction", 0, true]; +}; waitUntil {sleep 1; getpos _ammo select 2<0.2}; _smoke = "SmokeShellGreen" CreateVehicle (getpos _ammo); diff --git a/source/support/arty.sqf b/source/functions/support/fn_arty.sqf similarity index 100% rename from source/support/arty.sqf rename to source/functions/support/fn_arty.sqf diff --git a/source/support/fob.sqf b/source/functions/support/fn_fob.sqf similarity index 66% rename from source/support/fob.sqf rename to source/functions/support/fn_fob.sqf index 4f0cfeb..44bb7d1 100644 --- a/source/support/fob.sqf +++ b/source/functions/support/fn_fob.sqf @@ -16,8 +16,7 @@ - Nil - */ -_position = _this select 0; -_size = _this select 1; +params ["_position","_size"]; if (commandpointsblu1 < 10) exitWith { ["info",["Not enough command points","Not enough Command Points (10CP required)"]] call bis_fnc_showNotification; @@ -43,7 +42,7 @@ if (_amountOPFOR > 0) exitWith { _art = [player,"fob_support"] call BIS_fnc_addCommMenuItem; }; -// Attempt to find a safe position +// Attempt to find a safe position _foundPickupPos = [_position, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) exitWith { hint "No valid FOB pos nearby\nTry to go near a flat, object free zone."; @@ -56,7 +55,7 @@ commandpointsblu1 = commandpointsblu1 - 10; publicVariable "commandpointsblu1"; [west, "PAPA_BEAR"] sidechat "Roger that, the FOB is being deployed..."; -_fobname = [1] call compile preprocessFile "random_name.sqf"; +_fobname = [1] call duws_fnc_random_name; // create marker on FOB _markername = format["fob%1%2",round (_foundPickupPos select 0),round (_foundPickupPos select 1)]; // Define marker name //hint _markername; @@ -73,32 +72,18 @@ sleep 5; _fob = "Land_Cargo_HQ_V1_F" createVehicle _foundPickupPos; -DUWS_fnc_fob = { - _this addaction ["Player stats","dialog\info\info.sqf", "", 0, true, true, "", "_this == player"]; - _this addaction ["Request ammobox drop(2CP)","support\fob_ammobox.sqf", "", 0, true, true, "", "_this == player"]; - _this addaction ["Squad manager","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"]; - _this addaction ["FOB manager","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"]; - if (support_armory_available) then { - _this addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; - }; - if (isServer) then { - _this addaction ["Rest (wait/save)","savegame.sqf", "", 0, true, true, "", "_this == player"]; - } else { - _this addaction ["Rest","savegameClient.sqf", "", 0, true, true, "", "_this == player"]; - }; -}; -[_fob,"DUWS_fnc_fob",true,true] spawn BIS_fnc_MP; // [_fob,"DUWS_fnc_fob",nil,true] spawn BIS_fnc_MP; +_fob remoteExecCall ["DUWS_fnc_fob_addAction", 0, true]; // For fortifying -_fob addaction ["Fortify FOB(4CP)","inithq\fortifyFOB.sqf", [(getpos _fob), _fob], 0, true, true, "", "_this == player"]; +_fob addaction ["Fortify FOB(4CP)",duws_fnc_fortifyFOB, [(getpos _fob), _fob], 0, true, true, "", "_this == player"]; -[_foundPickupPos, _size] execvm "createpatrol.sqf"; -[_foundPickupPos, _size] execvm "createpatrol.sqf"; -[_foundPickupPos, _size] execvm "createpatrol.sqf"; +[_foundPickupPos, _size] call duws_fnc_createpatrol; +[_foundPickupPos, _size] call duws_fnc_createpatrol; +[_foundPickupPos, _size] call duws_fnc_createpatrol; [west, "PAPA_BEAR"] sidechat "The FOB has been deployed."; -_handle = [_foundPickupPos, _fob] execVM "initHQ\guardsFOB.sqf"; +[_foundPickupPos, _fob] call duws_fnc_guardsFOB; // CREATE ZONE NOTIFICATION TRIGGER @@ -107,7 +92,7 @@ _trg23=createTrigger["EmptyDetector",_foundPickupPos]; _trg23 triggerAttachVehicle [player]; _trg23 setTriggerArea[_size,_size,0,false]; _trg23 setTriggerActivation["VEHICLE","PRESENT",true]; -_trg23 setTriggerStatements["this", format["[""FOB %1"",thislist] execvm 'enterlocation.sqf'",_fobname], ""]; +_trg23 setTriggerStatements["this", format["[""FOB %1"",thislist] spawn duws_fnc_enterlocation",_fobname], ""]; // warning trigger when an enemy approaches the camp _trgWarning=createTrigger["EmptyDetector",_foundPickupPos]; diff --git a/source/functions/support/fn_fob_addAction.sqf b/source/functions/support/fn_fob_addAction.sqf new file mode 100644 index 0000000..df99896 --- /dev/null +++ b/source/functions/support/fn_fob_addAction.sqf @@ -0,0 +1,12 @@ +_this addaction ["Player stats",duws_fnc_info, "", 0, true, true, "", "_this == player"]; +_this addaction ["Request ammobox drop(2CP)",duws_fnc_fob_ammobox, "", 0, true, true, "", "_this == player"]; +_this addaction ["Squad manager",duws_fnc_squadmng, "", 0, true, true, "", "_this == player"]; +_this addaction ["FOB manager",duws_fnc_fobmanageropen, "", 0, true, true, "", "_this == player"]; +if (support_armory_available) then { + _this addaction ["Armory (VA)",{[] call duws_fnc_bisArsenal}, "", 0, true, true, "", "_this == player"]; +}; +if (isServer) then { + _this addaction ["Rest (wait/save)",duws_fnc_savegame, "", 0, true, true, "", "_this == player"]; +} else { + _this addaction ["Rest",duws_fnc_savegameClient, "", 0, true, true, "", "_this == player"]; +}; diff --git a/source/functions/support/fn_fob_ammobox.sqf b/source/functions/support/fn_fob_ammobox.sqf new file mode 100644 index 0000000..2c3f276 --- /dev/null +++ b/source/functions/support/fn_fob_ammobox.sqf @@ -0,0 +1,49 @@ +/* + File: fob_ammobox.sqf + + Author: Kibot + + Description: + Variant of ammobox.sqf with less spread in deployment. + Air-deploys a NATO ammobox with a parachute at a assigned location. + + Parameter(s): + _this select 0 - OBJECT - A non-nil object with a physical location. + + Usage: + _scriptHandle = [player] spawn duws_fnc_fob_ammobox; + + Returns: + - Nil - +*/ + +params ["_target"]; +private _location = getPos _target; + +if (commandpointsblu1<2) exitWith { + ["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification; +}; +commandpointsblu1 = commandpointsblu1 - 2; +publicVariable "commandpointsblu1"; + +hint "A supply crate has been dropped near the FOB"; + +// Create the parachute +_parachute = "Steerable_Parachute_F" CreateVehicle _location; +_parachute setPos [_location select 0, _location select 1, (_location select 2)+50]; +// Create the supply crate +_ammo = Blufor_SupplyCrate CreateVehicle [_location select 0,_location select 1,(_location select 2)+20]; +_ammo attachTo [_parachute,[0,0,0]]; + +{ + _ammo addItemCargo _x; +} forEach Blufor_Ammobox_Contents; + +if (support_armory_available) then +{ + [_ammo,["Armory",{[] call duws_fnc_bisArsenal},[], 0, false, false, "", "_this distance _target < 4"]] remoteExecCall ["addAction", 0, true]; +}; + +waitUntil {sleep 1; getpos _ammo select 2<0.2}; +_smoke = "SmokeShellGreen" CreateVehicle (getpos _ammo); +["info",["Supply delivered","The supply crate has been marked with green smokes"]] call bis_fnc_showNotification; diff --git a/source/support/mapclickarty.sqf b/source/functions/support/fn_mapclickarty.sqf similarity index 93% rename from source/support/mapclickarty.sqf rename to source/functions/support/fn_mapclickarty.sqf index f822c98..2f47b5d 100644 --- a/source/support/mapclickarty.sqf +++ b/source/functions/support/fn_mapclickarty.sqf @@ -41,7 +41,7 @@ if (commandpointsblu1<_cost) exitWith { }; hint "Click on your map to give the coordinates or wait 60 seconds to cancel the strike"; -OnMapSingleClick format["_null = [_pos,%2,%3,%4,%5,%6,%7,'%8'] execVM 'support\arty.sqf';clicked=true;onMapSingleClick ''",_pos,_salvos,_radius,_interval,_rps,_supportype,_cost,_ammotype]; +OnMapSingleClick format["_null = [_pos,%2,%3,%4,%5,%6,%7,'%8'] spawn duws_fnc_arty;clicked=true;onMapSingleClick ''",_pos,_salvos,_radius,_interval,_rps,_supportype,_cost,_ammotype]; // TIMER while {_timer > 0 AND !clicked} do { diff --git a/source/support/mapclickuav.sqf b/source/functions/support/fn_mapclickuav.sqf similarity index 87% rename from source/support/mapclickuav.sqf rename to source/functions/support/fn_mapclickuav.sqf index a855dac..aad869d 100644 --- a/source/support/mapclickuav.sqf +++ b/source/functions/support/fn_mapclickuav.sqf @@ -12,7 +12,7 @@ if (commandpointsblu1<3) exitWith { }; hint "Click on your map to scan a location using the UAV"; -OnMapSingleClick "_null = [_pos,500] execVM 'support\uav_map.sqf';clicked=true;onMapSingleClick ''; hint 'Coordinates received'"; +OnMapSingleClick "_null = [_pos,500] spawn duws_fnc_uav_map;clicked=true;onMapSingleClick ''; hint 'Coordinates received'"; // TIMER while {_timer>0 AND !clicked} do { diff --git a/source/support/paradrop.sqf b/source/functions/support/fn_paradrop.sqf similarity index 79% rename from source/support/paradrop.sqf rename to source/functions/support/fn_paradrop.sqf index 5150d10..907b774 100644 --- a/source/support/paradrop.sqf +++ b/source/functions/support/fn_paradrop.sqf @@ -1,4 +1,4 @@ -_target = _this select 0; +params ["_target"]; _lz = getpos _target; @@ -18,42 +18,42 @@ _radius = 130; _parachute1 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute1 setPos [_lz select 0, _lz select 1, (_lz select 2)+150]; -_soldier1 = _group createUnit ["B_medic_F",[0,0,0],[],0,"form"]; +_soldier1 = _group createUnit [Blufor_Medic,[0,0,0],[],0,"form"]; _soldier1 moveindriver _parachute1; _parachute2 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute2 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier2 = _group createUnit ["B_Soldier_LAT_F",[0,0,0],[],0,"form"]; +_soldier2 = _group createUnit [Blufor_Rifleman_AT,[0,0,0],[],0,"form"]; _soldier2 moveindriver _parachute2; _parachute3 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute3 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier3 = _group createUnit ["B_Soldier_GL_F",[0,0,0],[],0,"form"]; +_soldier3 = _group createUnit [Blufor_Grenadier,[0,0,0],[],0,"form"]; _soldier3 moveindriver _parachute3; _parachute1 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute1 setPos [_lz select 0, _lz select 1, (_lz select 2)+150]; -_soldier1 = _group createUnit ["B_soldier_gl_F",[0,0,0],[],0,"form"]; +_soldier1 = _group createUnit [Blufor_Grenadier,[0,0,0],[],0,"form"]; _soldier1 moveindriver _parachute1; _parachute2 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute2 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier2 = _group createUnit ["B_Soldier_ar_F",[0,0,0],[],0,"form"]; +_soldier2 = _group createUnit [Blufor_Autorifleman,[0,0,0],[],0,"form"]; _soldier2 moveindriver _parachute2; _parachute3 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute3 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier3 = _group createUnit ["B_Soldier_F",[0,0,0],[],0,"form"]; +_soldier3 = _group createUnit [Blufor_Rifleman,[0,0,0],[],0,"form"]; _soldier3 moveindriver _parachute3; _parachute2 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute2 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier2 = _group createUnit ["B_Soldier_lat_F",[0,0,0],[],0,"form"]; +_soldier2 = _group createUnit [Blufor_Rifleman_AT,[0,0,0],[],0,"form"]; _soldier2 moveindriver _parachute2; _parachute3 = "Steerable_Parachute_F" CreateVehicle _lz; _parachute3 setPos [(_lz select 0)+(random _radius)-(random _radius), (_lz select 1)+(random _radius)-(random _radius), (_lz select 2)+150]; -_soldier3 = _group createUnit ["B_Soldier_ar_F",[0,0,0],[],0,"form"]; +_soldier3 = _group createUnit [Blufor_Autorifleman,[0,0,0],[],0,"form"]; _soldier3 moveindriver _parachute3; diff --git a/source/functions/support/fn_sitrep.sqf b/source/functions/support/fn_sitrep.sqf new file mode 100644 index 0000000..392c423 --- /dev/null +++ b/source/functions/support/fn_sitrep.sqf @@ -0,0 +1,18 @@ + + + +if (commandpointsblu1>=1) exitWith +{ + commandpointsblu1 = commandpointsblu1 - 1; + publicVariable "commandpointsblu1"; + + saveGame; + + sleep 0.5; + ["sitrepinfo",["SITREP","The game has been saved"]] call bis_fnc_showNotification; + [west, "PAPA_BEAR"] sidechat format["SITREP received, we have %1 command points and our army power is at %2",commandpointsblu1,WARCOM_blufor_ap]; + sleep 1; + [] call duws_fnc_bottom_right_message; +}; + +["sitrepinfo",["SITREP","Not enough Command Points (1CP)"]] call bis_fnc_showNotification; \ No newline at end of file diff --git a/source/support/uav_map.sqf b/source/functions/support/fn_uav_map.sqf similarity index 98% rename from source/support/uav_map.sqf rename to source/functions/support/fn_uav_map.sqf index 31f2665..83618c1 100644 --- a/source/support/uav_map.sqf +++ b/source/functions/support/fn_uav_map.sqf @@ -1,5 +1,4 @@ -_centerPos = _this select 0; -_checkedRadius = _this select 1; +params ["_centerPos", "_checkedRadius"]; commandpointsblu1 = commandpointsblu1 - 3; publicVariable "commandpointsblu1"; diff --git a/source/support/veh_refit.sqf b/source/functions/support/fn_veh_refit.sqf similarity index 100% rename from source/support/veh_refit.sqf rename to source/functions/support/fn_veh_refit.sqf diff --git a/source/support/taxi/boatTaxi.sqf b/source/functions/support/taxi/fn_boatTaxi.sqf similarity index 89% rename from source/support/taxi/boatTaxi.sqf rename to source/functions/support/taxi/fn_boatTaxi.sqf index dfc6ed7..26c2d57 100644 --- a/source/support/taxi/boatTaxi.sqf +++ b/source/functions/support/taxi/fn_boatTaxi.sqf @@ -1,9 +1,9 @@ -_posplayer = _this select 0; -_radius = _this select 1; +params ["_posplayer","_radius"]; + _foundPickupPos = []; taxiCanTakeOff = false; -_music = call compile preprocessFile "support\taxi\random_music.sqf"; +_music = [] call duws_fnc_random_music; //B_Lifeboat if (commandpointsblu1 < 1) exitWith { @@ -36,12 +36,12 @@ str(_markerpickup) setMarkerText "Pickup"; _spawnPos = [_posplayer, 400,500,10,2,5,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // create the boat -_helo = createVehicle ["B_Lifeboat", _spawnPos,[], 0, "FLY"]; -_helogroup = createGroup west; -_pilot = _helogroup createUnit ["B_diver_F", [5,5,5], [], 0, "NONE"]; +_helo = createVehicle [Blufor_Taxi_Boat, _spawnPos,[], 0, "FLY"]; +_helogroup = createGroup west; +_pilot = _helogroup createUnit [Blufor_diver, [5,5,5], [], 0, "NONE"]; -_helo addAction ["Tell the driver where to go", "support\taxi\mapclickboat.sqf", "", 0, true, true, "", "vehicle _this == _target"]; -_pilot setcaptive true; +_helo addAction ["Tell the driver where to go", duws_fnc_mapclickboat, "", 0, true, true, "", "vehicle _this == _target"]; +_pilot setcaptive true; _pilot moveindriver _helo; @@ -49,7 +49,7 @@ _wp = _helogroup addWaypoint [[_foundPickupPos select 0, (_foundPickupPos select _wp setWaypointType "MOVE"; [_helogroup, 1] setWaypointCombatMode "BLUE"; -_fobname = [1] call compile preprocessFile "random_name.sqf"; +_fobname = [1] call duws_fnc_random_name; _pilot sideChat format["This is %1, I'm approching your location for pick up, check your map. ETA 2 minutes.",_fobname]; @@ -61,7 +61,7 @@ hint format["%1 is too damaged to continue the mission",_fobname]; // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"boat_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // **************************************************** _inVehCheck = true; @@ -69,7 +69,7 @@ while {_inVehCheck} do { waitUntil {sleep 0.1;taxiCanTakeOff or (getdammage _helo > 0.7 or !alive _pilot)}; // wait until the player has given a validpos if (getdammage _helo > 0.7 or !alive _pilot) exitWith {}; // get out of the loop if choopa is down // check if player is inside choppa -if (vehicle player != _helo) then {taxiCanTakeOff = false; _pilot sidechat format["This is %1, get back in, I can't transport you're not inside the boat !",_fobname]; _helo addAction ["Give a location to the pilot", "support\taxi\mapclickboat.sqf", "", 0, true, true, "", "vehicle _this == _target"];} else {_inVehCheck = false;}; +if (vehicle player != _helo) then {taxiCanTakeOff = false; _pilot sidechat format["This is %1, get back in, I can't transport you're not inside the boat !",_fobname]; _helo addAction ["Give a location to the pilot", duws_fnc_mapclickboat, "", 0, true, true, "", "vehicle _this == _target"];} else {_inVehCheck = false;}; }; // IF THE PILOT IS DEAD OR CHOPPA DOWN ************** @@ -80,7 +80,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; // --- AJOUTER DE NOUVEAU LE SUPPORT -}; +}; // ***************************** @@ -88,7 +88,7 @@ _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; playMusic [_music, 0]; _helo lock true; titleText ["Driver: Roger that, we're oscar mike...", "PLAIN DOWN"]; -str(_markerpickup) setMarkerPos ClickedTaxiPos; +str(_markerpickup) setMarkerPos ClickedTaxiPos; str(_markerpickup) setMarkerText "Drop point"; @@ -103,7 +103,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** // TELEPORT BOAT NEAR DROP POINT @@ -130,7 +130,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** @@ -144,7 +144,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** titleText ["Driver: We've arrived at the drop point", "PLAIN DOWN"]; @@ -164,7 +164,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** diff --git a/source/support/taxi/helotaxi.sqf b/source/functions/support/taxi/fn_helotaxi.sqf similarity index 88% rename from source/support/taxi/helotaxi.sqf rename to source/functions/support/taxi/fn_helotaxi.sqf index df41583..78a26ce 100644 --- a/source/support/taxi/helotaxi.sqf +++ b/source/functions/support/taxi/fn_helotaxi.sqf @@ -1,9 +1,9 @@ -_posplayer = _this select 0; -_radius = _this select 1; +params ["_posplayer","_radius"]; + _foundPickupPos = []; taxiCanTakeOff = false; -_music = call compile preprocessFile "support\taxi\random_music.sqf"; +_music = [] call duws_fnc_random_music; if (commandpointsblu1 < 1) exitWith { @@ -35,30 +35,30 @@ str(_markerpickup) setMarkerText "LZ"; // create the chopper, gunners and pilots -_helo = createVehicle ["B_Heli_Transport_01_camo_F", [_posplayer select 0, (_posplayer select 1)+2000, 200],[], 0, "FLY"]; -_helogroup = createGroup west; -_pilot = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"]; -_copilot = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"]; -_gunner1 = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"]; -_gunner2 = _helogroup createUnit ["B_Helipilot_F", [5,5,5], [], 0, "NONE"]; +_helo = createVehicle [Blufor_Taxi_Helo, [_posplayer select 0, (_posplayer select 1)+2000, 200],[], 0, "FLY"]; +_helogroup = createGroup west; +_pilot = _helogroup createUnit [Blufor_Heli_Pilot, [5,5,5], [], 0, "NONE"]; +_copilot = _helogroup createUnit [Blufor_Heli_Pilot, [5,5,5], [], 0, "NONE"]; +_gunner1 = _helogroup createUnit [Blufor_Heli_Pilot, [5,5,5], [], 0, "NONE"]; +_gunner2 = _helogroup createUnit [Blufor_Heli_Pilot, [5,5,5], [], 0, "NONE"]; _helo flyInHeight 100; -_helo addAction ["Give a LZ to the pilot", "support\taxi\mapclickhelo.sqf", "", 0, true, true, "", "vehicle _this == _target"]; - -_pilot setcaptive true; - +_helo addAction ["Give a LZ to the pilot", duws_fnc_mapclickhelo, "", 0, true, true, "", "vehicle _this == _target"]; + +_pilot setcaptive true; + _pilot moveindriver _helo; -_copilot moveInTurret [_helo, [0]]; +_copilot moveInTurret [_helo, [0]]; _gunner1 moveInTurret [_helo, [1]]; _gunner2 moveInTurret [_helo, [2]]; // create the helipad to land and the waypoints -_helipad1 = createVehicle ["Land_HelipadEmpty_F", _foundPickupPos, [], 0, "NONE"]; +_helipad1 = createVehicle ["Land_HelipadEmpty_F", _foundPickupPos, [], 0, "NONE"]; _wp = _helogroup addWaypoint [[_foundPickupPos select 0, (_foundPickupPos select 1)-75], 0]; _wp setWaypointType "MOVE"; [_helogroup, 1] setWaypointCombatMode "BLUE"; -_fobname = [1] call compile preprocessFile "random_name.sqf"; +_fobname = [1] call duws_fnc_random_name; _random1 = round random 9; _random2 = round random 9; @@ -68,7 +68,7 @@ _pilot sideChat format["This is %1 %2-%3, we're approaching your location for pi waitUntil {_foundpickuppos distance _helo < 350 or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the helo is near the lz -_pilot setcaptive false; +_pilot setcaptive false; // IF THE PILOT IS DEAD OR CHOPPA DOWN ****************** if (vehicle _pilot == _pilot or !alive _pilot) exitWith { deleteVehicle _helipad1; @@ -77,7 +77,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // **************************************************** // spawn smokeshell @@ -102,7 +102,7 @@ while {_inVehCheck} do { waitUntil {sleep 0.1;taxiCanTakeOff or (vehicle _pilot == _pilot or !alive _pilot)}; // wait until the player has given a validpos if (vehicle _pilot == _pilot or !alive _pilot) exitWith {}; // get out of the loop if choopa is down // check if player is inside choppa -if (vehicle player != _helo) then {taxiCanTakeOff = false; _pilot sidechat format["This is %1 %2-%3, get back in, I can't transport you're not inside the chopper !",_fobname,_random1,_random2]; _helo addAction ["Give a LZ to the pilot", "support\taxi\mapclickhelo.sqf", "", 0, true, true, "", "vehicle _this == _target"];} else {_inVehCheck = false;}; +if (vehicle player != _helo) then {taxiCanTakeOff = false; _pilot sidechat format["This is %1 %2-%3, get back in, I can't transport you're not inside the chopper !",_fobname,_random1,_random2]; _helo addAction ["Give a LZ to the pilot", duws_fnc_mapclickhelo, "", 0, true, true, "", "vehicle _this == _target"];} else {_inVehCheck = false;}; }; // IF THE PILOT IS DEAD OR CHOPPA DOWN ************** @@ -113,7 +113,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; // --- AJOUTER DE NOUVEAU LE SUPPORT -}; +}; // ***************************** @@ -121,7 +121,7 @@ _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; playMusic [_music, 0]; //_helo lock true; titleText ["Pilot: Roger that, we're oscar mike...", "PLAIN DOWN"]; -str(_markerpickup) setMarkerPos ClickedTaxiPos; +str(_markerpickup) setMarkerPos ClickedTaxiPos; // create the helipad to land and the waypoints _helipad = createVehicle ["Land_HelipadEmpty_F", ClickedTaxiPos, [], 0, "NONE"]; @@ -150,7 +150,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** if (enableChopperFastTravel) then { // TELEPORT HELO NEAR LZ @@ -172,7 +172,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** _helo land "LAND"; @@ -196,7 +196,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** titleText ["Pilot: We've arrived at the LZ", "PLAIN DOWN"]; _helo lock false; @@ -226,7 +226,7 @@ hint format["%1 %2-%2 is too damaged to continue the mission",_fobname,_random1, // --- AJOUTER DE NOUVEAU LE SUPPORT sleep 15; _art = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem; -}; +}; // ***************************** _pilot sideChat format["This is %1 %2-%3, we are RTB",_fobname,_random1,_random2]; diff --git a/source/support/taxi/mapclickboat.sqf b/source/functions/support/taxi/fn_mapclickboat.sqf similarity index 74% rename from source/support/taxi/mapclickboat.sqf rename to source/functions/support/taxi/fn_mapclickboat.sqf index ca9ed03..e81b266 100644 --- a/source/support/taxi/mapclickboat.sqf +++ b/source/functions/support/taxi/fn_mapclickboat.sqf @@ -1,7 +1,7 @@ _timer = 9999999; clicked = false; -_helo = _this select 0; -_actionID = _this select 2; +params ["_target", "_caller", "_actionId", "_arguments"]; +private _helo = _target; /* // IF NOT ENOUGH PTS if (commandpointsblu1<3) exitWith { @@ -29,15 +29,15 @@ while {_timer>0} do { _foundPickupPos = [ClickedTaxiPos, 0,50,10,2,5,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) then { - if (ClickedTaxiPos distance player < 100) exitWith { - clicked = false; - titleText ["Driver: This is too close from our position", "PLAIN DOWN"]; - }; - clicked = false; - titleText ["Driver: I can't go there", "PLAIN DOWN"]; - } - else - {onMapSingleClick "";_timer = 0;taxiCanTakeOff = true;} + if (ClickedTaxiPos distance player < 100) exitWith { + clicked = false; + titleText ["Driver: This is too close from our position", "PLAIN DOWN"]; + }; + clicked = false; + titleText ["Driver: I can't go there", "PLAIN DOWN"]; + } + else + {onMapSingleClick "";_timer = 0;taxiCanTakeOff = true;} }; _timer = _timer-1; // remove 1 to timer diff --git a/source/support/taxi/mapclickhelo.sqf b/source/functions/support/taxi/fn_mapclickhelo.sqf similarity index 73% rename from source/support/taxi/mapclickhelo.sqf rename to source/functions/support/taxi/fn_mapclickhelo.sqf index 252207b..ad08199 100644 --- a/source/support/taxi/mapclickhelo.sqf +++ b/source/functions/support/taxi/fn_mapclickhelo.sqf @@ -1,7 +1,7 @@ _timer = 9999999; clicked = false; -_helo = _this select 0; -_actionID = _this select 2; +params ["_target", "_caller", "_actionId", "_arguments"]; +private _helo = _target; /* // IF NOT ENOUGH PTS if (commandpointsblu1<3) exitWith { @@ -29,15 +29,15 @@ while {_timer>0} do { _foundPickupPos = [ClickedTaxiPos, 0,50,10,0,0.2,0,[],[[0,0],[0,0]]] call BIS_fnc_findSafePos; // find a valid pos if (0 == _foundPickupPos select 0 && 0 == _foundPickupPos select 1) then { - if (ClickedTaxiPos distance player < 1000) exitWith { - clicked = false; - titleText ["Pilot: This LZ is too close from our position", "PLAIN DOWN"]; - }; - clicked = false; - titleText ["Pilot: No clear LZ around here, give me another location", "PLAIN DOWN"]; - } - else - {onMapSingleClick "";_timer = 0;taxiCanTakeOff = true;} + if (ClickedTaxiPos distance player < 1000) exitWith { + clicked = false; + titleText ["Pilot: This LZ is too close from our position", "PLAIN DOWN"]; + }; + clicked = false; + titleText ["Pilot: No clear LZ around here, give me another location", "PLAIN DOWN"]; + } + else + {onMapSingleClick "";_timer = 0;taxiCanTakeOff = true;} }; _timer = _timer-1; // remove 1 to timer diff --git a/source/support/taxi/random_music.Sqf b/source/functions/support/taxi/fn_random_music.Sqf similarity index 100% rename from source/support/taxi/random_music.Sqf rename to source/functions/support/taxi/fn_random_music.Sqf diff --git a/source/functions/taw_vd/CfgFunctions.hpp b/source/functions/taw_vd/CfgFunctions.hpp new file mode 100644 index 0000000..cb0a2d3 --- /dev/null +++ b/source/functions/taw_vd/CfgFunctions.hpp @@ -0,0 +1,21 @@ +class TAW_VD { + tag = "TAWVD"; + + class Initialize { + file = "taw_vd"; + class stateTracker { + ext = ".fsm"; + postInit = 1; + headerType = -1; + }; + + class onSliderChanged {}; + class onTerrainChanged {}; + class updateViewDistance {}; + class openMenu {}; + class onChar {}; + class openSaveManager {}; + class onSavePressed {}; + class onSaveSelectionChanged {}; + }; +}; \ No newline at end of file diff --git a/source/functions/taw_vd/GUI.h b/source/functions/taw_vd/GUI.h new file mode 100644 index 0000000..c79ba93 --- /dev/null +++ b/source/functions/taw_vd/GUI.h @@ -0,0 +1,668 @@ +#include "defines.h" + +class RscEdit_taw { + type = 2; + style = 0x00 + 0x40; + font = "PuristaMedium"; + shadow = 2; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorBackground[] = {0, 0, 0, 1}; + soundSelect[] = {"",0.1,1}; + soundExpand[] = {"",0.1,1}; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorDisabled[] = {1, 1, 1, 0.25}; + autocomplete = false; + colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1}; + canModify = 1; +}; + +class RscListBox_taw { + style = 16; + idc = -1; + type = 5; + w = 0.275; + h = 0.04; + font = "PuristaMedium"; + colorSelect[] = {1, 1, 1, 1}; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0.28,0.28,0.28,0.28}; + colorSelect2[] = {1, 1, 1, 1}; + colorSelectBackground[] = {0.95, 0.95, 0.95, 0.5}; + colorSelectBackground2[] = {1, 1, 1, 0.5}; + colorScrollbar[] = {0.2, 0.2, 0.2, 1}; + colorPicture[] = {1,1,1,1}; + colorPictureSelected[] = {1,1,1,1}; + colorPictureDisabled[] = {1,1,1,1}; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + wholeHeight = 0.45; + rowHeight = 0.04; + color[] = {0.7, 0.7, 0.7, 1}; + colorActive[] = {0,0,0,1}; + colorDisabled[] = {0,0,0,0.3}; + sizeEx = 0.023; + soundSelect[] = {"",0.1,1}; + soundExpand[] = {"",0.1,1}; + soundCollapse[] = {"",0.1,1}; + maxHistoryDelay = 1; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + tooltipColorText[] = {1,1,1,1}; + tooltipColorBox[] = {1,1,1,1}; + tooltipColorShade[] = {0,0,0,0.65}; + + class ListScrollBar { + color[] = {1,1,1,1}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + shadow = 0; + scrollSpeed = 0.06; + width = 0; + height = 0; + autoScrollEnabled = 1; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + } +}; + +class RscCheckBox { + access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified) + idc = -1; // Control identification (without it, the control won't be displayed) + type = 77; // Type + style = ST_LEFT + ST_MULTI; // Style + default = 0; // Control selected by default (only one within a display can be used) + blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect. + + x = 0; + y = 0; + w = 1 * GUI_GRID_CENTER_W; // Width + h = 1 * GUI_GRID_CENTER_H; // Height + + //Colors + color[] = { 1, 1, 1, 0.7 }; // Texture color + colorFocused[] = { 1, 1, 1, 1 }; // Focused texture color + colorHover[] = { 1, 1, 1, 1 }; // Mouse over texture color + colorPressed[] = { 1, 1, 1, 1 }; // Mouse pressed texture color + colorDisabled[] = { 1, 1, 1, 0.2 }; // Disabled texture color + + //Background colors + colorBackground[] = { 0, 0, 0, 0 }; // Fill color + colorBackgroundFocused[] = { 0, 0, 0, 0 }; // Focused fill color + colorBackgroundHover[] = { 0, 0, 0, 0 }; // Mouse hover fill color + colorBackgroundPressed[] = { 0, 0, 0, 0 }; // Mouse pressed fill color + colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // Disabled fill color + + //Textures + textureChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked CheckBox. + textureUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked CheckBox. + textureFocusedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked focused CheckBox (Could be used for showing different texture when focused). + textureFocusedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked focused CheckBox. + textureHoverChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureHoverUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + texturePressedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + texturePressedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + textureDisabledChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureDisabledUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + + tooltip = ""; // Tooltip text + tooltipColorShade[] = { 0, 0, 0, 1 }; // Tooltip background color + tooltipColorText[] = { 1, 1, 1, 1 }; // Tooltip text color + tooltipColorBox[] = { 1, 1, 1, 1 }; // Tooltip frame color + + //Sounds + soundClick[] = { "\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1 }; // Sound played after control is activated in format {file, volume, pitch} + soundEnter[] = { "\A3\ui_f\data\sound\RscButton\soundEnter", 0.09, 1 }; // Sound played when mouse cursor enters the control + soundPush[] = { "\A3\ui_f\data\sound\RscButton\soundPush", 0.09, 1 }; // Sound played when the control is pushed down + soundEscape[] = { "\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1 }; // Sound played when the control is released after pushing down +}; + +class RscXSliderH { + style = 1024; + type = 43; + shadow = 2; + x = 0; + y = 0; + h = 0.029412; + w = 0.400000; + color[] = { + 1, 1, 1, 0.7 + }; + colorActive[] = { + 1, 1, 1, 1 + }; + colorDisabled[] = { + 1, 1, 1, 0.500000 + }; + arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; + thumb = "\A3\ui_f\data\gui\cfg\slider\thumb_ca.paa"; +}; + +class RscText_taw { + x = 0; + y = 0; + h = 0.037; + w = 0.3; + type = 0; + style = 0; + shadow = 1; + colorShadow[] = {0, 0, 0, 0.5}; + font = "PuristaMedium"; + SizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + colorText[] = {1, 1, 1, 1.0}; + colorBackground[] = {0, 0, 0, 0}; + linespacing = 1; +}; + +class RscTitle:RscText_taw { + style = 0; + shadow = 0; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 1}; +}; + +class RscShortcutButton_taw { + idc = -1; + style = 0; + default = 0; + shadow = 1; + w = 0.183825; + h = "( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)"; + color[] = {1,1,1,1.0}; + colorFocused[] = {1,1,1,1.0}; + color2[] = {0.95,0.95,0.95,1}; + colorDisabled[] = {1,1,1,0.25}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorBackground2[] = {1,1,1,1}; + animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa"; + animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa"; + animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa"; + periodFocus = 1.2; + periodOver = 0.8; + class HitZone + { + left = 0.0; + top = 0.0; + right = 0.0; + bottom = 0.0; + }; + class ShortcutPos + { + left = 0; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + w = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + h = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + class TextPos + { + left = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0.0; + }; + period = 0.4; + font = "PuristaMedium"; + size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + action = ""; + class Attributes + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; + class AttributesImage + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + }; +}; + +class RscControlsGroup { + type = 15; + idc = -1; + x = 0; + y = 0; + w = 1; + h = 1; + shadow = 0; + style = 16; + + class ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + shadow = 0; + scrollSpeed = 0.05; + }; + + class VScrollbar:ScrollBar { + width = 0.021; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + shadow = 0; + color[] = {1, 1, 1, 0.6}; + }; + + class HScrollbar:ScrollBar { + height = 0.028; + shadow = 0; + color[] = {1, 1, 1, 0.6}; + }; + + //class ListScrollBar : ScrollBar {}; + + class Controls {}; +}; + +class RscControlsGroupNoScrollbars : RscControlsGroup { + class VScrollbar : VScrollbar { + width = 0; + }; + + class HScrollbar : HScrollbar { + height = 0; + }; +}; + +class RscButtonMenu:RscShortcutButton_taw { + idc = -1; + type = 16; + style = "0x02 + 0xC0"; + default = 0; + shadow = 0; + x = 0; + y = 0; + w = 0.095589; + h = 0.039216; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground2[] = {0.75,0.75,0.75,1}; + color[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + color2[] = {0,0,0,1}; + colorText[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.25}; + period = 1.2; + periodFocus = 1.2; + periodOver = 1.2; + size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + tooltipColorText[] = {1,1,1,1}; + tooltipColorBox[] = {1,1,1,1}; + tooltipColorShade[] = {0,0,0,0.65}; + class TextPos + { + left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0.0; + }; + class Attributes + { + font = "PuristaLight"; + color = "#E5E5E5"; + align = "left"; + shadow = "false"; + }; + class ShortcutPos + { + left = "(6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005"; + top = 0.005; + w = 0.0225; + h = 0.03; + }; + soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; + textureNoShortcut = ""; +}; + +class TAW_VDMenu { + idd = MENU_IDD; + name = "TAW_VDMenu"; + movingEnabled = 0; + enableSimulation = 1; + + onLoad = "((_this select 0) displayCtrl 2999) ctrlSetFade 1; ((_this select 0) displayCtrl 2999) ctrlCommit 0;"; + + class controlsBackground { + class TitleBackground : RscText_taw { + colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; + idc = -1; + x = .3; + y = .2; + w = .5; + h = (1 / 25); + }; + + class MainBackground : RscText_taw { + colorBackground[] = { 0, 0, 0, .7 }; + idc = -1; + x = .3; + y = .2 + (11 / 250); + w = .5; + h = .57 - (22 / 250); + }; + + class Title : RscTitle { + colorBackround[] = { 0, 0, 0, 0 }; + idc = -1; + text = "View Settings (SCRIPT)"; + x = .3; + y = .2; + w = .8; + h = (1 / 25); + }; + + class OnFootText : RscText_taw { + idc = -1; + text = "Infantry:"; + x = .32; + y = .258; + w = .275; + h = .04; + }; + + class inCarText : OnFootText { + text = "Ground:"; + y = .305; + }; + + class inAirText : OnFootText { + text = "Air:"; + y = .355; + }; + + class ObjectText : OnFootText { + text = "Object:"; + y = .655; + }; + + class DroneText : OnFootText { + text = "Drone:"; + y = .405; + }; + + class TerrainBackground : TitleBackground { + text = "Grass Settings"; + shadow = 0; + y = .46; + }; + + class ObjectBackground : TitleBackground { + text = "Object Settings"; + y = .55; + }; + + class ButtonClose : RscButtonMenu { + idc = -1; + text = "Close"; + onButtonClick = "closeDialog 0;"; + x = 0.3; + y = 0.77 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + + class SaveManagerBtn:ButtonClose { + text = "Saves"; + onButtonClick = "[] call tawvd_fnc_openSaveManager;"; + x = .465; + }; + }; + + class controls { + + //Sliders + class VD_onFoot_slider : RscXSliderH { + idc = INFANTRY_SLIDER; + text = ""; + onSliderPosChanged = "[0, _this select 1] call TAWVD_fnc_onSliderChanged;"; + toolTip = "View Distance while on foot"; + x = .42; + y = .30 - (1 / 25); + w = "9 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + + class VD_inCar_slider : VD_onFoot_slider { + idc = GROUND_SLIDER; + toolTip = "View distance while in a ground vehicle"; + onSliderPosChanged = "[1, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .35 - (1 / 25); + }; + + class VD_inAir_slider : VD_onFoot_slider { + idc = AIR_SLIDER; + toolTip = "View distance while in an aircraft"; + onSliderPosChanged = "[2, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .40 - (1 / 25); + }; + + class VD_Object_slider : VD_onFoot_slider { + idc = OBJECT_SLIDER; + toolTip = "Object rendering distance"; + onSliderPosChanged = "[3, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .7 - (1 / 25); + }; + + class VD_Drone_slider:VD_onFoot_slider { + idc = DRONE_SLIDER; + toolTip = "View distance while operating a UAV/UGV"; + onSliderPosChanged = "[4, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .45 - (1 / 25); + } + + //Values (RscEdit Butons) + class VD_onFoot_Edit : RscEdit_taw { + idc = INFANTRY_EDIT; + text = ""; + onKeyUp = "[_this select 0, _this select 1, 'ground',true] call TAWVD_fnc_onChar;"; + + x = .7; + y = .258; + w = .08; + h = .04; + }; + + class VD_inCar_Edit : VD_onFoot_Edit { + idc = GROUND_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'vehicle',true] call TAWVD_fnc_onChar;"; + y = .31; + }; + + class VD_inAir_Edit : VD_onFoot_Edit { + idc = AIR_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'air',true] call TAWVD_fnc_onChar;"; + y = .36; + }; + + class VD_inDrone_Edit:VD_onFoot_Edit { + idc = DRONE_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'drone',true] call TAWVD_fnc_onChar;"; + y = .41; + }; + + class VD_Object_Edit : VD_onFoot_Edit { + idc = OBJECT_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'object',true] call TAWVD_fnc_onChar;"; + y = .656; + }; + + //Grass Settings + class VD_terrain_none { + idc = TERRAIN_NONE; + type = 11; + style = 0; + font = "PuristaLight"; + color[] = { 1, 1, 1, 1 }; + colorActive[] = { 1, 0.2, 0.2, 1 }; + colorDisabled[] = {0, 0, 0, 1}; + soundEnter[] = { "\A3\ui_f\data\sound\onover", 0.09, 1 }; + soundPush[] = { "\A3\ui_f\data\sound\new1", 0.0, 0 }; + soundClick[] = { "\A3\ui_f\data\sound\onclick", 0.07, 1 }; + soundEscape[] = { "\A3\ui_f\data\sound\onescape", 0.09, 1 }; + text = "None"; + action = "['none'] call TAWVD_fnc_onTerrainChanged;"; + sizeEx = 0.04; + + x = .38; y = .505; + w = .275; h = .04; + }; + + class VD_terrain_low : VD_terrain_none { + idc = -1; + text = "Low"; + action = "['low'] call TAWVD_fnc_onTerrainChanged;"; + x = .47; + }; + + class VD_terrain_normal : VD_terrain_none { + idc = -1; + text = "Normal"; + action = "['norm'] call TAWVD_fnc_onTerrainChanged;"; + x = .56; + }; + + class VD_terrain_high : VD_terrain_none { + idc = -1; + text = "High"; + action = "['high'] call TAWVD_fnc_onTerrainChanged;"; + x = .67; + }; + + class ObjectSyncCheckbox : RscCheckbox + { + idc = 2931; + x = .32; y = .6; + tooltip = "Sync object rendering with view rendering"; + onCheckedChanged = "if((_this select 1) == 1) then {tawvd_syncObject = true;ctrlEnable [2941,false]; ctrlEnable [2942,false];} else {tawvd_syncObject = false; ctrlEnable [2942,true]; ctrlEnable [2941,true];};"; + w = 1 * GUI_GRID_CENTER_W; + h = 1 * GUI_GRID_CENTER_H; + }; + + class ObjectSynctext : RscText_taw { + idc = -1; + text = "Sync with view"; + x = .345; y = .596; + w = .35; h = .04; + }; + + class Manager:RscControlsGroup { + idc = MANAGER_GROUP; + + x = -0.21; y = .2; + w = .5; h = 3; + class Controls { + class SaveLoadGroup:RscControlsGroupNoScrollbars { + idc = SAVELOAD_GROUP; + + x = 0; + y = 0; + w = .5; + h = 3; + + class Controls { + class MyTitleBackground:RscText_taw { + colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; + idc = -1; + x = 0; + y = 0; + w = .5; + h = (1 / 25); + }; + + class Title : RscTitle { + colorBackround[] = { 0, 0, 0, 0 }; + idc = -1; + text = "Save Manager"; + x = 0; + y = 0; + w = .8; + h = (1 / 25); + }; + + class MainBackground:RscText_taw { + colorBackground[] = { 0, 0, 0, .7 }; + idc = -1; + x = 0; + y = 0 + (11 / 250); + w = .5; + h = .57 - (22 / 250); + }; + + class SaveList:RscListBox_taw { + idc = SAVES_LIST; + sizeEx = 0.04; + colorBackground[] = {0.1,0.1,0.1,0.9}; + x = 0; y = 0 + (11 / 250); + w = .5; h = .49 - (22 / 250); + + onLBSelChanged = "_this call TAWVD_fnc_onSaveSelectionChanged;"; + }; + + class SaveSlotName:VD_onFoot_Edit { + idc = SLOT_NAME; + text = "SAVE NAME"; + colorBackground[] = {0,0,0,0.6}; + onKeyUp = ""; + + x = .025; y = .42 + (11 / 250); + w = .45; + }; + + class SaveButton:RscButtonMenu { + text = "Save"; + onButtonClick = "[] call TAWVD_fnc_onSavePressed;"; + x = 0; + y = 0.57 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + + class HideButton:RscButtonMenu { + text = "Hide"; + onButtonClick = "((findDisplay 2900) displayCtrl 2999) ctrlSetFade 1; ((findDisplay 2900) displayCtrl 2999) ctrlCommit 0.3;"; + x = .16; + y = 0.57 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + }; + }; + }; + }; + }; +}; diff --git a/source/functions/taw_vd/defines.h b/source/functions/taw_vd/defines.h new file mode 100644 index 0000000..02f92ef --- /dev/null +++ b/source/functions/taw_vd/defines.h @@ -0,0 +1,44 @@ +/* Main display IDD & IDC's */ +#define MENU_IDD 2900 +#define INFANTRY_SLIDER 2901 +#define INFANTRY_EDIT 2902 +#define GROUND_SLIDER 2911 +#define GROUND_EDIT 2912 +#define AIR_SLIDER 2921 +#define AIR_EDIT 2922 +#define OBJECT_SLIDER 2941 +#define OBJECT_EDIT 2942 +#define DRONE_SLIDER 2951 +#define DRONE_EDIT 2952 +#define TERRAIN_NONE 2950 +#define GUI_GRID_CENTER_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_CENTER_HAbs (GUI_GRID_CENTER_WAbs / 1.2) +#define GUI_GRID_CENTER_W (GUI_GRID_CENTER_WAbs / 40) +#define GUI_GRID_CENTER_H (GUI_GRID_CENTER_HAbs / 25) +#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) +#define GUI_GRID_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2) +#define ST_LEFT 0x00 +#define ST_MULTI 0x10 +#define SEL(ARRAY,INDEX) (ARRAY select INDEX) + +/* Save / Load Manager */ +#define MANAGER_GROUP 2999 +#define SAVELOAD_GROUP 3000 +#define SAVES_LIST 3001 +#define SLOT_NAME 3002 + +/* Namespace Macros */ +#define SVAR_MNS missionNamespace setVariable +#define SVAR_UINS uiNamespace setVariable +#define SVAR_PNS parsingNamespace setVariable +#define GVAR_MNS missionNamespace getVariable +#define GVAR_UINS uiNamespace getVariable +#define GVAR_PNS parsingNamespace getVariable + +/* Condition Macros */ +#define EQUAL(condition1,condition2) condition1 isEqualTo condition2 + +/* Display Macros */ +#define CONTROL(disp,ctrl) ((findDisplay ##disp) displayCtrl ##ctrl) +#define CONTROL_DATA(ctrl) (lbData[ctrl,lbCurSel ctrl]) +#define CONTROL_DATAI(ctrl,index) ctrl lbData index \ No newline at end of file diff --git a/source/functions/taw_vd/fn_onChar.sqf b/source/functions/taw_vd/fn_onChar.sqf new file mode 100644 index 0000000..c655536 --- /dev/null +++ b/source/functions/taw_vd/fn_onChar.sqf @@ -0,0 +1,36 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + When a character is entered it is validated and changes the + correct slider it is associated with. I probably over-complicated + this more then I had to but onChar behaves weird. + + PARAMS: + 0: CONTROL + 1: SCALAR (INT) + 2: STRING (Case option) +*/ +private["_value","_varName","_maxRange"]; +params ["_control","_code","_slider"]; + +disableSerialization; +if(isNull _control) exitWith {}; //POOOOOP + +_maxRange = if(!isNil "tawvd_maxRange") then {tawvd_maxRange} else {20000}; +_value = parseNumber (ctrlText _control); +if(_value > _maxRange OR _value < 100) exitwith {[] call TAWVD_fnc_openMenu;}; + +_varName = switch (_slider) do { + case "ground": {"tawvd_foot"}; + case "vehicle": {"tawvd_car"}; + case "air": {"tawvd_air"}; + case "object": {"tawvd_object"}; + case "drone": {"tawvd_drone"}; + default {"tawvd_foot"}; +}; + +SVAR_MNS [_varName,_value]; +[] call TAWVD_fnc_updateViewDistance; +[] call TAWVD_fnc_openMenu; \ No newline at end of file diff --git a/source/functions/taw_vd/fn_onSavePressed.sqf b/source/functions/taw_vd/fn_onSavePressed.sqf new file mode 100644 index 0000000..fe9e93e --- /dev/null +++ b/source/functions/taw_vd/fn_onSavePressed.sqf @@ -0,0 +1,26 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + Updates the view distance dependant on whether the player + is on foot, a car or an aircraft. +*/ +private ["_saveIndex","_saveName"]; +_saveIndex = lbCurSel SAVES_LIST; +_saveName = ctrlText SLOT_NAME; + +SVAR_PNS [format["tawvd_slot_%1",_saveIndex], + [ + _saveName, + tawvd_foot, + tawvd_car, + tawvd_air, + tawvd_drone, + tawvd_object, + tawvd_syncObject + ] +]; + +saveProfileNamespace; +[] call TAWVD_fnc_openSaveManager; diff --git a/source/taw_vd/fn_onSaveSelectionChanged.sqf b/source/functions/taw_vd/fn_onSaveSelectionChanged.sqf similarity index 82% rename from source/taw_vd/fn_onSaveSelectionChanged.sqf rename to source/functions/taw_vd/fn_onSaveSelectionChanged.sqf index 2715028..cd3fb26 100644 --- a/source/taw_vd/fn_onSaveSelectionChanged.sqf +++ b/source/functions/taw_vd/fn_onSaveSelectionChanged.sqf @@ -1,10 +1,10 @@ #include "defines.h" /* - Author: Bryan "Tonic" Boardwine - - Description: - Updates the view distance dependant on whether the player - is on foot, a car or an aircraft. + Author: Bryan "Tonic" Boardwine + + Description: + Updates the view distance dependant on whether the player + is on foot, a car or an aircraft. */ private "_saveData"; params [["_control",controlNull,[controlNull]],["_index",-1,[0]]]; diff --git a/source/functions/taw_vd/fn_onSliderChanged.sqf b/source/functions/taw_vd/fn_onSliderChanged.sqf new file mode 100644 index 0000000..0bf0d73 --- /dev/null +++ b/source/functions/taw_vd/fn_onSliderChanged.sqf @@ -0,0 +1,35 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + Called when the slider is changed for any field and + updates the view distance for it. +*/ +private "_varData"; +params [["_mode",-1,[0]],["_value",-1,[0]]]; + +if(EQUAL(_mode,-1) OR EQUAL(_value,-1)) exitWith {}; + +disableSerialization; + +_varData = switch(_mode) do { + case 0: {["tawvd_foot",INFANTRY_EDIT]}; + case 1: {["tawvd_car",GROUND_EDIT]}; + case 2: {["tawvd_air",AIR_EDIT]}; + case 3: {["tawvd_object",OBJECT_EDIT]}; + case 4: {["tawvd_drone",DRONE_EDIT]}; +}; + +SVAR_MNS [SEL(_varData,0),round(_value)]; +ctrlSetText[SEL(_varData,1),str(GVAR_MNS SEL(_varData,0))]; +[] call TAWVD_fnc_updateViewDistance; + +if(EQUAL(_mode,3)) then { + setObjectViewDistance [tawvd_object,100]; +}; + +if(tawvd_syncObject) then { + sliderSetPosition[OBJECT_SLIDER, tawvd_object]; + ctrlSetText[OBJECT_EDIT,str(tawvd_object)]; +}; \ No newline at end of file diff --git a/source/functions/taw_vd/fn_onTerrainChanged.sqf b/source/functions/taw_vd/fn_onTerrainChanged.sqf new file mode 100644 index 0000000..e75f7e2 --- /dev/null +++ b/source/functions/taw_vd/fn_onTerrainChanged.sqf @@ -0,0 +1,17 @@ + +/* + Author: Bryan "Tonic" Boardwine + + Description: + Updates the players terraingrid when called. +*/ +private "_type"; +_type = param [0,"",[""]]; +if(_type == "") exitWith {}; + +switch (_type) do { + case "none": {if(isNil "tawvd_disablenone") then {setTerrainGrid 50;};}; + case "low": {setTerrainGrid 30;}; + case "norm": {setTerrainGrid 12.5;}; + case "high": {setTerrainGrid 3.125;}; +}; \ No newline at end of file diff --git a/source/functions/taw_vd/fn_openMenu.sqf b/source/functions/taw_vd/fn_openMenu.sqf new file mode 100644 index 0000000..5b15560 --- /dev/null +++ b/source/functions/taw_vd/fn_openMenu.sqf @@ -0,0 +1,41 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + Called via addAction and opens the TAW View Distance Menu +*/ +if(isNull (findDisplay MENU_IDD)) then { + if(!createDialog "TAW_VDMenu") exitWith {hint "Something went wrong, the menu won't open?"}; +}; +disableSerialization; + +{ + ctrlSetText[SEL(_x,0),str(SEL(_x,1))]; +} foreach [[INFANTRY_EDIT,tawvd_foot],[GROUND_EDIT,tawvd_car],[AIR_EDIT,tawvd_air],[OBJECT_EDIT,tawvd_object],[DRONE_EDIT,tawvd_drone]]; + +//Setup the sliders +{ + if(!isNil "tawvd_maxRange") then { + slidersetRange [_x select 0,100,tawvd_maxRange]; + } else { + slidersetRange [_x select 0,100,20000]; + }; + ((findDisplay MENU_IDD) displayCtrl (_x select 0)) sliderSetSpeed [100,100,100]; + sliderSetPosition[_x select 0, _x select 1]; +} foreach [[INFANTRY_SLIDER,tawvd_foot],[GROUND_SLIDER,tawvd_car],[AIR_SLIDER,tawvd_air],[OBJECT_SLIDER,tawvd_object],[DRONE_SLIDER,tawvd_drone]]; + +((findDisplay MENU_IDD) displayCtrl 2931) cbSetChecked tawvd_syncObject; + +if(tawvd_syncObject) then { + ctrlEnable [OBJECT_SLIDER,false]; + ctrlEnable [OBJECT_EDIT,false]; +} else { + ctrlEnable [OBJECT_SLIDER,true]; + ctrlEnable [OBJECT_EDIT,true]; +}; + +//Lets disable it.. +if(!isNil "tawvd_disablenone") then { + ctrlEnable [TERRAIN_NONE,false]; +}; \ No newline at end of file diff --git a/source/functions/taw_vd/fn_openSaveManager.sqf b/source/functions/taw_vd/fn_openSaveManager.sqf new file mode 100644 index 0000000..33c0fa8 --- /dev/null +++ b/source/functions/taw_vd/fn_openSaveManager.sqf @@ -0,0 +1,31 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + Updates the view distance dependant on whether the player + is on foot, a car or an aircraft. +*/ +private ["_controlGrp","_saveList"]; +disableSerialization; + +/* Store displays */ +_controlGrp = CONTROL(MENU_IDD,MANAGER_GROUP); +_saveList = CONTROL(MENU_IDD,SAVES_LIST); +lbClear _saveList; //Purge the list + +/* Make the Saves manager group visible */ +_controlGrp ctrlSetfade 0; +_controlGrp ctrlCommit .3; + +/* Fill the listbox */ +for "_i" from 0 to 9 do { + _varData = GVAR_PNS format["tawvd_slot_%1",_i]; + if(!isNil "_varData") then { + _saveList lbAdd SEL(_varData,0); + _saveList lbSetData [(lbSize _saveList)-1,"true"]; + } else { + _saveList lbAdd format["Save Slot %1",_i]; + _saveList lbSetData [(lbSize _saveList)-1,"false"]; + }; +}; \ No newline at end of file diff --git a/source/taw_vd/fn_stateTracker.fsm b/source/functions/taw_vd/fn_stateTracker.fsm similarity index 94% rename from source/taw_vd/fn_stateTracker.fsm rename to source/functions/taw_vd/fn_stateTracker.fsm index ba7e91e..16f4c4f 100644 --- a/source/taw_vd/fn_stateTracker.fsm +++ b/source/functions/taw_vd/fn_stateTracker.fsm @@ -39,12 +39,12 @@ class FSM "tawvd_addon_disable = true;" \n "" \n "if(isNil {profileNamespace getVariable ""tawvd_foot""}) then {" \n - " profileNamespace setVariable [""tawvd_foot"",viewDistance];" \n - " profileNamespace setVariable [""tawvd_car"",viewDistance];" \n - " profileNamespace setVariable [""tawvd_air"",viewDistance];" \n - " profileNamespace setVariable [""tawvd_drone"",viewDistance];" \n - " profileNamespace setVariable [""tawvd_object"",viewDistance];" \n - " saveProfileNamespace;" \n + " profileNamespace setVariable [""tawvd_foot"",viewDistance];" \n + " profileNamespace setVariable [""tawvd_car"",viewDistance];" \n + " profileNamespace setVariable [""tawvd_air"",viewDistance];" \n + " profileNamespace setVariable [""tawvd_drone"",viewDistance];" \n + " profileNamespace setVariable [""tawvd_object"",viewDistance];" \n + " saveProfileNamespace;" \n "};" \n "" \n "tawvd_foot = profileNamespace getVariable [""tawvd_foot"",viewDistance];" \n diff --git a/source/functions/taw_vd/fn_updateViewDistance.sqf b/source/functions/taw_vd/fn_updateViewDistance.sqf new file mode 100644 index 0000000..d30f1e7 --- /dev/null +++ b/source/functions/taw_vd/fn_updateViewDistance.sqf @@ -0,0 +1,35 @@ +#include "defines.h" +/* + Author: Bryan "Tonic" Boardwine + + Description: + Updates the view distance dependant on whether the player + is on foot, a car or an aircraft. +*/ +private "_dist"; +switch (true) do { + case (!(EQUAL(SEL(UAVControl getConnectedUAV player,1),""))): { + setViewDistance tawvd_drone; + _dist = tawvd_drone; + }; + + case ((vehicle player) isKindOf "Man"): { + setViewDistance tawvd_foot; + _dist = tawvd_foot; + }; + + case ((vehicle player) isKindOf "LandVehicle"): { + setViewDistance tawvd_car; + _dist = tawvd_car; + }; + + case ((vehicle player) isKindOf "Air"): { + setViewDistance tawvd_air; + _dist = tawvd_air; + }; +}; + +if(tawvd_syncObject) then { + setObjectViewDistance [_dist,100]; + tawvd_object = _dist; +}; \ No newline at end of file diff --git a/source/utilities/autoSave.sqf b/source/functions/utilities/fn_autoSave.sqf similarity index 100% rename from source/utilities/autoSave.sqf rename to source/functions/utilities/fn_autoSave.sqf diff --git a/source/utilities/groupReset.sqf b/source/functions/utilities/fn_groupReset.sqf similarity index 100% rename from source/utilities/groupReset.sqf rename to source/functions/utilities/fn_groupReset.sqf diff --git a/source/zonescap/blufor_cap.sqf b/source/functions/zonescap/fn_blufor_cap.sqf similarity index 83% rename from source/zonescap/blufor_cap.sqf rename to source/functions/zonescap/fn_blufor_cap.sqf index 7b388fc..f0480ab 100644 --- a/source/zonescap/blufor_cap.sqf +++ b/source/functions/zonescap/fn_blufor_cap.sqf @@ -1,9 +1,4 @@ -_place = _this select 0; -_points = _this select 1; -_markername = _this select 2; -_markername2 = _this select 3; -_triggerPos = _this select 4; - +params ["_place","_points","_markername","_markername2","_triggerPos"]; amount_zones_captured = amount_zones_captured + 1; ["us_takencontrol",[_place]] call bis_fnc_showNotification; @@ -32,7 +27,7 @@ WARCOM_blufor_ap = WARCOM_blufor_ap + _points; publicVariable "WARCOM_blufor_ap"; // ADD Skill to operatives -_operHandler = execVM "dialog\operative\operative_mission_complete.sqf"; +[] call operative_mission_complete; // MODIFY MARKER ICON str(_markername) setMarkerColor "ColorGreen"; @@ -54,6 +49,6 @@ private "_trg"; call compile format["_trg = trigger%1%2",round (_triggerPos select 0),round (_triggerPos select 1)]; //// MAKE THE TRIGGER CAPTURABLE FOR OPFOR _trg setTriggerActivation["EAST SEIZED","PRESENT",true]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] execvm 'zonescap\opfor_cap.sqf'",_place,_points,_markername,_markername2,_triggerPos], ""]; +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] call duws_fnc_opfor_cap",_place,_points,_markername,_markername2,_triggerPos], ""]; diff --git a/source/zonescap/opfor_cap.sqf b/source/functions/zonescap/fn_opfor_cap.sqf similarity index 85% rename from source/zonescap/opfor_cap.sqf rename to source/functions/zonescap/fn_opfor_cap.sqf index 31ee35d..8e0ac8f 100644 --- a/source/zonescap/opfor_cap.sqf +++ b/source/functions/zonescap/fn_opfor_cap.sqf @@ -1,9 +1,4 @@ -_place = _this select 0; -_points = _this select 1; -_markername = _this select 2; -_markername2 = _this select 3; -_triggerPos = _this select 4; - +params ["_place","_points","_markername","_markername2","_triggerPos"]; amount_zones_captured = amount_zones_captured - 1; ["us_lostcontrol",[_place]] call bis_fnc_showNotification; @@ -44,6 +39,6 @@ private "_trg"; call compile format["_trg = trigger%1%2",round (_triggerPos select 0),round (_triggerPos select 1)]; //// MAKE THE TRIGGER CAPTURABLE FOR OPFOR _trg setTriggerActivation["WEST SEIZED","PRESENT",true]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] execvm 'zonescap\blufor_cap.sqf'",_place,_points,_markername,_markername2,_triggerPos], ""]; +_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] call duws_fnc_blufor_cap",_place,_points,_markername,_markername2,_triggerPos], ""]; diff --git a/source/includes/CfgFunctions.hpp b/source/includes/CfgFunctions.hpp new file mode 100644 index 0000000..c7f3168 --- /dev/null +++ b/source/includes/CfgFunctions.hpp @@ -0,0 +1,467 @@ +//https://community.bistudio.com/wiki/Functions_Library_(Arma_3) +class CfgFunctions +{ + class duws + { + class initMission + { + //duws_fnc_clientInit + class clientInit + { + //postInit = 1; + }; + //duws_fnc_serverInit + class serverInit + { + //preInit = 1; + }; + class DUWS_CONFIG + { + preInit = 1; + file = "DUWS_CONFIG.sqf"; + }; + class processUnitConfig {}; + class processVehicleConfig {}; + class processGroupConfig {}; + }; + + class generic + { + class bisArsenal {}; + // [] call duws_fnc_bisArsenal + class captured {}; + // [place, points, markername, markername2, triggerPos] call duws_fnc_captured + class createopfortified {}; + // [position] call duws_fnc_createopfortified + class createoppatrol {}; + // [position, radius] call duws_fnc_createoppatrol + class createopteam {}; + // [position, radius] call duws_fnc_createopteam + class createopwpteam {}; + // [position, radius] call duws_fnc_createopwpteam + class createpatrol {}; + // [position, radius] call duws_fnc_createpatrol + class convertCPtoAP {}; + // [] call duws_fnc_convertCPtoAP + class dynamic_menu {}; + // [???] spawn duws_fnc_dynamic_menu + class dyn_music_init + { + postInit = 1; + }; + // [] spawn duws_fnc_dynamic_music_init + class enterlocation {}; + // [place, trigger] spawn duws_fnc_enterlocation + class mapsize {}; + // [unit, debug] spawn duws_fnc_mapsize + class musicloop {}; + // [] spawn duws_fnc_musicloop + class random_name {}; + // [length] call duws_fnc_random_name + class random_veh {}; + // [faction, vehClass, position, radius] spawn duws_fnc_random_veh + class request {}; + // [] call duws_fnc_request + class request_squad {}; + // [] call duws_fnc_request_squad + class request_support {}; + // [] call duws_fnc_request_support + class request_unit {}; + // [] call duws_fnc_request_unit + class request_vehicle {}; + // [] call duws_fnc_request_vehicle + class savegame {}; + // [] spawn duws_fnc_savegame + class savegameClient {}; + // [] spawn duws_fnc_savegameClient + class spawnVehicle {}; + //[requiredPoints, vehicleType] call duws_fnc_spawnVehicle + class zones_bonus {}; + // [] spawn duws_fnc_zones_bonus + class zonesundercontrol {}; + // [] spawn duws_fnc_zonesundercontrol + class hc_init {}; + // [] call duws_fnc_hc_init + }; + + class fob + { + class fast_travel {}; + // [] call duws_fnc_fast_travel + class fobmanageropen {}; + // [] spawn duws_fnc_fobmanageropen + class radiochatter {}; + // [object] spawn duws_fnc_radiochatter + class reinforce {}; + // [] spawn duws_fnc_reinforce + }; + + class utilities + { + class autoSave {}; + // [] spawn duws_fnc_autoSave + class groupReset {}; + // [] call duws_fnc_groupReset + }; + + class WARCOM + { + class random_veh_blu_patrol {}; + // [faction, vehclass, position, radius] spawn duws_fnc_random_veh_blu_patrol + class random_veh_opf_patrol {}; + // [faction, vehclass, position, radius] spawn duws_fnc_random_veh_opf_patrol + class WARCOM_blu_assault {}; + // [] call duws_fnc_WARCOM_blu_assault + class WARCOM_blu_patrol {}; + // [] call duws_fnc_WARCOM_blu_patrol + class WARCOM_gps_marker {}; + // [group, TFname] spawn duws_fnc_WARCOM_gps_marker + class WARCOM_init {}; + // [array of zones total, blu hq pos, op hq pos, blufor ap, opfor ap, blu attack delay, blu ai skill range, opfor ai skill, opfor assault delay] call duws_fnc_WARCOM_init + class WARCOM_opf_assault {}; + // [] call duws_fnc_WARCOM_opf_assault + class WARCOM_opf_patrol {}; + // [] call duws_fnc_WARCOM_opf_patrol + class WARCOM_opf_qrf {}; + // [attachedUnit] spawn duws_fnc_WARCOM_opf_qrf + class WARCOM_wp {}; + // [group] call duws_fnc_WARCOM_wp + class WARCOM_wp_blu_patrol {}; + // [group] call duws_fnc_WARCOM_wp_blu_patrol + class WARCOM_wp_opf {}; + // [group] call duws_fnc_WARCOM_wp_opf + class WARCOM_wp_opf_patrol {}; + // [group] call duws_fnc_WARCOM_wp_opf_patrol + class WARCOM_wp_opf_qrf {}; + // [group, unitpos] call duws_fnc_WARCOM_wp_opf_qrf + }; + + class initHQ + { + class BluHQinit {}; + // [_hqblu] spawn duws_fnc_BluHQinit + class drawIcon {}; + // [] spawn duws_fnc_drawIcon + // Used for generating HQ 3d marker + class drawIconFnc {}; + // [] spawn duws_fnc_drawIconFnc + // Called from duws_fnc_drawIcon + class fobmanager {}; + // [] call duws_fnc_fobmanager + class fortify {}; + // [_centerPos, _hq] spawn duws_fnc_fortify + class fortifyFOB {}; + // (in addaction) '_this spawn duws_fnc_fortifyFOB' with arguments '[(getpos _fob), _fob]' + class fortifyFOB2 {}; + // [_centerPos, _fob] spawn duws_fnc_fortifyFOB2 + class guards {}; + // [_centerPos, _hq] call duws_fnc_guards + class guardsFOB {}; + // [_centerPos, _fob, _size] call duws_fnc_guardsFOB + class guardsHQ {}; + // [_centerPos, _distance] call duws_fnc_guardsHQ + class hq_radioloop {}; + // [_object] spawn duws_fnc_radioloop + class HQaddactions {}; + // [_hq] call duws_fnc_HQaddactions + class locatorhq {}; + // [] spawn duws_fnc_locatorhq + class refortify {}; + // (in addaction) '_this call duws_fnc_fortify' with arguments '[_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _hq]' + class refortifyFOB {}; + // (in addaction) '_this call duws_fnc_refortifyFOB' with arguments '[_aaPod, _gl1Pod, _atPod1, _atPod2, _atPod3, _centerPos, _fob]' + class reguard {}; + // (in addaction) '_this call duws_fnc_reguard' with arguments '[_groupGuard, _groupPatrol, _centerPos, _hq]' + class reguardFOB {}; + // (in addaction) '_this call duws_fnc_reguardFOB' with arguments '[_groupGuard, _groupPatrol, _centerPos, _fob]' + class teleport {}; + // [_fobpos] call duws_fnc_teleport + class commanderAnim {}; + // [unit] call duws_fnc_commanderAnim + }; + + class startup + { + class endconditions {}; + // [] spawn duws_fnc_endconditions + class manual {}; + // [] spawn duws_fnc_manual + class placement {}; + // [] spawn duws_fnc_placement + class placement_closed {}; + // [] spawn duws_fnc_placement_closed + class random {}; + // [] call duws_fnc_random + class startup {}; + // [] spawn duws_fnc_startup + class startup_closed {}; + // [] call duws_fnc_startup_closed + class startup_common {}; + // [] call duws_fnc_startup_common + class startup_manual_start {}; + // [] spawn duws_fnc_startup_manual_start + class startup_random_start {}; + // [] spawn duws_fnc_startup_random_start + class weather {}; + // [] spawn duws_fnc_weather + class weather_broadcast {}; + // [] spawn duws_fnc_weather_broadcast + class weather_client {}; + // [] spawn duws_fnc_weather_client + }; + + class initZones + { + class createzone {}; + // ["Outpost Airbase",5,50,getpos this,true] spawn duws_fnc_createzone + class createzonebackup {}; + // ["Outpost Airbase",5,50,getpos this,true] spawn duws_fnc_createzonebackup + class locatorzonesV1 {}; + // [radius, diff] spawn duws_fnc_locatorzonesV1 + class locatorzonesV1_backup {}; + // [radius, diff] spawn duws_fnc_locatorzonesV1_backup + class locatorzonesV2 {}; + // [radius, diff] spawn duws_fnc_locatorzonesV2 + }; + + class zonescap + { + class blufor_cap {} + // [place, points, markername, markername2, triggerPos] call duws_fnc_blufor_cap + class opfor_cap {}; + // [place, points, markername, markername2, triggerPos] call duws_fnc_opfor_cap + }; + + class prefabs + { + class site_Barracks {}; + class site_campsite {}; + class site_commandOP {}; + class site_CommStation {}; + class site_outpost1 {}; + class site_outpost2 {}; + class site_powerRelay {}; + class site_reconOutpost {}; + class site_researchBunker {}; + class site_researchStation {}; + class site_vehfittingstation {}; + }; + + class persistent + { + class persistent_stats_init {}; + // [] call duws_fnc_persistent_stats_init; + class persistent_stats_missions_total {}; + // [] call duws_fnc_persistent_stats_missions_total; + class persistent_stats_reset {}; + // [] spawn duws_fnc_persistent_stats_reset; + class persistent_stats_win {}; + // [] call duws_fnc_persistent_stats_win; + class persistent_stats_zones_add {}; + // [] call duws_fnc_persistent_stats_zones_add; + + class experience_init {}; + // [] call duws_fnc_experience_init; + class experience_ability_check {}; + // [] spawn duws_fnc_experience_ability_check + class experience_ability_fieldcomm {}; + // [player] spawn duws_fnc_experience_ability_fieldcomm; + class experience_ability_heal {}; + // [player] spawn duws_fnc_experience_ability_heal; + class experience_ability_logistic {}; + // [player] spawn duws_fnc_experience_ability_logistic; + class experience_ability_logistic_boost {}; + // [player] spawn duws_fnc_experience_ability_logistic_boost + class experience_ability_refit {}; + // [player] spawn duws_fnc_experience_ability_refit + class experience_ability_slowtime {}; + // [player] spawn duws_fnc_experience_ability_slowtime; + class experience_ability_stamina {}; + // [player] spawn duws_fnc_experience_ability_stamina; + class experience_ability_warrior {}; + // [player] spawn duws_fnc_experience_ability_warruir + }; + + class operative + { + class operator_add_aim {}; + // [] call duws_fnc_operator_add_aim + class operator_add_comms {}; + // [] call duws_fnc_operator_add_comms + class operator_add_courage {}; + // [] call duws_fnc_operator_add_courage + class operator_add_reflexes {}; + // [] call duws_fnc_operator_add_reflexes + class operator_add_reload {}; + // [] call duws_fnc_operator_add_reload + class operator_add_spotting {}; + // [] call duws_fnc_operator_add_spotting + class lbselected {}; + // [] call duws_fnc_lbselected + class operative_mission_complete {}; + // [] call operative_mission_complete + class operator_open {}; + // [] spawn duws_fnc_operator_open + class operator_recruit {}; + // [] spawn duws_fnc_operator_recruit + }; + + class missions + { + class destroy_mission {}; + // [location] spawn duws_fnc_destroy_mission + class pilot_mission {}; + // [location] spawn duws_fnc_pilot_mission + class rescue_mission {}; + // [location] spawn duws_fnc_rescue_mission + class rescue_success {}; + // ["_markername","_sol1","_sol2","_sol3","_MissionPos","_markername2","_trg"] spawn duws_fnc_rescue_success + class sabotage_mission {}; + // [location] spawn duws_fnc_sabotage_mission + class sabotage_success {}; + // (in addaction) {_this call duws_fnc_sabotage_success;} + class steal_mission {}; + // [location] spawn duws_fnc_steal_mission + class target_mission {}; + // [location] spawn duws_fnc_target_mission + class underwater_mission {}; + // [location] spawn duws_fnc_underwater_mission + class underwater_success {}; + // (in addaction) {_this call duws_fnc_underwater_success;} + + class missionTimer {}; + // [] spawn duws_fnc_missionTimer + class stratmap {}; + // [] spawn duws_fnc_stratmap + }; + + class squad + { + class copyloadout {}; + // [] call duws_fnc_copyLoadout + class dismiss {}; + // [] call duws_fnc_dismiss + class dismissHC {}; + // [] spawn duws_fnc_dismissHC + class renamesquad {}; + // [] spawn duws_fnc_renamesquad + class squadmng {}; + // [] spawn duws_fnc_squadmng + }; + + class support + { + class ammobox {}; + // [target] spawn duws_fnc_ammobox + class arty {}; + // [position, salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_arty + class fob {}; + // [position, size] spawn duws_fnc_fob + class fob_addAction {}; + // object remoteExecCall ["DUWS_fnc_fob_addAction", ] + class fob_ammobox {}; + // [target, location] spawn duws_fnc_fob_ammobox + class FOBactions {}; + // [fob] call duws_fnc_FOBactions + class FOBreceiveaction {}; + // [] spawn duws_fnc_FOBreceiveaction + class mapclickarty {}; + // [salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_mapclickarty + class mapclickuav {}; + // [] spawn duws_fnc_mapclickuav + class paradrop {}; + // [] spawn duws_fnc_paradrop + class sitrep {}; + // [] spawn duws_fnc_sitrep + class uav_map {}; + // [centerPos, checkedRadius] spawn duws_fnc_uav_map + class veh_refit {}; + // [] call duws_fnc_veh_refit + + // Taxi + class boatTaxi + { + file = "functions\support\taxi\fn_boatTaxi.sqf"; + }; + // [posplayer, radius] spawn duws_fnc_boatTaxi + class heloTaxi + { + file = "functions\support\taxi\fn_heloTaxi.sqf"; + }; + // [posplayer, radius] spawn duws_fnc_heloTaxi + class mapclickboat + { + file = "functions\support\taxi\fn_mapclickboat.sqf"; + }; + // (in addaction) {_this spawn duws_fnc_mapclickboat} + class mapclickhelo + { + file = "functions\support\taxi\fn_mapclickhelo.sqf"; + }; + // (in addaction) {_this spawn duws_fnc_mapclickhelo} + class random_music + { + file = "functions\support\taxi\fn_random_music.sqf"; + }; + // [] call duws_fnc_random_music + + // Cluster + class cluster + { + file = "functions\support\cluster\fn_cluster.sqf"; + }; + // [position, salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_cluster + class mapclickcluster + { + file = "functions\support\cluster\fn_mapclickcluster.sqf"; + }; + // [salvos, radius, interval, rps, supporttype, cost, ammotype] spawn duws_fnc_mapclickcluster + }; + + class misc + { + class bottom_right_message {}; + // [position, date] call duws_fnc_bottom_right_message + class gps_marker {}; + // [] spawn duws_fnc_gps_marker + }; + + class info + { + class info {}; + // [] spawn duws_fnc_info + }; + + class pFLIR + { + class livefeed {}; + class livefeed1 {}; + class livefeedexit {}; + }; + + }; + class TAW_VD + { + tag = "TAWVD"; + + class TAW_VD + { + class stateTracker { + ext = ".fsm"; + postInit = 1; + headerType = -1; + }; + + class onSliderChanged {}; + class onTerrainChanged {}; + class updateViewDistance {}; + class openMenu {}; + class onChar {}; + class openSaveManager {}; + class onSavePressed {}; + class onSaveSelectionChanged {}; + }; + }; + + #include "..\AIS\cfgFunctions.hpp" +}; diff --git a/source/includes/debriefing.hpp b/source/includes/debriefing.hpp new file mode 100644 index 0000000..06ca5fb --- /dev/null +++ b/source/includes/debriefing.hpp @@ -0,0 +1,22 @@ +class CfgDebriefing +{ + class island_captured_win + { + title = "Island Captured!"; + subtitle = ""; + description = "You have successfully captured all the zones and destroyed the enemy forces on the island. This island is now under BLUFOR control. Time to take back another island, soldier..."; + pictureBackground = ""; + picture = "\a3\ui_f\data\gui\cfg\hints\UnitType_ca.paa"; + pictureColor[] = {0.0,0,1,1}; + }; + + class officerkilled + { + title = "HQ Officer Killed"; + subtitle = ""; + description = "Your commanding officer has been killed, you are now alone and stranded on the island. You will be evacuated shortly."; + pictureBackground = ""; + picture = "\a3\ui_f\data\gui\cfg\hints\ActionMenu_ca.paa"; + pictureColor[] = {1,0,0,1}; + }; +}; diff --git a/source/dialog/defines.hpp b/source/includes/defines.hpp similarity index 100% rename from source/dialog/defines.hpp rename to source/includes/defines.hpp diff --git a/source/dialog/fob/fobmanager.hpp b/source/includes/fobmanager.hpp similarity index 95% rename from source/dialog/fob/fobmanager.hpp rename to source/includes/fobmanager.hpp index 0d6b81e..c3a4678 100644 --- a/source/dialog/fob/fobmanager.hpp +++ b/source/includes/fobmanager.hpp @@ -1,7 +1,7 @@ class fob_mng_dialog { - idd = -1; - movingenable = true; + idd = -1; + movingenable = true; // onLoad = "_this call FRAME_01_Load"; class controls @@ -56,7 +56,7 @@ class fob_mng_dialog w = 12 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Send a team from your High Command to reinforce a specific FOB"; //--- ToDo: Localize; - action = "_derp = [] execVM 'dialog\fob\reinforce.sqf'"; + action = "[] spawn duws_fnc_reinforce"; }; class frame_fast_travel: RscFrame { @@ -76,7 +76,7 @@ class fob_mng_dialog y = 14 * GUI_GRID_H + GUI_GRID_Y; w = 12 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "_derp = [] execVM 'dialog\fob\fast_travel.sqf'"; + action = "[] call duws_fnc_fast_travel"; tooltip = "Fast travel between the FOB's and the base"; //--- ToDo: Localize; }; class fast_travel_combo: RscCombo diff --git a/source/hints.hpp b/source/includes/hints.hpp similarity index 100% rename from source/hints.hpp rename to source/includes/hints.hpp diff --git a/source/dialog/info/info.hpp b/source/includes/info/info.hpp similarity index 99% rename from source/dialog/info/info.hpp rename to source/includes/info/info.hpp index 9dfa29f..c6f3816 100644 --- a/source/dialog/info/info.hpp +++ b/source/includes/info/info.hpp @@ -1,7 +1,7 @@ class info_radio { - idd = -1; - movingenable = false; + idd = -1; + movingenable = false; // onLoad = "_this call FRAME_01_Load"; class controls diff --git a/source/dialog/info/reset/reset.hpp b/source/includes/info/reset.hpp similarity index 94% rename from source/dialog/info/reset/reset.hpp rename to source/includes/info/reset.hpp index ee9fa3d..be9648a 100644 --- a/source/dialog/info/reset/reset.hpp +++ b/source/includes/info/reset.hpp @@ -1,7 +1,7 @@ class reset_confirm { - idd = -1; - movingenable = false; + idd = -1; + movingenable = false; // onLoad = "_this call FRAME_01_Load"; class controls @@ -40,7 +40,7 @@ class reset_confirm colorBackground[] = {1, 0, 0,0.5}; colorBackgroundActive[] = {1,0.2,0.2,1}; colorFocused[] = {1,0.2,0.2,0}; - action = "_hurr = [] execVM ""persistent\persistent_stats_reset.sqf"""; + action = "_hurr = [] spawn duws_fnc_persistent_stats_reset"; }; class no_button: RscButton { diff --git a/source/locations.hpp b/source/includes/locations.hpp similarity index 99% rename from source/locations.hpp rename to source/includes/locations.hpp index f6633ee..ecfb157 100644 --- a/source/locations.hpp +++ b/source/includes/locations.hpp @@ -218,7 +218,7 @@ class CfgNotifications duration = 8; // How many seconds will the notification be displayed priority = 0; // Priority; higher number = more important; tasks in queue are selected by priority difficulty[] = {}; // Required difficulty settings. All listed difficulties has to be enabled - }; + }; class operator_healed { @@ -230,5 +230,5 @@ class CfgNotifications duration = 8; // How many seconds will the notification be displayed priority = 0; // Priority; higher number = more important; tasks in queue are selected by priority difficulty[] = {}; // Required difficulty settings. All listed difficulties has to be enabled - }; + }; }; \ No newline at end of file diff --git a/source/dialog/operative/identities.hpp b/source/includes/operative/identities.hpp similarity index 97% rename from source/dialog/operative/identities.hpp rename to source/includes/operative/identities.hpp index d112c23..7e08164 100644 --- a/source/dialog/operative/identities.hpp +++ b/source/includes/operative/identities.hpp @@ -128,7 +128,7 @@ class CfgIdentities glasses="none"; speaker="Male13ENG"; pitch=0.9; - }; + }; class reynolds { @@ -148,7 +148,7 @@ class CfgIdentities glasses="G_Tactical_Clear"; speaker="Male07ENG"; pitch=0.9; - }; + }; class mckendrick { @@ -158,7 +158,7 @@ class CfgIdentities glasses="none"; speaker="Male04ENG"; pitch=1; - }; + }; class snake { @@ -178,7 +178,7 @@ class CfgIdentities glasses="G_Tactical_Clear"; speaker="Male06ENG"; pitch=1; - }; + }; class fox { @@ -188,7 +188,7 @@ class CfgIdentities glasses="none"; speaker="Male01ENG"; pitch=1.05; - }; + }; class martinez { @@ -198,7 +198,7 @@ class CfgIdentities glasses="G_Combat"; speaker="Male06ENG"; pitch=1; - }; + }; class stranger { @@ -208,7 +208,7 @@ class CfgIdentities glasses="none"; speaker="Male04ENGB"; pitch=0.9; - }; + }; class dixon { @@ -218,5 +218,5 @@ class CfgIdentities glasses="none"; speaker="Male010ENG"; pitch=0.9; - }; + }; }; \ No newline at end of file diff --git a/source/dialog/operative/operative.hpp b/source/includes/operative/operative.hpp similarity index 96% rename from source/dialog/operative/operative.hpp rename to source/includes/operative/operative.hpp index 55720ce..e76b9a5 100644 --- a/source/dialog/operative/operative.hpp +++ b/source/includes/operative/operative.hpp @@ -66,7 +66,7 @@ class operativemaingui y = 6 * GUI_GRID_H + GUI_GRID_Y; w = 9.5 * GUI_GRID_W; h = 13.5 * GUI_GRID_H; - onLBSelChanged = "execVM 'dialog\operative\LBselected.sqf'"; //UI event handler + onLBSelChanged = "[] call duws_fnc_lbselected"; //UI event handler }; class operative_skill_frame: RscFrame { @@ -280,7 +280,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_aim"; + action = "call duws_fnc_operator_add_aim"; }; class operative_add_reflexes: RscButton { @@ -291,7 +291,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_reflexes"; + action = "call duws_fnc_operator_add_reflexes"; }; class operative_add_spotting: RscButton { @@ -302,7 +302,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_spotting"; + action = "call duws_fnc_operator_add_spotting"; }; class operative_add_courage: RscButton { @@ -313,7 +313,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_courage"; + action = "call duws_fnc_operator_add_courage"; }; class operative_add_comms: RscButton { @@ -324,7 +324,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_comms"; + action = "call duws_fnc_operator_add_comms"; }; class operative_add_reload: RscButton { @@ -335,7 +335,7 @@ class operativemaingui w = 1 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Spend 1 point on this skill"; //--- ToDo: Localize; - action = "call DUWS_operator_add_reload"; + action = "call duws_fnc_operator_add_reload"; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END diff --git a/source/includes/paramdebugconsole.hpp b/source/includes/paramdebugconsole.hpp new file mode 100644 index 0000000..9cfe3c6 --- /dev/null +++ b/source/includes/paramdebugconsole.hpp @@ -0,0 +1,15 @@ +// From biwiki: +// Param templates currently don't work with PBO missions manually copied to MPMissions folder. Unpacked missions, Steam missions and missions which are part of an addon works correctly. +// So I just copied the file into the mission instead. + +#ifndef DEBUGCONSOLE_DEFAULT + #define DEBUGCONSOLE_DEFAULT 0 +#endif + +class DebugConsole +{ + title = $STR_A3_paramDebugConsole_title; + values[] = {0,1}; + texts[] = {$STR_DISABLED,$STR_ENABLED}; + default = DEBUGCONSOLE_DEFAULT; +}; diff --git a/source/params.hpp b/source/includes/params.hpp similarity index 77% rename from source/params.hpp rename to source/includes/params.hpp index 932719a..bb7feda 100644 --- a/source/params.hpp +++ b/source/includes/params.hpp @@ -19,4 +19,10 @@ class Params { texts[] = {"On","Off"}; default = 1; }; + + #define DEBUGCONSOLE_DEFAULT 0 + #include "paramDebugConsole.hpp" + + #define TIMEACCELERATION_DEFAULT 10 + #include "paramTimeAcceleration.hpp" } diff --git a/source/includes/paramtimeacceleration.hpp b/source/includes/paramtimeacceleration.hpp new file mode 100644 index 0000000..ae245ba --- /dev/null +++ b/source/includes/paramtimeacceleration.hpp @@ -0,0 +1,22 @@ +// From biwiki: +// Param templates currently don't work with PBO missions manually copied to MPMissions folder. Unpacked missions, Steam missions and missions which are part of an addon works correctly. +// So I just copied the file into the mission instead. + +#ifndef TIMEACCELERATION_DEFAULT + #define TIMEACCELERATION_DEFAULT 1 +#endif + +class TimeAcceleration +{ + title = $STR_usract_time_inc; + values[] = {1,2,5,10,20}; + texts[] = { + "x1", + "x2", + "x5", + "x10", + "x20" + }; + default = TIMEACCELERATION_DEFAULT; + function = "BIS_fnc_paramTimeAcceleration"; +}; diff --git a/source/dialog/request.hpp b/source/includes/request.hpp similarity index 94% rename from source/dialog/request.hpp rename to source/includes/request.hpp index e9f5cad..43444e0 100644 --- a/source/dialog/request.hpp +++ b/source/includes/request.hpp @@ -70,7 +70,7 @@ class ressourceheader y = 15.5 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "_nil=[]ExecVM ""dialog\request_unit.sqf"""; + action = "[] call duws_fnc_request_unit"; tooltip = "Request a single unit AI to join your own personal squad"; }; class requestsquadbutton: RscButton @@ -81,7 +81,7 @@ class ressourceheader y = 15.5 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "_nil=[]ExecVM ""dialog\request_squad.sqf"""; + action = "[] call duws_fnc_request_squad"; tooltip = "Request an entire squad, accessible through High Command"; }; class requestvehiclebutton: RscButton @@ -93,7 +93,7 @@ class ressourceheader w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Request an EMPTY vehicle to spawn at your position"; - action = "_nil=[]ExecVM ""dialog\request_vehicle.sqf"""; + action = "[] call duws_fnc_request_vehicle"; }; class supportunlockbutton: RscButton { @@ -103,7 +103,7 @@ class ressourceheader y = 21.5 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "_nil=[]ExecVM ""dialog\request_support.sqf"""; + action = "[] call duws_fnc_request_support"; tooltip = "Unlock supports accessible with the communication menu (0-8) in the radio"; }; class exitbutton: RscButton @@ -164,7 +164,7 @@ class ressourceheader y = 11 * GUI_GRID_H + GUI_GRID_Y; w = 10.5 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; - action = "_derp = [] execVM 'missions\stratmap.sqf'; closeDialog 0"; + action = "_derp = [] spawn duws_fnc_stratmap; closeDialog 0"; tooltip = "Select a random side mission. Accomplishing a side mission gives you CP."; }; class ap_mainframe: RscFrame @@ -232,7 +232,7 @@ class ressourceheader y = 20.5 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "_nil=[]ExecVM ""dialog\convertCPtoAP.sqf"""; + action = "[]call duws_fnc_convertCPtoAP"; tooltip = "You remove 10 CP from your pool to add 15 AP to our forces"; }; class recruit_operative_button: RscButton @@ -243,7 +243,7 @@ class ressourceheader y = 18 * GUI_GRID_H + GUI_GRID_Y; w = 11.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; - action = "execVM ""dialog\operative\operator_open.sqf"""; + action = "[] spawn duws_fnc_operator_open"; tooltip = "Recruit special units that will stay during the entire campaign"; }; }; diff --git a/source/dialog/squad/rename/renamesquad.hpp b/source/includes/squad/renamesquad.hpp similarity index 95% rename from source/dialog/squad/rename/renamesquad.hpp rename to source/includes/squad/renamesquad.hpp index aa1060d..89bd787 100644 --- a/source/dialog/squad/rename/renamesquad.hpp +++ b/source/includes/squad/renamesquad.hpp @@ -37,7 +37,7 @@ class squad_rename_dialog y = 15 * GUI_GRID_H + GUI_GRID_Y; w = 19 * GUI_GRID_W; h = 1.5 * GUI_GRID_H; - action = "_derp = [] execVM 'dialog\squad\rename\renamesquad.sqf'"; + action = "[] spawn duws_fnc_renamesquad"; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END diff --git a/source/dialog/squad/squadmng.hpp b/source/includes/squad/squadmng.hpp similarity index 95% rename from source/dialog/squad/squadmng.hpp rename to source/includes/squad/squadmng.hpp index c626f94..529bbdc 100644 --- a/source/dialog/squad/squadmng.hpp +++ b/source/includes/squad/squadmng.hpp @@ -1,7 +1,7 @@ class squad_mng_dialog { - idd = -1; - movingenable = true; + idd = -1; + movingenable = true; // onLoad = "_this call FRAME_01_Load"; class controls @@ -46,7 +46,7 @@ class squad_mng_dialog w = 24.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Add the squad members under your control with High Command"; //--- ToDo: Localize; - action = "_derp = [] execVM 'dialog\squad\dismiss.sqf'; closeDialog 0"; + action = "[] call duws_fnc_dismiss; closeDialog 0"; }; class dismiss_txt_info: RscText { @@ -90,7 +90,7 @@ class squad_mng_dialog w = 24.5 * GUI_GRID_W; h = 1 * GUI_GRID_H; tooltip = "Dismiss a HC squad and add the units under your direct control"; //--- ToDo: Localize; - action = "_derp = [] execVM 'dialog\squad\dismissHC.sqf'; closeDialog 0"; + action = "[] spawn duws_fnc_dismissHC; closeDialog 0"; }; class renameHC_button: RscButton { diff --git a/source/dialog/squad_number_init.hpp b/source/includes/squad_number_init.hpp similarity index 100% rename from source/dialog/squad_number_init.hpp rename to source/includes/squad_number_init.hpp diff --git a/source/dialog/startup/hq_placement/placement.hpp b/source/includes/startup/placement.hpp similarity index 84% rename from source/dialog/startup/hq_placement/placement.hpp rename to source/includes/startup/placement.hpp index 560b2be..d1c1e85 100644 --- a/source/dialog/startup/hq_placement/placement.hpp +++ b/source/includes/startup/placement.hpp @@ -1,8 +1,8 @@ class startup_hq_placement_dialog { - idd = -1; - movingenable = false; - onUnload = "_nul = execVM ""dialog\startup\hq_placement\placement_closed.sqf"""; //UI event handler + idd = -1; + movingenable = false; + onUnload = "[] spawn duws_fnc_placement_closed"; //UI event handler // onLoad = "_this call FRAME_01_Load"; class controls @@ -37,7 +37,7 @@ class startup_hq_placement_dialog w = 18 * GUI_GRID_W; h = 2.5 * GUI_GRID_H; tooltip = "The HQ is randomly placed somewhere on the island"; //--- ToDo: Localize; - action = "_nul = [] execvm ""dialog\startup\hq_placement\random.sqf""; closedialog 0;"; + action = "[] call duws_fnc_random; closedialog 0;"; }; class hq_placement_manual_button: RscButton { @@ -48,7 +48,7 @@ class startup_hq_placement_dialog w = 18 * GUI_GRID_W; h = 2.5 * GUI_GRID_H; tooltip = "You choose where the HQ is placed on the island"; //--- ToDo: Localize; - action = "_nul = [] execvm ""dialog\startup\hq_placement\manual.sqf""; closedialog 0;"; + action = "[] spawn duws_fnc_manual; closedialog 0;"; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END diff --git a/source/dialog/startup/startup.hpp b/source/includes/startup/startup.hpp similarity index 97% rename from source/dialog/startup/startup.hpp rename to source/includes/startup/startup.hpp index 20d8269..e991a37 100644 --- a/source/dialog/startup/startup.hpp +++ b/source/includes/startup/startup.hpp @@ -3,7 +3,7 @@ class startup_dialog { idd = -1; movingenable = false; - onUnload = "_nul = execVM ""dialog\startup\startup_closed.sqf"""; // UI event handler + onUnload = "[] call duws_fnc_startup_closed"; // UI event handler class controls { @@ -294,7 +294,7 @@ class startup_dialog sizeEx = 0.05; colorBackground[] = {1, 0, 0,0.5}; tooltip = "Randomly generate the zones, then start the campaign"; - action = "_nul = [] execvm ""dialog\startup\startup_random_start.sqf"""; + action = "[] spawn duws_fnc_startup_random_start"; }; class start_button2: RscButton { @@ -307,7 +307,7 @@ class startup_dialog sizeEx = 0.05; colorBackground[] = {1, 0, 0,0.5}; tooltip = "Manually generate the zones, then start the campaign"; - action = "_nul = [] execvm ""dialog\startup\startup_manual_start.sqf"""; + action = "[] spawn duws_fnc_startup_manual_start"; }; }; }; \ No newline at end of file diff --git a/source/support/support.hpp b/source/includes/support.hpp similarity index 83% rename from source/support/support.hpp rename to source/includes/support.hpp index a5aa21e..1b4c586 100644 --- a/source/support/support.hpp +++ b/source/includes/support.hpp @@ -4,7 +4,7 @@ class CfgCommunicationMenu { text = "DUWS-R Support"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [] execVM 'dynamic_menu.sqf'"; // Code executed upon activation (ignored when the submenu is not empty) + expression = "_null = [] spawn duws_fnc_dynamic_menu"; // Code executed upon activation (ignored when the submenu is not empty) icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa"; // Icon displayed permanently next to the command menu cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -14,7 +14,7 @@ class CfgCommunicationMenu { text = "Artillery Strike (4 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [6, 100, 8, 3, 1, 4, 'R_80mm_HE'] execVM 'support\mapclickarty.sqf'"; // Code executed upon activation (ignored when the submenu is not empty) + expression = "_null = [6, 100, 8, 3, 1, 4, 'R_80mm_HE'] spawn duws_fnc_mapclickarty"; // Code executed upon activation (ignored when the submenu is not empty) icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\artillery_ca.paa"; // Icon displayed permanently next to the command menu cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -24,7 +24,7 @@ class CfgCommunicationMenu { text = "Mortar strike (2 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [8, 50, 5, 3, 2, 2, 'grenade'] execVM 'support\mapclickarty.sqf'"; // Code executed upon activation (ignored when the submenu is not empty) + expression = "_null = [8, 50, 5, 3, 2, 2, 'grenade'] spawn duws_fnc_mapclickarty"; // Code executed upon activation (ignored when the submenu is not empty) icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\mortar_ca.paa"; cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -34,7 +34,7 @@ class CfgCommunicationMenu { text = "JDAM Strike (1 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [1, 2, 1, 1, 3, 1, 'Bo_Mk82'] execVM 'support\mapclickarty.sqf'"; // Code executed upon activation (ignored when the submenu is not empty) + expression = "_null = [1, 2, 1, 1, 3, 1, 'Bo_Mk82'] spawn duws_fnc_mapclickarty"; // Code executed upon activation (ignored when the submenu is not empty) icon = "\a3\ui_f\data\gui\cfg\hints\Designator_ca.paa"; cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -44,7 +44,7 @@ class CfgCommunicationMenu { text = "SITREP (1 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = execVM 'support\sitrep.sqf'"; // Code executed upon activation (ignored when the submenu is not empty) + expression = "_null = [] spawn duws_fnc_sitrep"; // Code executed upon activation (ignored when the submenu is not empty) icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa"; // Icon displayed permanently next to the command menu cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -54,7 +54,7 @@ class CfgCommunicationMenu { text = "Supply drop (2 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [player] execVM 'support\ammobox.sqf'"; + expression = "_null = [player] spawn duws_fnc_ammobox"; icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\supplydrop_ca.paa"; // Icon displayed permanently next to the command menu cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -64,7 +64,7 @@ class CfgCommunicationMenu { text = "Airborne troops (25 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [player] execVM 'support\paradrop.sqf'"; + expression = "_null = [player] spawn duws_fnc_paradrop"; icon = "\a3\ui_f\data\gui\cfg\hints\BasicStances_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -74,7 +74,7 @@ class CfgCommunicationMenu { text = "UAV Recon (3 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = execVM 'support\mapclickuav.sqf'"; + expression = "_null = spawn duws_fnc_mapclickuav"; icon = "\a3\ui_f\data\gui\cfg\hints\Radar_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -84,7 +84,7 @@ class CfgCommunicationMenu { text = "Vehicle Refit (2 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = execVM 'support\veh_refit.sqf'"; + expression = "_null = call duws_fnc_veh_refit"; icon = "\a3\ui_f\data\gui\cfg\hints\VehicleAmmo_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -94,7 +94,7 @@ class CfgCommunicationMenu { text = "Establish FOB (10 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [getpos player, 500] execVM 'support\fob.sqf'"; + expression = "_null = [getpos player, 500] spawn duws_fnc_fob"; icon = "\a3\ui_f\data\gui\cfg\hints\Head_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -104,7 +104,7 @@ class CfgCommunicationMenu { text = "Helicopter taxi(1 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_nill = [getpos player,50] execVM 'support\taxi\helotaxi.sqf'"; + expression = "_nill = [getpos player,50] spawn duws_fnc_heloTaxi"; icon = "\a3\ui_f\data\gui\cfg\hints\TakeOff_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -114,7 +114,7 @@ class CfgCommunicationMenu { text = "Mk.20 II CBU (6 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [1, 250, 1, 90, 1, 6, 'grenade'] execVM 'support\cluster\mapclickcluster.sqf'"; + expression = "_null = [1, 250, 1, 90, 1, 6, 'grenade'] spawn duws_fnc_mapclickcluster"; icon = "\a3\ui_f\data\gui\cfg\hints\Death_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item @@ -124,7 +124,7 @@ class CfgCommunicationMenu { text = "Boat taxi (1 CP)"; // Text displayed in the menu and in a notification submenu = ""; // Submenu opened upon activation - expression = "_null = [getpos player,10] execVM 'support\taxi\boattaxi.sqf'"; + expression = "_null = [getpos player,10] spawn duws_fnc_boatTaxi"; icon = "\a3\ui_f\data\gui\cfg\hints\BasicDive_ca.paa"; cursor = ""; // Custom cursor displayed when the item is selected enable = "1"; // Simple expression condition for enabling the item diff --git a/source/dialog/supports_init.hpp b/source/includes/supports_init.hpp similarity index 100% rename from source/dialog/supports_init.hpp rename to source/includes/supports_init.hpp diff --git a/source/initHQ/HQaddactions.sqf b/source/initHQ/HQaddactions.sqf deleted file mode 100644 index 8ab892b..0000000 --- a/source/initHQ/HQaddactions.sqf +++ /dev/null @@ -1,15 +0,0 @@ -_hq = _this select 0; - -_hq addaction ["Player stats","dialog\info\info.sqf", "", 0, true, true, "", "_this == player"]; -_hq addaction ["Request units","dialog\request.sqf", "", 0, true, true, "", "_this == player"]; -_hq addaction ["Squad manager","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"]; -_hq addaction ["FOB manager","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"]; -if (isServer) then { - _hq addaction ["Rest (wait/save)","savegame.sqf", "", 0, true, true, "", "_this == player"]; -}; - -if (!isServer) then { - _hq addaction ["Rest","savegameClient.sqf", "", 0, true, true, "", "_this == player"]; -}; - -_hq addaction ["RESET SQUAD LEADER","utilities\groupReset.sqf", "", 0, true, true, "", "_this == player"]; diff --git a/source/initHQ/guardsHQ.sqf b/source/initHQ/guardsHQ.sqf deleted file mode 100644 index 4a02285..0000000 --- a/source/initHQ/guardsHQ.sqf +++ /dev/null @@ -1,34 +0,0 @@ -_centerPos = _this select 0; - -// patrolling guard -_groupPatrol = [ [(_centerPos select 0)+40, (_centerPos select 1)+40], WEST, ["B_Soldier_F","B_Soldier_F","B_Soldier_AT_F","B_engineer_F","B_medic_F","B_recon_F","B_Soldier_AT_F","B_Soldier_AA_F"],[],[],[0.6,0.8,0.7]] call BIS_fnc_spawnGroup; - -_groupPatrol setCombatMode "YELLOW"; - _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+40, (_centerPos select 1)+40], 0]; - _wp setWaypointType "MOVE"; -_wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; - - _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-40, (_centerPos select 1)+40], 0]; - _wp setWaypointType "MOVE"; -_wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; - - _wp = _groupPatrol addWaypoint [[(_centerPos select 0)-40, (_centerPos select 1)-40], 0]; - _wp setWaypointType "MOVE"; -_wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; - - _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+40, (_centerPos select 1)-40], 0]; - _wp setWaypointType "MOVE"; - - _wp = _groupPatrol addWaypoint [[(_centerPos select 0)+40, (_centerPos select 1)+40], 0]; - _wp setWaypointType "CYCLE"; -_wp setWaypointBehaviour "SAFE"; -_wp setWaypointSpeed "LIMITED"; - -// ADD Infinite Ammo eventhandler -{ -_x addEventHandler ["Fired",{(_this select 0) setvehicleammo 1}]; -_x addEventHandler ["HandleDamage", {false}]; -} forEach (units _groupPatrol); diff --git a/source/initZones/createzone.sqf b/source/initZones/createzone.sqf deleted file mode 100644 index aa94c69..0000000 --- a/source/initZones/createzone.sqf +++ /dev/null @@ -1,311 +0,0 @@ -// _trg = ["Outpost Airbase",5,50,getpos this,true] execvm "createzone.sqf"; -// Name of the place,pts,radius,position,fortified/not -// - -_place = _this select 0; -_points = _this select 1; -_size = _this select 2; -_trigger = _this select 3; -_fortified = _this select 4; -_prefab = _this select 5; - -amount_zones_created = amount_zones_created + 1; -publicVariable "amount_zones_created"; -zones_created = true; // Tell that at least 1 zone is created - -// Add the zone to the array of zones (need for manual placement of zones and WARCOM) -if (isNil ("Array_of_OPFOR_zones")) then {Array_of_OPFOR_zones = [];}; -Array_of_OPFOR_zones = Array_of_OPFOR_zones + [_trigger]; - -// CREATE MARKER (ICON) -_markername = format["%1%2",round(_trigger select 0),round(_trigger select 1)]; // Define marker name -//hint _markername; -_markerstr = createMarker [str(_markername),_trigger]; -_markerstr setMarkerShape "ICON"; -str(_markername) setMarkerType "hd_objective"; -str(_markername) setMarkerColor "ColorRed"; -str(_markername) setMarkerText _place; -str(_markername) setMarkerSize [0, 0]; - -// CREATE MARKER (ELLIPSE ZONE) -_markername2 = format["%1%2ellipse",round(_trigger select 0),round(_trigger select 1)]; // Define marker name -//hint _markername2; -_markerstr2 = createMarker [str(_markername2),_trigger]; -_markerstr2 setMarkerShape "ELLIPSE"; -str(_markername2) setMarkerBrush "SolidBorder"; -str(_markername2) setMarkerColor "ColorRed"; -str(_markername2) setMarkerSize [_size, _size]; -str(_markername2) setMarkerAlpha 0.1; - - - -// CREATE ZONE CAPTURABLE TRIGGER -_trg=createTrigger["EmptyDetector",_trigger]; -_trg setTriggerArea[_size,_size,0,false]; -_trg setTriggerActivation["WEST SEIZED","PRESENT",false]; -_trg setTriggerStatements["this", format["[""%1"",%2,""%3"",""%4"",%5] execvm 'captured.sqf'",_place,_points,_markername,_markername2,_trigger], ""]; -_trg setTriggerTimeout [30, 60, 300, true ]; -// CREATE VARNAME FOR ZONE TRIGGER --> use the pos of the trigger -_triggerName = format["trigger%1%2",round (_trigger select 0),round (_trigger select 1)]; -call compile format["%1 = _trg",_triggerName]; - - - - - - - - - -// CREATE PREFAB -if (_prefab) then { -_array_of_prefabs = [["Command Outpost",true,"initZones\prefabs\commandOP.sqf"], -["Vehicle Refit Station",false,"initZones\prefabs\vehfittingstation.sqf"], -["Research Bunker",true,"initZones\prefabs\researchBunker.sqf"], -["Recon Outpost",true,"initZones\prefabs\reconOutpost.sqf"], -["Power Relay",true,"initZones\prefabs\powerRelay.sqf"], -["Com. Station",true,"initZones\prefabs\commstation.sqf"], -["Outpost",true,"initZones\prefabs\outpost1.sqf"], -["Outpost",true,"initZones\prefabs\outpost2.sqf"], -["Barracks",true,"initZones\prefabs\barracks.sqf"], -["Research Station",false,"initZones\prefabs\researchStation.sqf"], -["Camp Site",false,"initZones\prefabs\campsite.sqf"]]; - -_amount_of_prefabs = count _array_of_prefabs; -_indexedAmount = _amount_of_prefabs - 1; -_dice = round random _indexedAmount; - -_prefab_array = _array_of_prefabs select _dice; -_place = _prefab_array select 0; -_fortified = _prefab_array select 1; -_path = _prefab_array select 2; - -_prefab_create = [_trigger] execVM _path; -str(_markername) setMarkerText _place; -}; - - - -// CREATE ZONE NOTIFICATION TRIGGER -_trg2=createTrigger["EmptyDetector",_trigger]; -_trg2 triggerAttachVehicle [player]; -_trg2 setTriggerArea[_size,_size,0,false]; -_trg2 setTriggerActivation["VEHICLE","PRESENT",true]; -_trg2 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocation.sqf'",_place], ""]; - - - - - - - - - - - - - - - - - - -// move the spawn location, or units get stuck -_fortifiedspawn = _trigger; -_trigger = [(_trigger select 0)+40,_trigger select 1]; - - -// CREATE OPFOR. HEAVY CLUSTERFUCK INCOMING. -// Check if fortified is true -if (_fortified) then -{ - [_fortifiedspawn] execvm "createopfortified.sqf"; - sleep 2; -}; - -// Check if radius is 100m or smaller => create 2 patrols then exit the script -if (_size < 101) exitWith -{ - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; -}; -// Check if radius is 250m-100m => create 2 patrols and 1 fireteam then exit the script -if (_size < 251) exitWith -{ - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; -}; -// Check if radius is 250m-500m => create 2 patrols and 2 fireteams then exit the script -if (_size < 501) exitWith -{ - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; -}; -if (_size <= 1000) exitWith -{ - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -}; -if (_size <= 1500) exitWith -{ -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -}; -if (_size <= 2000) exitWith -{ -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; -}; -if (_size <= 3000) exitWith -{ -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; -}; - -// IF NOT IN PARAMETERS (TOO BIG ZONE) -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - -_vehcreate = ["OPF_F","armored",_trigger,_size] execVM "random_veh.sqf"; -waitUntil {scriptDone _vehcreate}; - - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopwpteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createopteam.sqf"; - waituntil {scriptdone _handle}; - _handle = [_trigger, _size] execvm "createoppatrol.sqf"; - waituntil {scriptdone _handle}; - ["OPF_F","air",_trigger,_size] execVM "random_veh.sqf"; - \ No newline at end of file diff --git a/source/misc/bottom_right_message.sqf b/source/misc/bottom_right_message.sqf deleted file mode 100644 index 55d5034..0000000 --- a/source/misc/bottom_right_message.sqf +++ /dev/null @@ -1,221 +0,0 @@ -/* - Author: Jiri Wainar - - Description: - Display OSD with location, time and possibly some other campaign related info. - - Parameter(s): - _this select 0: array (optional) - position (default: player's position) - _this select 1: array (optional) - date in format [_year,_month,_day,_hour,_min] (default: current date) - - Example: - [] call BIS_fnc_camp_showOSD; - - Returns: - - nothing - -*/ - -private["_fn_getSector"]; - -_fn_getSector = -{ - private["_map","_posX","_posY","_gridX","_gridY","_secWidth","_secHeight"]; - private["_bottomLeftX","_bottomLeftY","_topRightX","_topRightY"]; - - _map = toLower worldName; - - if !(_map in ["altis","stratis"]) exitWith - { - -1 - }; - - if (_map == "stratis") then - { - _bottomLeftX = 1302; - _bottomLeftY = 230; - _topRightX = 6825; - _topRightY = 7810; - } - else - { - _bottomLeftX = 1765; - _bottomLeftY = 4639; - _topRightX = 28624; - _topRightY = 26008; - }; - - _posX = _this select 0; - _posY = _this select 1; - - //check if player is outside the map grid - if !(_posX > _bottomLeftX && _posX < _topRightX && _posY > _bottomLeftY && _posY < _topRightY) exitWith - { - 0 - }; - - //offset player pos to [0,0] - _posX = _posX - _bottomLeftX; - _posY = _posY - _bottomLeftY; - - _secWidth = (_topRightX - _bottomLeftX)/3; - _secHeight = (_topRightY - _bottomLeftY)/3; - - _gridX = floor (_posX/_secWidth); - _gridY = floor (_posY/_secHeight); - - ((_gridY * 3) + _gridX + 1) -}; - - -private["_position","_date","_output","_showDate","_showLocation","_showMap"]; -private["_tLoc","_tMap","_tDate","_tTime","_tTimeH","_tTimeM","_tDay","_tMonth","_tYear"]; - -_showDate = true; - - -_position = [_this, 0, getPos player, [[]]] call BIS_fnc_param; -_date = [_this, 1, date, [[]]] call BIS_fnc_param; -_tMap = [_this, 2, "auto", [""]] call BIS_fnc_param; -_tLoc = [_this, 3, "auto", [""]] call BIS_fnc_param; - -if (_tMap != "") then -{ - _showMap = true; -} -else -{ - _showMap = false; -}; - -if (_tLoc != "") then -{ - _showLocation = true; -} -else -{ - _showLocation = false; -}; - -//get map text -if (_showMap && _tMap == "auto") then -{ - private["_sector","_map","_template"]; - - _sector = _position call _fn_getSector; - - if (_sector == -1) then - { - ["Map not recognized! Only 'Altis' and 'Stratis' are supported."] call BIS_fnc_error; - - _showMap = false; - _showLocation = false; - }; - - _map = gettext (configfile >> "cfgworlds" >> worldname >> "description"); - - _template = switch (_sector) do - { - case 1: {localize "STR_A3_SectorNorthWest"}; - case 2: {localize "STR_A3_SectorSouth"}; - case 3: {localize "STR_A3_SectorSouthEast"}; - case 4: {localize "STR_A3_SectorWest"}; - case 5: {localize "STR_A3_SectorCentral"}; - case 6: {localize "STR_A3_SectorEast"}; - case 7: {localize "STR_A3_SectorNorthWest"}; - case 8: {localize "STR_A3_SectorNorth"}; - case 9: {localize "STR_A3_SectorNorthEast"}; - - default - { - _showLocation = false; - - //hardcoded for Stratis and Altis only - if (worldname == "Stratis") then - { - localize "STR_A3_NearStratis" - } - else - { - localize "STR_A3_NearAltis" - }; - }; - }; - - _tMap = format[_template,_map]; -}; - -//get current location text -if (_showLocation && _tLoc == "auto") then -{ - private["_locations","_loc"]; - - _locations = nearestLocations [getPos player, ["NameCity","NameCityCapital","NameLocal","NameMarine","NameVillage"], 500]; - - //filter-out locations without names - { - if (text _x == "") then - { - locations set [_forEachIndex, objNull]; - }; - } - forEach _locations; _locations = _locations - [objNull]; - - if (count _locations > 0) then - { - _loc = _locations select 0; - - if ((getPos player) in _loc) then - { - _tLoc = text _loc; - } - else - { - _tLoc = format[localize "STR_A3_NearLocation", text _loc]; //tolocalize: "Poblíž lokace %1" - }; - } - else - { - _tLoc = ""; - _showLocation = false; - }; -}; - -//get daytime data -_tYear = _date select 0; -_tMonth = _date select 1; -_tDay = _date select 2; - -if (_tMonth < 10) then {_tMonth = format["0%1",_tMonth]}; -if (_tDay < 10) then {_tDay = format["0%1",_tDay]}; - -//get date text -_tDate = format["%1-%2-%3",_tYear,_tMonth,_tDay]; - -//get time text -_tTimeH = _date select 3; -_tTimeM = _date select 4; - -if (_tTimeH < 10) then {_tTimeH = format["0%1",_tTimeH]}; -if (_tTimeM < 10) then {_tTimeM = format["0%1",_tTimeM]}; - -_tTime = format["%1:%2",_tTimeH,_tTimeM]; - - -//sum the output params & print it -_output = -[ - [_tDate,"%1",0], - [_tTime,"%1
",5] -]; - -if (_showLocation) then -{ - _output = _output + [[toUpper _tLoc,"%1
",5]]; -}; - -if (_showMap) then -{ - _output = _output + [[_tMap,"%1
",30]]; -}; - -[_output,-safezoneX,0.85,"%1"] spawn BIS_fnc_typeText; \ No newline at end of file diff --git a/source/misc/gps_marker.sqf b/source/misc/gps_marker.sqf deleted file mode 100644 index 600b5de..0000000 --- a/source/misc/gps_marker.sqf +++ /dev/null @@ -1,33 +0,0 @@ -_player_has_gps = false; -private ["_markername"]; - -while {true} do { - - while {!_player_has_gps} do { - _number = assignedItems player find "ItemGPS"; - if (_number != -1 && !_player_has_gps) then { // Check if player has a gps assigned, if yes create marker - _markername = format["gps%1%2%3",round (getpos player select 0),round (getpos player select 1),round (random 10000)]; // --START CREATE MARKER-- - _markerstr = createMarker [str(_markername), getpos player]; - _markerstr setMarkerShape "ICON"; - str(_markername) setMarkerType "mil_arrow2"; - str(_markername) setMarkerColor "ColorGreen"; - str(_markername) setMarkerSize [0.3, 0.5]; - str(_markername) setMarkerText format["%1",profileName]; - _player_dir = getDir player; - str(_markername) setmarkerdir _player_dir; - _player_has_gps = true; - }; // --END CREATE MARKER-- - sleep 3; - }; - - - while {_player_has_gps} do { - _player_dir = getDir player; - str(_markername) setmarkerdir _player_dir; - str(_markername) setMarkerPos getpos player; - _number = assignedItems player find "ItemGPS"; - if (_number == -1) then {_player_has_gps = false; deletemarker str(_markername)}; - sleep 0.7; - }; -sleep 0.2; -}; \ No newline at end of file diff --git a/source/mission.sqm b/source/mission.sqm index 2f81338..6cc3046 100644 Binary files a/source/mission.sqm and b/source/mission.sqm differ diff --git a/source/pFLIR/livefeed.sqf b/source/pFLIR/livefeed.sqf deleted file mode 100644 index 2474663..0000000 --- a/source/pFLIR/livefeed.sqf +++ /dev/null @@ -1,76 +0,0 @@ -// pFLIRenable = player addaction ["Activate FLIR","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]; - -// pflir aim -trucPIPtarget = "Land_Sack_F" createVehicle ([0,0,0]); // PAS OUBLIER DE SUPPRIMER LE TRUC -trucPIPtarget attachTo [player,[0,2000,1]]; -trucPIPtarget hideobject true; - -// pflir camera creation -_lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed; -BIS_liveFeed attachTo [player,[0,1,1]]; -BIS_liveFeed camPrepareFOV 0.2; -BIS_liveFeed camCommitPrepared 0; - -pFlirActivated = true; -player removeEventHandler ["respawn",PlayerKilledEH3]; -player removeAction pFlirEnable; - - -// Stance management init -_actualStance = stance player; -switch (_actualStance) do -{ - case "STAND": - { - BIS_liveFeed attachTo [player,[0,1,1.68]]; - trucPIPtarget attachTo [player,[0,2000,1.68]]; - }; - - case "CROUCH": - { - BIS_liveFeed attachTo [player,[0,1,0.85]]; - trucPIPtarget attachTo [player,[0,2000,0.85]]; - }; - - case "PRONE": - { - BIS_liveFeed attachTo [player,[0,1,0.25]]; - trucPIPtarget attachTo [player,[0,2000,0.25]]; - }; - -}; - -// add action to disable FLIR -sleep 1; - -pFLIRdisable = player addaction ["Deactivate FLIR","pflir\livefeedexit.sqf","", 0,false,true,"","_target == _this"]; -PlayerKilledEH2 = player addEventHandler ["killed", {execvm "pflir\livefeedexit.sqf"}]; //removes screen from hud - - - -while {pFlirActivated} do { -waitUntil {(_actualStance != stance player) or !pFlirActivated}; -if (!pFlirActivated) exitWith {}; - _actualStance = stance player; - switch (_actualStance) do - { - case "STAND": - { - BIS_liveFeed attachTo [player,[0,1,1.68]]; - trucPIPtarget attachTo [player,[0,2000,1.68]]; - }; - - case "CROUCH": - { - BIS_liveFeed attachTo [player,[0,1,0.85]]; - trucPIPtarget attachTo [player,[0,2000,0.85]]; - }; - - case "PRONE": - { - BIS_liveFeed attachTo [player,[0,1,0.25]]; - trucPIPtarget attachTo [player,[0,2000,0.25]]; - }; - - }; -}; \ No newline at end of file diff --git a/source/pFLIR/livefeed1.sqf b/source/pFLIR/livefeed1.sqf deleted file mode 100644 index 7bccd6f..0000000 --- a/source/pFLIR/livefeed1.sqf +++ /dev/null @@ -1,76 +0,0 @@ -// pFLIRenable = player addaction ["Activate FLIR","pflir\livefeed.sqf","", 0,false,true,"","_target == _this"]; - -// pflir aim -trucPIPtarget = "Land_Sack_F" createVehicle ([0,0,0]); // PAS OUBLIER DE SUPPRIMER LE TRUC -trucPIPtarget attachTo [player,[0,2000,1]]; -trucPIPtarget hideobject true; - -// pflir camera creation -_lol = [player, trucPIPtarget, player,2] call BIS_fnc_liveFeed; -BIS_liveFeed attachTo [player,[0,1,1]]; -BIS_liveFeed camPrepareFOV 0.2; -BIS_liveFeed camCommitPrepared 0; - -pFlirActivated = true; -player removeEventHandler ["respawn",PlayerRespawnEH2]; -player removeAction pFLIRenable; - - -// Stance management init -_actualStance = stance player; -switch (_actualStance) do -{ - case "STAND": - { - BIS_liveFeed attachTo [player,[0,1,1.68]]; - trucPIPtarget attachTo [player,[0,2000,1.68]]; - }; - - case "CROUCH": - { - BIS_liveFeed attachTo [player,[0,1,0.85]]; - trucPIPtarget attachTo [player,[0,2000,0.85]]; - }; - - case "PRONE": - { - BIS_liveFeed attachTo [player,[0,1,0.25]]; - trucPIPtarget attachTo [player,[0,2000,0.25]]; - }; - -}; - -// add action to disable FLIR -sleep 1; - -pFLIRdisable = player addaction ["Deactivate FLIR","pflir\livefeedexit.sqf","", 0,false,true,"","_target == _this"]; -PlayerKilledEH2 = player addEventHandler ["killed", {execvm "pflir\livefeedexit.sqf"}]; //removes screen from hud - - - -while {pFlirActivated} do { -waitUntil {(_actualStance != stance player) or !pFlirActivated}; -if (!pFlirActivated) exitWith {}; - _actualStance = stance player; - switch (_actualStance) do - { - case "STAND": - { - BIS_liveFeed attachTo [player,[0,1,1.68]]; - trucPIPtarget attachTo [player,[0,2000,1.68]]; - }; - - case "CROUCH": - { - BIS_liveFeed attachTo [player,[0,1,0.85]]; - trucPIPtarget attachTo [player,[0,2000,0.85]]; - }; - - case "PRONE": - { - BIS_liveFeed attachTo [player,[0,1,0.25]]; - trucPIPtarget attachTo [player,[0,2000,0.25]]; - }; - - }; -}; \ No newline at end of file diff --git a/source/persistent/experience/experience_ability_fieldcomm.sqf b/source/persistent/experience/experience_ability_fieldcomm.sqf deleted file mode 100644 index b034a9a..0000000 --- a/source/persistent/experience/experience_ability_fieldcomm.sqf +++ /dev/null @@ -1,7 +0,0 @@ -player addaction ["Squad manager","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"]; - - - - - - \ No newline at end of file diff --git a/source/repetitive_cleanup.sqf b/source/repetitive_cleanup.sqf deleted file mode 100644 index a810a7c..0000000 --- a/source/repetitive_cleanup.sqf +++ /dev/null @@ -1,155 +0,0 @@ -/* - NAME: repetitive_cleanup.sqf - VERSION: 1.9 - - DESCRIPTION: - Can delete everything that is not really needed - dead bodies, dropped items, smokes, chemlights, explosives, empty groups - Works even on Altis, it eats only items which are/were 100m from all units - - USAGE: - in server's init - [ - 60, // seconds to delete dead bodies (0 means don't delete) - 5*60, // seconds to delete dead vehicles (0 means don't delete) - 3*60, // seconds to delete immobile vehicles (0 means don't delete) - 2*60, // seconds to delete dropped weapons (0 means don't delete) - 10*60, // seconds to deleted planted explosives (0 means don't delete) - 0 // seconds to delete dropped smokes/chemlights (0 means don't delete) - ] execVM 'repetitive_cleanup.sqf'; - - will delete dead bodies after 60 seconds (1 minute) - will delete dead vehicles after 5*60 seconds (5 minutes) - will delete immobile vehicles after 3*60 seconds (3 minutes) - will delete weapons after 2*60 seconds (2 minutes) - will delete planted explosives after 10*60 seconds (10 minutes) - will not delete any smokes/chemlights since its disabled (set to 0) - - If you want something to withstand the clean up, paste this into it's init: - this setVariable["persistent",true]; -*/ - -if (!isServer) exitWith {}; // isn't server - -#define PUSH(A,B) A set [count (A),B]; -#define REM(A,B) A=A-[B]; - -private ["_ttdBodies","_ttdVehiclesDead","_ttdVehiclesImmobile","_ttdWeapons","_ttdPlanted","_ttdSmokes","_addToCleanup","_unit","_objectsToCleanup","_timesWhenToCleanup","_removeFromCleanup"]; - -_ttdBodies=[_this,0,0,[0]] call BIS_fnc_param; -_ttdVehiclesDead=[_this,1,0,[0]] call BIS_fnc_param; -_ttdVehiclesImmobile=[_this,2,0,[0]] call BIS_fnc_param; -_ttdWeapons=[_this,3,0,[0]] call BIS_fnc_param; -_ttdPlanted=[_this,4,0,[0]] call BIS_fnc_param; -_ttdSmokes=[_this,5,0,[0]] call BIS_fnc_param; - -if({_x>0}count _this==0) exitWith {}; // all times are 0, we do not want to run this script at all - -_objectsToCleanup=[]; -_timesWhenToCleanup=[]; - -_addToCleanup = { - _object = _this select 0; - if(!(_object getVariable["persistent",false])) then { - _newTime = (_this select 1)+time; - _index = _objectsToCleanup find _object; - if(_index == -1) then { - PUSH(_objectsToCleanup,_object) - PUSH(_timesWhenToCleanup,_newTime) - } else { - _currentTime = _timesWhenToCleanup select _index; - if(_currentTime>_newTime) then { - _timesWhenToCleanup set[_index, _newTime]; - }; - }; - }; -}; - -_removeFromCleanup = { - _object = _this select 0; - _index = _objectsToCleanup find _object; - if(_index != -1) then { - _objectsToCleanup set[_index, 0]; - _timesWhenToCleanup set[_index, 0]; - }; -}; - -while{true} do { - sleep 10; - { - _unit = _x; - if (_ttdWeapons>0) then { - { - { - [_x, _ttdWeapons] call _addToCleanup; - } forEach (getpos _unit nearObjects [_x, 100]); - } forEach ["WeaponHolder","GroundWeaponHolder","WeaponHolderSimulated"]; - }; - - if (_ttdPlanted>0) then { - { - { - [_x, _ttdPlanted] call _addToCleanup; - } forEach (getpos _unit nearObjects [_x, 100]); - } forEach ["TimeBombCore"]; - }; - - if (_ttdSmokes>0) then { - { - { - [_x, _ttdSmokes] call _addToCleanup; - } forEach (getpos _unit nearObjects [_x, 100]); - } forEach ["SmokeShell"]; - }; - - } forEach allUnits; - - { - if ((count units _x)==0) then { - deleteGroup _x; - }; - } forEach allGroups; - - if (_ttdBodies>0) then { - { - [_x, _ttdBodies] call _addToCleanup; - } forEach allDeadMen; - }; - - if (_ttdVehiclesDead>0) then { - { - if(_x == vehicle _x) then { // make sure its vehicle - [_x, _ttdVehiclesDead] call _addToCleanup; - }; - } forEach (allDead - allDeadMen); // all dead without dead men == mostly dead vehicles - }; - - if (_ttdVehiclesImmobile>0) then { - { - if(!canMove _x && {alive _x}count crew _x==0) then { - [_x, _ttdVehiclesImmobile] call _addToCleanup; - } else { - [_x] call _removeFromCleanup; - }; - } forEach vehicles; - }; - - REM(_objectsToCleanup,0) - REM(_timesWhenToCleanup,0) - - { - if(isNull(_x)) then { - _objectsToCleanup set[_forEachIndex, 0]; - _timesWhenToCleanup set[_forEachIndex, 0]; - } else { - if(_timesWhenToCleanup select _forEachIndex < time) then { - deleteVehicle _x; - _objectsToCleanup set[_forEachIndex, 0]; - _timesWhenToCleanup set[_forEachIndex, 0]; - }; - }; - } forEach _objectsToCleanup; - - REM(_objectsToCleanup,0) - REM(_timesWhenToCleanup,0) -}; \ No newline at end of file diff --git a/source/savegameClient.sqf b/source/savegameClient.sqf deleted file mode 100644 index 48af196..0000000 --- a/source/savegameClient.sqf +++ /dev/null @@ -1,4 +0,0 @@ -skipTime 6; -player setdammage 0; -{_x setdammage 0} forEach units group player; -hint "You and your squad members have been fully healed"; \ No newline at end of file diff --git a/source/sounds/radiochatter2.ogg b/source/sounds/radiochatter2.ogg index 6546dae..cce5ea3 100644 Binary files a/source/sounds/radiochatter2.ogg and b/source/sounds/radiochatter2.ogg differ diff --git a/source/sounds/radiochatter3.ogg b/source/sounds/radiochatter3.ogg index 4a27139..a27ad98 100644 Binary files a/source/sounds/radiochatter3.ogg and b/source/sounds/radiochatter3.ogg differ diff --git a/source/sounds/radiochatter4.ogg b/source/sounds/radiochatter4.ogg index ee08942..ce2da52 100644 Binary files a/source/sounds/radiochatter4.ogg and b/source/sounds/radiochatter4.ogg differ diff --git a/source/sounds/sounds.hpp b/source/sounds/sounds.hpp index abcc739..7cd042c 100644 --- a/source/sounds/sounds.hpp +++ b/source/sounds/sounds.hpp @@ -1,36 +1,36 @@ class CfgSounds { - sounds[] = {}; - class radiochatter2 - { - // how the sound is referred to in the editor (e.g. trigger effects) - name = "radiochatter2"; - // filename, volume, pitch - sound[] = {"sounds\radiochatter2.ogg", 1, 1}; - titles[] = {}; - }; - class radiochatter4 - { - // how the sound is referred to in the editor (e.g. trigger effects) - name = "radiochatter4"; - // filename, volume, pitch - sound[] = {"sounds\radiochatter4.ogg", 1, 1}; - titles[] = {}; - }; - class loadgun - { - // how the sound is referred to in the editor (e.g. trigger effects) - name = "loadgun"; - // filename, volume, pitch - sound[] = {"sounds\support\loadgun.ogg", 1, 1}; - titles[] = {}; - }; - class boots - { - // how the sound is referred to in the editor (e.g. trigger effects) - name = "boots"; - // filename, volume, pitch - sound[] = {"sounds\support\boots.ogg", 2, 1}; - titles[] = {}; - }; + sounds[] = {}; + class radiochatter2 + { + // how the sound is referred to in the editor (e.g. trigger effects) + name = "radiochatter2"; + // filename, volume, pitch + sound[] = {"sounds\radiochatter2.ogg", 1, 1}; + titles[] = {}; + }; + class radiochatter4 + { + // how the sound is referred to in the editor (e.g. trigger effects) + name = "radiochatter4"; + // filename, volume, pitch + sound[] = {"sounds\radiochatter4.ogg", 1, 1}; + titles[] = {}; + }; + class loadgun + { + // how the sound is referred to in the editor (e.g. trigger effects) + name = "loadgun"; + // filename, volume, pitch + sound[] = {"sounds\support\loadgun.ogg", 1, 1}; + titles[] = {}; + }; + class boots + { + // how the sound is referred to in the editor (e.g. trigger effects) + name = "boots"; + // filename, volume, pitch + sound[] = {"sounds\support\boots.ogg", 2, 1}; + titles[] = {}; + }; }; \ No newline at end of file diff --git a/source/sounds/support/boots.ogg b/source/sounds/support/boots.ogg index ff8b208..17ec51c 100644 Binary files a/source/sounds/support/boots.ogg and b/source/sounds/support/boots.ogg differ diff --git a/source/sounds/support/loadgun.ogg b/source/sounds/support/loadgun.ogg index 4fb30e9..eb3660e 100644 Binary files a/source/sounds/support/loadgun.ogg and b/source/sounds/support/loadgun.ogg differ diff --git a/source/support/FOBactions.sqf b/source/support/FOBactions.sqf deleted file mode 100644 index 551a5e8..0000000 --- a/source/support/FOBactions.sqf +++ /dev/null @@ -1,17 +0,0 @@ -_fob = _this select 0; - -_fob addaction ["Player stats","dialog\info\info.sqf", "", 0, true, true, "", "_this == player"]; -_fob addaction ["Request ammobox drop(2CP)","support\fob_ammobox.sqf", "", 0, true, true, "", "_this == player"]; - -if (support_armory_available) then { - _fob addaction ["Armory (VA)","bisArsenal.sqf", "", 0, true, true, "", "_this == player"]; -}; - -_fob addaction ["Squad manager","dialog\squad\squadmng.sqf", "", 0, true, true, "", "_this == player"]; -_fob addaction ["FOB manager","dialog\fob\FOBmanageropen.sqf", "", 0, true, true, "", "_this == player"]; - -if (isServer) then { - _fob addaction ["Rest (wait/save)","savegame.sqf", "", 0, true, true, "", "_this == player"]; -} else { - _fob addaction ["Rest","savegameClient.sqf", "", 0, true, true, "", "_this == player"]; -}; diff --git a/source/support/FOBreceiveaction.sqf b/source/support/FOBreceiveaction.sqf deleted file mode 100644 index ea9a70c..0000000 --- a/source/support/FOBreceiveaction.sqf +++ /dev/null @@ -1,6 +0,0 @@ - sleep 10; - _fobAmount = count Array_of_FOBS; - _fobIndex = _fobAmount - 1; - _createdFOB = Array_of_FOBS select _fobIndex; -// hint format["fobIndex: %1\ncreatedFOB: %2\nArray: %3",_fobIndex,_createdFOB,Array_of_FOBS]; - [_createdFOB] execVM "support\FOBactions.sqf"; \ No newline at end of file diff --git a/source/support/fob_ammobox.sqf b/source/support/fob_ammobox.sqf deleted file mode 100644 index 33d49a6..0000000 --- a/source/support/fob_ammobox.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - File: fob_ammobox.sqf - - Author: Kibot - - Description: - Variant of ammobox.sqf with less spread in deployment. - Air-deploys a NATO ammobox with a parachute at a assigned location. - - Parameter(s): - _this select 0 - OBJECT - A non-nil object with a physical location. - - Usage: - _scriptHandle = [player] execVM 'fob_ammobox.sqf'; - - Returns: - - Nil - -*/ - -_target = _this select 0; -_location = getpos _target; - -if (commandpointsblu1<2) exitWith { - ["info",["Not enough command points","Not enough Command Points (2CP required)"]] call bis_fnc_showNotification; -}; -commandpointsblu1 = commandpointsblu1 - 2; -publicVariable "commandpointsblu1"; - -hint "A supply crate has been dropped near the FOB"; - -// Create the parachute -_parachute = "Steerable_Parachute_F" CreateVehicle _location; -_parachute setPos [_location select 0, _location select 1, (_location select 2)+50]; -// Create the supply crate -_ammo = "B_supplyCrate_F" CreateVehicle [_location select 0,_location select 1,(_location select 2)+20]; -_ammo attachTo [_parachute,[0,0,0]]; - -_ammo addMagazineCargo ["30Rnd_65x39_caseless_mag", 70]; -_ammo addMagazineCargo ["30Rnd_65x39_caseless_mag_Tracer", 70]; -_ammo addMagazineCargo ["100Rnd_65x39_caseless_mag", 70]; -_ammo addMagazineCargo ["100Rnd_65x39_caseless_mag_tracer", 70]; -_ammo addMagazineCargo ["1Rnd_HE_Grenade_shell", 90]; -_ammo addMagazineCargo ["UGL_FlareRed_F", 70]; -_ammo addMagazineCargo ["UGL_FlareGreen_F", 70]; -_ammo addMagazineCargo ["1Rnd_Smoke_Grenade_shell", 70]; -_ammo addMagazineCargo ["1Rnd_SmokeRed_Grenade_shell", 70]; -_ammo addMagazineCargo ["1Rnd_SmokeBlue_Grenade_shell", 70]; -_ammo addMagazineCargo ["NLAW_F", 70]; -_ammo addMagazineCargo ["Chemlight_green", 70]; - -_ammo addBackpackCargo ["B_AssaultPack_khk",10]; - -if (support_armory_available) then {[[_ammo,["Armory","bisArsenal.sqf",[], 0, false, false, "", "_this distance _target < 4"]],"addAction",true,true] call BIS_fnc_MP;}; - -waitUntil {sleep 1; getpos _ammo select 2<0.2}; -_smoke = "SmokeShellGreen" CreateVehicle (getpos _ammo); -["info",["Supply delivered","The supply crate has been marked with green smokes"]] call bis_fnc_showNotification; diff --git a/source/support/sitrep.sqf b/source/support/sitrep.sqf deleted file mode 100644 index 80d52aa..0000000 --- a/source/support/sitrep.sqf +++ /dev/null @@ -1,18 +0,0 @@ - - - -if (commandpointsblu1>=1) exitWith -{ - commandpointsblu1 = commandpointsblu1 - 1; - publicVariable "commandpointsblu1"; - -saveGame; - - sleep 0.5; - ["sitrepinfo",["SITREP","The game has been saved"]] call bis_fnc_showNotification; - [west, "PAPA_BEAR"] sidechat format["SITREP received, we have %1 command points and our army power is at %2",commandpointsblu1,WARCOM_blufor_ap]; - sleep 1; -[] execVM "misc\bottom_right_message.sqf"; -}; - - ["sitrepinfo",["SITREP","Not enough Command Points (1CP)"]] call bis_fnc_showNotification; \ No newline at end of file diff --git a/source/taw_vd/CfgFunctions.hpp b/source/taw_vd/CfgFunctions.hpp deleted file mode 100644 index 65be88c..0000000 --- a/source/taw_vd/CfgFunctions.hpp +++ /dev/null @@ -1,21 +0,0 @@ -class TAW_VD { - tag = "TAWVD"; - - class Initialize { - file = "taw_vd"; - class stateTracker { - ext = ".fsm"; - postInit = 1; - headerType = -1; - }; - - class onSliderChanged {}; - class onTerrainChanged {}; - class updateViewDistance {}; - class openMenu {}; - class onChar {}; - class openSaveManager {}; - class onSavePressed {}; - class onSaveSelectionChanged {}; - }; -}; \ No newline at end of file diff --git a/source/taw_vd/GUI.h b/source/taw_vd/GUI.h index 26322e2..c79ba93 100644 --- a/source/taw_vd/GUI.h +++ b/source/taw_vd/GUI.h @@ -1,668 +1,668 @@ #include "defines.h" class RscEdit_taw { - type = 2; - style = 0x00 + 0x40; - font = "PuristaMedium"; - shadow = 2; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorBackground[] = {0, 0, 0, 1}; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - colorText[] = {0.95, 0.95, 0.95, 1}; - colorDisabled[] = {1, 1, 1, 0.25}; - autocomplete = false; - colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1}; - canModify = 1; + type = 2; + style = 0x00 + 0x40; + font = "PuristaMedium"; + shadow = 2; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorBackground[] = {0, 0, 0, 1}; + soundSelect[] = {"",0.1,1}; + soundExpand[] = {"",0.1,1}; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorDisabled[] = {1, 1, 1, 0.25}; + autocomplete = false; + colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", 1}; + canModify = 1; }; class RscListBox_taw { - style = 16; - idc = -1; - type = 5; - w = 0.275; - h = 0.04; - font = "PuristaMedium"; - colorSelect[] = {1, 1, 1, 1}; - colorText[] = {1, 1, 1, 1}; - colorBackground[] = {0.28,0.28,0.28,0.28}; - colorSelect2[] = {1, 1, 1, 1}; - colorSelectBackground[] = {0.95, 0.95, 0.95, 0.5}; - colorSelectBackground2[] = {1, 1, 1, 0.5}; - colorScrollbar[] = {0.2, 0.2, 0.2, 1}; - colorPicture[] = {1,1,1,1}; - colorPictureSelected[] = {1,1,1,1}; - colorPictureDisabled[] = {1,1,1,1}; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - wholeHeight = 0.45; - rowHeight = 0.04; - color[] = {0.7, 0.7, 0.7, 1}; - colorActive[] = {0,0,0,1}; - colorDisabled[] = {0,0,0,0.3}; - sizeEx = 0.023; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - soundCollapse[] = {"",0.1,1}; - maxHistoryDelay = 1; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - tooltipColorText[] = {1,1,1,1}; - tooltipColorBox[] = {1,1,1,1}; - tooltipColorShade[] = {0,0,0,0.65}; - - class ListScrollBar { - color[] = {1,1,1,1}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - shadow = 0; - scrollSpeed = 0.06; - width = 0; - height = 0; - autoScrollEnabled = 1; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - } + style = 16; + idc = -1; + type = 5; + w = 0.275; + h = 0.04; + font = "PuristaMedium"; + colorSelect[] = {1, 1, 1, 1}; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0.28,0.28,0.28,0.28}; + colorSelect2[] = {1, 1, 1, 1}; + colorSelectBackground[] = {0.95, 0.95, 0.95, 0.5}; + colorSelectBackground2[] = {1, 1, 1, 0.5}; + colorScrollbar[] = {0.2, 0.2, 0.2, 1}; + colorPicture[] = {1,1,1,1}; + colorPictureSelected[] = {1,1,1,1}; + colorPictureDisabled[] = {1,1,1,1}; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + wholeHeight = 0.45; + rowHeight = 0.04; + color[] = {0.7, 0.7, 0.7, 1}; + colorActive[] = {0,0,0,1}; + colorDisabled[] = {0,0,0,0.3}; + sizeEx = 0.023; + soundSelect[] = {"",0.1,1}; + soundExpand[] = {"",0.1,1}; + soundCollapse[] = {"",0.1,1}; + maxHistoryDelay = 1; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + tooltipColorText[] = {1,1,1,1}; + tooltipColorBox[] = {1,1,1,1}; + tooltipColorShade[] = {0,0,0,0.65}; + + class ListScrollBar { + color[] = {1,1,1,1}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + shadow = 0; + scrollSpeed = 0.06; + width = 0; + height = 0; + autoScrollEnabled = 1; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + } }; class RscCheckBox { - access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified) - idc = -1; // Control identification (without it, the control won't be displayed) - type = 77; // Type - style = ST_LEFT + ST_MULTI; // Style - default = 0; // Control selected by default (only one within a display can be used) - blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect. - - x = 0; - y = 0; - w = 1 * GUI_GRID_CENTER_W; // Width - h = 1 * GUI_GRID_CENTER_H; // Height - - //Colors - color[] = { 1, 1, 1, 0.7 }; // Texture color - colorFocused[] = { 1, 1, 1, 1 }; // Focused texture color - colorHover[] = { 1, 1, 1, 1 }; // Mouse over texture color - colorPressed[] = { 1, 1, 1, 1 }; // Mouse pressed texture color - colorDisabled[] = { 1, 1, 1, 0.2 }; // Disabled texture color - - //Background colors - colorBackground[] = { 0, 0, 0, 0 }; // Fill color - colorBackgroundFocused[] = { 0, 0, 0, 0 }; // Focused fill color - colorBackgroundHover[] = { 0, 0, 0, 0 }; // Mouse hover fill color - colorBackgroundPressed[] = { 0, 0, 0, 0 }; // Mouse pressed fill color - colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // Disabled fill color - - //Textures - textureChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked CheckBox. - textureUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked CheckBox. - textureFocusedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked focused CheckBox (Could be used for showing different texture when focused). - textureFocusedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked focused CheckBox. - textureHoverChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; - textureHoverUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; - texturePressedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; - texturePressedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; - textureDisabledChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; - textureDisabledUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; - - tooltip = ""; // Tooltip text - tooltipColorShade[] = { 0, 0, 0, 1 }; // Tooltip background color - tooltipColorText[] = { 1, 1, 1, 1 }; // Tooltip text color - tooltipColorBox[] = { 1, 1, 1, 1 }; // Tooltip frame color - - //Sounds - soundClick[] = { "\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1 }; // Sound played after control is activated in format {file, volume, pitch} - soundEnter[] = { "\A3\ui_f\data\sound\RscButton\soundEnter", 0.09, 1 }; // Sound played when mouse cursor enters the control - soundPush[] = { "\A3\ui_f\data\sound\RscButton\soundPush", 0.09, 1 }; // Sound played when the control is pushed down - soundEscape[] = { "\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1 }; // Sound played when the control is released after pushing down + access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified) + idc = -1; // Control identification (without it, the control won't be displayed) + type = 77; // Type + style = ST_LEFT + ST_MULTI; // Style + default = 0; // Control selected by default (only one within a display can be used) + blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect. + + x = 0; + y = 0; + w = 1 * GUI_GRID_CENTER_W; // Width + h = 1 * GUI_GRID_CENTER_H; // Height + + //Colors + color[] = { 1, 1, 1, 0.7 }; // Texture color + colorFocused[] = { 1, 1, 1, 1 }; // Focused texture color + colorHover[] = { 1, 1, 1, 1 }; // Mouse over texture color + colorPressed[] = { 1, 1, 1, 1 }; // Mouse pressed texture color + colorDisabled[] = { 1, 1, 1, 0.2 }; // Disabled texture color + + //Background colors + colorBackground[] = { 0, 0, 0, 0 }; // Fill color + colorBackgroundFocused[] = { 0, 0, 0, 0 }; // Focused fill color + colorBackgroundHover[] = { 0, 0, 0, 0 }; // Mouse hover fill color + colorBackgroundPressed[] = { 0, 0, 0, 0 }; // Mouse pressed fill color + colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // Disabled fill color + + //Textures + textureChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked CheckBox. + textureUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked CheckBox. + textureFocusedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; //Texture of checked focused CheckBox (Could be used for showing different texture when focused). + textureFocusedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; //Texture of unchecked focused CheckBox. + textureHoverChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureHoverUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + texturePressedChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + texturePressedUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + textureDisabledChecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa"; + textureDisabledUnchecked = "\A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"; + + tooltip = ""; // Tooltip text + tooltipColorShade[] = { 0, 0, 0, 1 }; // Tooltip background color + tooltipColorText[] = { 1, 1, 1, 1 }; // Tooltip text color + tooltipColorBox[] = { 1, 1, 1, 1 }; // Tooltip frame color + + //Sounds + soundClick[] = { "\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1 }; // Sound played after control is activated in format {file, volume, pitch} + soundEnter[] = { "\A3\ui_f\data\sound\RscButton\soundEnter", 0.09, 1 }; // Sound played when mouse cursor enters the control + soundPush[] = { "\A3\ui_f\data\sound\RscButton\soundPush", 0.09, 1 }; // Sound played when the control is pushed down + soundEscape[] = { "\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1 }; // Sound played when the control is released after pushing down }; class RscXSliderH { - style = 1024; - type = 43; - shadow = 2; - x = 0; - y = 0; - h = 0.029412; - w = 0.400000; - color[] = { - 1, 1, 1, 0.7 - }; - colorActive[] = { - 1, 1, 1, 1 - }; - colorDisabled[] = { - 1, 1, 1, 0.500000 - }; - arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; - border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; - thumb = "\A3\ui_f\data\gui\cfg\slider\thumb_ca.paa"; + style = 1024; + type = 43; + shadow = 2; + x = 0; + y = 0; + h = 0.029412; + w = 0.400000; + color[] = { + 1, 1, 1, 0.7 + }; + colorActive[] = { + 1, 1, 1, 1 + }; + colorDisabled[] = { + 1, 1, 1, 0.500000 + }; + arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; + thumb = "\A3\ui_f\data\gui\cfg\slider\thumb_ca.paa"; }; class RscText_taw { - x = 0; - y = 0; - h = 0.037; - w = 0.3; - type = 0; - style = 0; - shadow = 1; - colorShadow[] = {0, 0, 0, 0.5}; - font = "PuristaMedium"; - SizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - text = ""; - colorText[] = {1, 1, 1, 1.0}; - colorBackground[] = {0, 0, 0, 0}; - linespacing = 1; + x = 0; + y = 0; + h = 0.037; + w = 0.3; + type = 0; + style = 0; + shadow = 1; + colorShadow[] = {0, 0, 0, 0.5}; + font = "PuristaMedium"; + SizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + colorText[] = {1, 1, 1, 1.0}; + colorBackground[] = {0, 0, 0, 0}; + linespacing = 1; }; class RscTitle:RscText_taw { - style = 0; - shadow = 0; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0.95, 0.95, 0.95, 1}; + style = 0; + shadow = 0; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 1}; }; class RscShortcutButton_taw { - idc = -1; - style = 0; - default = 0; - shadow = 1; - w = 0.183825; - h = "( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)"; - color[] = {1,1,1,1.0}; - colorFocused[] = {1,1,1,1.0}; - color2[] = {0.95,0.95,0.95,1}; - colorDisabled[] = {1,1,1,0.25}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; - colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; - colorBackground2[] = {1,1,1,1}; - animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; - animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; - animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; - animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa"; - animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa"; - animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa"; - periodFocus = 1.2; - periodOver = 0.8; - class HitZone - { - left = 0.0; - top = 0.0; - right = 0.0; - bottom = 0.0; - }; - class ShortcutPos - { - left = 0; - top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; - w = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; - h = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - }; - class TextPos - { - left = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; - top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; - right = 0.005; - bottom = 0.0; - }; - period = 0.4; - font = "PuristaMedium"; - size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - text = ""; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; - action = ""; - class Attributes - { - font = "PuristaMedium"; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; - class AttributesImage - { - font = "PuristaMedium"; - color = "#E5E5E5"; - align = "left"; - }; + idc = -1; + style = 0; + default = 0; + shadow = 1; + w = 0.183825; + h = "( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20)"; + color[] = {1,1,1,1.0}; + colorFocused[] = {1,1,1,1.0}; + color2[] = {0.95,0.95,0.95,1}; + colorDisabled[] = {1,1,1,0.25}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorBackground2[] = {1,1,1,1}; + animTextureDefault = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureNormal = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureDisabled = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\normal_ca.paa"; + animTextureOver = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\over_ca.paa"; + animTextureFocused = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\focus_ca.paa"; + animTexturePressed = "\A3\ui_f\data\GUI\RscCommon\RscShortcutButton\down_ca.paa"; + periodFocus = 1.2; + periodOver = 0.8; + class HitZone + { + left = 0.0; + top = 0.0; + right = 0.0; + bottom = 0.0; + }; + class ShortcutPos + { + left = 0; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + w = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + h = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + class TextPos + { + left = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1) * (3/4)"; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 20) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0.0; + }; + period = 0.4; + font = "PuristaMedium"; + size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + action = ""; + class Attributes + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; + class AttributesImage + { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + }; }; class RscControlsGroup { - type = 15; - idc = -1; - x = 0; - y = 0; - w = 1; - h = 1; - shadow = 0; - style = 16; - - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - shadow = 0; - scrollSpeed = 0.05; - }; - - class VScrollbar:ScrollBar { - width = 0.021; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - shadow = 0; - color[] = {1, 1, 1, 0.6}; - }; - - class HScrollbar:ScrollBar { - height = 0.028; - shadow = 0; - color[] = {1, 1, 1, 0.6}; - }; - - //class ListScrollBar : ScrollBar {}; - - class Controls {}; + type = 15; + idc = -1; + x = 0; + y = 0; + w = 1; + h = 1; + shadow = 0; + style = 16; + + class ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + shadow = 0; + scrollSpeed = 0.05; + }; + + class VScrollbar:ScrollBar { + width = 0.021; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + shadow = 0; + color[] = {1, 1, 1, 0.6}; + }; + + class HScrollbar:ScrollBar { + height = 0.028; + shadow = 0; + color[] = {1, 1, 1, 0.6}; + }; + + //class ListScrollBar : ScrollBar {}; + + class Controls {}; }; class RscControlsGroupNoScrollbars : RscControlsGroup { - class VScrollbar : VScrollbar { - width = 0; - }; + class VScrollbar : VScrollbar { + width = 0; + }; - class HScrollbar : HScrollbar { - height = 0; - }; + class HScrollbar : HScrollbar { + height = 0; + }; }; class RscButtonMenu:RscShortcutButton_taw { - idc = -1; - type = 16; - style = "0x02 + 0xC0"; - default = 0; - shadow = 0; - x = 0; - y = 0; - w = 0.095589; - h = 0.039216; - animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - colorBackground[] = {0,0,0,0.8}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground2[] = {0.75,0.75,0.75,1}; - color[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - color2[] = {0,0,0,1}; - colorText[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.25}; - period = 1.2; - periodFocus = 1.2; - periodOver = 1.2; - size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - tooltipColorText[] = {1,1,1,1}; - tooltipColorBox[] = {1,1,1,1}; - tooltipColorShade[] = {0,0,0,0.65}; - class TextPos - { - left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; - right = 0.005; - bottom = 0.0; - }; - class Attributes - { - font = "PuristaLight"; - color = "#E5E5E5"; - align = "left"; - shadow = "false"; - }; - class ShortcutPos - { - left = "(6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005"; - top = 0.005; - w = 0.0225; - h = 0.03; - }; - soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; - textureNoShortcut = ""; + idc = -1; + type = 16; + style = "0x02 + 0xC0"; + default = 0; + shadow = 0; + x = 0; + y = 0; + w = 0.095589; + h = 0.039216; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground2[] = {0.75,0.75,0.75,1}; + color[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + color2[] = {0,0,0,1}; + colorText[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.25}; + period = 1.2; + periodFocus = 1.2; + periodOver = 1.2; + size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + tooltipColorText[] = {1,1,1,1}; + tooltipColorBox[] = {1,1,1,1}; + tooltipColorShade[] = {0,0,0,0.65}; + class TextPos + { + left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2"; + right = 0.005; + bottom = 0.0; + }; + class Attributes + { + font = "PuristaLight"; + color = "#E5E5E5"; + align = "left"; + shadow = "false"; + }; + class ShortcutPos + { + left = "(6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)) - 0.0225 - 0.005"; + top = 0.005; + w = 0.0225; + h = 0.03; + }; + soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; + textureNoShortcut = ""; }; class TAW_VDMenu { - idd = MENU_IDD; - name = "TAW_VDMenu"; - movingEnabled = 0; - enableSimulation = 1; - - onLoad = "((_this select 0) displayCtrl 2999) ctrlSetFade 1; ((_this select 0) displayCtrl 2999) ctrlCommit 0;"; - - class controlsBackground { - class TitleBackground : RscText_taw { - colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; - idc = -1; - x = .3; - y = .2; - w = .5; - h = (1 / 25); - }; - - class MainBackground : RscText_taw { - colorBackground[] = { 0, 0, 0, .7 }; - idc = -1; - x = .3; - y = .2 + (11 / 250); - w = .5; - h = .57 - (22 / 250); - }; - - class Title : RscTitle { - colorBackround[] = { 0, 0, 0, 0 }; - idc = -1; - text = "View Settings (SCRIPT)"; - x = .3; - y = .2; - w = .8; - h = (1 / 25); - }; - - class OnFootText : RscText_taw { - idc = -1; - text = "Infantry:"; - x = .32; - y = .258; - w = .275; - h = .04; - }; - - class inCarText : OnFootText { - text = "Ground:"; - y = .305; - }; - - class inAirText : OnFootText { - text = "Air:"; - y = .355; - }; - - class ObjectText : OnFootText { - text = "Object:"; - y = .655; - }; - - class DroneText : OnFootText { - text = "Drone:"; - y = .405; - }; - - class TerrainBackground : TitleBackground { - text = "Grass Settings"; - shadow = 0; - y = .46; - }; - - class ObjectBackground : TitleBackground { - text = "Object Settings"; - y = .55; - }; - - class ButtonClose : RscButtonMenu { - idc = -1; - text = "Close"; - onButtonClick = "closeDialog 0;"; - x = 0.3; - y = 0.77 - (1 / 25); - w = (6.25 / 40); - h = (1 / 25); - }; - - class SaveManagerBtn:ButtonClose { - text = "Saves"; - onButtonClick = "[] call tawvd_fnc_openSaveManager;"; - x = .465; - }; - }; - - class controls { - - //Sliders - class VD_onFoot_slider : RscXSliderH { - idc = INFANTRY_SLIDER; - text = ""; - onSliderPosChanged = "[0, _this select 1] call TAWVD_fnc_onSliderChanged;"; - toolTip = "View Distance while on foot"; - x = .42; - y = .30 - (1 / 25); - w = "9 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - - class VD_inCar_slider : VD_onFoot_slider { - idc = GROUND_SLIDER; - toolTip = "View distance while in a ground vehicle"; - onSliderPosChanged = "[1, _this select 1] call TAWVD_fnc_onSliderChanged;"; - y = .35 - (1 / 25); - }; - - class VD_inAir_slider : VD_onFoot_slider { - idc = AIR_SLIDER; - toolTip = "View distance while in an aircraft"; - onSliderPosChanged = "[2, _this select 1] call TAWVD_fnc_onSliderChanged;"; - y = .40 - (1 / 25); - }; - - class VD_Object_slider : VD_onFoot_slider { - idc = OBJECT_SLIDER; - toolTip = "Object rendering distance"; - onSliderPosChanged = "[3, _this select 1] call TAWVD_fnc_onSliderChanged;"; - y = .7 - (1 / 25); - }; - - class VD_Drone_slider:VD_onFoot_slider { - idc = DRONE_SLIDER; - toolTip = "View distance while operating a UAV/UGV"; - onSliderPosChanged = "[4, _this select 1] call TAWVD_fnc_onSliderChanged;"; - y = .45 - (1 / 25); - } - - //Values (RscEdit Butons) - class VD_onFoot_Edit : RscEdit_taw { - idc = INFANTRY_EDIT; - text = ""; - onKeyUp = "[_this select 0, _this select 1, 'ground',true] call TAWVD_fnc_onChar;"; - - x = .7; - y = .258; - w = .08; - h = .04; - }; - - class VD_inCar_Edit : VD_onFoot_Edit { - idc = GROUND_EDIT; - onKeyUp = "[_this select 0, _this select 1, 'vehicle',true] call TAWVD_fnc_onChar;"; - y = .31; - }; - - class VD_inAir_Edit : VD_onFoot_Edit { - idc = AIR_EDIT; - onKeyUp = "[_this select 0, _this select 1, 'air',true] call TAWVD_fnc_onChar;"; - y = .36; - }; - - class VD_inDrone_Edit:VD_onFoot_Edit { - idc = DRONE_EDIT; - onKeyUp = "[_this select 0, _this select 1, 'drone',true] call TAWVD_fnc_onChar;"; - y = .41; - }; - - class VD_Object_Edit : VD_onFoot_Edit { - idc = OBJECT_EDIT; - onKeyUp = "[_this select 0, _this select 1, 'object',true] call TAWVD_fnc_onChar;"; - y = .656; - }; - - //Grass Settings - class VD_terrain_none { - idc = TERRAIN_NONE; - type = 11; - style = 0; - font = "PuristaLight"; - color[] = { 1, 1, 1, 1 }; - colorActive[] = { 1, 0.2, 0.2, 1 }; - colorDisabled[] = {0, 0, 0, 1}; - soundEnter[] = { "\A3\ui_f\data\sound\onover", 0.09, 1 }; - soundPush[] = { "\A3\ui_f\data\sound\new1", 0.0, 0 }; - soundClick[] = { "\A3\ui_f\data\sound\onclick", 0.07, 1 }; - soundEscape[] = { "\A3\ui_f\data\sound\onescape", 0.09, 1 }; - text = "None"; - action = "['none'] call TAWVD_fnc_onTerrainChanged;"; - sizeEx = 0.04; - - x = .38; y = .505; - w = .275; h = .04; - }; - - class VD_terrain_low : VD_terrain_none { - idc = -1; - text = "Low"; - action = "['low'] call TAWVD_fnc_onTerrainChanged;"; - x = .47; - }; - - class VD_terrain_normal : VD_terrain_none { - idc = -1; - text = "Normal"; - action = "['norm'] call TAWVD_fnc_onTerrainChanged;"; - x = .56; - }; - - class VD_terrain_high : VD_terrain_none { - idc = -1; - text = "High"; - action = "['high'] call TAWVD_fnc_onTerrainChanged;"; - x = .67; - }; - - class ObjectSyncCheckbox : RscCheckbox - { - idc = 2931; - x = .32; y = .6; - tooltip = "Sync object rendering with view rendering"; - onCheckedChanged = "if((_this select 1) == 1) then {tawvd_syncObject = true;ctrlEnable [2941,false]; ctrlEnable [2942,false];} else {tawvd_syncObject = false; ctrlEnable [2942,true]; ctrlEnable [2941,true];};"; - w = 1 * GUI_GRID_CENTER_W; - h = 1 * GUI_GRID_CENTER_H; - }; - - class ObjectSynctext : RscText_taw { - idc = -1; - text = "Sync with view"; - x = .345; y = .596; - w = .35; h = .04; - }; - - class Manager:RscControlsGroup { - idc = MANAGER_GROUP; - - x = -0.21; y = .2; - w = .5; h = 3; - class Controls { - class SaveLoadGroup:RscControlsGroupNoScrollbars { - idc = SAVELOAD_GROUP; - - x = 0; - y = 0; - w = .5; - h = 3; - - class Controls { - class MyTitleBackground:RscText_taw { - colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; - idc = -1; - x = 0; - y = 0; - w = .5; - h = (1 / 25); - }; - - class Title : RscTitle { - colorBackround[] = { 0, 0, 0, 0 }; - idc = -1; - text = "Save Manager"; - x = 0; - y = 0; - w = .8; - h = (1 / 25); - }; - - class MainBackground:RscText_taw { - colorBackground[] = { 0, 0, 0, .7 }; - idc = -1; - x = 0; - y = 0 + (11 / 250); - w = .5; - h = .57 - (22 / 250); - }; - - class SaveList:RscListBox_taw { - idc = SAVES_LIST; - sizeEx = 0.04; - colorBackground[] = {0.1,0.1,0.1,0.9}; - x = 0; y = 0 + (11 / 250); - w = .5; h = .49 - (22 / 250); - - onLBSelChanged = "_this call TAWVD_fnc_onSaveSelectionChanged;"; - }; - - class SaveSlotName:VD_onFoot_Edit { - idc = SLOT_NAME; - text = "SAVE NAME"; - colorBackground[] = {0,0,0,0.6}; - onKeyUp = ""; - - x = .025; y = .42 + (11 / 250); - w = .45; - }; - - class SaveButton:RscButtonMenu { - text = "Save"; - onButtonClick = "[] call TAWVD_fnc_onSavePressed;"; - x = 0; - y = 0.57 - (1 / 25); - w = (6.25 / 40); - h = (1 / 25); - }; - - class HideButton:RscButtonMenu { - text = "Hide"; - onButtonClick = "((findDisplay 2900) displayCtrl 2999) ctrlSetFade 1; ((findDisplay 2900) displayCtrl 2999) ctrlCommit 0.3;"; - x = .16; - y = 0.57 - (1 / 25); - w = (6.25 / 40); - h = (1 / 25); - }; - }; - }; - }; - }; - }; + idd = MENU_IDD; + name = "TAW_VDMenu"; + movingEnabled = 0; + enableSimulation = 1; + + onLoad = "((_this select 0) displayCtrl 2999) ctrlSetFade 1; ((_this select 0) displayCtrl 2999) ctrlCommit 0;"; + + class controlsBackground { + class TitleBackground : RscText_taw { + colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; + idc = -1; + x = .3; + y = .2; + w = .5; + h = (1 / 25); + }; + + class MainBackground : RscText_taw { + colorBackground[] = { 0, 0, 0, .7 }; + idc = -1; + x = .3; + y = .2 + (11 / 250); + w = .5; + h = .57 - (22 / 250); + }; + + class Title : RscTitle { + colorBackround[] = { 0, 0, 0, 0 }; + idc = -1; + text = "View Settings (SCRIPT)"; + x = .3; + y = .2; + w = .8; + h = (1 / 25); + }; + + class OnFootText : RscText_taw { + idc = -1; + text = "Infantry:"; + x = .32; + y = .258; + w = .275; + h = .04; + }; + + class inCarText : OnFootText { + text = "Ground:"; + y = .305; + }; + + class inAirText : OnFootText { + text = "Air:"; + y = .355; + }; + + class ObjectText : OnFootText { + text = "Object:"; + y = .655; + }; + + class DroneText : OnFootText { + text = "Drone:"; + y = .405; + }; + + class TerrainBackground : TitleBackground { + text = "Grass Settings"; + shadow = 0; + y = .46; + }; + + class ObjectBackground : TitleBackground { + text = "Object Settings"; + y = .55; + }; + + class ButtonClose : RscButtonMenu { + idc = -1; + text = "Close"; + onButtonClick = "closeDialog 0;"; + x = 0.3; + y = 0.77 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + + class SaveManagerBtn:ButtonClose { + text = "Saves"; + onButtonClick = "[] call tawvd_fnc_openSaveManager;"; + x = .465; + }; + }; + + class controls { + + //Sliders + class VD_onFoot_slider : RscXSliderH { + idc = INFANTRY_SLIDER; + text = ""; + onSliderPosChanged = "[0, _this select 1] call TAWVD_fnc_onSliderChanged;"; + toolTip = "View Distance while on foot"; + x = .42; + y = .30 - (1 / 25); + w = "9 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + + class VD_inCar_slider : VD_onFoot_slider { + idc = GROUND_SLIDER; + toolTip = "View distance while in a ground vehicle"; + onSliderPosChanged = "[1, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .35 - (1 / 25); + }; + + class VD_inAir_slider : VD_onFoot_slider { + idc = AIR_SLIDER; + toolTip = "View distance while in an aircraft"; + onSliderPosChanged = "[2, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .40 - (1 / 25); + }; + + class VD_Object_slider : VD_onFoot_slider { + idc = OBJECT_SLIDER; + toolTip = "Object rendering distance"; + onSliderPosChanged = "[3, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .7 - (1 / 25); + }; + + class VD_Drone_slider:VD_onFoot_slider { + idc = DRONE_SLIDER; + toolTip = "View distance while operating a UAV/UGV"; + onSliderPosChanged = "[4, _this select 1] call TAWVD_fnc_onSliderChanged;"; + y = .45 - (1 / 25); + } + + //Values (RscEdit Butons) + class VD_onFoot_Edit : RscEdit_taw { + idc = INFANTRY_EDIT; + text = ""; + onKeyUp = "[_this select 0, _this select 1, 'ground',true] call TAWVD_fnc_onChar;"; + + x = .7; + y = .258; + w = .08; + h = .04; + }; + + class VD_inCar_Edit : VD_onFoot_Edit { + idc = GROUND_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'vehicle',true] call TAWVD_fnc_onChar;"; + y = .31; + }; + + class VD_inAir_Edit : VD_onFoot_Edit { + idc = AIR_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'air',true] call TAWVD_fnc_onChar;"; + y = .36; + }; + + class VD_inDrone_Edit:VD_onFoot_Edit { + idc = DRONE_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'drone',true] call TAWVD_fnc_onChar;"; + y = .41; + }; + + class VD_Object_Edit : VD_onFoot_Edit { + idc = OBJECT_EDIT; + onKeyUp = "[_this select 0, _this select 1, 'object',true] call TAWVD_fnc_onChar;"; + y = .656; + }; + + //Grass Settings + class VD_terrain_none { + idc = TERRAIN_NONE; + type = 11; + style = 0; + font = "PuristaLight"; + color[] = { 1, 1, 1, 1 }; + colorActive[] = { 1, 0.2, 0.2, 1 }; + colorDisabled[] = {0, 0, 0, 1}; + soundEnter[] = { "\A3\ui_f\data\sound\onover", 0.09, 1 }; + soundPush[] = { "\A3\ui_f\data\sound\new1", 0.0, 0 }; + soundClick[] = { "\A3\ui_f\data\sound\onclick", 0.07, 1 }; + soundEscape[] = { "\A3\ui_f\data\sound\onescape", 0.09, 1 }; + text = "None"; + action = "['none'] call TAWVD_fnc_onTerrainChanged;"; + sizeEx = 0.04; + + x = .38; y = .505; + w = .275; h = .04; + }; + + class VD_terrain_low : VD_terrain_none { + idc = -1; + text = "Low"; + action = "['low'] call TAWVD_fnc_onTerrainChanged;"; + x = .47; + }; + + class VD_terrain_normal : VD_terrain_none { + idc = -1; + text = "Normal"; + action = "['norm'] call TAWVD_fnc_onTerrainChanged;"; + x = .56; + }; + + class VD_terrain_high : VD_terrain_none { + idc = -1; + text = "High"; + action = "['high'] call TAWVD_fnc_onTerrainChanged;"; + x = .67; + }; + + class ObjectSyncCheckbox : RscCheckbox + { + idc = 2931; + x = .32; y = .6; + tooltip = "Sync object rendering with view rendering"; + onCheckedChanged = "if((_this select 1) == 1) then {tawvd_syncObject = true;ctrlEnable [2941,false]; ctrlEnable [2942,false];} else {tawvd_syncObject = false; ctrlEnable [2942,true]; ctrlEnable [2941,true];};"; + w = 1 * GUI_GRID_CENTER_W; + h = 1 * GUI_GRID_CENTER_H; + }; + + class ObjectSynctext : RscText_taw { + idc = -1; + text = "Sync with view"; + x = .345; y = .596; + w = .35; h = .04; + }; + + class Manager:RscControlsGroup { + idc = MANAGER_GROUP; + + x = -0.21; y = .2; + w = .5; h = 3; + class Controls { + class SaveLoadGroup:RscControlsGroupNoScrollbars { + idc = SAVELOAD_GROUP; + + x = 0; + y = 0; + w = .5; + h = 3; + + class Controls { + class MyTitleBackground:RscText_taw { + colorBackground[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.7])" }; + idc = -1; + x = 0; + y = 0; + w = .5; + h = (1 / 25); + }; + + class Title : RscTitle { + colorBackround[] = { 0, 0, 0, 0 }; + idc = -1; + text = "Save Manager"; + x = 0; + y = 0; + w = .8; + h = (1 / 25); + }; + + class MainBackground:RscText_taw { + colorBackground[] = { 0, 0, 0, .7 }; + idc = -1; + x = 0; + y = 0 + (11 / 250); + w = .5; + h = .57 - (22 / 250); + }; + + class SaveList:RscListBox_taw { + idc = SAVES_LIST; + sizeEx = 0.04; + colorBackground[] = {0.1,0.1,0.1,0.9}; + x = 0; y = 0 + (11 / 250); + w = .5; h = .49 - (22 / 250); + + onLBSelChanged = "_this call TAWVD_fnc_onSaveSelectionChanged;"; + }; + + class SaveSlotName:VD_onFoot_Edit { + idc = SLOT_NAME; + text = "SAVE NAME"; + colorBackground[] = {0,0,0,0.6}; + onKeyUp = ""; + + x = .025; y = .42 + (11 / 250); + w = .45; + }; + + class SaveButton:RscButtonMenu { + text = "Save"; + onButtonClick = "[] call TAWVD_fnc_onSavePressed;"; + x = 0; + y = 0.57 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + + class HideButton:RscButtonMenu { + text = "Hide"; + onButtonClick = "((findDisplay 2900) displayCtrl 2999) ctrlSetFade 1; ((findDisplay 2900) displayCtrl 2999) ctrlCommit 0.3;"; + x = .16; + y = 0.57 - (1 / 25); + w = (6.25 / 40); + h = (1 / 25); + }; + }; + }; + }; + }; + }; }; diff --git a/source/taw_vd/defines.h b/source/taw_vd/defines.h index e75b7f9..02f92ef 100644 --- a/source/taw_vd/defines.h +++ b/source/taw_vd/defines.h @@ -11,12 +11,12 @@ #define DRONE_SLIDER 2951 #define DRONE_EDIT 2952 #define TERRAIN_NONE 2950 -#define GUI_GRID_CENTER_WAbs ((safezoneW / safezoneH) min 1.2) -#define GUI_GRID_CENTER_HAbs (GUI_GRID_CENTER_WAbs / 1.2) -#define GUI_GRID_CENTER_W (GUI_GRID_CENTER_WAbs / 40) -#define GUI_GRID_CENTER_H (GUI_GRID_CENTER_HAbs / 25) -#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) -#define GUI_GRID_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2) +#define GUI_GRID_CENTER_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_CENTER_HAbs (GUI_GRID_CENTER_WAbs / 1.2) +#define GUI_GRID_CENTER_W (GUI_GRID_CENTER_WAbs / 40) +#define GUI_GRID_CENTER_H (GUI_GRID_CENTER_HAbs / 25) +#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) +#define GUI_GRID_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2) #define ST_LEFT 0x00 #define ST_MULTI 0x10 #define SEL(ARRAY,INDEX) (ARRAY select INDEX) diff --git a/source/taw_vd/fn_onChar.sqf b/source/taw_vd/fn_onChar.sqf deleted file mode 100644 index 2026cab..0000000 --- a/source/taw_vd/fn_onChar.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - When a character is entered it is validated and changes the - correct slider it is associated with. I probably over-complicated - this more then I had to but onChar behaves weird. - - PARAMS: - 0: CONTROL - 1: SCALAR (INT) - 2: STRING (Case option) -*/ -private["_value","_varName","_maxRange"]; -params ["_control","_code","_slider"]; - -disableSerialization; -if(isNull _control) exitWith {}; //POOOOOP - -_maxRange = if(!isNil "tawvd_maxRange") then {tawvd_maxRange} else {20000}; -_value = parseNumber (ctrlText _control); -if(_value > _maxRange OR _value < 100) exitwith {[] call TAWVD_fnc_openMenu;}; - -_varName = switch (_slider) do { - case "ground": {"tawvd_foot"}; - case "vehicle": {"tawvd_car"}; - case "air": {"tawvd_air"}; - case "object": {"tawvd_object"}; - case "drone": {"tawvd_drone"}; - default {"tawvd_foot"}; -}; - -SVAR_MNS [_varName,_value]; -[] call TAWVD_fnc_updateViewDistance; -[] call TAWVD_fnc_openMenu; \ No newline at end of file diff --git a/source/taw_vd/fn_onSavePressed.sqf b/source/taw_vd/fn_onSavePressed.sqf deleted file mode 100644 index fb5ea4a..0000000 --- a/source/taw_vd/fn_onSavePressed.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - Updates the view distance dependant on whether the player - is on foot, a car or an aircraft. -*/ -private ["_saveIndex","_saveName"]; -_saveIndex = lbCurSel SAVES_LIST; -_saveName = ctrlText SLOT_NAME; - -SVAR_PNS [format["tawvd_slot_%1",_saveIndex], - [ - _saveName, - tawvd_foot, - tawvd_car, - tawvd_air, - tawvd_drone, - tawvd_object, - tawvd_syncObject - ] -]; - -saveProfileNamespace; -[] call TAWVD_fnc_openSaveManager; diff --git a/source/taw_vd/fn_onSliderChanged.sqf b/source/taw_vd/fn_onSliderChanged.sqf deleted file mode 100644 index a8423d5..0000000 --- a/source/taw_vd/fn_onSliderChanged.sqf +++ /dev/null @@ -1,35 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - Called when the slider is changed for any field and - updates the view distance for it. -*/ -private "_varData"; -params [["_mode",-1,[0]],["_value",-1,[0]]]; - -if(EQUAL(_mode,-1) OR EQUAL(_value,-1)) exitWith {}; - -disableSerialization; - -_varData = switch(_mode) do { - case 0: {["tawvd_foot",INFANTRY_EDIT]}; - case 1: {["tawvd_car",GROUND_EDIT]}; - case 2: {["tawvd_air",AIR_EDIT]}; - case 3: {["tawvd_object",OBJECT_EDIT]}; - case 4: {["tawvd_drone",DRONE_EDIT]}; -}; - -SVAR_MNS [SEL(_varData,0),round(_value)]; -ctrlSetText[SEL(_varData,1),str(GVAR_MNS SEL(_varData,0))]; -[] call TAWVD_fnc_updateViewDistance; - -if(EQUAL(_mode,3)) then { - setObjectViewDistance [tawvd_object,100]; -}; - -if(tawvd_syncObject) then { - sliderSetPosition[OBJECT_SLIDER, tawvd_object]; - ctrlSetText[OBJECT_EDIT,str(tawvd_object)]; -}; \ No newline at end of file diff --git a/source/taw_vd/fn_onTerrainChanged.sqf b/source/taw_vd/fn_onTerrainChanged.sqf deleted file mode 100644 index 2194d9d..0000000 --- a/source/taw_vd/fn_onTerrainChanged.sqf +++ /dev/null @@ -1,17 +0,0 @@ - -/* - Author: Bryan "Tonic" Boardwine - - Description: - Updates the players terraingrid when called. -*/ -private "_type"; -_type = param [0,"",[""]]; -if(_type == "") exitWith {}; - -switch (_type) do { - case "none": {if(isNil "tawvd_disablenone") then {setTerrainGrid 50;};}; - case "low": {setTerrainGrid 30;}; - case "norm": {setTerrainGrid 12.5;}; - case "high": {setTerrainGrid 3.125;}; -}; \ No newline at end of file diff --git a/source/taw_vd/fn_openMenu.sqf b/source/taw_vd/fn_openMenu.sqf deleted file mode 100644 index bac3f4d..0000000 --- a/source/taw_vd/fn_openMenu.sqf +++ /dev/null @@ -1,41 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - Called via addAction and opens the TAW View Distance Menu -*/ -if(isNull (findDisplay MENU_IDD)) then { - if(!createDialog "TAW_VDMenu") exitWith {hint "Something went wrong, the menu won't open?"}; -}; -disableSerialization; - -{ - ctrlSetText[SEL(_x,0),str(SEL(_x,1))]; -} foreach [[INFANTRY_EDIT,tawvd_foot],[GROUND_EDIT,tawvd_car],[AIR_EDIT,tawvd_air],[OBJECT_EDIT,tawvd_object],[DRONE_EDIT,tawvd_drone]]; - -//Setup the sliders -{ - if(!isNil "tawvd_maxRange") then { - slidersetRange [_x select 0,100,tawvd_maxRange]; - } else { - slidersetRange [_x select 0,100,20000]; - }; - ((findDisplay MENU_IDD) displayCtrl (_x select 0)) sliderSetSpeed [100,100,100]; - sliderSetPosition[_x select 0, _x select 1]; -} foreach [[INFANTRY_SLIDER,tawvd_foot],[GROUND_SLIDER,tawvd_car],[AIR_SLIDER,tawvd_air],[OBJECT_SLIDER,tawvd_object],[DRONE_SLIDER,tawvd_drone]]; - -((findDisplay MENU_IDD) displayCtrl 2931) cbSetChecked tawvd_syncObject; - -if(tawvd_syncObject) then { - ctrlEnable [OBJECT_SLIDER,false]; - ctrlEnable [OBJECT_EDIT,false]; -} else { - ctrlEnable [OBJECT_SLIDER,true]; - ctrlEnable [OBJECT_EDIT,true]; -}; - -//Lets disable it.. -if(!isNil "tawvd_disablenone") then { - ctrlEnable [TERRAIN_NONE,false]; -}; \ No newline at end of file diff --git a/source/taw_vd/fn_openSaveManager.sqf b/source/taw_vd/fn_openSaveManager.sqf deleted file mode 100644 index 03a4029..0000000 --- a/source/taw_vd/fn_openSaveManager.sqf +++ /dev/null @@ -1,31 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - Updates the view distance dependant on whether the player - is on foot, a car or an aircraft. -*/ -private ["_controlGrp","_saveList"]; -disableSerialization; - -/* Store displays */ -_controlGrp = CONTROL(MENU_IDD,MANAGER_GROUP); -_saveList = CONTROL(MENU_IDD,SAVES_LIST); -lbClear _saveList; //Purge the list - -/* Make the Saves manager group visible */ -_controlGrp ctrlSetfade 0; -_controlGrp ctrlCommit .3; - -/* Fill the listbox */ -for "_i" from 0 to 9 do { - _varData = GVAR_PNS format["tawvd_slot_%1",_i]; - if(!isNil "_varData") then { - _saveList lbAdd SEL(_varData,0); - _saveList lbSetData [(lbSize _saveList)-1,"true"]; - } else { - _saveList lbAdd format["Save Slot %1",_i]; - _saveList lbSetData [(lbSize _saveList)-1,"false"]; - }; -}; \ No newline at end of file diff --git a/source/taw_vd/fn_updateViewDistance.sqf b/source/taw_vd/fn_updateViewDistance.sqf deleted file mode 100644 index 38fe689..0000000 --- a/source/taw_vd/fn_updateViewDistance.sqf +++ /dev/null @@ -1,35 +0,0 @@ -#include "defines.h" -/* - Author: Bryan "Tonic" Boardwine - - Description: - Updates the view distance dependant on whether the player - is on foot, a car or an aircraft. -*/ -private "_dist"; -switch (true) do { - case (!(EQUAL(SEL(UAVControl getConnectedUAV player,1),""))): { - setViewDistance tawvd_drone; - _dist = tawvd_drone; - }; - - case ((vehicle player) isKindOf "Man"): { - setViewDistance tawvd_foot; - _dist = tawvd_foot; - }; - - case ((vehicle player) isKindOf "LandVehicle"): { - setViewDistance tawvd_car; - _dist = tawvd_car; - }; - - case ((vehicle player) isKindOf "Air"): { - setViewDistance tawvd_air; - _dist = tawvd_air; - }; -}; - -if(tawvd_syncObject) then { - setObjectViewDistance [_dist,100]; - tawvd_object = _dist; -}; \ No newline at end of file diff --git a/source/zones_bonus.sqf b/source/zones_bonus.sqf deleted file mode 100644 index 6f9165a..0000000 --- a/source/zones_bonus.sqf +++ /dev/null @@ -1,9 +0,0 @@ -[] spawn { - waitUntil {zoneundercontrolblu >= 1}; - sleep 20; - [player,"fob_support"] remoteExecCall ["BIS_fnc_addCommMenuItem", 0, true]; - //_sitrep = [player,"fob_support"] call BIS_fnc_addCommMenuItem; - ["info",["Establishing a FOB","Check the briefing for more info (RTI Manual)"]] remoteExecCall ["bis_fnc_showNotification", 0, true]; - //["info",["Establishing a FOB","Check the briefing for more info (RTI Manual)"]] call bis_fnc_showNotification; - sleep 2; -}; \ No newline at end of file