cba'd functions

This commit is contained in:
jodav 2015-01-12 10:49:21 +01:00
parent d85c05ffe3
commit 5871053564
13 changed files with 78 additions and 53 deletions

View File

@ -5,10 +5,12 @@ private ["_unit", "_side"];
_unit = _this select 0; _unit = _this select 0;
_side = _this select 1; _side = _this select 1;
_unit getVariable ["AGM_canMoveRallypoint", false] // rallypoint names are defined in CfgVehicles.hpp
_unit getVariable ["ACE_canMoveRallypoint"), false]
&& {!isNull ([ && {!isNull ([
objNull, objNull,
missionNamespace getVariable ["AGM_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["AGM_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull] missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1)} ] select ([west, east, independent] find _side) + 1)}

View File

@ -1,5 +1,5 @@
/* /*
Name: AGM_Respawn_fnc_handleKilled Name: ACE_Respawn_fnc_handleKilled
Author(s): Author(s):
bux578 bux578
@ -20,12 +20,12 @@ private ["_killedUnit"];
_killedUnit = _this select 0; _killedUnit = _this select 0;
// Saves the gear when the player is killed // Saves the gear when the player is killed
AGM_Respawn_unitGear = []; GVAR(unitGear) = [];
if (AGM_Respawn_SavePreDeathGear) then { if (GVAR(SavePreDeathGear)) then {
AGM_Respawn_unitGear = [_killedUnit] call AGM_Respawn_fnc_getAllGear; GVAR(unitGear) = [_killedUnit] call FUNC(getAllGear);
}; };
if (missionNamespace getVariable ["AGM_showFriendlyFireMessage", false]) then { if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then {
[_this, "AGM_Respawn_fnc_showFriendlyFireMessage", 2] call AGM_Core_fnc_execRemoteFnc; [_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(Core, execRemoteFnc);
}; };

View File

@ -20,6 +20,6 @@ private ["_respawnedUnit"];
_respawnedUnit = _this select 0; _respawnedUnit = _this select 0;
// Restores the gear when the player respawns // Restores the gear when the player respawns
if (AGM_Respawn_SavePreDeathGear) then { if (GVAR(SavePreDeathGear)) then {
[_respawnedUnit, AGM_Respawn_unitGear] call AGM_Respawn_fnc_restoreGear; [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear);
}; };

View File

@ -13,5 +13,5 @@ if (isNil _name) then {
publicVariable _name; publicVariable _name;
} else { } else {
deleteVehicle _rallypoint; deleteVehicle _rallypoint;
diag_log text "[AGM] Respawn: ERROR Multiple Rallypoints of same type."; diag_log text "[ACE] Respawn: ERROR Multiple Rallypoints of same type.";
}; };

View File

@ -16,28 +16,28 @@ _activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
AGM_Respawn_Module = true; GVAR(Module) = true;
[_logic, "AGM_Respawn_SavePreDeathGear", "SavePreDeathGear"] call AGM_Core_fnc_readBooleanParameterFromModule; [_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(Core, readBooleanParameterFromModule);
[_logic, "AGM_Respawn_RemoveDeadBodiesDisonncected", "RemoveDeadBodiesDisonncected"] call AGM_Core_fnc_readBooleanParameterFromModule; [_logic, QGVAR(RemoveDeadBodiesDisonncected), "RemoveDeadBodiesDisonncected"] call EFUNC(Core, readBooleanParameterFromModule);
if (isServer) then { if (isServer) then {
if (AGM_Respawn_RemoveDeadBodiesDisonncected) then { if (GVAR(RemoveDeadBodiesDisonncected)) then {
_fnc_deleteDisconnected = { _fnc_deleteDisconnected = {
_this spawn { _this spawn {
_unit = _this select 0; _unit = _this select 0;
sleep 4; sleep 4;
if (!alive _unit) then { if (!alive _unit) then {
deleteVehicle _unit; deleteVehicle _unit;
}; };
}; };
false false
}; };
addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected]; addMissionEventHandler ["HandleDisconnect", _fnc_deleteDisconnected];
}; };
}; };
diag_log text "[AGM]: Respawn Module Initialized."; diag_log text "[ACE]: Respawn Module Initialized.";

View File

@ -18,11 +18,11 @@ _this spawn {
if !(_activated) exitWith {}; if !(_activated) exitWith {};
if (isServer) then { if (isServer) then {
_varName = "AGM_showFriendlyFireMessage"; _varName = QGVAR(showFriendlyFireMessage);
missionNamespace setVariable [_varName, true]; missionNamespace setVariable [_varName, true];
publicVariable _varName; publicVariable _varName;
}; };
diag_log text "[AGM]: Friendly Fire Messages Module Initialized."; diag_log text "[ACE]: Friendly Fire Messages Module Initialized.";
}; };

View File

@ -16,10 +16,8 @@ _activated = _this select 2;
if !(_activated) exitWith {}; if !(_activated) exitWith {};
//_mode = parseNumber (_logic getVariable "Action");
{ {
_x setVariable ["AGM_canMoveRallypoint", true]; _x setVariable ["ACE_canMoveRallypoint", true];
} forEach _units; } forEach _units;
diag_log text "[AGM]: Rallypoint Module Initialized."; diag_log text "[ACE]: Rallypoint Module Initialized.";

View File

@ -4,11 +4,13 @@ _this spawn {
_unit = _this select 0; _unit = _this select 0;
_side = _this select 1; _side = _this select 1;
// rallypoint names are defined in CfgVehicles.hpp
_rallypoint = [ _rallypoint = [
objNull, objNull,
missionNamespace getVariable ["AGM_RallypointExit_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["AGM_RallypointExit_East", objNull], missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull] missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
] select ([west, east, independent] find _side) + 1; ] select ([west, east, independent] find _side) + 1;
if (isNull _rallypoint) exitWith {}; if (isNull _rallypoint) exitWith {};
@ -19,7 +21,7 @@ _this spawn {
_position set [2, 0]; _position set [2, 0];
["Deploy in 5 seconds ..."] call AGM_Core_fnc_displayTextStructured; [localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured);
sleep 5; sleep 5;
_rallypoint setPosATL _position; _rallypoint setPosATL _position;
@ -31,5 +33,5 @@ _this spawn {
_marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber]; _marker setMarkerTextLocal format ["%1:%2", [date select 3, 2, 0] call CBA_fnc_FORMATNumber, [date select 4, 2, 0] call CBA_fnc_FORMATNumber];
*/ */
["Rallypoint deployed"] call AGM_Core_fnc_displayTextStructured; [localize "STR_ACE_Respawn_Deploy"] call EFUNC(Core, displayTextStructured);
}; };

View File

@ -15,7 +15,7 @@ private ["_body", "_forceRemove", "_bodyRemoveTimer"];
_body = _this select 0; _body = _this select 0;
_forceRemove = _this select 1; _forceRemove = _this select 1;
_bodyRemoveTimer = AGM_Respawn_BodyRemoveTimer max 0; _bodyRemoveTimer = GVAR(BodyRemoveTimer) max 0;
// could be used for SpecOps missions. // could be used for SpecOps missions.
if (_forceRemove) then { if (_forceRemove) then {

View File

@ -11,5 +11,5 @@ _forceRemove = _this select 0;
} forEach playableUnits; } forEach playableUnits;
if (!isNil "_body" && {!alive _body}) then { if (!isNil "_body" && {!alive _body}) then {
[_body, _forceRemove] call AGM_Respawn_fnc_removeBody; [_body, _forceRemove] call FUNC(removeBody);
}; };

View File

@ -5,8 +5,8 @@ private ["_unit", "_killer"];
_unit = _this select 0; _unit = _this select 0;
_killer = _this select 1; _killer = _this select 1;
if (_unit != _killer && side group _unit in [side group AGM_player, civilian] && {side group _killer == side group AGM_player}) then { if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then {
systemChat format ["%1 was killed by %2", [_unit] call AGM_Core_fnc_getName, [_killer] call AGM_Core_fnc_getName]; systemChat format ["%1 was killed by %2", [_unit] call EFUNC(Core, getName), [_killer] call EFUNC(Core, getName)];
[_unit, "killedByFriendly", [_unit, _killer]] call AGM_Core_fnc_callCustomEventHandlers; [_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(Core, callCustomEventHandlers);
}; };

View File

@ -6,22 +6,24 @@ _unit = _this select 0;
_side = _this select 1; _side = _this select 1;
_toBase = _this select 2; _toBase = _this select 2;
// rallypoint names are defined in CfgVehicles.hpp
_rallypoint = ([ _rallypoint = ([
[ [
objNull, objNull,
missionNamespace getVariable ["AGM_RallypointExit_West", objNull], missionNamespace getVariable ["ACE_RallypointExit_West", objNull],
missionNamespace getVariable ["AGM_RallypointExit_East", objNull], missionNamespace getVariable ["ACE_RallypointExit_East", objNull],
missionNamespace getVariable ["AGM_RallypointExit_Independent", objNull] missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull]
], ],
[ [
objNull, objNull,
missionNamespace getVariable ["AGM_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["AGM_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["AGM_Rallypoint_Independent", objNull] missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] ]
] select _toBase) select ([west, east, independent] find _side) + 1; ] select _toBase) select ([west, east, independent] find _side) + 1;
if (isNull _rallypoint) exitWith {}; if (isNull _rallypoint) exitWith {};
_unit setPosASL (getPosASL _rallypoint); _unit setPosASL (getPosASL _rallypoint);
[["Teleported to Rallypoint", "Teleported to Base"] select _toBase] call AGM_Core_fnc_displayTextStructured; [[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(Core, displayTextStructured);

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="Interaction">
<Key ID="STR_ACE_Respawn_Deploy">
<English>Deploy in 5 seconds ...</English>
<German>Wird in 5 Sekunden errichtet ...</German>
</Key>
<Key ID="STR_ACE_Respawn_Deployed">
<English>Rallypoint deployed</English>
<German>Rallypoint errichtet</German>
</Key>
<Key ID="STR_ACE_Respawn_TeleportedToBase">
<English>Teleported to Base</English>
<German>Zur Basis teleportiert</German>
</Key>
<Key ID="STR_ACE_Respawn_TeleportedToRallypoint">
<English>Teleported to Rallypoint</English>
<German>Zum Rallypoint teleportiert</German>
</Key>
</Package>
</Project>