Normalize to LF line endings

This commit is contained in:
jonpas 2016-05-30 18:37:03 +02:00
parent 5672a96f5f
commit 816da2aef1
485 changed files with 79952 additions and 79953 deletions

16
.gitignore vendored
View File

@ -1,8 +1,8 @@
release/* release/*
*.cache *.cache
*.pbo *.pbo
texHeaders.bin texHeaders.bin
*.swp *.swp
*.swo *.swo
*.biprivatekey *.biprivatekey
Thumbs.db Thumbs.db

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#include "script_component.hpp" #include "script_component.hpp"
uiNamespace setVariable ['ATragMX_Display', nil]; uiNamespace setVariable ['ATragMX_Display', nil];
GVAR(active) = false; GVAR(active) = false;
[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler; [GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler;

File diff suppressed because it is too large Load Diff

View File

@ -1,81 +1,81 @@
/* /*
* Author: jaynus * Author: jaynus
* Internal net event handler. * Internal net event handler.
* *
* Arguments: * Arguments:
* None * None
* *
* Return Value: * Return Value:
* None * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventType", "_event"]; params ["_eventType", "_event"];
if (_eventType == "ACEg") then { if (_eventType == "ACEg") then {
_event params ["_eventName", "_eventArgs"]; _event params ["_eventName", "_eventArgs"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (!isNil "_eventFunctions") then { if (!isNil "_eventFunctions") then {
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Net Event %1",_eventName); ACE_LOGINFO_1("* Net Event %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs); ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif #endif
{ {
if (!isNil "_x") then { if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex)); _eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK #ifdef DEBUG_EVENTS_CALLSTACK
ACE_LOGINFO_1(" ID: %1",_forEachIndex); ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif #endif
}; };
} forEach _eventFunctions; } forEach _eventFunctions;
}; };
}; };
if (_eventType == "ACEc") then { if (_eventType == "ACEc") then {
if (isServer) then { if (isServer) then {
_event params ["_eventName", "_eventTargets", "_eventArgs"]; _event params ["_eventName", "_eventTargets", "_eventArgs"];
private _sentEvents = []; private _sentEvents = [];
if (!IS_ARRAY(_eventTargets)) then { if (!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets]; _eventTargets = [_eventTargets];
}; };
//If not multiplayer, and there are targets, then just run localy //If not multiplayer, and there are targets, then just run localy
if (!isMultiplayer && {count _eventTargets > 0}) exitWith { if (!isMultiplayer && {count _eventTargets > 0}) exitWith {
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
}; };
private _serverFlagged = false; private _serverFlagged = false;
{ {
private _owner = _x; private _owner = _x;
if (IS_OBJECT(_x)) then { if (IS_OBJECT(_x)) then {
_owner = owner _x; _owner = owner _x;
}; };
if !(_owner in _sentEvents) then { if !(_owner in _sentEvents) then {
_sentEvents pushBack _owner; _sentEvents pushBack _owner;
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
if (isDedicated || {_x != ACE_player}) then { if (isDedicated || {_x != ACE_player}) then {
if (isDedicated && {local _x} && {!_serverFlagged}) then { if (isDedicated && {local _x} && {!_serverFlagged}) then {
_serverFlagged = true; _serverFlagged = true;
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
} else { } else {
_owner publicVariableClient "ACEg"; _owner publicVariableClient "ACEg";
}; };
} else { } else {
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
}; };
}; };
false false
} count _eventTargets; } count _eventTargets;
}; };
}; };

View File

@ -1,25 +1,25 @@
/* /*
* Author: jaynus * Author: jaynus
* Handles a server-side request for synchronization ALL events on JIP to a client. * Handles a server-side request for synchronization ALL events on JIP to a client.
* *
* Arguments: * Arguments:
* 0: client <OBJECT> * 0: client <OBJECT>
* *
* Return Value: * Return Value:
* Event is successed <BOOL> * Event is successed <BOOL>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_client"]; params ["_client"];
{ {
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x); private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
_eventEntry params ["", "_eventLog"]; _eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent);
false false
} count (GVAR(syncedEvents) select 0); } count (GVAR(syncedEvents) select 0);
true true

View File

@ -1,48 +1,48 @@
/* /*
* Author: jaynus * Author: jaynus
* Receives either requests for synchronization from clients, or the synchronization data from the server. * Receives either requests for synchronization from clients, or the synchronization data from the server.
* *
* Arguments [Client] : * Arguments [Client] :
* 0: eventName <STRING> * 0: eventName <STRING>
* 1: eventLog <ARRAY> * 1: eventLog <ARRAY>
* *
* Arguments [Server] : * Arguments [Server] :
* 0: eventName <STRING> * 0: eventName <STRING>
* 1: client <OBJECT> * 1: client <OBJECT>
* *
* Return Value: * Return Value:
* Event is successed <BOOL> * Event is successed <BOOL>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
//SEH_s //SEH_s
if (isServer) then { if (isServer) then {
// Find the event name, and shovel out the events to the client // Find the event name, and shovel out the events to the client
params ["_eventName", "_client"]; params ["_eventName", "_client"];
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName); ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
false false
}; };
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
_eventEntry params ["", "_eventLog"]; _eventEntry params ["", "_eventLog"];
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); ["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent);
} else { } else {
params ["_eventName", "_eventLog"]; params ["_eventName", "_eventLog"];
// This is the client handling the response from the server // This is the client handling the response from the server
// Start running the events // Start running the events
{ {
_x params ["", "_eventArgs","_ttl"]; _x params ["", "_eventArgs","_ttl"];
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent); [_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
false false
} count _eventLog; } count _eventLog;
ACE_LOGINFO_1("[%1] synchronized",_eventName); ACE_LOGINFO_1("[%1] synchronized",_eventName);
}; };
true true

View File

@ -1,37 +1,37 @@
/* /*
* Author: jaynus * Author: jaynus
* Handles synced events being received. Server will log them, and server/client will execute them. * Handles synced events being received. Server will log them, and server/client will execute them.
* *
* Arguments [Client] : * Arguments [Client] :
* 0: eventName <STRING> * 0: eventName <STRING>
* 1: arguments <ARRAY> * 1: arguments <ARRAY>
* 2: ttl <NUMBER> * 2: ttl <NUMBER>
* *
* Return Value: * Return Value:
* Boolean of success <BOOL> * Boolean of success <BOOL>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_name", "_args", "_ttl"]; params ["_name", "_args", "_ttl"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name); ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
false false
}; };
private _internalData = HASH_GET(GVAR(syncedEvents),_name); private _internalData = HASH_GET(GVAR(syncedEvents),_name);
if (isServer) then { if (isServer) then {
// Server needs to internally log it for synchronization // Server needs to internally log it for synchronization
if (_ttl > -1) then { if (_ttl > -1) then {
_internalData = HASH_GET(GVAR(syncedEvents),_name); _internalData = HASH_GET(GVAR(syncedEvents),_name);
_internalData params ["", "_eventLog"]; _internalData params ["", "_eventLog"];
_eventLog pushBack [ACE_diagTime, _args, _ttl]; _eventLog pushBack [ACE_diagTime, _args, _ttl];
}; };
}; };
_internalData params ["_eventCode"]; _internalData params ["_eventCode"];
_args call _eventCode; _args call _eventCode;

View File

@ -1,25 +1,25 @@
/* /*
* Author: Nou * Author: Nou
* Add an event handler. * Add an event handler.
* *
* Arguments: * Arguments:
* 0: Event name <STRING> * 0: Event name <STRING>
* 1: Event code <CODE> * 1: Event code <CODE>
* *
* Return Value: * Return Value:
* Event handler ID number (for use with fnc_removeEventHandler) <NUMBER> * Event handler ID number (for use with fnc_removeEventHandler) <NUMBER>
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventCode"]; params ["_eventName", "_eventCode"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (isNil "_eventFunctions") then { if (isNil "_eventFunctions") then {
_eventFunctions = []; _eventFunctions = [];
GVAR(eventsLocation) setVariable [_eventName, _eventFunctions]; GVAR(eventsLocation) setVariable [_eventName, _eventFunctions];
}; };
_eventFunctions pushBack _eventCode // Return event function count _eventFunctions pushBack _eventCode // Return event function count

View File

@ -1,30 +1,30 @@
/* /*
* Author: jaynus * Author: jaynus
* Register an event handler for an ACE synced event * Register an event handler for an ACE synced event
* *
* Arguments: * Arguments:
* 0: Name <STRING> * 0: Name <STRING>
* 1: Handler <CODE> * 1: Handler <CODE>
* 2: TTL (optional: 0) <NUMBER, CODE> * 2: TTL (optional: 0) <NUMBER, CODE>
* *
* Return Value: * Return Value:
* Boolean of success <BOOL> * Boolean of success <BOOL>
* *
* Example: * Example:
* ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler * ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_name", "_handler", ["_ttl", 0]]; params ["_name", "_handler", ["_ttl", 0]];
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name); ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
false false
}; };
private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
private _data = [_handler, [], _ttl, _eventId]; private _data = [_handler, [], _ttl, _eventId];
HASH_SET(GVAR(syncedEvents),_name,_data); HASH_SET(GVAR(syncedEvents),_name,_data);

View File

@ -1,44 +1,44 @@
/* /*
* Author: ? * Author: ?
* Dumps an array to the RPT, showing the depth of each element. * Dumps an array to the RPT, showing the depth of each element.
* *
* Arguments: * Arguments:
* 0: Array to be dumped <ARRAY> * 0: Array to be dumped <ARRAY>
* 1: Depth <NUMBER><OPTIONAL> * 1: Depth <NUMBER><OPTIONAL>
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray * [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_var", ["_depth", 0, [0]]]; params ["_var", ["_depth", 0, [0]]];
private _pad = ""; private _pad = "";
for "_i" from 0 to _depth do { for "_i" from 0 to _depth do {
_pad = _pad + toString [9]; _pad = _pad + toString [9];
}; };
_depth = _depth + 1; _depth = _depth + 1;
if (IS_ARRAY(_var)) then { if (IS_ARRAY(_var)) then {
if (_var isEqualTo []) then { if (_var isEqualTo []) then {
diag_log text format ["%1[],", _pad]; diag_log text format ["%1[],", _pad];
} else { } else {
diag_log text format ["%1[", _pad]; diag_log text format ["%1[", _pad];
{ {
[_x, _depth] call FUNC(dumpArray); [_x, _depth] call FUNC(dumpArray);
false false
} count _var; } count _var;
diag_log text format ["%1],", _pad]; diag_log text format ["%1],", _pad];
}; };
} else { } else {
diag_log text format ["%1%2", _pad, _var]; diag_log text format ["%1%2", _pad, _var];
}; };

View File

@ -1,88 +1,88 @@
/* /*
* Author: ? * Author: ?
* Dumps performance counter statistics into Logs. * Dumps performance counter statistics into Logs.
* *
* Arguments: * Arguments:
* None * None
* *
* Return Value: * Return Value:
* None * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
diag_log text format ["REGISTERED ACE PFH HANDLERS"]; diag_log text format ["REGISTERED ACE PFH HANDLERS"];
diag_log text format ["-------------------------------------------"]; diag_log text format ["-------------------------------------------"];
if (!isNil "ACE_PFH_COUNTER") then { if (!isNil "ACE_PFH_COUNTER") then {
{ {
_x params ["_pfh", "_parameters"]; _x params ["_pfh", "_parameters"];
private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)}; private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)};
diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2];
false false
} count ACE_PFH_COUNTER; } count ACE_PFH_COUNTER;
}; };
diag_log text format ["ACE COUNTER RESULTS"]; diag_log text format ["ACE COUNTER RESULTS"];
diag_log text format ["-------------------------------------------"]; diag_log text format ["-------------------------------------------"];
{ {
private _counterEntry = _x; private _counterEntry = _x;
private _iter = 0; private _iter = 0;
private _total = 0; private _total = 0;
private _count = 0; private _count = 0;
private _averageResult = 0; private _averageResult = 0;
if (count _counterEntry > 3) then { if (count _counterEntry > 3) then {
// calc // calc
{ {
if (_iter > 2) then { if (_iter > 2) then {
_count = _count + 1; _count = _count + 1;
private _delta = (_x select 1) - (_x select 0); private _delta = (_x select 1) - (_x select 0);
_total = _total + _delta; _total = _total + _delta;
}; };
_iter = _iter + 1; _iter = _iter + 1;
false false
} count _counterEntry; } count _counterEntry;
// results // results
_averageResult = (_total / _count) * 1000; _averageResult = (_total / _count) * 1000;
// dump results // dump results
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult]; diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
} else { } else {
diag_log text format ["%1: No results", _counterEntry select 0]; diag_log text format ["%1: No results", _counterEntry select 0];
}; };
false false
} count ACE_COUNTERS; } count ACE_COUNTERS;
/* /*
// Dump PFH Trackers // Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
diag_log text format["-------------------------------------------"]; diag_log text format["-------------------------------------------"];
{ {
private _delay = _x select 2; private _delay = _x select 2;
//if(_delay > 0) then { _delay = _delay / 1000; }; //if(_delay > 0) then { _delay = _delay / 1000; };
diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)];
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER; } forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
// Dump PFH Trackers // Dump PFH Trackers
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
diag_log text format["-------------------------------------------"]; diag_log text format["-------------------------------------------"];
{ {
private _delta = _x select 1; private _delta = _x select 1;
//if(_delta > 0) then { _delta = _delta / 1000; }; //if(_delta > 0) then { _delta = _delta / 1000; };
diag_log text format[" DELTA: %1s", _delta]; diag_log text format[" DELTA: %1s", _delta];
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER; } forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
//{ //{
// //
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER; //} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
*/ */

View File

@ -1,42 +1,42 @@
/* /*
* Author: jaynus * Author: jaynus
* Get the absolute turret direction for FOV/PIP turret. * Get the absolute turret direction for FOV/PIP turret.
* *
* Arguments: * Arguments:
* 0: Vehicle <OBJECT> * 0: Vehicle <OBJECT>
* 1: Turret Position <ARRAY> * 1: Turret Position <ARRAY>
* *
* Return Value: * Return Value:
* 0: Position ASL <ARRAY> * 0: Position ASL <ARRAY>
* 1: Direction <ARRAY> * 1: Direction <ARRAY>
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_vehicle", "_position"]; params ["_vehicle", "_position"];
private _turret = [_vehicle, _position] call CBA_fnc_getTurret; private _turret = [_vehicle, _position] call CBA_fnc_getTurret;
private _pov = getText (_turret >> "memoryPointGunnerOptics"); private _pov = getText (_turret >> "memoryPointGunnerOptics");
private _gunBeg = getText (_turret >> "gunBeg"); private _gunBeg = getText (_turret >> "gunBeg");
private _gunEnd = getText (_turret >> "gunEnd"); private _gunEnd = getText (_turret >> "gunEnd");
TRACE_3("", _pov, _gunBeg, _gunEnd); TRACE_3("", _pov, _gunBeg, _gunEnd);
// Pull the PIP pov or barrel direction, depending on how the model is set up // Pull the PIP pov or barrel direction, depending on how the model is set up
private _povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ? private _povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ?
private _povDir = [0,0,0]; private _povDir = [0,0,0];
if (_pov == "pip0_pos") then { if (_pov == "pip0_pos") then {
private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir")); private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir"));
_povDir = _pipDir vectorDiff _povPos; _povDir = _pipDir vectorDiff _povPos;
} else { } else {
private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg)); private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg));
private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd)); private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd));
_povDir = _gunBeginPos vectorDiff _gunEndPos; _povDir = _gunBeginPos vectorDiff _gunEndPos;
}; };
[_povPos, _povDir] [_povPos, _povDir]

View File

@ -1,21 +1,21 @@
/* /*
* Author: Nou * Author: Nou
* Execute a global event on all clients, including self. * Execute a global event on all clients, including self.
* *
* Arguments: * Arguments:
* 0: Event name <STRING> * 0: Event name <STRING>
* 1: Event args <ANY> * 1: Event args <ANY>
* *
* Return Value: * Return Value:
* None * None
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventArgs"]; params ["_eventName", "_eventArgs"];
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
publicVariable "ACEg"; publicVariable "ACEg";
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);

View File

@ -1,36 +1,36 @@
/* /*
* Author: Nou * Author: Nou
* Execute a local event on this client only. * Execute a local event on this client only.
* *
* Arguments: * Arguments:
* 0: Event name (string) * 0: Event name (string)
* 1: Event args (any) * 1: Event args (any)
* *
* Return Value: * Return Value:
* None * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventArgs"]; params ["_eventName", "_eventArgs"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (!isNil "_eventFunctions") then { if (!isNil "_eventFunctions") then {
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Local Event: %1",_eventName); ACE_LOGINFO_1("* Local Event: %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs); ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif #endif
{ {
if (!isNil "_x") then { if (!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex)); _eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
#ifdef DEBUG_EVENTS_CALLSTACK #ifdef DEBUG_EVENTS_CALLSTACK
ACE_LOGINFO_1(" ID: %1",_forEachIndex); ACE_LOGINFO_1(" ID: %1",_forEachIndex);
#endif #endif
}; };
} forEach _eventFunctions; } forEach _eventFunctions;
}; };

View File

@ -1,17 +1,17 @@
/* /*
* Author: Nou * Author: Nou
* Remove all events of a certain event type. * Remove all events of a certain event type.
* *
* Argument: * Argument:
* 0: Event name <STRING> * 0: Event name <STRING>
* *
* Return Value: * Return Value:
* None * None
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName"]; params ["_eventName"];
GVAR(eventsLocation) setVariable [_eventName, nil]; GVAR(eventsLocation) setVariable [_eventName, nil];

View File

@ -1,23 +1,23 @@
/* /*
* Author: Nou * Author: Nou
* Remove an event handler. * Remove an event handler.
* *
* Argument: * Argument:
* 0: Event name <STRING> * 0: Event name <STRING>
* 1: Event code <NUMBER> * 1: Event code <NUMBER>
* *
* Return Value: * Return Value:
* None * None
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventCodeIndex"]; params ["_eventName", "_eventCodeIndex"];
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName; private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
if (isNil "_eventFunctions") exitWith {TRACE_1("eventName not found",_eventName);}; if (isNil "_eventFunctions") exitWith {TRACE_1("eventName not found",_eventName);};
if ((_eventCodeIndex < 0) || {(count _eventFunctions) <= _eventCodeIndex}) exitWith {TRACE_2("index out of bounds",_eventName,_eventCodeIndex);}; if ((_eventCodeIndex < 0) || {(count _eventFunctions) <= _eventCodeIndex}) exitWith {TRACE_2("index out of bounds",_eventName,_eventCodeIndex);};
_eventFunctions set [_eventCodeIndex, nil]; _eventFunctions set [_eventCodeIndex, nil];

View File

@ -1,26 +1,26 @@
/* /*
* Author: jaynus * Author: jaynus
* Remove a synced event handler * Remove a synced event handler
* *
* Arguments: * Arguments:
* 0: Name <STRING> * 0: Name <STRING>
* *
* Return Value: * Return Value:
* Boolean of success * Boolean of success
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_name"]; params ["_name"];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name); ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
false false
}; };
private _data = HASH_GET(GVAR(syncedEvents),_name); private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["", "", "", "_eventId"]; _data params ["", "", "", "_eventId"];
[_eventId] call FUNC(removeEventHandler); [_eventId] call FUNC(removeEventHandler);
HASH_REM(GVAR(syncedEvents),_name); HASH_REM(GVAR(syncedEvents),_name);

View File

@ -1,20 +1,20 @@
/* /*
* Author: jaynus * Author: jaynus
* Send a request to synchronize an event name from the client->server. Execute on client only. * Send a request to synchronize an event name from the client->server. Execute on client only.
* *
* Arguments: * Arguments:
* 0: eventName <STRING> * 0: eventName <STRING>
* *
* Return Value: * Return Value:
* Boolean of success * Boolean of success
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName"]; params ["_eventName"];
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand // Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
if (isServer) exitWith {false}; if (isServer) exitWith {false};
["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent); ["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent);

View File

@ -1,29 +1,29 @@
/* /*
* Author: Nou * Author: Nou
* Execute a event only on the server. * Execute a event only on the server.
* *
* Argument: * Argument:
* 0: Event name <STRING> * 0: Event name <STRING>
* 1: Event args <ANY> * 1: Event args <ANY>
* *
* Return Value: * Return Value:
* None * None
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventArgs"]; params ["_eventName", "_eventArgs"];
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ACE_LOGINFO_1("* Server Event: %1",_eventName); ACE_LOGINFO_1("* Server Event: %1",_eventName);
ACE_LOGINFO_1(" args=%1",_eventArgs); ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif #endif
ACEg = [_eventName, _eventArgs]; ACEg = [_eventName, _eventArgs];
if (!isServer) then { if (!isServer) then {
publicVariableServer "ACEg"; publicVariableServer "ACEg";
} else { } else {
["ACEg", ACEg] call FUNC(_handleNetEvent); ["ACEg", ACEg] call FUNC(_handleNetEvent);
}; };

View File

@ -1,26 +1,26 @@
/* /*
* Author: jaynus * Author: jaynus
* Call and propegate a synced event * Call and propegate a synced event
* *
* Arguments: * Arguments:
* 0: Name <STRING> * 0: Name <STRING>
* 1: Arguments <ARRAY> * 1: Arguments <ARRAY>
* 2: TTL <NUMBER, CODE> [Optional] for this specific event call * 2: TTL <NUMBER, CODE> [Optional] for this specific event call
* *
* Return Value: * Return Value:
* Boolean of success <BOOL> * Boolean of success <BOOL>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_name", "_args", ["_ttl", 0]]; params ["_name", "_args", ["_ttl", 0]];
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name); ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
false false
}; };
private _eventData = [_name, _args, _ttl]; private _eventData = [_name, _args, _ttl];
["SEH", _eventData] call FUNC(globalEvent); ["SEH", _eventData] call FUNC(globalEvent);

View File

@ -1,62 +1,62 @@
/* /*
* Author: ? * Author: ?
* *
* ? * ?
* *
* Arguments: * Arguments:
* ? * ?
* *
* Return Value: * Return Value:
* ? * ?
* *
* Public: ? * Public: ?
*/ */
#include "script_component.hpp" #include "script_component.hpp"
if (!isServer) exitWith {false}; if (!isServer) exitWith {false};
// Walk through the local synced events and clean up anything thats already EOL // Walk through the local synced events and clean up anything thats already EOL
// @TODO: This should be iteration limited to prevent FPS lag // @TODO: This should be iteration limited to prevent FPS lag
{ {
private _name = _x; private _name = _x;
private _data = HASH_GET(GVAR(syncedEvents),_name); private _data = HASH_GET(GVAR(syncedEvents),_name);
_data params ["_eventTime", "_eventLog", "_globalEventTTL"]; _data params ["_eventTime", "_eventLog", "_globalEventTTL"];
private _newEventLog = []; private _newEventLog = [];
// @TODO: This should be iteration limited to prevent FPS lag // @TODO: This should be iteration limited to prevent FPS lag
{ {
private _eventEntry = _x; private _eventEntry = _x;
private _ttlReturn = true; private _ttlReturn = true;
if (_globalEventTTL isEqualType {}) then { if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL; _ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else { } else {
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}}; _ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
}; };
if (_ttlReturn) then { if (_ttlReturn) then {
// Do event based TTL check // Do event based TTL check
_eventEntry params ["_time", "", "_eventTTL"]; _eventEntry params ["_time", "", "_eventTTL"];
if (_eventTTL isEqualType {}) then { if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL; _ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else { } else {
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}}; _ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};
}; };
}; };
// Finally drop it if the TTL check fails // Finally drop it if the TTL check fails
if (_ttlReturn) then { if (_ttlReturn) then {
_newEventLog pushBack _x; _newEventLog pushBack _x;
}; };
false false
} count _eventLog; } count _eventLog;
_data set [1, _newEventLog]; _data set [1, _newEventLog];
false false
} count (GVAR(syncedEvents) select 0); } count (GVAR(syncedEvents) select 0);
// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events // @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events

View File

@ -1,33 +1,33 @@
/* /*
* Author: Nou * Author: Nou
* Execute a event only on specific clients. * Execute a event only on specific clients.
* *
* Arguments: * Arguments:
* 0: Event name (STRING) * 0: Event name (STRING)
* 1: Event targets <OBJECT, ARRAY> * 1: Event targets <OBJECT, ARRAY>
* 2: Event args <ANY> * 2: Event args <ANY>
* *
* Note: If local executor is in list of targets, event will execute with * Note: If local executor is in list of targets, event will execute with
* network delay, and not immediatly. * network delay, and not immediatly.
* *
* Return Value: * Return Value:
* None * None
* *
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_eventName", "_eventTargets", "_eventArgs"]; params ["_eventName", "_eventTargets", "_eventArgs"];
#ifdef DEBUG_EVENTS #ifdef DEBUG_EVENTS
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets); ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
ACE_LOGINFO_1(" args=%1",_eventArgs); ACE_LOGINFO_1(" args=%1",_eventArgs);
#endif #endif
ACEc = [_eventName, _eventTargets, _eventArgs]; ACEc = [_eventName, _eventTargets, _eventArgs];
if (!isServer) then { if (!isServer) then {
publicVariableServer "ACEc"; publicVariableServer "ACEc";
} else { } else {
["ACEc", ACEc] call FUNC(_handleNetEvent); ["ACEc", ACEc] call FUNC(_handleNetEvent);
}; };

View File

@ -1,40 +1,40 @@
/* /*
* Author: jaynus * Author: jaynus
* PFEH to set all Ace Time Variables * PFEH to set all Ace Time Variables
* *
* Arguments: * Arguments:
* None * None
* *
* Return Value: * Return Value:
* None * None
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
BEGIN_COUNTER(timePFH); BEGIN_COUNTER(timePFH);
private _lastTickTime = ACE_diagTime; private _lastTickTime = ACE_diagTime;
private _lastGameTime = ACE_gameTime; private _lastGameTime = ACE_gameTime;
ACE_gameTime = time; ACE_gameTime = time;
ACE_diagTime = diag_tickTime; ACE_diagTime = diag_tickTime;
private _delta = ACE_diagTime - _lastTickTime; private _delta = ACE_diagTime - _lastTickTime;
if (ACE_gameTime <= _lastGameTime) then { if (ACE_gameTime <= _lastGameTime) then {
TRACE_1("paused",_delta); TRACE_1("paused",_delta);
ACE_paused = true; ACE_paused = true;
// Game is paused or not running // Game is paused or not running
ACE_pausedTime = ACE_pausedTime + _delta; ACE_pausedTime = ACE_pausedTime + _delta;
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime); ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
} else { } else {
TRACE_1("live",_delta); TRACE_1("live",_delta);
ACE_paused = false; ACE_paused = false;
// Time is updating // Time is updating
ACE_realTime = ACE_realTime + _delta; ACE_realTime = ACE_realTime + _delta;
ACE_virtualTime = ACE_virtualTime + (_delta * accTime); ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
ACE_time = ACE_virtualTime; ACE_time = ACE_virtualTime;
}; };
END_COUNTER(timePFH); END_COUNTER(timePFH);

View File

@ -1,23 +1,23 @@
/* /*
* Author: ? * Author: ?
* ? * ?
* *
* Arguments: * Arguments:
* ? * ?
* *
* Return Value: * Return Value:
* ? * ?
* *
* Public: ? * Public: ?
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_object", "_matrix", "_offset"]; params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object; private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"]; _matrix params ["_xVec", "_yVec", "_zVec"];
_offset params ["_x", "_y", "_z"]; _offset params ["_x", "_y", "_z"];
(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return (_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return

View File

@ -1,29 +1,29 @@
/* /*
* Author: ? * Author: ?
* ? * ?
* *
* Arguments: * Arguments:
* ? * ?
* *
* Return Value: * Return Value:
* ? * ?
* *
* Public: ? * Public: ?
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_object", "_matrix", "_offset"]; params ["_object", "_matrix", "_offset"];
private _origin = getPosASL _object; private _origin = getPosASL _object;
_matrix params ["_xVec", "_yVec", "_zVec"]; _matrix params ["_xVec", "_yVec", "_zVec"];
_offset = _offset vectorDiff _origin; _offset = _offset vectorDiff _origin;
_offset params ["_x", "_y", "_z"]; _offset params ["_x", "_y", "_z"];
[ [
((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z), ((_xVec select 0) * _x) + ((_xVec select 1) * _y) + ((_xVec select 2) * _z),
((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z), ((_yVec select 0) * _x) + ((_yVec select 1) * _y) + ((_yVec select 2) * _z),
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z) ((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
] // return ] // return

View File

@ -1,24 +1,24 @@
/* /*
* Author: jaynus * Author: jaynus
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy * Gets the wave height at a specific location. Uses a logic, so may be performance iffy
* *
* Arguments: * Arguments:
* 0: Position ASL to get height at * 0: Position ASL to get height at
* *
* Return Value: * Return Value:
* Wave height in meters * Wave height in meters
* *
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_position"]; params ["_position"];
if (isNil QGVAR(waveHeightLogic)) then { if (isNil QGVAR(waveHeightLogic)) then {
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
}; };
GVAR(waveHeightLogic) setPosASL _position; GVAR(waveHeightLogic) setPosASL _position;
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2) (getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)

View File

@ -1,74 +1,74 @@
/* /*
* Author: zGuba 2011 * Author: zGuba 2011
* Function helper for framing objects on screen. * Function helper for framing objects on screen.
* *
* Arguments: * Arguments:
* 0: object <OBJECT> * 0: object <OBJECT>
* 1: margins 3D <ARRAY> * 1: margins 3D <ARRAY>
* 0: X <NUMBER> * 0: X <NUMBER>
* 1: Y <NUMBER> * 1: Y <NUMBER>
* 2: Z <NUMBER> * 2: Z <NUMBER>
* 2: offset 3D <ARRAY> * 2: offset 3D <ARRAY>
* 0: X <NUMBER> * 0: X <NUMBER>
* 1: Y <NUMBER> * 1: Y <NUMBER>
* 2: Z <NUMBER> * 2: Z <NUMBER>
* *
* Return Value: * Return Value:
* 0: Minimal X <NUMMBER> * 0: Minimal X <NUMMBER>
* 1: Minimal Y <NUMMBER> * 1: Minimal Y <NUMMBER>
* 2: Maximal X <NUMMBER> * 2: Maximal X <NUMMBER>
* 3: Maximal Y <NUMMBER> * 3: Maximal Y <NUMMBER>
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_object", "_margins", "_offsets"]; params ["_object", "_margins", "_offsets"];
private _minX = 10; private _minX = 10;
private _minY = 10; private _minY = 10;
private _maxX = -10; private _maxX = -10;
private _maxY = -10; private _maxY = -10;
private _bounds = boundingBox _object; private _bounds = boundingBox _object;
_margins params ["_marginsX", "_marginsY", "_marginsZ"]; _margins params ["_marginsX", "_marginsY", "_marginsZ"];
_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"]; _offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"];
_bounds params ["_boundsMin", "_boundsMax"]; _bounds params ["_boundsMin", "_boundsMax"];
_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"]; _boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"];
_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"]; _boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"];
_boundsMinX = _boundsMinX - _marginsX + _offsetsX; _boundsMinX = _boundsMinX - _marginsX + _offsetsX;
_boundsMinY = _boundsMinY - _marginsY + _offsetsY; _boundsMinY = _boundsMinY - _marginsY + _offsetsY;
_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ; _boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ;
_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX; _boundsMaxX = _boundsMaxX + _marginsX + _offsetsX;
_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY; _boundsMaxY = _boundsMaxY + _marginsY + _offsetsY;
_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ; _boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ;
private _boundsCorners = [ private _boundsCorners = [
[_boundsMinX, _boundsMinY, _boundsMinZ], [_boundsMinX, _boundsMinY, _boundsMinZ],
[_boundsMinX, _boundsMinY, _boundsMaxZ], [_boundsMinX, _boundsMinY, _boundsMaxZ],
[_boundsMinX, _boundsMaxY, _boundsMinZ], [_boundsMinX, _boundsMaxY, _boundsMinZ],
[_boundsMinX, _boundsMaxY, _boundsMaxZ], [_boundsMinX, _boundsMaxY, _boundsMaxZ],
[_boundsMaxX, _boundsMinY, _boundsMinZ], [_boundsMaxX, _boundsMinY, _boundsMinZ],
[_boundsMaxX, _boundsMinY, _boundsMaxZ], [_boundsMaxX, _boundsMinY, _boundsMaxZ],
[_boundsMaxX, _boundsMaxY, _boundsMinZ], [_boundsMaxX, _boundsMaxY, _boundsMinZ],
[_boundsMaxX, _boundsMaxY, _boundsMaxZ] [_boundsMaxX, _boundsMaxY, _boundsMaxZ]
]; ];
{ {
private _ppos = worldToScreen (_object modelToWorld _x); private _ppos = worldToScreen (_object modelToWorld _x);
if (count _ppos >= 2) then { if (count _ppos >= 2) then {
_ppos params ["_pposX", "_pposY"]; _ppos params ["_pposX", "_pposY"];
if (_pposX < _minX) then {_minX = _pposX}; if (_pposX < _minX) then {_minX = _pposX};
if (_pposX > _maxX) then {_maxX = _pposX}; if (_pposX > _maxX) then {_maxX = _pposX};
if (_pposY < _minY) then {_minY = _pposY}; if (_pposY < _minY) then {_minY = _pposY};
if (_pposY > _maxY) then {_maxY = _pposY}; if (_pposY > _maxY) then {_maxY = _pposY};
}; //else - what to do if it is offscreen? }; //else - what to do if it is offscreen?
false false
} count _boundsCorners; } count _boundsCorners;
[_minX, _minY, _maxX, _maxY] [_minX, _minY, _maxX, _maxY]

View File

@ -1,13 +1,13 @@
#include "\z\ace\addons\common\script_component.hpp" #include "\z\ace\addons\common\script_component.hpp"
#define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)}) #define VALIDHASH(hash) (IS_ARRAY(hash) && {(count hash) >= 2} && {IS_ARRAY(hash select 0)} && {IS_ARRAY(hash select 1)})
#define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo] #define ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
#define HANDLECATCH diag_log text _exception; assert(exception=="") #define HANDLECATCH diag_log text _exception; assert(exception=="")
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\ #define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
_callFrom = "";\ _callFrom = "";\
_lineNo = -1;\ _lineNo = -1;\
if((count _this) > c) then {\ if((count _this) > c) then {\
_callFrom = _this select c;\ _callFrom = _this select c;\
_lineNo = _this select c+1;\ _lineNo = _this select c+1;\
}; };

View File

@ -1,13 +1,13 @@
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];
private _vehicle = vehicle _unit; private _vehicle = vehicle _unit;
if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false};
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
private _turret = [_unit] call EFUNC(common,getTurretIndex); private _turret = [_unit] call EFUNC(common,getTurretIndex);
[_vehicle, _turret] call FUNC(keyDown); [_vehicle, _turret] call FUNC(keyDown);
[_vehicle, _turret] call FUNC(keyUp); [_vehicle, _turret] call FUNC(keyUp);

View File

@ -1,27 +1,27 @@
class ACE_Settings { class ACE_Settings {
class GVAR(enabled) { class GVAR(enabled) {
value = 0; value = 0;
typeName = "BOOL"; typeName = "BOOL";
displayName = CSTRING(enabled_displayName); displayName = CSTRING(enabled_displayName);
}; };
class GVAR(maxRange) { class GVAR(maxRange) {
value = 4; value = 4;
typeName = "SCALAR"; typeName = "SCALAR";
displayName = CSTRING(maxRange_displayName); displayName = CSTRING(maxRange_displayName);
description = CSTRING(maxRange_description); description = CSTRING(maxRange_description);
}; };
class GVAR(indicatorForSelf) { class GVAR(indicatorForSelf) {
value = 1; value = 1;
typeName = "BOOL"; typeName = "BOOL";
isClientSettable = 1; isClientSettable = 1;
displayName = CSTRING(indicatorForSelf_name); displayName = CSTRING(indicatorForSelf_name);
description = CSTRING(indicatorForSelf_description); description = CSTRING(indicatorForSelf_description);
}; };
class GVAR(indicatorColor) { class GVAR(indicatorColor) {
value[] = {0.83, 0.68, 0.21, 0.75}; value[] = {0.83, 0.68, 0.21, 0.75};
typeName = "COLOR"; typeName = "COLOR";
isClientSettable = 1; isClientSettable = 1;
displayName = CSTRING(indicatorColor_name); displayName = CSTRING(indicatorColor_name);
description = CSTRING(indicatorColor_description); description = CSTRING(indicatorColor_description);
}; };
}; };

View File

@ -1,18 +1,18 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {QGVAR(moduleSettings)}; units[] = {QGVAR(moduleSettings)};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"Drill"}; author[] = {"Drill"};
authorUrl = "https://github.com/TheDrill/"; authorUrl = "https://github.com/TheDrill/";
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"

View File

@ -1,26 +1,26 @@
#define COMPONENT finger #define COMPONENT finger
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE // #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS // #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS // #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_FINGER #ifdef DEBUG_ENABLED_FINGER
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_FINGER #ifdef DEBUG_SETTINGS_FINGER
#define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER #define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER
#endif #endif
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
#define BASE_SIZE 44 #define BASE_SIZE 44
#define FP_TIMEOUT 2 #define FP_TIMEOUT 2
#define FP_ACTION_TIMEOUT 1 #define FP_ACTION_TIMEOUT 1
#define FP_DISTANCE 10000 #define FP_DISTANCE 10000
#define FP_RANDOMIZATION_X 350 #define FP_RANDOMIZATION_X 350
#define FP_RANDOMIZATION_Y 100 #define FP_RANDOMIZATION_Y 100

View File

@ -1,478 +1,478 @@
#define BASE_DRAG -0.01 #define BASE_DRAG -0.01
#define HD_MULT 5 #define HD_MULT 5
#define BASE_DRAG_HD (BASE_DRAG*HD_MULT) #define BASE_DRAG_HD (BASE_DRAG*HD_MULT)
class CfgAmmo { class CfgAmmo {
//class ace_arty_105mm_m1_m782_time; //class ace_arty_105mm_m1_m782_time;
//class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {}; //class ace_arty_105mm_m1_m782_prox: ace_arty_105mm_m1_m782_time {};
//class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox {
// GVAR(skip) = 1; // GVAR(skip) = 1;
//}; //};
class Bo_GBU12_LGB; class Bo_GBU12_LGB;
class ACE_GBU12 : Bo_GBU12_LGB { class ACE_GBU12 : Bo_GBU12_LGB {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
GVAR(metal) = 140000; GVAR(metal) = 140000;
GVAR(charge) = 87000; GVAR(charge) = 87000;
GVAR(gurney_c) = 2320; GVAR(gurney_c) = 2320;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
sideAirFriction = 0.04; sideAirFriction = 0.04;
airFriction = 0.04; airFriction = 0.04;
laserLock = 0; laserLock = 0;
}; };
class GrenadeBase; class GrenadeBase;
class Grenade; class Grenade;
class GrenadeHand: Grenade { class GrenadeHand: Grenade {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(skip) = 0; GVAR(skip) = 0;
GVAR(force) = 1; GVAR(force) = 1;
// This is a good high-drag frag type for grenades. // This is a good high-drag frag type for grenades.
GVAR(classes)[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
/* /*
These values are based on the M67 Grenade, should be tweaked for These values are based on the M67 Grenade, should be tweaked for
individual grenades. individual grenades.
*/ */
GVAR(metal) = 210; // metal in grams GVAR(metal) = 210; // metal in grams
GVAR(charge) = 185; // explosive in grams GVAR(charge) = 185; // explosive in grams
GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations GVAR(gurney_c) = 2843; // Gurney velocity constant for explosive type. See: http://en.wikipedia.org/wiki/Gurney_equations
GVAR(gurney_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations GVAR(gurney_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations
}; };
class GrenadeHand_stone: GrenadeHand { class GrenadeHand_stone: GrenadeHand {
GVAR(skip) = 1; GVAR(skip) = 1;
}; };
class SmokeShell: GrenadeHand { class SmokeShell: GrenadeHand {
GVAR(skip) = 1; GVAR(skip) = 1;
}; };
class RocketBase; class RocketBase;
class R_Hydra_HE: RocketBase { class R_Hydra_HE: RocketBase {
// Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 3850; GVAR(metal) = 3850;
GVAR(charge) = 1040; GVAR(charge) = 1040;
GVAR(gurney_c) = 2700; GVAR(gurney_c) = 2700;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
//class R_57mm_HE: RocketBase { //class R_57mm_HE: RocketBase {
// GVAR(skip) = 1; // GVAR(skip) = 1;
//}; //};
class R_80mm_HE: RocketBase { class R_80mm_HE: RocketBase {
GVAR(skip) = 1; GVAR(skip) = 1;
}; };
//class R_S8T_AT: RocketBase { //class R_S8T_AT: RocketBase {
// GVAR(skip) = 1; // GVAR(skip) = 1;
//}; //};
class BombCore; class BombCore;
class Bo_Mk82: BombCore { class Bo_Mk82: BombCore {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
GVAR(metal) = 140000; GVAR(metal) = 140000;
GVAR(charge) = 87000; GVAR(charge) = 87000;
GVAR(gurney_c) = 2320; GVAR(gurney_c) = 2320;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class G_40mm_HE: GrenadeBase { class G_40mm_HE: GrenadeBase {
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(force) = 1; GVAR(force) = 1;
GVAR(classes)[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
GVAR(metal) = 200; GVAR(metal) = 200;
GVAR(charge) = 32; GVAR(charge) = 32;
GVAR(gurney_c) = 2700; GVAR(gurney_c) = 2700;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class G_40mm_HEDP: G_40mm_HE { class G_40mm_HEDP: G_40mm_HE {
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_tiny_HD"}; GVAR(classes)[] = {"ACE_frag_tiny_HD"};
GVAR(metal) = 200; GVAR(metal) = 200;
GVAR(charge) = 45; GVAR(charge) = 45;
GVAR(gurney_c) = 2830; GVAR(gurney_c) = 2830;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class ACE_G_40mm_HEDP: G_40mm_HEDP { class ACE_G_40mm_HEDP: G_40mm_HEDP {
}; };
class ACE_G_40mm_HE: G_40mm_HE { class ACE_G_40mm_HE: G_40mm_HE {
}; };
class ACE_G_40mm_Practice: ACE_G_40mm_HE { class ACE_G_40mm_Practice: ACE_G_40mm_HE {
GVAR(skip) = 1; GVAR(skip) = 1;
GVAR(force) = 0; GVAR(force) = 0;
}; };
class ACE_G40mm_HE_VOG25P: G_40mm_HE { class ACE_G40mm_HE_VOG25P: G_40mm_HE {
GVAR(skip) = 0; GVAR(skip) = 0;
GVAR(force) = 1; GVAR(force) = 1;
}; };
// curator ammo entries // curator ammo entries
class ShellBase; class ShellBase;
class Sh_125mm_HEAT; class Sh_125mm_HEAT;
class Sh_155mm_AMOS: ShellBase { class Sh_155mm_AMOS: ShellBase {
// Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
GVAR(metal) = 36000; GVAR(metal) = 36000;
GVAR(charge) = 9979; GVAR(charge) = 9979;
GVAR(gurney_c) = 2440; GVAR(gurney_c) = 2440;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class Sh_82mm_AMOS : Sh_155mm_AMOS { class Sh_82mm_AMOS : Sh_155mm_AMOS {
// Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 3200; GVAR(metal) = 3200;
GVAR(charge) = 420; GVAR(charge) = 420;
GVAR(gurney_c) = 2440; GVAR(gurney_c) = 2440;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS { class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 800; GVAR(metal) = 800;
GVAR(charge) = 4200; GVAR(charge) = 4200;
GVAR(gurney_c) = 2320; GVAR(gurney_c) = 2320;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class Sh_105mm_HEAT_MP : Sh_125mm_HEAT { class Sh_105mm_HEAT_MP : Sh_125mm_HEAT {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 11400; GVAR(metal) = 11400;
GVAR(charge) = 7100; GVAR(charge) = 7100;
GVAR(gurney_c) = 2800; GVAR(gurney_c) = 2800;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class Sh_120mm_HE : ShellBase { class Sh_120mm_HE : ShellBase {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 23000; GVAR(metal) = 23000;
GVAR(charge) = 3148; GVAR(charge) = 3148;
GVAR(gurney_c) = 2830; GVAR(gurney_c) = 2830;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class Sh_125mm_HE: Sh_120mm_HE { class Sh_125mm_HE: Sh_120mm_HE {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 16000; GVAR(metal) = 16000;
GVAR(charge) = 3200; GVAR(charge) = 3200;
GVAR(gurney_c) = 2440; GVAR(gurney_c) = 2440;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS {
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"};
GVAR(metal) = 1950; GVAR(metal) = 1950;
GVAR(charge) = 15800; GVAR(charge) = 15800;
GVAR(gurney_c) = 2320; GVAR(gurney_c) = 2320;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
//class R_230mm_HE; //class R_230mm_HE;
//class ModuleOrdnanceRocket_F_ammo: R_230mm_HE { //class ModuleOrdnanceRocket_F_ammo: R_230mm_HE {
//}; //};
//class R_230mm_fly; //class R_230mm_fly;
//class ModuleOrdnanceRocket_F_subammo: R_230mm_fly { //class ModuleOrdnanceRocket_F_subammo: R_230mm_fly {
//}; //};
// end of curator ammo entries // end of curator ammo entries
//class R_SMAW_HEDP; //class R_SMAW_HEDP;
//class R_MEEWS_HEDP : R_SMAW_HEDP { //class R_MEEWS_HEDP : R_SMAW_HEDP {
// GVAR(force) = 1; // GVAR(force) = 1;
// GVAR(multiplier) = 1.2; // GVAR(multiplier) = 1.2;
//}; //};
class MissileBase; class MissileBase;
class Missile_AGM_02_F : MissileBase { class Missile_AGM_02_F : MissileBase {
// Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 56250; GVAR(metal) = 56250;
GVAR(charge) = 39000; GVAR(charge) = 39000;
GVAR(gurney_c) = 2700; GVAR(gurney_c) = 2700;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
class M_Hellfire_AT: MissileBase { class M_Hellfire_AT: MissileBase {
// Source: http://www.designation-systems.net/dusrm/m-114.html // Source: http://www.designation-systems.net/dusrm/m-114.html
GVAR(enabled) = 1; GVAR(enabled) = 1;
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
GVAR(metal) = 8000; GVAR(metal) = 8000;
GVAR(charge) = 2400; GVAR(charge) = 2400;
GVAR(gurney_c) = 2700; GVAR(gurney_c) = 2700;
GVAR(gurney_k) = 1/2; GVAR(gurney_k) = 1/2;
}; };
/* /*
class B_762x51_Ball; class B_762x51_Ball;
class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement? class ACE_frag_base: B_762x51_Ball { ////TODO: B_762x45_Ball no longer exists, is this a valid replacement?
model = "\A3\Weapons_f\ammo\shell"; model = "\A3\Weapons_f\ammo\shell";
timeToLive = 12; timeToLive = 12;
typicalSpeed = 800; typicalSpeed = 800;
// Fix sounds // Fix sounds
effectFly = "AmmoClassic"; effectFly = "AmmoClassic";
soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30}; soundDefault1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.158114,1,30};
soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30}; soundDefault2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.158114,1,30};
soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30}; soundDefault3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.158114,1,30};
soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30}; soundDefault4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.158114,1,30};
soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30}; soundDefault5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.158114,1,30};
soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30}; soundDefault6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.158114,1,30};
soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30}; soundDefault7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.158114,1,30};
soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30}; soundDefault8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.158114,1,30};
soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30}; soundGroundSoft1[] = {"A3\sounds_f\weapons\hits\soft_ground_1.wav",0.02811705,1,30};
soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30}; soundGroundSoft2[] = {"A3\sounds_f\weapons\hits\soft_ground_2.wav",0.02811705,1,30};
soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30}; soundGroundSoft3[] = {"A3\sounds_f\weapons\hits\soft_ground_3.wav",0.02811705,1,30};
soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30}; soundGroundSoft4[] = {"A3\sounds_f\weapons\hits\soft_ground_4.wav",0.02811705,1,30};
soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30}; soundGroundSoft5[] = {"A3\sounds_f\weapons\hits\soft_ground_5.wav",0.02811705,1,30};
soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30}; soundGroundSoft6[] = {"A3\sounds_f\weapons\hits\soft_ground_6.wav",0.02811705,1,30};
soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30}; soundGroundSoft7[] = {"A3\sounds_f\weapons\hits\soft_ground_7.wav",0.02811705,1,30};
soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30}; soundGroundSoft8[] = {"A3\sounds_f\weapons\hits\soft_ground_8.wav",0.02811705,1,30};
soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40}; soundGroundHard1[] = {"A3\sounds_f\weapons\hits\hard_ground_1.wav",0.62946,1,40};
soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40}; soundGroundHard2[] = {"A3\sounds_f\weapons\hits\hard_ground_2.wav",0.62946,1,40};
soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40}; soundGroundHard3[] = {"A3\sounds_f\weapons\hits\hard_ground_3.wav",0.62946,1,40};
soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40}; soundGroundHard4[] = {"A3\sounds_f\weapons\hits\hard_ground_4.wav",0.62946,1,40};
soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40}; soundGroundHard5[] = {"A3\sounds_f\weapons\hits\hard_ground_5.wav",0.62946,1,40};
soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40}; soundGroundHard6[] = {"A3\sounds_f\weapons\hits\hard_ground_6.wav",0.62946,1,40};
soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40}; soundGroundHard7[] = {"A3\sounds_f\weapons\hits\hard_ground_7.wav",0.62946,1,40};
soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40}; soundGroundHard8[] = {"A3\sounds_f\weapons\hits\hard_ground_8.wav",0.62946,1,40};
soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45}; soundMetal1[] = {"A3\sounds_f\weapons\hits\metal_1.wav",0.158114,1,45};
soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45}; soundMetal2[] = {"A3\sounds_f\weapons\hits\metal_2.wav",0.158114,1,45};
soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45}; soundMetal3[] = {"A3\sounds_f\weapons\hits\metal_3.wav",0.158114,1,45};
soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45}; soundMetal4[] = {"A3\sounds_f\weapons\hits\metal_4.wav",0.158114,1,45};
soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45}; soundMetal5[] = {"A3\sounds_f\weapons\hits\metal_5.wav",0.158114,1,45};
soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45}; soundMetal6[] = {"A3\sounds_f\weapons\hits\metal_6.wav",0.158114,1,45};
soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45}; soundMetal7[] = {"A3\sounds_f\weapons\hits\metal_7.wav",0.158114,1,45};
soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45}; soundMetal8[] = {"A3\sounds_f\weapons\hits\metal_8.wav",0.158114,1,45};
soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25}; soundGlass1[] = {"A3\sounds_f\weapons\hits\glass_1.wav",0.177828,1,25};
soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25}; soundGlass2[] = {"A3\sounds_f\weapons\hits\glass_2.wav",0.177828,1,25};
soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25}; soundGlass3[] = {"A3\sounds_f\weapons\hits\glass_3.wav",0.177828,1,25};
soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25}; soundGlass4[] = {"A3\sounds_f\weapons\hits\glass_4.wav",0.177828,1,25};
soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25}; soundGlass5[] = {"A3\sounds_f\weapons\hits\glass_5.wav",0.177828,1,25};
soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25}; soundGlass6[] = {"A3\sounds_f\weapons\hits\glass_6.wav",0.177828,1,25};
soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25}; soundGlass7[] = {"A3\sounds_f\weapons\hits\glass_7.wav",0.177828,1,25};
soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25}; soundGlass8[] = {"A3\sounds_f\weapons\hits\glass_8.wav",0.177828,1,25};
soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30}; soundGlassArmored1[] = {"A3\sounds_f\weapons\hits\glass_arm_1.wav",0.177828,1,30};
soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30}; soundGlassArmored2[] = {"A3\sounds_f\weapons\hits\glass_arm_2.wav",0.177828,1,30};
soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30}; soundGlassArmored3[] = {"A3\sounds_f\weapons\hits\glass_arm_3.wav",0.177828,1,30};
soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30}; soundGlassArmored4[] = {"A3\sounds_f\weapons\hits\glass_arm_4.wav",0.177828,1,30};
soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30}; soundGlassArmored5[] = {"A3\sounds_f\weapons\hits\glass_arm_5.wav",0.177828,1,30};
soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30}; soundGlassArmored6[] = {"A3\sounds_f\weapons\hits\glass_arm_6.wav",0.177828,1,30};
soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30}; soundGlassArmored7[] = {"A3\sounds_f\weapons\hits\glass_arm_7.wav",0.177828,1,30};
soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30}; soundGlassArmored8[] = {"A3\sounds_f\weapons\hits\glass_arm_8.wav",0.177828,1,30};
soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40}; soundVehiclePlate1[] = {"A3\sounds_f\weapons\hits\metal_plate_1.wav",0.281170,1,40};
soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40}; soundVehiclePlate2[] = {"A3\sounds_f\weapons\hits\metal_plate_2.wav",0.281170,1,40};
soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40}; soundVehiclePlate3[] = {"A3\sounds_f\weapons\hits\metal_plate_3.wav",0.281170,1,40};
soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40}; soundVehiclePlate4[] = {"A3\sounds_f\weapons\hits\metal_plate_4.wav",0.281170,1,40};
soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40}; soundVehiclePlate5[] = {"A3\sounds_f\weapons\hits\metal_plate_5.wav",0.281170,1,40};
soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40}; soundVehiclePlate6[] = {"A3\sounds_f\weapons\hits\metal_plate_6.wav",0.281170,1,40};
soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40}; soundVehiclePlate7[] = {"A3\sounds_f\weapons\hits\metal_plate_7.wav",0.281170,1,40};
soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40}; soundVehiclePlate8[] = {"A3\sounds_f\weapons\hits\metal_plate_8.wav",0.281170,1,40};
soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30}; soundWood1[] = {"A3\sounds_f\weapons\hits\wood_1.wav",0.158114,1,30};
soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30}; soundWood2[] = {"A3\sounds_f\weapons\hits\wood_2.wav",0.158114,1,30};
soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30}; soundWood3[] = {"A3\sounds_f\weapons\hits\wood_3.wav",0.158114,1,30};
soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30}; soundWood4[] = {"A3\sounds_f\weapons\hits\wood_4.wav",0.158114,1,30};
soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30}; soundWood5[] = {"A3\sounds_f\weapons\hits\wood_5.wav",0.158114,1,30};
soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30}; soundWood6[] = {"A3\sounds_f\weapons\hits\wood_6.wav",0.158114,1,30};
soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30}; soundWood7[] = {"A3\sounds_f\weapons\hits\wood_7.wav",0.158114,1,30};
soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30}; soundWood8[] = {"A3\sounds_f\weapons\hits\wood_8.wav",0.158114,1,30};
soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25}; soundHitBody1[] = {"A3\sounds_f\weapons\hits\body_1.wav",0.0177828,1,25};
soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25}; soundHitBody2[] = {"A3\sounds_f\weapons\hits\body_2.wav",0.0177828,1,25};
soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25}; soundHitBody3[] = {"A3\sounds_f\weapons\hits\body_3.wav",0.0177828,1,25};
soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25}; soundHitBody4[] = {"A3\sounds_f\weapons\hits\body_4.wav",0.0177828,1,25};
soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25}; soundHitBody5[] = {"A3\sounds_f\weapons\hits\body_5.wav",0.0177828,1,25};
soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25}; soundHitBody6[] = {"A3\sounds_f\weapons\hits\body_6.wav",0.0177828,1,25};
soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25}; soundHitBody7[] = {"A3\sounds_f\weapons\hits\body_7.wav",0.0177828,1,25};
soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25}; soundHitBody8[] = {"A3\sounds_f\weapons\hits\body_8.wav",0.0177828,1,25};
soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30}; soundHitBuilding1[] = {"A3\sounds_f\weapons\hits\building_1.wav",0.251189,1,30};
soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30}; soundHitBuilding2[] = {"A3\sounds_f\weapons\hits\building_2.wav",0.251189,1,30};
soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30}; soundHitBuilding3[] = {"A3\sounds_f\weapons\hits\building_3.wav",0.251189,1,30};
soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30}; soundHitBuilding4[] = {"A3\sounds_f\weapons\hits\building_4.wav",0.251189,1,30};
soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30}; soundHitBuilding5[] = {"A3\sounds_f\weapons\hits\building_5.wav",0.251189,1,30};
soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30}; soundHitBuilding6[] = {"A3\sounds_f\weapons\hits\building_6.wav",0.251189,1,30};
soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30}; soundHitBuilding7[] = {"A3\sounds_f\weapons\hits\building_7.wav",0.251189,1,30};
soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30}; soundHitBuilding8[] = {"A3\sounds_f\weapons\hits\building_8.wav",0.251189,1,30};
soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25}; soundHitFoliage1[] = {"A3\sounds_f\weapons\hits\foliage_1.wav",0.177828,1,25};
soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25}; soundHitFoliage2[] = {"A3\sounds_f\weapons\hits\foliage_2.wav",0.177828,1,25};
soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25}; soundHitFoliage3[] = {"A3\sounds_f\weapons\hits\foliage_3.wav",0.177828,1,25};
soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25}; soundHitFoliage4[] = {"A3\sounds_f\weapons\hits\foliage_4.wav",0.177828,1,25};
soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25}; soundHitFoliage5[] = {"A3\sounds_f\weapons\hits\foliage_5.wav",0.177828,1,25};
soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25}; soundHitFoliage6[] = {"A3\sounds_f\weapons\hits\foliage_6.wav",0.177828,1,25};
soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25}; soundHitFoliage7[] = {"A3\sounds_f\weapons\hits\foliage_7.wav",0.177828,1,25};
soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25}; soundHitFoliage8[] = {"A3\sounds_f\weapons\hits\foliage_8.wav",0.177828,1,25};
soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25}; soundPlastic1[] = {"A3\sounds_f\weapons\hits\plastic_1.wav",0.177828,1,25};
soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25}; soundPlastic2[] = {"A3\sounds_f\weapons\hits\plastic_2.wav",0.177828,1,25};
soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25}; soundPlastic3[] = {"A3\sounds_f\weapons\hits\plastic_3.wav",0.177828,1,25};
soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25}; soundPlastic4[] = {"A3\sounds_f\weapons\hits\plastic_4.wav",0.177828,1,25};
soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25}; soundPlastic5[] = {"A3\sounds_f\weapons\hits\plastic_5.wav",0.177828,1,25};
soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25}; soundPlastic6[] = {"A3\sounds_f\weapons\hits\plastic_6.wav",0.177828,1,25};
soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25}; soundPlastic7[] = {"A3\sounds_f\weapons\hits\plastic_7.wav",0.177828,1,25};
soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25}; soundPlastic8[] = {"A3\sounds_f\weapons\hits\plastic_8.wav",0.177828,1,25};
soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35}; soundConcrete1[] = {"A3\sounds_f\weapons\hits\concrete_1.wav",0.177828,1,35};
soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35}; soundConcrete2[] = {"A3\sounds_f\weapons\hits\concrete_2.wav",0.177828,1,35};
soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35}; soundConcrete3[] = {"A3\sounds_f\weapons\hits\concrete_3.wav",0.177828,1,35};
soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35}; soundConcrete4[] = {"A3\sounds_f\weapons\hits\concrete_4.wav",0.177828,1,35};
soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35}; soundConcrete5[] = {"A3\sounds_f\weapons\hits\concrete_5.wav",0.177828,1,35};
soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35}; soundConcrete6[] = {"A3\sounds_f\weapons\hits\concrete_6.wav",0.177828,1,35};
soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35}; soundConcrete7[] = {"A3\sounds_f\weapons\hits\concrete_7.wav",0.177828,1,35};
soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35}; soundConcrete8[] = {"A3\sounds_f\weapons\hits\concrete_8.wav",0.177828,1,35};
soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25}; soundRubber1[] = {"A3\sounds_f\weapons\hits\tyre_1.wav",0.158114,1,25};
soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25}; soundRubber2[] = {"A3\sounds_f\weapons\hits\tyre_2.wav",0.158114,1,25};
soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25}; soundRubber3[] = {"A3\sounds_f\weapons\hits\tyre_3.wav",0.158114,1,25};
soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25}; soundRubber4[] = {"A3\sounds_f\weapons\hits\tyre_4.wav",0.158114,1,25};
soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25}; soundRubber5[] = {"A3\sounds_f\weapons\hits\tyre_5.wav",0.158114,1,25};
soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25}; soundRubber6[] = {"A3\sounds_f\weapons\hits\tyre_6.wav",0.158114,1,25};
soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25}; soundRubber7[] = {"A3\sounds_f\weapons\hits\tyre_7.wav",0.158114,1,25};
soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25}; soundRubber8[] = {"A3\sounds_f\weapons\hits\tyre_8.wav",0.158114,1,25};
soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25}; soundWater1[] = {"A3\sounds_f\weapons\hits\water_01.wav",0.158114,1,25};
soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25}; soundWater2[] = {"A3\sounds_f\weapons\hits\water_02.wav",0.158114,1,25};
soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25}; soundWater3[] = {"A3\sounds_f\weapons\hits\water_03.wav",0.158114,1,25};
soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25}; soundWater4[] = {"A3\sounds_f\weapons\hits\water_04.wav",0.158114,1,25};
soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25}; soundWater5[] = {"A3\sounds_f\weapons\hits\water_05.wav",0.158114,1,25};
soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25}; soundWater6[] = {"A3\sounds_f\weapons\hits\water_06.wav",0.158114,1,25};
soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25}; soundWater7[] = {"A3\sounds_f\weapons\hits\water_07.wav",0.158114,1,25};
soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25}; soundWater8[] = {"A3\sounds_f\weapons\hits\water_08.wav",0.158114,1,25};
hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1}; hitGroundSoft[] = {"soundGroundSoft1",0.2,"soundGroundSoft2",0.2,"soundGroundSoft3",0.1,"soundGroundSoft4",0.1,"soundGroundSoft5",0.1,"soundGroundSoft6",0.1,"soundGroundSoft7",0.1,"soundGroundSoft8",0.1};
hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1}; hitGroundHard[] = {"soundGroundHard1",0.2,"soundGroundHard2",0.2,"soundGroundHard3",0.1,"soundGroundHard4",0.1,"soundGroundHard5",0.1,"soundGroundHard6",0.1,"soundGroundHard7",0.1,"soundGroundHard8",0.1};
hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125}; hitMan[] = {"soundHitBody1",0.125,"soundHitBody2",0.125,"soundHitBody3",0.125,"soundHitBody4",0.125,"soundHitBody5",0.125,"soundHitBody6",0.125,"soundHitBody7",0.125,"soundHitBody8",0.125};
hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; hitArmor[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125};
hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1}; hitBuilding[] = {"soundHitBuilding1",0.2,"soundHitBuilding2",0.2,"soundHitBuilding3",0.1,"soundHitBuilding4",0.1,"soundHitBuilding5",0.1,"soundHitBuilding6",0.1,"soundHitBuilding7",0.1,"soundHitBuilding8",0.1};
hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125}; hitFoliage[] = {"soundHitFoliage1",0.125,"soundHitFoliage2",0.125,"soundHitFoliage3",0.125,"soundHitFoliage4",0.125,"soundHitFoliage5",0.125,"soundHitFoliage6",0.125,"soundHitFoliage7",0.125,"soundHitFoliage8",0.125};
hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125}; hitWood[] = {"soundWood1",0.125,"soundWood2",0.125,"soundWood3",0.125,"soundWood4",0.125,"soundWood5",0.125,"soundWood6",0.125,"soundWood7",0.125,"soundWood8",0.125};
hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125}; hitGlass[] = {"soundGlass1",0.125,"soundGlass2",0.125,"soundGlass3",0.125,"soundGlass4",0.125,"soundGlass5",0.125,"soundGlass6",0.125,"soundGlass7",0.125,"soundGlass8",0.125};
hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125}; hitGlassArmored[] = {"soundGlassArmored1",0.125,"soundGlassArmored2",0.125,"soundGlassArmored3",0.125,"soundGlassArmored4",0.125,"soundGlassArmored5",0.125,"soundGlassArmored6",0.125,"soundGlassArmored7",0.125,"soundGlassArmored8",0.125};
hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125}; hitConcrete[] = {"soundConcrete1",0.125,"soundConcrete2",0.125,"soundConcrete3",0.125,"soundConcrete4",0.125,"soundConcrete5",0.125,"soundConcrete6",0.125,"soundConcrete7",0.125,"soundConcrete8",0.125};
hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125}; hitRubber[] = {"soundRubber1",0.125,"soundRubber2",0.125,"soundRubber3",0.125,"soundRubber4",0.125,"soundRubber5",0.125,"soundRubber6",0.125,"soundRubber7",0.125,"soundRubber8",0.125};
hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125}; hitPlastic[] = {"soundPlastic1",0.125,"soundPlastic2",0.125,"soundPlastic3",0.125,"soundPlastic4",0.125,"soundPlastic5",0.125,"soundPlastic6",0.125,"soundPlastic7",0.125,"soundPlastic8",0.125};
hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1}; hitDefault[] = {"soundDefault1",0.2,"soundDefault2",0.2,"soundDefault3",0.1,"soundDefault4",0.1,"soundDefault5",0.1,"soundDefault6",0.1,"soundDefault7",0.1,"soundDefault8",0.1};
hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125}; hitMetal[] = {"soundMetal1",0.125,"soundMetal2",0.125,"soundMetal3",0.125,"soundMetal4",0.125,"soundMetal5",0.125,"soundMetal6",0.125,"soundMetal7",0.125,"soundMetal8",0.125};
hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125}; hitMetalplate[] = {"soundVehiclePlate1",0.125,"soundVehiclePlate2",0.125,"soundVehiclePlate3",0.125,"soundVehiclePlate4",0.125,"soundVehiclePlate5",0.125,"soundVehiclePlate6",0.125,"soundVehiclePlate7",0.125,"soundVehiclePlate8",0.125};
hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125}; hitWater[] = {"soundWater1",0.125,"soundWater2",0.125,"soundWater3",0.125,"soundWater4",0.125,"soundWater5",0.125,"soundWater6",0.125,"soundWater7",0.125,"soundWater8",0.125};
bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35}; bulletFly1[] = {"A3\sounds_f\weapons\hits\bullet_by_1.wav",1,1,35};
bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35}; bulletFly2[] = {"A3\sounds_f\weapons\hits\bullet_by_2.wav",1,1,35};
bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35}; bulletFly3[] = {"A3\sounds_f\weapons\hits\bullet_by_3.wav",1,1,35};
bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35}; bulletFly4[] = {"A3\sounds_f\weapons\hits\bullet_by_4.wav",1,1,35};
bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35}; bulletFly5[] = {"A3\sounds_f\weapons\hits\bullet_by_5.wav",1,1,35};
bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35}; bulletFly6[] = {"A3\sounds_f\weapons\hits\bullet_by_6.wav",1,1,35};
bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35}; bulletFly7[] = {"A3\sounds_f\weapons\hits\bullet_by_7.wav",1,1,35};
bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35}; bulletFly8[] = {"A3\sounds_f\weapons\hits\bullet_by_8.wav",1,1,35};
bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167}; bulletFly[] = {"bulletFly1",0.166,"bulletFly2",0.166,"bulletFly3",0.166,"bulletFly4",0.166,"bulletFly5",0.166,"bulletFly6",0.167,"bulletFly7",0.166,"bulletFly8",0.167};
supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35}; supersonicCrackNear[] = {"A3\sounds_f\weapons\hits\sscrack1.wav",1,1,35};
supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135}; supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135};
}; };
*/ */
class B_65x39_Caseless; class B_65x39_Caseless;
class ACE_frag_base: B_65x39_Caseless { class ACE_frag_base: B_65x39_Caseless {
timeToLive = 12; timeToLive = 12;
typicalSpeed = 1500; typicalSpeed = 1500;
deflecting = 65; deflecting = 65;
}; };
class ACE_frag_tiny: ACE_frag_base { class ACE_frag_tiny: ACE_frag_base {
hit = 6; hit = 6;
airFriction = BASE_DRAG; airFriction = BASE_DRAG;
caliber = 0.75; caliber = 0.75;
}; };
class ACE_frag_tiny_HD: ACE_frag_base { class ACE_frag_tiny_HD: ACE_frag_base {
hit = 6; hit = 6;
airFriction = BASE_DRAG_HD; airFriction = BASE_DRAG_HD;
caliber = 0.75; caliber = 0.75;
}; };
class ACE_frag_small: ACE_frag_base { class ACE_frag_small: ACE_frag_base {
hit = 12; hit = 12;
airFriction = BASE_DRAG*0.9; airFriction = BASE_DRAG*0.9;
}; };
class ACE_frag_small_HD: ACE_frag_base { class ACE_frag_small_HD: ACE_frag_base {
hit = 12; hit = 12;
airFriction = BASE_DRAG_HD*0.9; airFriction = BASE_DRAG_HD*0.9;
}; };
class ACE_frag_medium: ACE_frag_base { class ACE_frag_medium: ACE_frag_base {
hit = 14; hit = 14;
airFriction = BASE_DRAG*0.75; airFriction = BASE_DRAG*0.75;
caliber = 1.2; caliber = 1.2;
}; };
class ACE_frag_medium_HD: ACE_frag_base { class ACE_frag_medium_HD: ACE_frag_base {
hit = 14; hit = 14;
airFriction = BASE_DRAG_HD*0.75; airFriction = BASE_DRAG_HD*0.75;
caliber = 1.2; caliber = 1.2;
}; };
class ACE_frag_large: ACE_frag_base { class ACE_frag_large: ACE_frag_base {
hit = 28; hit = 28;
indirectHit = 2; indirectHit = 2;
indirectHitRange = 0.25; indirectHitRange = 0.25;
airFriction = BASE_DRAG*0.65; airFriction = BASE_DRAG*0.65;
caliber = 2; caliber = 2;
explosive = 0; explosive = 0;
}; };
class ACE_frag_large_HD: ACE_frag_large { class ACE_frag_large_HD: ACE_frag_large {
hit = 28; hit = 28;
indirectHit = 2; indirectHit = 2;
indirectHitRange = 0.25; indirectHitRange = 0.25;
airFriction = BASE_DRAG_HD*0.65; airFriction = BASE_DRAG_HD*0.65;
caliber = 2; caliber = 2;
}; };
class ACE_frag_huge: ACE_frag_large { class ACE_frag_huge: ACE_frag_large {
hit = 40; hit = 40;
indirectHit = 4; indirectHit = 4;
indirectHitRange = 0.5; indirectHitRange = 0.5;
airFriction = BASE_DRAG*0.5; airFriction = BASE_DRAG*0.5;
caliber = 2.8; caliber = 2.8;
}; };
class ACE_frag_huge_HD: ACE_frag_large { class ACE_frag_huge_HD: ACE_frag_large {
hit = 40; hit = 40;
indirectHit = 4; indirectHit = 4;
indirectHitRange = 0.5; indirectHitRange = 0.5;
airFriction = BASE_DRAG_HD*0.5; airFriction = BASE_DRAG_HD*0.5;
caliber = 2.8; caliber = 2.8;
}; };
class ACE_frag_spall_small: ACE_frag_small { class ACE_frag_spall_small: ACE_frag_small {
timeToLive = 0.1; timeToLive = 0.1;
}; };
class ACE_frag_spall_medium: ACE_frag_medium { class ACE_frag_spall_medium: ACE_frag_medium {
timeToLive = 0.15; timeToLive = 0.15;
}; };
class ACE_frag_spall_large: ACE_frag_large { class ACE_frag_spall_large: ACE_frag_large {
timeToLive = 0.25; timeToLive = 0.25;
}; };
class ACE_frag_spall_huge: ACE_frag_huge { class ACE_frag_spall_huge: ACE_frag_huge {
timeToLive = 0.3; timeToLive = 0.3;
}; };
#include "CfgAmmoReflections.hpp" #include "CfgAmmoReflections.hpp"
}; };

View File

@ -1,130 +1,130 @@
//CfgAmmoReflections.hpp //CfgAmmoReflections.hpp
#define ACE_EXPLOSION_REFLECTION(range, hit)\ #define ACE_EXPLOSION_REFLECTION(range, hit)\
class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\ class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\
indirectHitRange = range;\ indirectHitRange = range;\
indirectHit = hit;\ indirectHit = hit;\
dangerRadiusHit = range*3;\ dangerRadiusHit = range*3;\
suppressionRadiusHit = range*2;\ suppressionRadiusHit = range*2;\
} }
#define ACE_EXPLOSION_RANGE(range)\ #define ACE_EXPLOSION_RANGE(range)\
ACE_EXPLOSION_REFLECTION(range,10);\ ACE_EXPLOSION_REFLECTION(range,10);\
ACE_EXPLOSION_REFLECTION(range,20);\ ACE_EXPLOSION_REFLECTION(range,20);\
ACE_EXPLOSION_REFLECTION(range,30);\ ACE_EXPLOSION_REFLECTION(range,30);\
ACE_EXPLOSION_REFLECTION(range,40);\ ACE_EXPLOSION_REFLECTION(range,40);\
ACE_EXPLOSION_REFLECTION(range,50);\ ACE_EXPLOSION_REFLECTION(range,50);\
ACE_EXPLOSION_REFLECTION(range,60);\ ACE_EXPLOSION_REFLECTION(range,60);\
ACE_EXPLOSION_REFLECTION(range,70);\ ACE_EXPLOSION_REFLECTION(range,70);\
ACE_EXPLOSION_REFLECTION(range,80);\ ACE_EXPLOSION_REFLECTION(range,80);\
ACE_EXPLOSION_REFLECTION(range,90);\ ACE_EXPLOSION_REFLECTION(range,90);\
ACE_EXPLOSION_REFLECTION(range,100);\ ACE_EXPLOSION_REFLECTION(range,100);\
ACE_EXPLOSION_REFLECTION(range,110);\ ACE_EXPLOSION_REFLECTION(range,110);\
ACE_EXPLOSION_REFLECTION(range,120);\ ACE_EXPLOSION_REFLECTION(range,120);\
ACE_EXPLOSION_REFLECTION(range,130);\ ACE_EXPLOSION_REFLECTION(range,130);\
ACE_EXPLOSION_REFLECTION(range,140);\ ACE_EXPLOSION_REFLECTION(range,140);\
ACE_EXPLOSION_REFLECTION(range,150);\ ACE_EXPLOSION_REFLECTION(range,150);\
ACE_EXPLOSION_REFLECTION(range,160);\ ACE_EXPLOSION_REFLECTION(range,160);\
ACE_EXPLOSION_REFLECTION(range,170);\ ACE_EXPLOSION_REFLECTION(range,170);\
ACE_EXPLOSION_REFLECTION(range,180);\ ACE_EXPLOSION_REFLECTION(range,180);\
ACE_EXPLOSION_REFLECTION(range,190);\ ACE_EXPLOSION_REFLECTION(range,190);\
ACE_EXPLOSION_REFLECTION(range,200);\ ACE_EXPLOSION_REFLECTION(range,200);\
ACE_EXPLOSION_REFLECTION(range,210);\ ACE_EXPLOSION_REFLECTION(range,210);\
ACE_EXPLOSION_REFLECTION(range,220);\ ACE_EXPLOSION_REFLECTION(range,220);\
ACE_EXPLOSION_REFLECTION(range,230);\ ACE_EXPLOSION_REFLECTION(range,230);\
ACE_EXPLOSION_REFLECTION(range,240);\ ACE_EXPLOSION_REFLECTION(range,240);\
ACE_EXPLOSION_REFLECTION(range,250);\ ACE_EXPLOSION_REFLECTION(range,250);\
ACE_EXPLOSION_REFLECTION(range,260);\ ACE_EXPLOSION_REFLECTION(range,260);\
ACE_EXPLOSION_REFLECTION(range,270);\ ACE_EXPLOSION_REFLECTION(range,270);\
ACE_EXPLOSION_REFLECTION(range,280);\ ACE_EXPLOSION_REFLECTION(range,280);\
ACE_EXPLOSION_REFLECTION(range,290);\ ACE_EXPLOSION_REFLECTION(range,290);\
ACE_EXPLOSION_REFLECTION(range,300);\ ACE_EXPLOSION_REFLECTION(range,300);\
ACE_EXPLOSION_REFLECTION(range,310);\ ACE_EXPLOSION_REFLECTION(range,310);\
ACE_EXPLOSION_REFLECTION(range,320);\ ACE_EXPLOSION_REFLECTION(range,320);\
ACE_EXPLOSION_REFLECTION(range,330);\ ACE_EXPLOSION_REFLECTION(range,330);\
ACE_EXPLOSION_REFLECTION(range,340);\ ACE_EXPLOSION_REFLECTION(range,340);\
ACE_EXPLOSION_REFLECTION(range,350);\ ACE_EXPLOSION_REFLECTION(range,350);\
ACE_EXPLOSION_REFLECTION(range,360);\ ACE_EXPLOSION_REFLECTION(range,360);\
ACE_EXPLOSION_REFLECTION(range,370);\ ACE_EXPLOSION_REFLECTION(range,370);\
ACE_EXPLOSION_REFLECTION(range,380);\ ACE_EXPLOSION_REFLECTION(range,380);\
ACE_EXPLOSION_REFLECTION(range,390);\ ACE_EXPLOSION_REFLECTION(range,390);\
ACE_EXPLOSION_REFLECTION(range,400);\ ACE_EXPLOSION_REFLECTION(range,400);\
ACE_EXPLOSION_REFLECTION(range,410);\ ACE_EXPLOSION_REFLECTION(range,410);\
ACE_EXPLOSION_REFLECTION(range,420);\ ACE_EXPLOSION_REFLECTION(range,420);\
ACE_EXPLOSION_REFLECTION(range,430);\ ACE_EXPLOSION_REFLECTION(range,430);\
ACE_EXPLOSION_REFLECTION(range,440);\ ACE_EXPLOSION_REFLECTION(range,440);\
ACE_EXPLOSION_REFLECTION(range,450);\ ACE_EXPLOSION_REFLECTION(range,450);\
ACE_EXPLOSION_REFLECTION(range,460);\ ACE_EXPLOSION_REFLECTION(range,460);\
ACE_EXPLOSION_REFLECTION(range,470);\ ACE_EXPLOSION_REFLECTION(range,470);\
ACE_EXPLOSION_REFLECTION(range,480);\ ACE_EXPLOSION_REFLECTION(range,480);\
ACE_EXPLOSION_REFLECTION(range,490);\ ACE_EXPLOSION_REFLECTION(range,490);\
ACE_EXPLOSION_REFLECTION(range,500) ACE_EXPLOSION_REFLECTION(range,500)
class ace_explosion_reflection_base : Sh_120mm_HE { class ace_explosion_reflection_base : Sh_120mm_HE {
CraterWaterEffects = ""; CraterWaterEffects = "";
CraterEffects = ""; CraterEffects = "";
effectsMissile = ""; effectsMissile = "";
ExplosionEffects = ""; ExplosionEffects = "";
effectFlare = ""; effectFlare = "";
class HitEffects { class HitEffects {
hitWater = ""; hitWater = "";
}; };
multiSoundHit[] = {}; multiSoundHit[] = {};
explosionTime = 0.0001; explosionTime = 0.0001;
explosive = 1; explosive = 1;
soundFakeFall[] = {}; soundFakeFall[] = {};
typicalSpeed = 0; typicalSpeed = 0;
model = "\A3\Weapons_F\empty.p3d"; model = "\A3\Weapons_F\empty.p3d";
craterShape = "\A3\weapons_f\empty.p3d"; craterShape = "\A3\weapons_f\empty.p3d";
}; };
ACE_EXPLOSION_RANGE(2); ACE_EXPLOSION_RANGE(2);
ACE_EXPLOSION_RANGE(4); ACE_EXPLOSION_RANGE(4);
ACE_EXPLOSION_RANGE(6); ACE_EXPLOSION_RANGE(6);
ACE_EXPLOSION_RANGE(8); ACE_EXPLOSION_RANGE(8);
ACE_EXPLOSION_RANGE(10); ACE_EXPLOSION_RANGE(10);
ACE_EXPLOSION_RANGE(12); ACE_EXPLOSION_RANGE(12);
ACE_EXPLOSION_RANGE(14); ACE_EXPLOSION_RANGE(14);
ACE_EXPLOSION_RANGE(16); ACE_EXPLOSION_RANGE(16);
ACE_EXPLOSION_RANGE(18); ACE_EXPLOSION_RANGE(18);
ACE_EXPLOSION_RANGE(20); ACE_EXPLOSION_RANGE(20);
ACE_EXPLOSION_RANGE(22); ACE_EXPLOSION_RANGE(22);
ACE_EXPLOSION_RANGE(24); ACE_EXPLOSION_RANGE(24);
ACE_EXPLOSION_RANGE(26); ACE_EXPLOSION_RANGE(26);
ACE_EXPLOSION_RANGE(28); ACE_EXPLOSION_RANGE(28);
ACE_EXPLOSION_RANGE(30); ACE_EXPLOSION_RANGE(30);
ACE_EXPLOSION_RANGE(32); ACE_EXPLOSION_RANGE(32);
ACE_EXPLOSION_RANGE(34); ACE_EXPLOSION_RANGE(34);
ACE_EXPLOSION_RANGE(36); ACE_EXPLOSION_RANGE(36);
ACE_EXPLOSION_RANGE(38); ACE_EXPLOSION_RANGE(38);
ACE_EXPLOSION_RANGE(40); ACE_EXPLOSION_RANGE(40);
ACE_EXPLOSION_RANGE(42); ACE_EXPLOSION_RANGE(42);
ACE_EXPLOSION_RANGE(44); ACE_EXPLOSION_RANGE(44);
ACE_EXPLOSION_RANGE(46); ACE_EXPLOSION_RANGE(46);
ACE_EXPLOSION_RANGE(48); ACE_EXPLOSION_RANGE(48);
ACE_EXPLOSION_RANGE(50); ACE_EXPLOSION_RANGE(50);
ACE_EXPLOSION_RANGE(52); ACE_EXPLOSION_RANGE(52);
ACE_EXPLOSION_RANGE(54); ACE_EXPLOSION_RANGE(54);
ACE_EXPLOSION_RANGE(56); ACE_EXPLOSION_RANGE(56);
ACE_EXPLOSION_RANGE(58); ACE_EXPLOSION_RANGE(58);
ACE_EXPLOSION_RANGE(60); ACE_EXPLOSION_RANGE(60);
ACE_EXPLOSION_RANGE(62); ACE_EXPLOSION_RANGE(62);
ACE_EXPLOSION_RANGE(64); ACE_EXPLOSION_RANGE(64);
ACE_EXPLOSION_RANGE(66); ACE_EXPLOSION_RANGE(66);
ACE_EXPLOSION_RANGE(68); ACE_EXPLOSION_RANGE(68);
ACE_EXPLOSION_RANGE(70); ACE_EXPLOSION_RANGE(70);
ACE_EXPLOSION_RANGE(72); ACE_EXPLOSION_RANGE(72);
ACE_EXPLOSION_RANGE(74); ACE_EXPLOSION_RANGE(74);
ACE_EXPLOSION_RANGE(76); ACE_EXPLOSION_RANGE(76);
ACE_EXPLOSION_RANGE(78); ACE_EXPLOSION_RANGE(78);
ACE_EXPLOSION_RANGE(80); ACE_EXPLOSION_RANGE(80);
ACE_EXPLOSION_RANGE(82); ACE_EXPLOSION_RANGE(82);
ACE_EXPLOSION_RANGE(84); ACE_EXPLOSION_RANGE(84);
ACE_EXPLOSION_RANGE(86); ACE_EXPLOSION_RANGE(86);
ACE_EXPLOSION_RANGE(88); ACE_EXPLOSION_RANGE(88);
ACE_EXPLOSION_RANGE(90); ACE_EXPLOSION_RANGE(90);
ACE_EXPLOSION_RANGE(92); ACE_EXPLOSION_RANGE(92);
ACE_EXPLOSION_RANGE(94); ACE_EXPLOSION_RANGE(94);
ACE_EXPLOSION_RANGE(96); ACE_EXPLOSION_RANGE(96);
ACE_EXPLOSION_RANGE(98); ACE_EXPLOSION_RANGE(98);
ACE_EXPLOSION_RANGE(100); ACE_EXPLOSION_RANGE(100);

View File

@ -1,18 +1,18 @@
class Extended_PreStart_EventHandlers { class Extended_PreStart_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart)); init = QUOTE(call COMPILE_FILE(XEH_preStart));
}; };
}; };
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit)); init = QUOTE(call COMPILE_FILE(XEH_preInit));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit)); init = QUOTE(call COMPILE_FILE(XEH_postInit));
}; };
}; };

View File

@ -1,30 +1,30 @@
#include "script_component.hpp" #include "script_component.hpp"
if(GVAR(EnableDebugTrace) && !isMultiplayer) then { if(GVAR(EnableDebugTrace) && !isMultiplayer) then {
GVAR(traceFrags) = true; GVAR(traceFrags) = true;
GVAR(autoTrace) = true; GVAR(autoTrace) = true;
}; };
if(isServer) then { if(isServer) then {
[QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler); [QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler);
}; };
["SettingsInitialized", { ["SettingsInitialized", {
//If not enabled, exit //If not enabled, exit
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
// Register fire event handler // Register fire event handler
["firedPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
["firedPlayerNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedPlayerNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
["firedNonPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedNonPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
["firedPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
["firedPlayerVehicleNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedPlayerVehicleNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
["firedNonPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler); ["firedNonPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler; [FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler;
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
//Cache for ammo type configs //Cache for ammo type configs
GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0]; GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
GVAR(cacheRoundsTypesToTrack) setText QGVAR(cacheRoundsTypesToTrack); GVAR(cacheRoundsTypesToTrack) setText QGVAR(cacheRoundsTypesToTrack);

View File

@ -1,25 +1,25 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false; ADDON = false;
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
GVAR(blackList) = []; GVAR(blackList) = [];
GVAR(traceFrags) = false; GVAR(traceFrags) = false;
GVAR(TOTALFRAGS) = 0; GVAR(TOTALFRAGS) = 0;
GVAR(spallHPData) = []; GVAR(spallHPData) = [];
GVAR(spallIsTrackingCount) = 0; GVAR(spallIsTrackingCount) = 0;
GVAR(autoTrace) = false; GVAR(autoTrace) = false;
GVAR(traceID) = -1; GVAR(traceID) = -1;
GVAR(traces) = []; GVAR(traces) = [];
GVAR(tracesStarted) = false; GVAR(tracesStarted) = false;
GVAR(lastIterationIndex) = 0; GVAR(lastIterationIndex) = 0;
GVAR(objects) = []; GVAR(objects) = [];
GVAR(objectTypes) = []; GVAR(objectTypes) = [];
GVAR(arguments) = []; GVAR(arguments) = [];
ADDON = true; ADDON = true;

View File

@ -1,15 +1,15 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"}; requiredAddons[] = {"ace_common"};
author[] = {"Nou"}; author[] = {"Nou"};
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"
#include "CfgAmmo.hpp" #include "CfgAmmo.hpp"
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"

View File

@ -1,74 +1,74 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"]; private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"];
PARAMS_3(_gun,_type,_round); PARAMS_3(_gun,_type,_round);
DEFAULT_PARAM(3,_doFragTrack,false); DEFAULT_PARAM(3,_doFragTrack,false);
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled)); //_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
//if(_enabled < 1) exitWith {}; //if(_enabled < 1) exitWith {};
if(_round in GVAR(blackList)) exitWith { if(_round in GVAR(blackList)) exitWith {
GVAR(blackList) = GVAR(blackList) - [_round]; GVAR(blackList) = GVAR(blackList) - [_round];
}; };
// Exit on max track // Exit on max track
if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { }; if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { };
if(_gun == ACE_player) then { if(_gun == ACE_player) then {
_doFragTrack = true; _doFragTrack = true;
} else { } else {
if((gunner _gun) == ACE_player) then { if((gunner _gun) == ACE_player) then {
_doFragTrack = true; _doFragTrack = true;
} else { } else {
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
_doFragTrack = true; _doFragTrack = true;
}; };
}; };
}; };
_doSpall = false; _doSpall = false;
if(GVAR(SpallEnabled)) then { if(GVAR(SpallEnabled)) then {
if(GVAR(spallIsTrackingCount) <= 0) then { if(GVAR(spallIsTrackingCount) <= 0) then {
GVAR(spallHPData) = []; GVAR(spallHPData) = [];
}; };
if(GVAR(spallIsTrackingCount) > 5) then { if(GVAR(spallIsTrackingCount) > 5) then {
// ACE_player sideChat "LIMT!"; // ACE_player sideChat "LIMT!";
} else { } else {
_doSpall = true; _doSpall = true;
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
}; };
}; };
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; // ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
if(GVAR(autoTrace)) then { if(GVAR(autoTrace)) then {
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack); [ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
}; };
// We only do the single track object check here. // We only do the single track object check here.
// We should do an {!(_round in GVAR(objects))} // We should do an {!(_round in GVAR(objects))}
// But we leave that out here for optimization. So this cannot be a framework function // But we leave that out here for optimization. So this cannot be a framework function
// Otherwise, it should only be added once and from the FiredEH // Otherwise, it should only be added once and from the FiredEH
if(_doFragTrack && alive _round) then { if(_doFragTrack && alive _round) then {
_spallTrack = []; _spallTrack = [];
_spallTrackID = []; _spallTrackID = [];
private["_args"]; private["_args"];
_args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID, _args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))), (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")), (getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")), (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))), (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))))) (getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
]; ];
TRACE_1("Initializing track", _round); TRACE_1("Initializing track", _round);
GVAR(objects) pushBack _round; GVAR(objects) pushBack _round;
GVAR(arguments) pushBack _args; GVAR(arguments) pushBack _args;
if(_doSpall) then { if(_doSpall) then {
[_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack); [_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack);
}; };
// ACE_player sideChat "WTF2"; // ACE_player sideChat "WTF2";
}; };

View File

@ -1,23 +1,23 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"]; private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"];
if (GVAR(autoTrace)) then { if (GVAR(autoTrace)) then {
[] call FUNC(startTracing); [] call FUNC(startTracing);
}; };
// setAccTime 0.05; // setAccTime 0.05;
_index = (count GVAR(traces)); _index = (count GVAR(traces));
_obj = _this select 1; _obj = _this select 1;
_origin = _this select 0; _origin = _this select 0;
_color = [1,0,0,1]; _color = [1,0,0,1];
if((count _this) > 2) then { if((count _this) > 2) then {
_color = _this select 2; _color = _this select 2;
}; };
_positions = []; _positions = [];
_objSpd = vectorMagnitude (velocity _obj); _objSpd = vectorMagnitude (velocity _obj);
_positions set[(count _positions), [(getPos _obj), _objSpd]]; _positions set[(count _positions), [(getPos _obj), _objSpd]];
_data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color];
GVAR(traces) set[_index, _data]; GVAR(traces) set[_index, _data];
[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call CBA_fnc_addPerFrameHandler; [DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call CBA_fnc_addPerFrameHandler;

View File

@ -1,26 +1,26 @@
//fnc_doExplosions.sqf //fnc_doExplosions.sqf
#include "script_component.hpp" #include "script_component.hpp"
private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"];
_params = _this select 0; _params = _this select 0;
_explosions = _params select 0; _explosions = _params select 0;
_index = _params select 1; _index = _params select 1;
for "_i" from _index to ((_index+2) min (count _explosions)) do { for "_i" from _index to ((_index+2) min (count _explosions)) do {
_exp = _explosions select _i; _exp = _explosions select _i;
_refExp = _exp select 0; _refExp = _exp select 0;
_bpos = _exp select 1; _bpos = _exp select 1;
_hit = _exp select 2; _hit = _exp select 2;
_distance = _exp select 3; _distance = _exp select 3;
_indirectHitRange = _exp select 4; _indirectHitRange = _exp select 4;
_depth = _exp select 5; _depth = _exp select 5;
_refExp createVehicle (ASLtoATL _bpos); _refExp createVehicle (ASLtoATL _bpos);
// if(_hit >= 150 && _distance > _indirectHitRange) then { // if(_hit >= 150 && _distance > _indirectHitRange) then {
// [_bpos, _refExp, _depth] call FUNC(doReflections); // [_bpos, _refExp, _depth] call FUNC(doReflections);
// }; // };
}; };
_index = _index + 2; _index = _index + 2;
if(_index >= (count _explosions)) then { if(_index >= (count _explosions)) then {
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
} else { } else {
_params set[1, _index]; _params set[1, _index];
}; };

View File

@ -1,18 +1,18 @@
//fnc_doReflections.sqf //fnc_doReflections.sqf
#include "script_component.hpp" #include "script_component.hpp"
private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"]; private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"];
_pos = _this select 0; _pos = _this select 0;
_ammo = _this select 1; _ammo = _this select 1;
_depth = 1; _depth = 1;
if(count _this > 2) then { if(count _this > 2) then {
_depth = _this select 2; _depth = _this select 2;
}; };
// TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]]; // TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]];
if(_depth <= 2) then { if(_depth <= 2) then {
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange");
_indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit");
_testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0];
[DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler; [DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler;
}; };

View File

@ -1,151 +1,151 @@
//fnc_doSpall.sqf //fnc_doSpall.sqf
#include "script_component.hpp" #include "script_component.hpp"
// ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; // ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA";
private ["_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"]; private ["_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"];
_hitData = _this select 0; _hitData = _this select 0;
_initialData = GVAR(spallHPData) select (_hitData select 0); _initialData = GVAR(spallHPData) select (_hitData select 0);
_hpData = (_hitData select 1) select (_this select 1); _hpData = (_hitData select 1) select (_this select 1);
_object = _hpData select 0; _object = _hpData select 0;
_object removeEventHandler ["hitPart", _initialData select 0]; _object removeEventHandler ["hitPart", _initialData select 0];
_foundObjects = _initialData select 7; _foundObjects = _initialData select 7;
_index = _foundObjects find _object; _index = _foundObjects find _object;
if(_index != -1) then { if(_index != -1) then {
_foundObjecsts set[_index, nil]; _foundObjecsts set[_index, nil];
}; };
_roundType = (_initialData select 2); _roundType = (_initialData select 2);
_round = (_initialData select 3); _round = (_initialData select 3);
_object = (_initialData select 1); _object = (_initialData select 1);
_caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber"); _caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber");
_explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive"); _explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive");
_idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange"); _idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange");
_alive = true; _alive = true;
if(!alive _round && (_initialData select 6) == 1) then { if(!alive _round && (_initialData select 6) == 1) then {
_alive = false; _alive = false;
}; };
if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
// ACE_player sideChat format["BBBB"]; // ACE_player sideChat format["BBBB"];
_exit = false; _exit = false;
_vm = 1; _vm = 1;
_velocity = _initialData select 5; _velocity = _initialData select 5;
_oldVelocity = vectorMagnitude _velocity; _oldVelocity = vectorMagnitude _velocity;
_curVelocity = vectorMagnitude (velocity _round); _curVelocity = vectorMagnitude (velocity _round);
if(alive _round) then { if(alive _round) then {
_diff = _velocity vectorDiff (velocity _round); _diff = _velocity vectorDiff (velocity _round);
_polar = _diff call CBA_fnc_vect2polar; _polar = _diff call CBA_fnc_vect2polar;
// ACE_player sideChat format["polar: %1", _polar]; // ACE_player sideChat format["polar: %1", _polar];
if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then { if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then {
if(_caliber < 2.5) then { if(_caliber < 2.5) then {
// ACE_player sideChat format["exit!"]; // ACE_player sideChat format["exit!"];
_exit = true; _exit = true;
} else { } else {
_vm = 1-(_curVelocity/_oldVelocity); _vm = 1-(_curVelocity/_oldVelocity);
}; };
}; };
}; };
if(!_exit) then { if(!_exit) then {
_unitDir = vectorNormalized _velocity; _unitDir = vectorNormalized _velocity;
_pos = _hpData select 3; _pos = _hpData select 3;
_spallPos = nil; _spallPos = nil;
for "_i" from 0 to 100 do { for "_i" from 0 to 100 do {
_pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i)); _pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i));
_pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1))); _pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1)));
// _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)]; // _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)];
// diag_log text format["b: %1", _blah]; // diag_log text format["b: %1", _blah];
// _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]]; // _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]];
// NOU_TRACES set[(count NOU_TRACES), _data]; // NOU_TRACES set[(count NOU_TRACES), _data];
if(!lineIntersects [_pos1, _pos2]) exitWith { if(!lineIntersects [_pos1, _pos2]) exitWith {
// ACE_player sideChat format["FOUND!"]; // ACE_player sideChat format["FOUND!"];
_spallPos = _pos2; _spallPos = _pos2;
}; };
}; };
if(!isNil "_spallPos") then { if(!isNil "_spallPos") then {
_spallPolar = _velocity call CBA_fnc_vect2polar; _spallPolar = _velocity call CBA_fnc_vect2polar;
if(_explosive > 0) then { if(_explosive > 0) then {
// ACE_player sideChat format["EXPLOSIVE!"]; // ACE_player sideChat format["EXPLOSIVE!"];
_warn = false; _warn = false;
_c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE"); _c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE");
if(_c == 0) then { _c = 1; _warn = true;}; if(_c == 0) then { _c = 1; _warn = true;};
_m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL"); _m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL");
if(_m == 0) then { _m = 2; _warn = true;}; if(_m == 0) then { _m = 2; _warn = true;};
_k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K"); _k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K");
if(_k == 0) then { _k = 1/2; _warn = true;}; if(_k == 0) then { _k = 1/2; _warn = true;};
_gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C"); _gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C");
if(_gC == 0) then { _gC = 2440; _warn = true;}; if(_gC == 0) then { _gC = 2440; _warn = true;};
if(_warn) then { if(_warn) then {
ACE_LOGWARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release ACE_LOGWARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_roundType); //TODO: turn this off when we get closer to release
}; };
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC; _fragPower = (((_m/_c)+_k)^-(1/2))*_gC;
_spallPolar set[0, _fragPower*0.66]; _spallPolar set[0, _fragPower*0.66];
}; };
_fragTypes = [ _fragTypes = [
"ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small", "ACE_frag_spall_small",
"ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium", "ACE_frag_spall_small","ACE_frag_spall_medium","ACE_frag_spall_medium","ACE_frag_spall_medium",
"ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge", "ACE_frag_spall_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge",
"ACE_frag_spall_huge" "ACE_frag_spall_huge"
]; ];
// diag_log text format["SPALL POWER: %1", _spallPolar select 0]; // diag_log text format["SPALL POWER: %1", _spallPolar select 0];
_spread = 15+(random 25); _spread = 15+(random 25);
_spallCount = 5+(random 10); _spallCount = 5+(random 10);
for "_i" from 1 to _spallCount do { for "_i" from 1 to _spallCount do {
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
if(abs _elev > 90) then { if(abs _elev > 90) then {
_dir = _dir + 180; _dir = _dir + 180;
}; };
_dir = _dir % 360; _dir = _dir % 360;
_vel = (_spallPolar select 0)*0.33*_vm; _vel = (_spallPolar select 0)*0.33*_vm;
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); _vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
_fragType = round (random ((count _fragTypes)-1)); _fragType = round (random ((count _fragTypes)-1));
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
_fragment setPosASL _spallPos; _fragment setPosASL _spallPos;
_fragment setVelocity _spallFragVect; _fragment setVelocity _spallFragVect;
if(GVAR(traceFrags)) then { if(GVAR(traceFrags)) then {
[ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); [ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack);
}; };
}; };
_spread = 5+(random 5); _spread = 5+(random 5);
_spallCount = 3+(random 5); _spallCount = 3+(random 5);
for "_i" from 1 to _spallCount do { for "_i" from 1 to _spallCount do {
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2)); _elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2)); _dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
if(abs _elev > 90) then { if(abs _elev > 90) then {
_dir = _dir + 180; _dir = _dir + 180;
}; };
_dir = _dir % 360; _dir = _dir % 360;
_vel = (_spallPolar select 0)*0.55*_vm; _vel = (_spallPolar select 0)*0.55*_vm;
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5)); _vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect; _spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
_fragType = round (random ((count _fragTypes)-1)); _fragType = round (random ((count _fragTypes)-1));
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
_fragment setPosASL _spallPos; _fragment setPosASL _spallPos;
_fragment setVelocity _spallFragVect; _fragment setVelocity _spallFragVect;
if(GVAR(traceFrags)) then { if(GVAR(traceFrags)) then {
[ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack); [ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack);
}; };
}; };
}; };
}; };
}; };

View File

@ -1,31 +1,31 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"]; private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"];
{ {
_positions = _x select 4; _positions = _x select 4;
_color = _x select 5; _color = _x select 5;
_index = 0; _index = 0;
_max = count _positions; _max = count _positions;
_startSpeed = 0.01 max ((_positions select 0) select 1); _startSpeed = 0.01 max ((_positions select 0) select 1);
_lastSpd = []; _lastSpd = [];
_lastPos = []; _lastPos = [];
while {_index < _max} do { while {_index < _max} do {
_data1 = _positions select _index; _data1 = _positions select _index;
_data2 = nil; _data2 = nil;
if(_index + ACE_TRACE_DRAW_INC >= _max) then { if(_index + ACE_TRACE_DRAW_INC >= _max) then {
_data2 = _positions select (_max - 1); _data2 = _positions select (_max - 1);
} else { } else {
_data2 = _positions select (_index + ACE_TRACE_DRAW_INC); _data2 = _positions select (_index + ACE_TRACE_DRAW_INC);
}; };
_pos1 = _data1 select 0; _pos1 = _data1 select 0;
_pos2 = _data2 select 0; _pos2 = _data2 select 0;
_index = _index + ACE_TRACE_DRAW_INC; _index = _index + ACE_TRACE_DRAW_INC;
drawLine3D [_pos1, _pos2, _color]; drawLine3D [_pos1, _pos2, _color];
_lastPos = _pos2; _lastPos = _pos2;
_lastSpd = _data1 select 1; _lastSpd = _data1 select 1;
}; };
// drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"]; // drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"];
} forEach GVAR(traces); } forEach GVAR(traces);

View File

@ -1,128 +1,128 @@
//fnc_findReflections.sqf //fnc_findReflections.sqf
#include "script_component.hpp" #include "script_component.hpp"
private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"]; private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"];
BEGIN_COUNTER(fnc_findReflections); BEGIN_COUNTER(fnc_findReflections);
_params = _this select 0; _params = _this select 0;
_pos = _params select 0; _pos = _params select 0;
_explosiveInfo = _params select 1; _explosiveInfo = _params select 1;
_los = _params select 2; _los = _params select 2;
_nlos = _params select 3; _nlos = _params select 3;
_zIndex = _params select 4; _zIndex = _params select 4;
_depth = _params select 5; _depth = _params select 5;
_rand = _params select 6; _rand = _params select 6;
_split = 15; _split = 15;
_radi = (360/_split*_depth); _radi = (360/_split*_depth);
// player sideChat format["p: %1", _explosiveInfo]; // player sideChat format["p: %1", _explosiveInfo];
_indirectHitRange = _explosiveInfo select 0; _indirectHitRange = _explosiveInfo select 0;
_indirectHit = _explosiveInfo select 1; _indirectHit = _explosiveInfo select 1;
_distanceCount = (floor _indirectHitRange*4) min 100; _distanceCount = (floor _indirectHitRange*4) min 100;
if(_zIndex < 5) then { if(_zIndex < 5) then {
_lastPos = _pos; _lastPos = _pos;
_zAng = _zIndex*20+2; _zAng = _zIndex*20+2;
if(_zAng > 80) then { if(_zAng > 80) then {
_radi = 1; _radi = 1;
_zAng = 90; _zAng = 90;
}; };
for "_i" from 0 to _radi do { for "_i" from 0 to _radi do {
_test = true; _test = true;
_vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect; _vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect;
for "_x" from 1 to _distanceCount do { for "_x" from 1 to _distanceCount do {
_testPos = _pos vectorAdd (_vec vectorMultiply _x); _testPos = _pos vectorAdd (_vec vectorMultiply _x);
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
_res = lineIntersectsWith [_pos, _testPos]; _res = lineIntersectsWith [_pos, _testPos];
if(count _res > 0) exitWith { if(count _res > 0) exitWith {
_test = false; _test = false;
_nlos pushBack _lastPos; _nlos pushBack _lastPos;
// { // {
// _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }]; // _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }];
// } forEach _res; // } forEach _res;
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
// TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]]; // TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]];
}; };
// if(terrainIntersectASL [_pos, _testPos]) exitWith {}; // if(terrainIntersectASL [_pos, _testPos]) exitWith {};
_lastPos = _testPos; _lastPos = _testPos;
}; };
}; };
_params set[4, _zIndex+1]; _params set[4, _zIndex+1];
} else { } else {
_depth = _depth + 1; _depth = _depth + 1;
_buckets = []; _buckets = [];
_excludes = []; _excludes = [];
_bucketIndex = 0; _bucketIndex = 0;
_bucketPos = nil; _bucketPos = nil;
_bucketList = nil; _bucketList = nil;
_c = 0; _c = 0;
while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do { while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do {
scopeName "mainSearch"; scopeName "mainSearch";
{ {
if(!(_forEachIndex in _excludes)) then { if(!(_forEachIndex in _excludes)) then {
_index = _buckets pushBack [_x, [_x]]; _index = _buckets pushBack [_x, [_x]];
_excludes pushBack _forEachIndex; _excludes pushBack _forEachIndex;
_bucketPos = _x; _bucketPos = _x;
_bucketList = (_buckets select _index) select 1; _bucketList = (_buckets select _index) select 1;
breakTo "mainSearch"; breakTo "mainSearch";
}; };
} forEach _nlos; } forEach _nlos;
{ {
if(!(_forEachIndex in _excludes)) then { if(!(_forEachIndex in _excludes)) then {
_testPos = _x; _testPos = _x;
if(_testPos vectorDistanceSqr _bucketPos <= 30) then { if(_testPos vectorDistanceSqr _bucketPos <= 30) then {
_bucketList pushBack _x; _bucketList pushBack _x;
_excludes pushBack _forEachIndex; _excludes pushBack _forEachIndex;
}; };
}; };
} forEach _nlos; } forEach _nlos;
_c = _c + 1; _c = _c + 1;
}; };
// player sideChat format["c: %1", count _buckets]; // player sideChat format["c: %1", count _buckets];
_explosions = []; _explosions = [];
{ {
_blist = _x select 1; _blist = _x select 1;
_avgX = 0; _avgX = 0;
_avgY = 0; _avgY = 0;
_avgZ = 0; _avgZ = 0;
{ {
_avgX = _avgX + (_x select 0); _avgX = _avgX + (_x select 0);
_avgY = _avgY + (_x select 1); _avgY = _avgY + (_x select 1);
_avgZ = _avgZ + (_x select 2); _avgZ = _avgZ + (_x select 2);
} forEach _blist; } forEach _blist;
_c = count _blist; _c = count _blist;
_bpos = [_avgX/_c, _avgY/_c, _avgZ/_c]; _bpos = [_avgX/_c, _avgY/_c, _avgZ/_c];
_distance = _pos vectorDistance _bpos; _distance = _pos vectorDistance _bpos;
_hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0); _hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0);
// _hitFactor = 1/(_distance^2); // _hitFactor = 1/(_distance^2);
_hit = _indirectHit*_hitFactor; _hit = _indirectHit*_hitFactor;
_hit = (floor (_hit/4)) min 500; _hit = (floor (_hit/4)) min 500;
_hit = _hit - (_hit%10); _hit = _hit - (_hit%10);
_range = (floor (_indirectHitRange-(_distance/4))) min 100; _range = (floor (_indirectHitRange-(_distance/4))) min 100;
_range = _range - (_range%2); _range = _range - (_range%2);
if(_hit >= 10 && _range > 0) then { if(_hit >= 10 && _range > 0) then {
// TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; // TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]];
// TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]]; // TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]];
_refExp = format["ace_explosion_reflection_%1_%2", _range, _hit]; _refExp = format["ace_explosion_reflection_%1_%2", _range, _hit];
// _refExp createVehicle (ASLtoATL _bpos); // _refExp createVehicle (ASLtoATL _bpos);
// drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _bpos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _bpos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""];
_explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth]; _explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth];
}; };
if(count _explosions > (_radi*2)/_depth) exitWith {}; if(count _explosions > (_radi*2)/_depth) exitWith {};
} forEach _buckets; } forEach _buckets;
// _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos); // _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos);
// _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3")))); // _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3"))));
// _dirvec = _dirvec vectorMultiply 100; // _dirvec = _dirvec vectorMultiply 100;
// _can setVelocity _dirvec; // _can setVelocity _dirvec;
[DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; [DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler;
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
}; };
END_COUNTER(fnc_findReflections); END_COUNTER(fnc_findReflections);

View File

@ -1,218 +1,218 @@
//fnc_frago.sqf //fnc_frago.sqf
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
#define FRAG_VEC_VAR 0.004 #define FRAG_VEC_VAR 0.004
#define MAX_FRAG_COUNT 50 #define MAX_FRAG_COUNT 50
if(!isServer) exitWith { }; if(!isServer) exitWith { };
BEGIN_COUNTER(frago); BEGIN_COUNTER(frago);
// _startTime = ACE_diagTime; // _startTime = ACE_diagTime;
private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"];
_round = _this select 0; _round = _this select 0;
_lastPos = _this select 1; _lastPos = _this select 1;
_lastVel = _this select 2; _lastVel = _this select 2;
_shellType = _this select 3; _shellType = _this select 3;
_gun = nil; _gun = nil;
if((count _this) > 5) then { if((count _this) > 5) then {
_gun = _this select 5; _gun = _this select 5;
}; };
_fragTypes = [ _fragTypes = [
"ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny",
"ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD", "ACE_frag_tiny_HD",
"ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small", "ACE_frag_small","ACE_frag_small","ACE_frag_small","ACE_frag_small",
"ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD", "ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD","ACE_frag_small_HD",
"ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD" "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD", "ACE_frag_medium_HD"
]; ];
_warn = false; _warn = false;
if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then { if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then {
_fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES"); _fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES");
} else { } else {
_warn = true; _warn = true;
}; };
_atlPos = ASLtoATL _lastPos; _atlPos = ASLtoATL _lastPos;
_isArmed = true; _isArmed = true;
if(!isNil "_gun") then { if(!isNil "_gun") then {
_fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance"); _fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance");
_isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist); _isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist);
}; };
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange"); _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange");
_fragRange = 20*_indirectHitRange*4; _fragRange = 20*_indirectHitRange*4;
// _c = 185; // grams of comp-b // _c = 185; // grams of comp-b
// _m = 210; // grams of fragmentating metal // _m = 210; // grams of fragmentating metal
// _k = 3/5; // spherical K factor // _k = 3/5; // spherical K factor
// _gC = 2843; // Gurney constant of comp-b in /ms // _gC = 2843; // Gurney constant of comp-b in /ms
// _c = 429; // grams of tritonal // _c = 429; // grams of tritonal
// _m = 496; // grams of fragmentating metal // _m = 496; // grams of fragmentating metal
// _k = 1/2; // spherical K factor // _k = 1/2; // spherical K factor
// _gC = 2320; // Gurney constant of tritonal in /ms // _gC = 2320; // Gurney constant of tritonal in /ms
_c = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CHARGE"); _c = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CHARGE");
if(_c == 0) then { _c = 1; _warn = true;}; if(_c == 0) then { _c = 1; _warn = true;};
_m = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_METAL"); _m = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_METAL");
if(_m == 0) then { _m = 2; _warn = true;}; if(_m == 0) then { _m = 2; _warn = true;};
_k = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_K"); _k = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_K");
if(_k == 0) then { _k = 1/2; _warn = true;}; if(_k == 0) then { _k = 1/2; _warn = true;};
_gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C"); _gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C");
if(_gC == 0) then { _gC = 2440; _warn = true;}; if(_gC == 0) then { _gC = 2440; _warn = true;};
if(_warn) then { if(_warn) then {
ACE_LOGWARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); //TODO: turn this off when we get closer to release ACE_LOGWARNING_1("Ammo class %1 lacks proper explosive properties definitions for frag!",_shellType); //TODO: turn this off when we get closer to release
}; };
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC; _fragPower = (((_m/_c)+_k)^-(1/2))*_gC;
_fragPower = _fragPower*0.8; // Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation _fragPower = _fragPower*0.8; // Gunery equation is for a non-fragmenting metal, imperical value of 80% represents fragmentation
_fragPowerRandom = _fragPower*0.5; _fragPowerRandom = _fragPower*0.5;
if((_atlPos select 2) < 0.5) then { if((_atlPos select 2) < 0.5) then {
_lastPos set[2, (_lastPos select 2)+0.5]; _lastPos set[2, (_lastPos select 2)+0.5];
}; };
// _manObjects = _atlPos nearEntities ["CaManBase", _fragRange]; // _manObjects = _atlPos nearEntities ["CaManBase", _fragRange];
// setAccTime 0.01; // setAccTime 0.01;
//_objects = nearestObjects [_atlPos, ["AllVehicles"], _fragRange]; // Not sure if tracking "ReammoBox" is required, if so revert this change for _objects //_objects = nearestObjects [_atlPos, ["AllVehicles"], _fragRange]; // Not sure if tracking "ReammoBox" is required, if so revert this change for _objects
_objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; _objects = _atlPos nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange];
// _objects = _manObjects; // _objects = _manObjects;
// Target also people inside vehicles or manning weapons // Target also people inside vehicles or manning weapons
_crew = []; _crew = [];
{ {
{ {
_crew set [count _crew,_x] _crew set [count _crew,_x]
} forEach (crew _x); } forEach (crew _x);
} forEach _objects; } forEach _objects;
_objects = _objects - _crew; _objects = _objects - _crew;
_objects = _objects + _crew; _objects = _objects + _crew;
_fragCount = 0; _fragCount = 0;
_fragArcs = []; _fragArcs = [];
_fragArcs set[360, 0]; _fragArcs set[360, 0];
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
ACE_player sideChat format["_fragRange: %1", _fragRange]; ACE_player sideChat format["_fragRange: %1", _fragRange];
ACE_player sideChat format["_objects: %1", _objects]; ACE_player sideChat format["_objects: %1", _objects];
#endif #endif
_doRandom = true; _doRandom = true;
if(_isArmed && (count _objects) > 0) then { if(_isArmed && (count _objects) > 0) then {
if (GVAR(ReflectionsEnabled)) then { if (GVAR(ReflectionsEnabled)) then {
[_lastPos, _shellType] call FUNC(doReflections); [_lastPos, _shellType] call FUNC(doReflections);
}; };
{ {
//if(random(1) > 0.5) then { //if(random(1) > 0.5) then {
_target = _x; _target = _x;
if(alive _target) then { if(alive _target) then {
_boundingBox = boundingBox _target; _boundingBox = boundingBox _target;
_targetPos = (getPosASL _target); _targetPos = (getPosASL _target);
_distance = _targetPos distance _lastPos; _distance = _targetPos distance _lastPos;
_add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10); _add = (((_boundingBox select 1) select 2)/2)+((((_distance-(_fragpower/8)) max 0)/_fragPower)*10);
_bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0); _bbX = (abs((_boundingBox select 0) select 0))+((_boundingBox select 1) select 0);
_bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1); _bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1);
_bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2); _bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2);
_cubic = _bbX*_bbY*_bbZ; _cubic = _bbX*_bbY*_bbZ;
if(_cubic > 1) then { if(_cubic > 1) then {
_doRandom = true; _doRandom = true;
_targetVel = (velocity _target); _targetVel = (velocity _target);
_targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))]; _targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))];
_targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))]; _targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))];
_targetPos set[2, (_targetPos select 2)+_add]; _targetPos set[2, (_targetPos select 2)+_add];
_baseVec = _lastPos vectorFromTo _targetPos; _baseVec = _lastPos vectorFromTo _targetPos;
_dir = floor(_baseVec call CBA_fnc_vectDir); _dir = floor(_baseVec call CBA_fnc_vectDir);
_currentCount = _fragArcs select _dir; _currentCount = _fragArcs select _dir;
if(isNil "_currentCount") then { if(isNil "_currentCount") then {
_currentCount = 0; _currentCount = 0;
}; };
if(_currentCount < 20) then { if(_currentCount < 20) then {
_count = ceil(random(sqrt(_m/1000))); _count = ceil(random(sqrt(_m/1000)));
_vecVar = FRAG_VEC_VAR; _vecVar = FRAG_VEC_VAR;
if(!(_target isKindOf "Man")) then { if(!(_target isKindOf "Man")) then {
_vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR; _vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR;
if((count (crew _target)) == 0 && _count > 0) then { if((count (crew _target)) == 0 && _count > 0) then {
_count = 0 max (_count/2); _count = 0 max (_count/2);
}; };
}; };
for "_i" from 1 to _count do { for "_i" from 1 to _count do {
_vec = +_baseVec; _vec = +_baseVec;
_vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)]; _vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)];
_vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)]; _vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)];
_vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)]; _vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)];
_fp = (_fragPower-(random (_fragPowerRandom))); _fp = (_fragPower-(random (_fragPowerRandom)));
_vel = _vec vectorMultiply _fp; _vel = _vec vectorMultiply _fp;
_fragType = round (random ((count _fragTypes)-1)); _fragType = round (random ((count _fragTypes)-1));
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
// diag_log text format["fp: %1 %2", _fp, typeOf _fragObj]; // diag_log text format["fp: %1 %2", _fp, typeOf _fragObj];
_fragObj setPosASL _lastPos; _fragObj setPosASL _lastPos;
_fragObj setVectorDir _vec; _fragObj setVectorDir _vec;
_fragObj setVelocity _vel; _fragObj setVelocity _vel;
if(GVAR(traceFrags)) then { if(GVAR(traceFrags)) then {
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
[ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack); [ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack);
}; };
_fragCount = _fragCount + 1; _fragCount = _fragCount + 1;
_currentCount = _currentCount + 1; _currentCount = _currentCount + 1;
}; };
_fragArcs set[_dir, _currentCount]; _fragArcs set[_dir, _currentCount];
}; };
}; };
}; };
//}; //};
if(_fragCount > MAX_FRAG_COUNT) exitWith {}; if(_fragCount > MAX_FRAG_COUNT) exitWith {};
} forEach _objects; } forEach _objects;
if(_fragCount > MAX_FRAG_COUNT) exitWith {}; if(_fragCount > MAX_FRAG_COUNT) exitWith {};
_randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20; _randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20;
_sectorSize = 360 / (_randomCount max 1); _sectorSize = 360 / (_randomCount max 1);
// _doRandom = false; // _doRandom = false;
if(_doRandom) then { if(_doRandom) then {
for "_i" from 1 to _randomCount do { for "_i" from 1 to _randomCount do {
// Distribute evenly // Distribute evenly
_sectorOffset = 360 * (_i - 1) / (_randomCount max 1); _sectorOffset = 360 * (_i - 1) / (_randomCount max 1);
_randomDir = random(_sectorSize); _randomDir = random(_sectorSize);
_vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))]; _vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))];
_fp = (_fragPower-(random (_fragPowerRandom))); _fp = (_fragPower-(random (_fragPowerRandom)));
_vel = _vec vectorMultiply _fp; _vel = _vec vectorMultiply _fp;
_fragType = round (random ((count _fragTypes)-1)); _fragType = round (random ((count _fragTypes)-1));
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
_fragObj setPosASL _lastPos; _fragObj setPosASL _lastPos;
_fragObj setVectorDir _vec; _fragObj setVectorDir _vec;
_fragObj setVelocity _vel; _fragObj setVelocity _vel;
if(GVAR(traceFrags)) then { if(GVAR(traceFrags)) then {
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
[ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack);
}; };
_fragCount = _fragCount + 1; _fragCount = _fragCount + 1;
}; };
}; };
}; };
// #ifdef DEBUG_MODE_FULL // #ifdef DEBUG_MODE_FULL
// ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; // ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)];
// ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; // ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))];
// #endif // #endif
// _endTime = ACE_diagTime; // _endTime = ACE_diagTime;
END_COUNTER(frago); END_COUNTER(frago);

View File

@ -1,50 +1,50 @@
/* /*
* Author: jaynus * Author: jaynus
* *
* Master single PFH abstraction for all rounds being tracked by frag/spall * Master single PFH abstraction for all rounds being tracked by frag/spall
* *
* Arguments: * Arguments:
* *
* *
* Return Value: * Return Value:
* None * None
*/ */
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
//PARAMS_2(_pfhArgs,_handle); //PARAMS_2(_pfhArgs,_handle);
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
private["_gcIndex", "_iter"]; private["_gcIndex", "_iter"];
_gcIndex = []; _gcIndex = [];
_iter = 0; _iter = 0;
while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do { while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do {
private["_object", "_args"]; private["_object", "_args"];
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then { if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then {
GVAR(lastIterationIndex) = 0; GVAR(lastIterationIndex) = 0;
}; };
_object = GVAR(objects) select GVAR(lastIterationIndex); _object = GVAR(objects) select GVAR(lastIterationIndex);
if(!isNil "_object") then { if(!isNil "_object") then {
_args = GVAR(arguments) select GVAR(lastIterationIndex); _args = GVAR(arguments) select GVAR(lastIterationIndex);
if(!(_args call FUNC(pfhRound))) then { if(!(_args call FUNC(pfhRound))) then {
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
}; };
}; };
_iter = _iter + 1; _iter = _iter + 1;
GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1; GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1;
}; };
// clean up dead object references // clean up dead object references
private["_deletionCount", "_deleteIndex"]; private["_deletionCount", "_deleteIndex"];
_deletionCount = 0; _deletionCount = 0;
{ {
TRACE_1("GC Projectile", _x); TRACE_1("GC Projectile", _x);
_deleteIndex = _x - _deletionCount; _deleteIndex = _x - _deletionCount;
GVAR(objects) deleteAt _deleteIndex; GVAR(objects) deleteAt _deleteIndex;
GVAR(arguments) deleteAt _deleteIndex; GVAR(arguments) deleteAt _deleteIndex;
_deletionCount = _deletionCount + 1; _deletionCount = _deletionCount + 1;
} forEach _gcIndex; } forEach _gcIndex;

View File

@ -1,50 +1,50 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; private ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
_round = _this select 0; _round = _this select 0;
_lastPos = _this select 1; _lastPos = _this select 1;
_lastVel = _this select 2; _lastVel = _this select 2;
_type = _this select 3; _type = _this select 3;
_firedFrame = _this select 4; _firedFrame = _this select 4;
_doSpall = _this select 6; _doSpall = _this select 6;
_spallTrack = _this select 7; _spallTrack = _this select 7;
_foundObjectHPIds = _this select 8; _foundObjectHPIds = _this select 8;
_skip = _this select 9; _skip = _this select 9;
_explosive = _this select 10; _explosive = _this select 10;
_indirectRange = _this select 11; _indirectRange = _this select 11;
_force = _this select 12; _force = _this select 12;
_fragPower = _this select 13; _fragPower = _this select 13;
if(_round in GVAR(blackList)) exitWith { if(_round in GVAR(blackList)) exitWith {
false false
}; };
if (!alive _round) exitWith { if (!alive _round) exitWith {
if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame
if(_skip == 0) then { if(_skip == 0) then {
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
[QGVAR(frag_eh), _this] call EFUNC(common,serverEvent); [QGVAR(frag_eh), _this] call EFUNC(common,serverEvent);
}; };
}; };
}; };
if(_doSpall) then { if(_doSpall) then {
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1; GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1;
// diag_log text format["F: %1", _foundObjectHPIds]; // diag_log text format["F: %1", _foundObjectHPIds];
{ {
if(!isNil "_x") then { if(!isNil "_x") then {
_x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex];
}; };
} forEach _spallTrack; } forEach _spallTrack;
}; };
false false
}; };
_this set[1, (getPosASL _round)]; _this set[1, (getPosASL _round)];
_this set[2, (velocity _round)]; _this set[2, (velocity _round)];
if(_doSpall) then { if(_doSpall) then {
private["_scale"]; private["_scale"];
_scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1; _scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1;
[_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
}; };
true true

View File

@ -1,11 +1,11 @@
#include "script_component.hpp" #include "script_component.hpp"
// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD // THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD
PARAMS_1(_round); PARAMS_1(_round);
if(_round in GVAR(blackList)) then { if(_round in GVAR(blackList)) then {
GVAR(blackList) = GVAR(blackList) - [_round]; GVAR(blackList) = GVAR(blackList) - [_round];
}; };
GVAR(objects) = GVAR(objects) - [_round]; GVAR(objects) = GVAR(objects) - [_round];

View File

@ -1,14 +1,14 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_ret"]; private ["_ret"];
_ret = true; _ret = true;
if(IS_ARRAY((_this select 0))) then { if(IS_ARRAY((_this select 0))) then {
_ret = false; _ret = false;
} else { } else {
if((_this select 0) in GVAR(trackedObjects)) then { if((_this select 0) in GVAR(trackedObjects)) then {
GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)]; GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)];
} else { } else {
_ret = false; _ret = false;
}; };
}; };
_ret _ret

View File

@ -1,29 +1,29 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"]; private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"];
//player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))]; //player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))];
if ((_this select 0) <= (count GVAR(spallHPData))) then { if ((_this select 0) <= (count GVAR(spallHPData))) then {
_initialData = GVAR(spallHPData) select (_this select 0); _initialData = GVAR(spallHPData) select (_this select 0);
if (!isNil "_initialData") then { if (!isNil "_initialData") then {
_hpRound = ((_this select 1) select 0) select 2; _hpRound = ((_this select 1) select 0) select 2;
_round = _initialData select 3; _round = _initialData select 3;
_hpDirect = ((_this select 1) select 0) select 10; _hpDirect = ((_this select 1) select 0) select 10;
if (_hpDirect && {_round == _hpRound}) then { if (_hpDirect && {_round == _hpRound}) then {
{ {
_hpData = _x; _hpData = _x;
_round = _initialData select 3; _round = _initialData select 3;
// diag_log text format["HPDUMP-------------------------------------"]; // diag_log text format["HPDUMP-------------------------------------"];
// { // {
// _hp = _x; // _hp = _x;
// diag_log text format["%1 --", _forEachIndex]; // diag_log text format["%1 --", _forEachIndex];
// { // {
// diag_log text format["%1: %2", _forEachIndex, _x]; // diag_log text format["%1: %2", _forEachIndex, _x];
// } forEach _hp; // } forEach _hp;
// } forEach (_this select 1); // } forEach (_this select 1);
[DFUNC(doSpall), [_this, _forEachIndex]] call EFUNC(common,execNextFrame); [DFUNC(doSpall), [_this, _forEachIndex]] call EFUNC(common,execNextFrame);
// player sideChat "WEEE"; // player sideChat "WEEE";
} forEach (_this select 1); } forEach (_this select 1);
}; };
}; };
}; };

View File

@ -1,32 +1,32 @@
//fnc_spallTrack.sqf //fnc_spallTrack.sqf
#include "script_component.hpp" #include "script_component.hpp"
private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"]; private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"];
_round = _this select 0; _round = _this select 0;
_multiplier = _this select 1; _multiplier = _this select 1;
_foundObjects = _this select 2; _foundObjects = _this select 2;
_foundObjectHPIds = _this select 3; _foundObjectHPIds = _this select 3;
_delta = (1/diag_fps) * _multiplier; _delta = (1/diag_fps) * _multiplier;
_curPos = getPosASL _round; _curPos = getPosASL _round;
_velocity = velocity _round; _velocity = velocity _round;
_velocityStep = _velocity vectorMultiply _delta; _velocityStep = _velocity vectorMultiply _delta;
_forwardPos = _curPos vectorAdd _velocityStep; _forwardPos = _curPos vectorAdd _velocityStep;
_intersectsWith = lineIntersectsWith [_curPos, _forwardPos]; _intersectsWith = lineIntersectsWith [_curPos, _forwardPos];
if (count _intersectsWith > 0) then { if (count _intersectsWith > 0) then {
// player sideChat format["inter: %1", _intersectsWith]; // player sideChat format["inter: %1", _intersectsWith];
{ {
if(!(_x in _foundObjects)) then { if(!(_x in _foundObjects)) then {
// diag_log text format["Adding HP: %1", _x]; // diag_log text format["Adding HP: %1", _x];
_index = (count GVAR(spallHPData)); _index = (count GVAR(spallHPData));
_hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; _hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]];
_foundObjects set[(count _foundObjects), _x]; _foundObjects set[(count _foundObjects), _x];
_foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; _foundObjectHPIds set[(count _foundObjectHPIds), _hpId];
_data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds];
GVAR(spallHPData) set[_index, _data]; GVAR(spallHPData) set[_index, _data];
}; };
} forEach _intersectsWith; } forEach _intersectsWith;
}; };

View File

@ -1,5 +1,5 @@
#include "script_component.hpp" #include "script_component.hpp"
if(!GVAR(tracesStarted)) then { if(!GVAR(tracesStarted)) then {
GVAR(tracesStarted) = true; GVAR(tracesStarted) = true;
GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler;
}; };

View File

@ -1,5 +1,5 @@
#include "script_component.hpp" #include "script_component.hpp"
if(GVAR(tracesStarted)) then { if(GVAR(tracesStarted)) then {
GVAR(tracesStarted) = false; GVAR(tracesStarted) = false;
[GVAR(traceID)] call CBA_fnc_removePerFrameHandler; [GVAR(traceID)] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -1,14 +1,14 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_params", "_tracerObj", "_index", "_positions", "_data"]; private ["_params", "_tracerObj", "_index", "_positions", "_data"];
_params = _this select 0; _params = _this select 0;
_tracerObj = _params select 0; _tracerObj = _params select 0;
_index = _params select 1; _index = _params select 1;
if (alive _tracerObj && (count GVAR(traces)) > 0) then { if (alive _tracerObj && (count GVAR(traces)) > 0) then {
_data = GVAR(traces) select _index; _data = GVAR(traces) select _index;
_positions = _data select 4; _positions = _data select 4;
_positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]]; _positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]];
} else { } else {
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
}; };

View File

@ -1,20 +1,20 @@
#define COMPONENT frag #define COMPONENT frag
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
//#define DEBUG_ENABLED_FRAG //#define DEBUG_ENABLED_FRAG
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE // #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS // #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS // #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_FRAG #ifdef DEBUG_ENABLED_FRAG
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_FRAG #ifdef DEBUG_SETTINGS_FRAG
#define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG
#endif #endif
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
#define ACE_TRACE_DRAW_INC 1 #define ACE_TRACE_DRAW_INC 1

View File

@ -1,67 +1,67 @@
//XEH_clientInit.sqf //XEH_clientInit.sqf
#include "script_component.hpp" #include "script_component.hpp"
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
GVAR(cachedBuildingTypes) = []; GVAR(cachedBuildingTypes) = [];
GVAR(cachedBuildingActionPairs) = []; GVAR(cachedBuildingActionPairs) = [];
GVAR(ParsedTextCached) = []; GVAR(ParsedTextCached) = [];
["SettingChanged", { ["SettingChanged", {
params ["_name"]; params ["_name"];
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then { if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
[] call FUNC(setupTextColors); [] call FUNC(setupTextColors);
}; };
}] call EFUNC(common,addEventhandler); }] call EFUNC(common,addEventhandler);
["SettingsInitialized", { ["SettingsInitialized", {
//Setup text/shadow/size/color settings matrix //Setup text/shadow/size/color settings matrix
[] call FUNC(setupTextColors); [] call FUNC(setupTextColors);
// Install the render EH on the main display // Install the render EH on the main display
addMissionEventHandler ["Draw3D", DFUNC(render)]; addMissionEventHandler ["Draw3D", DFUNC(render)];
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
//Add Actions to Houses: //Add Actions to Houses:
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler); ["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), ["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)),
{ {
// Statement // Statement
[0] call FUNC(keyDown) [0] call FUNC(keyDown)
},{[0,false] call FUNC(keyUp)}, },{[0,false] call FUNC(keyUp)},
[219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key [219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key
["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)), ["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)),
{ {
// Statement // Statement
[1] call FUNC(keyDown) [1] call FUNC(keyDown)
},{[1,false] call FUNC(keyUp)}, },{[1,false] call FUNC(keyUp)},
[219, [false, true, false]], false] call CBA_fnc_addKeybind; //Left Windows Key + Ctrl/Strg [219, [false, true, false]], false] call CBA_fnc_addKeybind; //Left Windows Key + Ctrl/Strg
// Listens for the falling unconscious event, just in case the menu needs to be closed // Listens for the falling unconscious event, just in case the menu needs to be closed
["medical_onUnconscious", { ["medical_onUnconscious", {
// If no menu is open just quit // If no menu is open just quit
if (GVAR(openedMenuType) < 0) exitWith {}; if (GVAR(openedMenuType) < 0) exitWith {};
params ["_unit", "_isUnconscious"]; params ["_unit", "_isUnconscious"];
if (_unit != ACE_player || !_isUnconscious) exitWith {}; if (_unit != ACE_player || !_isUnconscious) exitWith {};
GVAR(actionSelected) = false; GVAR(actionSelected) = false;
[GVAR(openedMenuType), false] call FUNC(keyUp); [GVAR(openedMenuType), false] call FUNC(keyUp);
}] call EFUNC(common,addEventhandler); }] call EFUNC(common,addEventhandler);
// disable firing while the interact menu is is is opened // disable firing while the interact menu is is is opened
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); ["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler);
// background options // background options
["interactMenuOpened", { ["interactMenuOpened", {
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);}; if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);};
if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];}; if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];};
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);
["interactMenuClosed", { ["interactMenuClosed", {
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);}; if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);};
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
}] call EFUNC(common,addEventHandler); }] call EFUNC(common,addEventHandler);

View File

@ -1,25 +1,25 @@
class Extended_PreStart_EventHandlers { class Extended_PreStart_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart)); init = QUOTE(call COMPILE_FILE(XEH_preStart));
}; };
}; };
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init)); init = QUOTE(call COMPILE_FILE(XEH_pre_init));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init)); init = QUOTE(call COMPILE_FILE(XEH_post_init));
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
}; };
}; };
class Extended_FiredBIS_EventHandlers { class Extended_FiredBIS_EventHandlers {
class All { class All {
ADDON = QUOTE(_this call FUNC(onFired)); ADDON = QUOTE(_this call FUNC(onFired));
}; };
}; };

View File

@ -1,13 +1,13 @@
class CfgSounds { class CfgSounds {
class ACE_Javelin_Locking { class ACE_Javelin_Locking {
name = "ACE_Javelin_Locking"; name = "ACE_Javelin_Locking";
sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0}; sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0};
titles[] = {}; titles[] = {};
}; };
class ACE_Javelin_Locked { class ACE_Javelin_Locked {
name = "ACE_Javelin_Locked"; name = "ACE_Javelin_Locked";
sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0}; sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0};
titles[] = {}; titles[] = {};
}; };
}; };

View File

@ -1,68 +1,68 @@
class CfgVehicles { class CfgVehicles {
class LandVehicle; class LandVehicle;
class StaticWeapon : LandVehicle { class StaticWeapon : LandVehicle {
class Turrets; class Turrets;
}; };
class StaticMGWeapon : StaticWeapon { class StaticMGWeapon : StaticWeapon {
class Turrets : Turrets { class Turrets : Turrets {
class MainTurret; class MainTurret;
}; };
}; };
class AT_01_base_F: StaticMGWeapon {}; class AT_01_base_F: StaticMGWeapon {};
class B_static_AT_F: AT_01_base_F { class B_static_AT_F: AT_01_base_F {
class Turrets : Turrets { class Turrets : Turrets {
class MainTurret : MainTurret { class MainTurret : MainTurret {
weapons[] = { QGVAR(Titan_Static) }; weapons[] = { QGVAR(Titan_Static) };
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
turretInfoType = "ACE_RscOptics_javelin"; turretInfoType = "ACE_RscOptics_javelin";
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
opticsZoomMin = 0.08333; opticsZoomMin = 0.08333;
opticsZoomMax = 0.04167; opticsZoomMax = 0.04167;
opticsZoomInit = 0.08333; opticsZoomInit = 0.08333;
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
opticsFlare = 0; opticsFlare = 0;
discretefov[] = {0.08333,0.04167}; discretefov[] = {0.08333,0.04167};
discreteInitIndex = 0; discreteInitIndex = 0;
}; };
}; };
}; };
class O_static_AT_F: AT_01_base_F { class O_static_AT_F: AT_01_base_F {
class Turrets : Turrets { class Turrets : Turrets {
class MainTurret : MainTurret { class MainTurret : MainTurret {
weapons[] = { QGVAR(Titan_Static) }; weapons[] = { QGVAR(Titan_Static) };
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
turretInfoType = "ACE_RscOptics_javelin"; turretInfoType = "ACE_RscOptics_javelin";
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
opticsZoomMin = 0.08333; opticsZoomMin = 0.08333;
opticsZoomMax = 0.04167; opticsZoomMax = 0.04167;
opticsZoomInit = 0.08333; opticsZoomInit = 0.08333;
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
opticsFlare = 0; opticsFlare = 0;
discretefov[] = {0.08333,0.04167}; discretefov[] = {0.08333,0.04167};
discreteInitIndex = 0; discreteInitIndex = 0;
}; };
}; };
}; };
class I_static_AT_F: AT_01_base_F { class I_static_AT_F: AT_01_base_F {
class Turrets : Turrets { class Turrets : Turrets {
class MainTurret : MainTurret { class MainTurret : MainTurret {
weapons[] = { QGVAR(Titan_Static) }; weapons[] = { QGVAR(Titan_Static) };
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
turretInfoType = "ACE_RscOptics_javelin"; turretInfoType = "ACE_RscOptics_javelin";
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
opticsZoomMin = 0.08333; opticsZoomMin = 0.08333;
opticsZoomMax = 0.04167; opticsZoomMax = 0.04167;
opticsZoomInit = 0.08333; opticsZoomInit = 0.08333;
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
opticsFlare = 0; opticsFlare = 0;
discretefov[] = {0.08333,0.04167}; discretefov[] = {0.08333,0.04167};
discreteInitIndex = 0; discreteInitIndex = 0;
}; };
}; };
}; };
}; };

View File

@ -1,72 +1,72 @@
class CfgWeapons { class CfgWeapons {
class Launcher; class Launcher;
class MissileLauncher; class MissileLauncher;
class Launcher_Base_F : Launcher { class Launcher_Base_F : Launcher {
class WeaponSlotsInfo; class WeaponSlotsInfo;
}; };
// @TODO: AA by default, motherfuckers // @TODO: AA by default, motherfuckers
class missiles_titan : MissileLauncher { class missiles_titan : MissileLauncher {
}; };
class missiles_titan_at : missiles_titan { }; class missiles_titan_at : missiles_titan { };
class GVAR(Titan_Static) : missiles_titan_at { class GVAR(Titan_Static) : missiles_titan_at {
GVAR(enabled) = 1; GVAR(enabled) = 1;
weaponInfoType = "ACE_RscOptics_javelin"; weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d); modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0; canLock = 0;
magazines[] = {"1Rnd_GAT_missiles"}; magazines[] = {"1Rnd_GAT_missiles"};
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
// @TODO: AA by default, motherfuckers // @TODO: AA by default, motherfuckers
class launch_Titan_base : Launcher_Base_F {}; class launch_Titan_base : Launcher_Base_F {};
class launch_Titan_short_base : launch_Titan_base { }; class launch_Titan_short_base : launch_Titan_base { };
class launch_B_Titan_short_F: launch_Titan_short_base { class launch_B_Titan_short_F: launch_Titan_short_base {
GVAR(enabled) = 1; GVAR(enabled) = 1;
weaponInfoType = "ACE_RscOptics_javelin"; weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d); modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0; canLock = 0;
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
class launch_I_Titan_short_F: launch_Titan_short_base { class launch_I_Titan_short_F: launch_Titan_short_base {
GVAR(enabled) = 1; GVAR(enabled) = 1;
weaponInfoType = "ACE_RscOptics_javelin"; weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d); modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0; canLock = 0;
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
class launch_O_Titan_short_F: launch_Titan_short_base { class launch_O_Titan_short_F: launch_Titan_short_base {
GVAR(enabled) = 1; GVAR(enabled) = 1;
weaponInfoType = "ACE_RscOptics_javelin"; weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d); modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0; canLock = 0;
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
class launch_Titan_short_F: launch_Titan_short_base { class launch_Titan_short_F: launch_Titan_short_base {
GVAR(enabled) = 1; GVAR(enabled) = 1;
weaponInfoType = "ACE_RscOptics_javelin"; weaponInfoType = "ACE_RscOptics_javelin";
modelOptics = PATHTOF(data\reticle_titan.p3d); modelOptics = PATHTOF(data\reticle_titan.p3d);
canLock = 0; canLock = 0;
lockingTargetSound[] = {"",0,1}; lockingTargetSound[] = {"",0,1};
lockedTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1};
}; };
}; };

View File

@ -1,454 +1,454 @@
class RscOpticsValue; class RscOpticsValue;
class RscControlsGroup; class RscControlsGroup;
class RscPicture; class RscPicture;
class RscMapControl; class RscMapControl;
class VScrollbar; class VScrollbar;
class HScrollbar; class HScrollbar;
class RscLine; class RscLine;
// Taken from AGM for optics management. // Taken from AGM for optics management.
class RscInGameUI { class RscInGameUI {
class ACE_RscOptics_javelin { class ACE_RscOptics_javelin {
idd = 300; idd = 300;
controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"}; controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"};
onLoad = QUOTE(_this call FUNC(onOpticLoad)); onLoad = QUOTE(_this call FUNC(onOpticLoad));
onUnload = QUOTE(_this call FUNC(onOpticUnload)); onUnload = QUOTE(_this call FUNC(onOpticUnload));
class ACE_javelin_elements_group: RscControlsGroup class ACE_javelin_elements_group: RscControlsGroup
{ {
x = "SafezoneX"; x = "SafezoneX";
y = "SafezoneY"; y = "SafezoneY";
w = "SafezoneW"; w = "SafezoneW";
h = "SafezoneH"; h = "SafezoneH";
idc = 170; idc = 170;
class VScrollbar { class VScrollbar {
autoScrollSpeed = -1; autoScrollSpeed = -1;
autoScrollDelay = 5; autoScrollDelay = 5;
autoScrollRewind = 0; autoScrollRewind = 0;
color[] = {1,1,1,0}; color[] = {1,1,1,0};
width = 0.001; width = 0.001;
}; };
class HScrollbar { class HScrollbar {
color[] = {1,1,1,0}; color[] = {1,1,1,0};
height = 0.001; height = 0.001;
}; };
class Controls { class Controls {
class CA_Distance: RscOpticsValue { class CA_Distance: RscOpticsValue {
idc = 151; idc = 151;
sizeEx = "0"; sizeEx = "0";
colorText[] = {0,0,0,0}; colorText[] = {0,0,0,0};
x = 0; x = 0;
y = 0; y = 0;
w = 0; w = 0;
h = 0; h = 0;
}; };
class ACE_javelin_Day_mode_off: RscPicture { class ACE_javelin_Day_mode_off: RscPicture {
idc = 1001; idc = 1001;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX";
y = "SafezoneY+SafezoneH*0.031 - SafezoneY"; y = "SafezoneY+SafezoneH*0.031 - SafezoneY";
w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
h = "SafezoneH*0.1045752"; h = "SafezoneH*0.1045752";
colorText[] = {0.2941,0.2941,0.2941,1}; colorText[] = {0.2941,0.2941,0.2941,1};
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa";
}; };
class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off { class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off {
idc = 160; idc = 160;
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class CA_Javelin_WFOV_mode_off : ACE_javelin_Day_mode_off { class CA_Javelin_WFOV_mode_off : ACE_javelin_Day_mode_off {
idc = 1004; idc = 1004;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.307/4)*3*SafezoneH - SafezoneX";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\wfov_co.paa";
}; };
class ACE_javelin_WFOV_mode_group: RscControlsGroup { class ACE_javelin_WFOV_mode_group: RscControlsGroup {
x = "SafezoneX"; x = "SafezoneX";
y = "SafezoneY"; y = "SafezoneY";
w = "SafezoneW"; w = "SafezoneW";
h = "SafezoneH"; h = "SafezoneH";
idc = 163; idc = 163;
class VScrollbar { class VScrollbar {
autoScrollSpeed = -1; autoScrollSpeed = -1;
autoScrollDelay = 5; autoScrollDelay = 5;
autoScrollRewind = 0; autoScrollRewind = 0;
color[] = {1,1,1,0}; color[] = {1,1,1,0};
width = 0.001; width = 0.001;
}; };
class HScrollbar { class HScrollbar {
color[] = {1,1,1,0}; color[] = {1,1,1,0};
height = 0.001; height = 0.001;
}; };
class Controls { class Controls {
class StadiaL: RscLine { class StadiaL: RscLine {
x = "0.4899*SafezoneW - SafezoneX"; x = "0.4899*SafezoneW - SafezoneX";
y = "0.171*SafezoneH - SafezoneY"; y = "0.171*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.049*SafezoneH"; h = "0.049*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class StadiaR: RscLine { class StadiaR: RscLine {
x = "0.5109*SafezoneW- SafezoneX"; x = "0.5109*SafezoneW- SafezoneX";
y = "0.171*SafezoneH - SafezoneY"; y = "0.171*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.049*SafezoneH"; h = "0.049*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class BracketL: RscLine { class BracketL: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX";
y = "0.4677*SafezoneH - SafezoneY"; y = "0.4677*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.0646*SafezoneH"; h = "0.0646*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class BracketR: RscLine { class BracketR: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX";
y = "0.4677*SafezoneH - SafezoneY"; y = "0.4677*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.0646*SafezoneH"; h = "0.0646*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class BracketT: RscLine { class BracketT: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
y = "0.3535*SafezoneH - SafezoneY"; y = "0.3535*SafezoneH - SafezoneY";
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
h = 0; h = 0;
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class BracketB: RscLine { class BracketB: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
y = "0.6465*SafezoneH - SafezoneY"; y = "0.6465*SafezoneH - SafezoneY";
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
h = 0; h = 0;
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
}; };
}; };
class CA_Javelin_NFOV_mode_off: ACE_javelin_Day_mode_off { class CA_Javelin_NFOV_mode_off: ACE_javelin_Day_mode_off {
idc = 1003; idc = 1003;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.586/4)*3*SafezoneH - SafezoneX";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\nfov_co.paa";
}; };
class ACE_javelin_NFOV_mode_group: RscControlsGroup { class ACE_javelin_NFOV_mode_group: RscControlsGroup {
x = "SafezoneX"; x = "SafezoneX";
y = "SafezoneY"; y = "SafezoneY";
w = "SafezoneW-SafezoneX"; w = "SafezoneW-SafezoneX";
h = "SafezoneH-SafezoneY"; h = "SafezoneH-SafezoneY";
idc = 162; idc = 162;
class VScrollbar { class VScrollbar {
autoScrollSpeed = -1; autoScrollSpeed = -1;
autoScrollDelay = 5; autoScrollDelay = 5;
autoScrollRewind = 0; autoScrollRewind = 0;
color[] = {1,1,1,0}; color[] = {1,1,1,0};
width = 0.001; width = 0.001;
}; };
class HScrollbar { class HScrollbar {
color[] = {1,1,1,0}; color[] = {1,1,1,0};
height = 0.001; height = 0.001;
}; };
class Controls { class Controls {
class StadiaL: RscLine { class StadiaL: RscLine {
x = "0.4788*SafezoneW - SafezoneX"; x = "0.4788*SafezoneW - SafezoneX";
y = "0.171*SafezoneH - SafezoneY"; y = "0.171*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.049*SafezoneH"; h = "0.049*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class StadiaR: RscLine { class StadiaR: RscLine {
x = "0.5212*SafezoneW - SafezoneX"; x = "0.5212*SafezoneW - SafezoneX";
y = "0.171*SafezoneH - SafezoneY"; y = "0.171*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.049*SafezoneH"; h = "0.049*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class LineHL: RscLine { class LineHL: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX";
y = "SafezoneH*0.5 - SafezoneY"; y = "SafezoneH*0.5 - SafezoneY";
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
h = "SafezoneH*0.0"; h = "SafezoneH*0.0";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class LineHR: RscLine { class LineHR: RscLine {
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX"; x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX";
y = "SafezoneH*0.5 - SafezoneY"; y = "SafezoneH*0.5 - SafezoneY";
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)"; w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
h = "SafezoneH*0.0"; h = "SafezoneH*0.0";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class LineVT: RscLine { class LineVT: RscLine {
x = "0.5*SafezoneW - SafezoneX"; x = "0.5*SafezoneW - SafezoneX";
y = "0.171*SafezoneH - SafezoneY"; y = "0.171*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.1825*SafezoneH"; h = "0.1825*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class LineVB: RscLine { class LineVB: RscLine {
x = "0.5*SafezoneW - SafezoneX"; x = "0.5*SafezoneW - SafezoneX";
y = "0.6465*SafezoneH - SafezoneY"; y = "0.6465*SafezoneH - SafezoneY";
w = 0; w = 0;
h = "0.1895*SafezoneH"; h = "0.1895*SafezoneH";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
}; };
}; };
class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off { class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off {
idc = 699000; idc = 699000;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.863/4)*3*SafezoneH - SafezoneX";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\seek_co.paa";
}; };
class ACE_javelin_SEEK: ACE_javelin_SEEK_off { class ACE_javelin_SEEK: ACE_javelin_SEEK_off {
idc = 166; idc = 166;
colorText[] = {0.2941,0.8745,0.2157,0}; colorText[] = {0.2941,0.8745,0.2157,0};
}; };
class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off { class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off {
idc = 1032; idc = 1032;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX";
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
colorText[] = {0.2941,0.2941,0.2941,1}; colorText[] = {0.2941,0.2941,0.2941,1};
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa";
}; };
class ACE_javelin_Missle: ACE_javelin_Missle_off { class ACE_javelin_Missle: ACE_javelin_Missle_off {
idc = 167; idc = 167;
colorText[] = {0.9255,0.5216,0.1216,0}; colorText[] = {0.9255,0.5216,0.1216,0};
}; };
class ACE_javelin_CLU_off: ACE_javelin_Missle_off { class ACE_javelin_CLU_off: ACE_javelin_Missle_off {
idc = 1027; idc = 1027;
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa";
}; };
class ACE_javelin_HangFire_off: ACE_javelin_Missle_off { class ACE_javelin_HangFire_off: ACE_javelin_Missle_off {
idc = 1028; idc = 1028;
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa";
}; };
class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off { class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off {
idc = 699001; idc = 699001;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa";
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
class ACE_javelin_DIR: ACE_javelin_Day_mode { class ACE_javelin_DIR: ACE_javelin_Day_mode {
idc = 699002; idc = 699002;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa";
colorText[] = {0.2941,0.2941,0.2941,1}; colorText[] = {0.2941,0.2941,0.2941,1};
}; };
class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off { class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off {
idc = 1002; idc = 1002;
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX"; x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY"; y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa";
}; };
class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off { class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off {
idc = 161; idc = 161;
colorText[] = {0.2941,0.8745,0.2157,1}; colorText[] = {0.2941,0.8745,0.2157,1};
}; };
}; };
}; };
class ACE_Targeting : RscControlsGroup { class ACE_Targeting : RscControlsGroup {
idc = 6999; idc = 6999;
x = "SafezoneX"; x = "SafezoneX";
y = "SafezoneY"; y = "SafezoneY";
w = "SafezoneW"; w = "SafezoneW";
h = "SafezoneH"; h = "SafezoneH";
enabled = 0; enabled = 0;
class Controls { class Controls {
class ACE_TargetingConstrains: RscControlsGroup { class ACE_TargetingConstrains: RscControlsGroup {
x = "SafezoneX"; x = "SafezoneX";
y = "SafezoneY"; y = "SafezoneY";
w = "SafezoneW-SafezoneX"; w = "SafezoneW-SafezoneX";
h = "SafezoneH-SafezoneY"; h = "SafezoneH-SafezoneY";
enabled = 0; enabled = 0;
class VScrollbar { class VScrollbar {
autoScrollSpeed = -1; autoScrollSpeed = -1;
autoScrollDelay = 5; autoScrollDelay = 5;
autoScrollRewind = 0; autoScrollRewind = 0;
color[] = {1,1,1,0}; color[] = {1,1,1,0};
width = 0.001; width = 0.001;
}; };
class HScrollbar { class HScrollbar {
color[] = {1,1,1,0}; color[] = {1,1,1,0};
height = 0.001; height = 0.001;
}; };
class Controls { class Controls {
class Top: RscPicture { class Top: RscPicture {
idc = 699101; idc = 699101;
text = "#(argb,8,8,3)color(1,1,1,1)"; text = "#(argb,8,8,3)color(1,1,1,1)";
colorText[] = {0.2941,0.2941,0.2941,1}; colorText[] = {0.2941,0.2941,0.2941,1};
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
y = "0.15*SafezoneH-SafezoneY"; y = "0.15*SafezoneH-SafezoneY";
w = "(3/4)*SafezoneH"; w = "(3/4)*SafezoneH";
h = "0.21*SafezoneH"; h = "0.21*SafezoneH";
}; };
class Bottom: Top { class Bottom: Top {
idc = 699102; idc = 699102;
y = "0.64*SafezoneH-SafezoneY"; y = "0.64*SafezoneH-SafezoneY";
}; };
class Left: Top { class Left: Top {
idc = 699103; idc = 699103;
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
y = "0.36*SafezoneH-SafezoneY"; y = "0.36*SafezoneH-SafezoneY";
w = "0.31*(3/4)*SafezoneH"; w = "0.31*(3/4)*SafezoneH";
h = "0.28*SafezoneH"; h = "0.28*SafezoneH";
}; };
class Right: Left { class Right: Left {
idc = 699104; idc = 699104;
x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX";
}; };
class OpticsBorders: RscPicture { class OpticsBorders: RscPicture {
idc = 699105; idc = 699105;
text = PATHTOF(data\javelin_ui_border_ca.paa); text = PATHTOF(data\javelin_ui_border_ca.paa);
colorText[] = {0,0,0,1}; colorText[] = {0,0,0,1};
x = "((SafezoneW -(3.1/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3.1/4)*SafezoneH)/2) - SafezoneX";
y = "0.15*SafezoneH-SafezoneY"; y = "0.15*SafezoneH-SafezoneY";
w = "(3.1/4)*SafezoneH"; w = "(3.1/4)*SafezoneH";
h = "0.7*SafezoneH"; h = "0.7*SafezoneH";
}; };
}; };
}; };
class ACE_TargetingGate : ACE_TargetingConstrains { class ACE_TargetingGate : ACE_TargetingConstrains {
idc = 699200; idc = 699200;
class Controls { class Controls {
class TargetingGateTL: ACE_TargetingConstrains { class TargetingGateTL: ACE_TargetingConstrains {
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
y = "0.15*SafezoneH - SafezoneY"; y = "0.15*SafezoneH - SafezoneY";
idc = 699201; idc = 699201;
class Controls { class Controls {
class LineH: RscLine { class LineH: RscLine {
idc = 699210; idc = 699210;
x = "0"; x = "0";
y = "0"; y = "0";
w = "0.025*(3/4)*SafezoneH"; w = "0.025*(3/4)*SafezoneH";
h = "0"; h = "0";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
class LineV: LineH { class LineV: LineH {
idc = 699211; idc = 699211;
w = "0"; w = "0";
h = "0.025*SafezoneH"; h = "0.025*SafezoneH";
}; };
}; };
}; };
class TargetingGateTR: TargetingGateTL { class TargetingGateTR: TargetingGateTL {
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
y = "0.15*SafezoneH - SafezoneY"; y = "0.15*SafezoneH - SafezoneY";
idc = 699202; idc = 699202;
class Controls { class Controls {
class LineH: RscLine { class LineH: RscLine {
idc = 699220; idc = 699220;
x = "0"; x = "0";
y = "0"; y = "0";
w = "0.025*(3/4)*SafezoneH"; w = "0.025*(3/4)*SafezoneH";
h = "0"; h = "0";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
class LineV: LineH { class LineV: LineH {
idc = 699221; idc = 699221;
x = "0.025*(3/4)*SafezoneH"; x = "0.025*(3/4)*SafezoneH";
w = "0"; w = "0";
h = "0.025*SafezoneH"; h = "0.025*SafezoneH";
}; };
}; };
}; };
class TargetingGateBL: TargetingGateTL { class TargetingGateBL: TargetingGateTL {
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
y = "0.825*SafezoneH - SafezoneY"; y = "0.825*SafezoneH - SafezoneY";
idc = 699203; idc = 699203;
class Controls { class Controls {
class LineH: RscLine { class LineH: RscLine {
x = "0"; x = "0";
y = "0.025*SafezoneH"; y = "0.025*SafezoneH";
w = "0.025*(3/4)*SafezoneH"; w = "0.025*(3/4)*SafezoneH";
h = "0"; h = "0";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
class LineV: LineH { class LineV: LineH {
y = "0"; y = "0";
w = "0"; w = "0";
h = "0.025*SafezoneH"; h = "0.025*SafezoneH";
}; };
}; };
}; };
class TargetingGateBR: TargetingGateBL { class TargetingGateBR: TargetingGateBL {
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
y = "0.825*SafezoneH - SafezoneY"; y = "0.825*SafezoneH - SafezoneY";
idc = 699204; idc = 699204;
class Controls { class Controls {
class LineH: RscLine { class LineH: RscLine {
x = "0"; x = "0";
y = "0.025*SafezoneH"; y = "0.025*SafezoneH";
w = "0.025*(3/4)*SafezoneH"; w = "0.025*(3/4)*SafezoneH";
h = "0"; h = "0";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
class LineV: LineH { class LineV: LineH {
x = "0.025*(3/4)*SafezoneH"; x = "0.025*(3/4)*SafezoneH";
y = "0"; y = "0";
w = "0"; w = "0";
h = "0.025*SafezoneH"; h = "0.025*SafezoneH";
}; };
}; };
}; };
}; };
}; };
class ACE_TargetingLines: ACE_TargetingConstrains { class ACE_TargetingLines: ACE_TargetingConstrains {
idc = 699300; idc = 699300;
class Controls { class Controls {
class LineH: RscLine { class LineH: RscLine {
idc = 699301; idc = 699301;
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX"; x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
y = "0.5*SafezoneH - SafezoneY"; y = "0.5*SafezoneH - SafezoneY";
w = "(3/4)*SafezoneH"; w = "(3/4)*SafezoneH";
h = "0"; h = "0";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
class LineV: RscLine { class LineV: RscLine {
idc = 699302; idc = 699302;
x = "0.5*SafezoneW - SafezoneX"; x = "0.5*SafezoneW - SafezoneX";
y = "0.15*SafezoneH - SafezoneY"; y = "0.15*SafezoneH - SafezoneY";
w = "0"; w = "0";
h = "0.7*SafezoneH"; h = "0.7*SafezoneH";
colorText[] = {0.8745,0.8745,0.8745,1}; colorText[] = {0.8745,0.8745,0.8745,1};
}; };
}; };
}; };
}; };
}; };
}; };
}; };
// on colorText[] = {0.2941, 0.8745, 0.2157, 1.0}; // on colorText[] = {0.2941, 0.8745, 0.2157, 1.0};
// off colorText[] = {0.2941, 0.2941, 0.2941, 1.0}; // off colorText[] = {0.2941, 0.2941, 0.2941, 1.0};
// orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0}; // orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0};
/* /*
ACE_Titan_elements_group: 170 ACE_Titan_elements_group: 170
ACE_Titan_Day_mode_off: 1001 ACE_Titan_Day_mode_off: 1001
ACE_Titan_Day_mode: 160 ACE_Titan_Day_mode: 160
ACE_Titan_WFOV_mode_off: 1004 ACE_Titan_WFOV_mode_off: 1004
ACE_Titan_WFOV_mode_group: 163 ACE_Titan_WFOV_mode_group: 163
ACE_Titan_NFOV_mode_off: 1003 ACE_Titan_NFOV_mode_off: 1003
ACE_Titan_NFOV_mode_group: 162 ACE_Titan_NFOV_mode_group: 162
ACE_Titan_SEEK_off: 1005 //1001 ACE_Titan_SEEK_off: 1005 //1001
ACE_Titan_SEEK: 166 ACE_Titan_SEEK: 166
ACE_Titan_Missle_off: 1032 ACE_Titan_Missle_off: 1032
ACE_Titan_Missle: 167 ACE_Titan_Missle: 167
ACE_Titan_CLU_off: 1027 ACE_Titan_CLU_off: 1027
ACE_Titan_HangFire_off: 1028 ACE_Titan_HangFire_off: 1028
ACE_Titan_TOP_off: 1006 ACE_Titan_TOP_off: 1006
ACE_Titan_DIR: 1007 ACE_Titan_DIR: 1007
ACE_Titan_FLTR_mode_off: 1002 ACE_Titan_FLTR_mode_off: 1002
ACE_Titan_FLTR_mode: 161 ACE_Titan_FLTR_mode: 161
*/ */

View File

@ -1,5 +1,5 @@
#include "script_component.hpp" #include "script_component.hpp"
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
#include "initKeybinds.sqf" #include "initKeybinds.sqf"

View File

@ -1,2 +1,2 @@
#include "script_component.hpp" #include "script_component.hpp"

View File

@ -1,10 +1,10 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false; ADDON = false;
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
GVAR(isLockKeyDown) = false; GVAR(isLockKeyDown) = false;
GVAR(pfehID) = -1; GVAR(pfehID) = -1;
ADDON = true; ADDON = true;

View File

@ -1,18 +1,18 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_main", "ace_common", "ace_missileguidance" }; requiredAddons[] = { "ace_main", "ace_common", "ace_missileguidance" };
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"
#include "RscInGameUI.hpp" #include "RscInGameUI.hpp"
#include "CfgSounds.hpp" #include "CfgSounds.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgMagazines.hpp" #include "CfgMagazines.hpp"

View File

@ -1,13 +1,13 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
private["_player", "_currentFireMode"]; private["_player", "_currentFireMode"];
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; _currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
if(_currentFireMode == "JAV_DIR") then { if(_currentFireMode == "JAV_DIR") then {
_currentFireMode = "JAV_TOP"; _currentFireMode = "JAV_TOP";
} else { } else {
_currentFireMode = "JAV_DIR"; _currentFireMode = "JAV_DIR";
}; };
ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false]; ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false];

View File

@ -1,3 +1,3 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);

View File

@ -1,3 +1,3 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);

View File

@ -1,17 +1,17 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
PARAMS_2(_shooter,_weapon); PARAMS_2(_shooter,_weapon);
// Bail on not missile or javelin PFEH not running // Bail on not missile or javelin PFEH not running
if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false }; if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false };
private ["_configs"]; private ["_configs"];
_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; _configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {}; if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {};
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false;

View File

@ -1,313 +1,313 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
#define __TRACKINTERVAL 0 // how frequent the check should be. #define __TRACKINTERVAL 0 // how frequent the check should be.
#define __LOCKONTIME 3 // Lock on won't occur sooner #define __LOCKONTIME 3 // Lock on won't occur sooner
private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"];
private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"];
private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"];
private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"];
private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"];
_currentShooter = (vehicle ACE_player); _currentShooter = (vehicle ACE_player);
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
// Reset arguments if we havnt rendered in over a second // Reset arguments if we havnt rendered in over a second
_args = uiNamespace getVariable[QGVAR(arguments), [] ]; _args = uiNamespace getVariable[QGVAR(arguments), [] ];
if( (count _args) > 0) then { if( (count _args) > 0) then {
_lastTick = _args select 0; _lastTick = _args select 0;
if(ACE_diagTime - _lastTick > 1) then { if(ACE_diagTime - _lastTick > 1) then {
[] call FUNC(onOpticLoad); [] call FUNC(onOpticLoad);
}; };
}; };
TRACE_1("Running", "Running"); TRACE_1("Running", "Running");
// Pull the arguments // Pull the arguments
_currentTarget = _args select 1; _currentTarget = _args select 1;
_runTime = _args select 2; _runTime = _args select 2;
_lockTime = _args select 3; _lockTime = _args select 3;
_soundTime = _args select 4; _soundTime = _args select 4;
_randomLockInterval = _args select 5; _randomLockInterval = _args select 5;
_fireDisabledEH = _args select 6; _fireDisabledEH = _args select 6;
private["_ammo", "_magazineConfig", "_weaponConfig"]; private["_ammo", "_magazineConfig", "_weaponConfig"];
_weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; _weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
_magazineConfig = if ((currentMagazine _currentShooter) != "") then { _magazineConfig = if ((currentMagazine _currentShooter) != "") then {
_ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo"); _ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo");
configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false]; configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false];
} else { } else {
[] []
}; };
//If weapon does not have "javelin enabled", then exit PFEH //If weapon does not have "javelin enabled", then exit PFEH
if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith { if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith {
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false;
if(!isNil "_fireDisabledEH") then { if(!isNil "_fireDisabledEH") then {
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
}; };
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
GVAR(pfehID) = -1; GVAR(pfehID) = -1;
}; };
// Find a target within the optic range // Find a target within the optic range
_newTarget = objNull; _newTarget = objNull;
// Bail on fast movement // Bail on fast movement
if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady.
ACE_player switchCamera "INTERNAL"; ACE_player switchCamera "INTERNAL";
if (player != ACE_player) then { if (player != ACE_player) then {
TRACE_2("Zeus, manually reseting RC after switchCamera",player,ACE_player); TRACE_2("Zeus, manually reseting RC after switchCamera",player,ACE_player);
player remoteControl ACE_player; player remoteControl ACE_player;
}; };
}; };
// Refresh the firemode // Refresh the firemode
[] call FUNC(showFireMode); [] call FUNC(showFireMode);
_ammo = _currentShooter ammo (currentWeapon _currentShooter); _ammo = _currentShooter ammo (currentWeapon _currentShooter);
// not loaded or not "javelin enabled" for magazine, hide targeting and enable firing // not loaded or not "javelin enabled" for magazine, hide targeting and enable firing
if ((_ammo == 0) || {(count _magazineConfig) < 1} || {(getNumber ((_magazineConfig select 0) >> "enabled")) != 1}) exitWith { if ((_ammo == 0) || {(count _magazineConfig) < 1} || {(getNumber ((_magazineConfig select 0) >> "enabled")) != 1}) exitWith {
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false;
if(!isNil "_fireDisabledEH") then { if(!isNil "_fireDisabledEH") then {
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
}; };
}; };
_range = parseNumber (ctrlText __JavelinIGUIRangefinder); _range = parseNumber (ctrlText __JavelinIGUIRangefinder);
TRACE_1("Viewing range", _range); TRACE_1("Viewing range", _range);
if (_range > 50 && {_range < 2500}) then { if (_range > 50 && {_range < 2500}) then {
_pos = positionCameraToWorld [0,0,_range]; _pos = positionCameraToWorld [0,0,_range];
_targetArray = _pos nearEntities ["AllVehicles", _range/100]; _targetArray = _pos nearEntities ["AllVehicles", _range/100];
TRACE_1("Searching at range", _targetArray); TRACE_1("Searching at range", _targetArray);
if (count (_targetArray) > 0) then { if (count (_targetArray) > 0) then {
_newTarget = _targetArray select 0; _newTarget = _targetArray select 0;
}; };
}; };
if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then { if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then {
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1]; private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1];
if (_intersectionsToCursorTarget isEqualTo []) then { if (_intersectionsToCursorTarget isEqualTo []) then {
_newTarget = cursorObject; _newTarget = cursorObject;
}; };
}; };
if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then { if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then {
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1]; private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1];
if (_intersectionsToCursorTarget isEqualTo []) then { if (_intersectionsToCursorTarget isEqualTo []) then {
_newTarget = cursorTarget; _newTarget = cursorTarget;
}; };
}; };
// Create constants // Create constants
_constraintTop = __ConstraintTop; _constraintTop = __ConstraintTop;
_constraintLeft = __ConstraintLeft; _constraintLeft = __ConstraintLeft;
_constraintBottom = __ConstraintBottom; _constraintBottom = __ConstraintBottom;
_constraintRight = __ConstraintRight; _constraintRight = __ConstraintRight;
_offsetX = __OffsetX; _offsetX = __OffsetX;
_offsetY = __OffsetY; _offsetY = __OffsetY;
__JavelinIGUITargeting ctrlShow true; __JavelinIGUITargeting ctrlShow true;
__JavelinIGUITargetingConstrains ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow true;
_zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selectionPosition "body"} else {_currentTarget selectionPosition "zamerny"}; _zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selectionPosition "body"} else {_currentTarget selectionPosition "zamerny"};
_randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; _randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)];
_apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); _apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds);
_aposX = 0; _aposX = 0;
_aposY = 0; _aposY = 0;
if (count _apos < 2) then { if (count _apos < 2) then {
_aposX = 1; _aposX = 1;
_aposY = 0; _aposY = 0;
} else { } else {
_aposX = (_apos select 0) + _offsetX; _aposX = (_apos select 0) + _offsetX;
_aposY = (_apos select 1) + _offsetY; _aposY = (_apos select 1) + _offsetY;
}; };
if((call CBA_fnc_getFoV) select 1 > 9) then { if((call CBA_fnc_getFoV) select 1 > 9) then {
__JavelinIGUINFOV ctrlSetTextColor __ColorGreen; __JavelinIGUINFOV ctrlSetTextColor __ColorGreen;
__JavelinIGUIWFOV ctrlSetTextColor __ColorGray; __JavelinIGUIWFOV ctrlSetTextColor __ColorGray;
} else { } else {
__JavelinIGUINFOV ctrlSetTextColor __ColorGray; __JavelinIGUINFOV ctrlSetTextColor __ColorGray;
__JavelinIGUIWFOV ctrlSetTextColor __ColorGreen; __JavelinIGUIWFOV ctrlSetTextColor __ColorGreen;
}; };
FUNC(disableFire) = { FUNC(disableFire) = {
_firedEH = _this select 0; _firedEH = _this select 0;
if(_firedEH < 0 && difficulty > 0) then { if(_firedEH < 0 && difficulty > 0) then {
_firedEH = [ACE_player, "DefaultAction", {true}, { _firedEH = [ACE_player, "DefaultAction", {true}, {
_canFire = (_this select 1) getVariable["ace_missileguidance_target", nil]; _canFire = (_this select 1) getVariable["ace_missileguidance_target", nil];
if(!isNil "_canFire") exitWith { false }; if(!isNil "_canFire") exitWith { false };
true true
}] call EFUNC(common,addActionEventHandler); }] call EFUNC(common,addActionEventHandler);
}; };
_firedEH _firedEH
}; };
FUNC(enableFire) = { FUNC(enableFire) = {
_firedEH = _this select 0; _firedEH = _this select 0;
if(_firedEH > 0 && difficulty > 0) then { if(_firedEH > 0 && difficulty > 0) then {
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler); [ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
}; };
-1 -1
}; };
if (isNull _newTarget) then { if (isNull _newTarget) then {
// No targets found // No targets found
_currentTarget = objNull; _currentTarget = objNull;
_lockTime = 0; _lockTime = 0;
__JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUISeek ctrlSetTextColor __ColorGray;
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false;
_currentShooter setVariable ["ace_missileguidance_target",nil, false]; _currentShooter setVariable ["ace_missileguidance_target",nil, false];
// Disallow fire // Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
} else { } else {
_fov = [] call CBA_fnc_getFoV; _fov = [] call CBA_fnc_getFoV;
TRACE_1("FOV", _fov); TRACE_1("FOV", _fov);
if (_newTarget distance ACE_player < 2500 if (_newTarget distance ACE_player < 2500
&& {(call CBA_fnc_getFoV) select 1 > 9} && {(call CBA_fnc_getFoV) select 1 > 9}
&& { (currentVisionMode ACE_player == 2)} && { (currentVisionMode ACE_player == 2)}
&& GVAR(isLockKeyDown) && GVAR(isLockKeyDown)
) then { ) then {
// Lock on after 3 seconds // Lock on after 3 seconds
if(_currentTarget != _newTarget) then { if(_currentTarget != _newTarget) then {
TRACE_1("New Target, reseting locking", _newTarget); TRACE_1("New Target, reseting locking", _newTarget);
_lockTime = ACE_diagTime; _lockTime = ACE_diagTime;
_currentTarget = _newTarget; _currentTarget = _newTarget;
playSound "ACE_Javelin_Locking"; playSound "ACE_Javelin_Locking";
} else { } else {
if(ACE_diagTime - _lockTime > __LOCKONTIME + _randomLockInterval) then { if(ACE_diagTime - _lockTime > __LOCKONTIME + _randomLockInterval) then {
TRACE_2("LOCKED!", _currentTarget, _lockTime); TRACE_2("LOCKED!", _currentTarget, _lockTime);
__JavelinIGUISeek ctrlSetTextColor __ColorGreen; __JavelinIGUISeek ctrlSetTextColor __ColorGreen;
__JavelinIGUITargeting ctrlShow true; __JavelinIGUITargeting ctrlShow true;
__JavelinIGUITargetingConstrains ctrlShow false; __JavelinIGUITargetingConstrains ctrlShow false;
__JavelinIGUITargetingGate ctrlShow true; __JavelinIGUITargetingGate ctrlShow true;
__JavelinIGUITargetingLines ctrlShow true; __JavelinIGUITargetingLines ctrlShow true;
// Move target marker to coords. // Move target marker to coords.
//__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1]; //__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1];
//__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY]; //__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY];
//{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV]; //{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV];
_boundsInput = if (_currentTarget isKindOf "CAManBase") then { _boundsInput = if (_currentTarget isKindOf "CAManBase") then {
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
} else { } else {
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"]; [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"];
}; };
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds); _bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
_minY = ((_bpos select 1) + _offsetY) max _constraintTop; _minY = ((_bpos select 1) + _offsetY) max _constraintTop;
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
TRACE_4("", _boundsInput, _bpos, _minX, _minY); TRACE_4("", _boundsInput, _bpos, _minX, _minY);
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
_currentShooter setVariable["ace_missileguidance_target", _currentTarget, false]; _currentShooter setVariable["ace_missileguidance_target", _currentTarget, false];
// Allow fire // Allow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
if(ACE_diagTime > _soundTime) then { if(ACE_diagTime > _soundTime) then {
playSound "ACE_Javelin_Locked"; playSound "ACE_Javelin_Locked";
_soundTime = ACE_diagTime + 0.25; _soundTime = ACE_diagTime + 0.25;
}; };
} else { } else {
__JavelinIGUITargeting ctrlShow true; __JavelinIGUITargeting ctrlShow true;
__JavelinIGUITargetingGate ctrlShow true; __JavelinIGUITargetingGate ctrlShow true;
__JavelinIGUITargetingConstrains ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow true;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
_currentShooter setVariable["ace_missileguidance_target", nil, false]; _currentShooter setVariable["ace_missileguidance_target", nil, false];
_boundsInput = if (_currentTarget isKindOf "CAManBase") then { _boundsInput = if (_currentTarget isKindOf "CAManBase") then {
[_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; [_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
} else { } else {
[_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"]; [_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"];
}; };
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds); _bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
_minY = ((_bpos select 1) + _offsetY) max _constraintTop; _minY = ((_bpos select 1) + _offsetY) max _constraintTop;
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
TRACE_4("", _boundsInput, _bpos, _minX, _minY); TRACE_4("", _boundsInput, _bpos, _minX, _minY);
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
if(ACE_diagTime > _soundTime) then { if(ACE_diagTime > _soundTime) then {
playSound "ACE_Javelin_Locking"; playSound "ACE_Javelin_Locking";
_soundTime = ACE_diagTime + 0.25; _soundTime = ACE_diagTime + 0.25;
}; };
// Disallow fire // Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
}; };
}; };
} else { } else {
// No targets found // No targets found
_currentTarget = objNull; _currentTarget = objNull;
_lockTime = 0; _lockTime = 0;
__JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUISeek ctrlSetTextColor __ColorGray;
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
__JavelinIGUITargetingConstraints ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false;
_currentShooter setVariable ["ace_missileguidance_target",nil, false]; _currentShooter setVariable ["ace_missileguidance_target",nil, false];
// Disallow fire // Disallow fire
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
}; };
}; };
//TRACE_2("", _newTarget, _currentTarget); //TRACE_2("", _newTarget, _currentTarget);
// Save arguments for next run // Save arguments for next run
_args set[0, ACE_diagTime]; _args set[0, ACE_diagTime];
_args set[1, _currentTarget]; _args set[1, _currentTarget];
_args set[2, _runTime]; _args set[2, _runTime];
_args set[3, _lockTime]; _args set[3, _lockTime];
_args set[4, _soundTime]; _args set[4, _soundTime];
_args set[6, _fireDisabledEH]; _args set[6, _fireDisabledEH];
uiNamespace setVariable[QGVAR(arguments), _args ]; uiNamespace setVariable[QGVAR(arguments), _args ];

View File

@ -1,37 +1,37 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
#define __LOCKONTIMERANDOM 2 // Deviation in lock on time #define __LOCKONTIMERANDOM 2 // Deviation in lock on time
if((count _this) > 0) then { if((count _this) > 0) then {
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
}; };
ACE_player setVariable ["ace_missileguidance_target",nil, false]; ACE_player setVariable ["ace_missileguidance_target",nil, false];
__JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUISeek ctrlSetTextColor __ColorGray;
__JavelinIGUINFOV ctrlSetTextColor __ColorGray; __JavelinIGUINFOV ctrlSetTextColor __ColorGray;
__JavelinIGUITargeting ctrlShow false; __JavelinIGUITargeting ctrlShow false;
__JavelinIGUITargetingConstrains ctrlShow false; __JavelinIGUITargetingConstrains ctrlShow false;
__JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingGate ctrlShow false;
__JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingLines ctrlShow false;
if(GVAR(pfehID) != -1) then { if(GVAR(pfehID) != -1) then {
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded [] call FUNC(onOpticUnload); // Unload optic if it was already loaded
}; };
uiNameSpace setVariable [QGVAR(arguments), uiNameSpace setVariable [QGVAR(arguments),
[ [
ACE_diagTime, // Last runtime ACE_diagTime, // Last runtime
objNull, // currentTargetObject objNull, // currentTargetObject
0, // Run Time 0, // Run Time
0, // Lock Time 0, // Lock Time
0, // Sound timer 0, // Sound timer
(random __LOCKONTIMERANDOM), // random lock time addition (random __LOCKONTIMERANDOM), // random lock time addition
-1 -1
] ]
]; ];
GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler; GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;

View File

@ -1,20 +1,20 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
private["_args", "_disableFireEH"]; private["_args", "_disableFireEH"];
// uiNameSpace setVariable ['ACE_RscOptics_javelin',nil]; // uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];
if(GVAR(pfehID) != -1) then { if(GVAR(pfehID) != -1) then {
[GVAR(pfehID)] call CBA_fnc_removePerFrameHandler; [GVAR(pfehID)] call CBA_fnc_removePerFrameHandler;
GVAR(pfehID) = -1; GVAR(pfehID) = -1;
}; };
_args = uiNamespace getVariable[QGVAR(arguments), nil ]; _args = uiNamespace getVariable[QGVAR(arguments), nil ];
if(!isNil "_args") then { if(!isNil "_args") then {
_disableFireEH = _args select 6; _disableFireEH = _args select 6;
if(_disableFireEH > 0 && difficulty > 0) then { if(_disableFireEH > 0 && difficulty > 0) then {
[ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler); [ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler);
}; };
uiNameSpace setVariable [QGVAR(arguments),nil]; uiNameSpace setVariable [QGVAR(arguments),nil];
}; };

View File

@ -1,14 +1,14 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
private["_player", "_currentFireMode"]; private["_player", "_currentFireMode"];
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"]; _currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
if(_currentFireMode == "JAV_TOP") then { if(_currentFireMode == "JAV_TOP") then {
__JavelinIGUITop ctrlSetTextColor __ColorGreen; __JavelinIGUITop ctrlSetTextColor __ColorGreen;
__JavelinIGUIDir ctrlSetTextColor __ColorGray; __JavelinIGUIDir ctrlSetTextColor __ColorGray;
} else { } else {
__JavelinIGUITop ctrlSetTextColor __ColorGray; __JavelinIGUITop ctrlSetTextColor __ColorGray;
__JavelinIGUIDir ctrlSetTextColor __ColorGreen; __JavelinIGUIDir ctrlSetTextColor __ColorGreen;
}; };

View File

@ -1,30 +1,30 @@
// by commy2 // by commy2
["ACE3 Weapons", QGVAR(lockTarget), localize LSTRING(LockTarget), ["ACE3 Weapons", QGVAR(lockTarget), localize LSTRING(LockTarget),
{ {
if (GETGVAR(isLockKeyDown,false)) exitWith {false}; if (GETGVAR(isLockKeyDown,false)) exitWith {false};
GVAR(isLockKeyDown) = true; GVAR(isLockKeyDown) = true;
// Statement // Statement
[ACE_player] call FUNC(lockKeyDown); [ACE_player] call FUNC(lockKeyDown);
// Return false so it doesn't block the rest weapon action // Return false so it doesn't block the rest weapon action
false false
}, },
{ {
// prevent holding down // prevent holding down
GVAR(isLockKeyDown) = false; GVAR(isLockKeyDown) = false;
// Statement // Statement
[ACE_player] call FUNC(lockKeyUp); [ACE_player] call FUNC(lockKeyUp);
false false
}, },
[15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key [15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key
["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), ["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode),
{ false }, { false },
{ {
[ACE_player] call FUNC(cycleFireMode); [ACE_player] call FUNC(cycleFireMode);
false false
}, },
[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key [15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key

View File

@ -1,67 +1,67 @@
#define COMPONENT javelin #define COMPONENT javelin
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE // #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS // #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS // #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_JAVELIN #ifdef DEBUG_ENABLED_JAVELIN
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif
#ifdef DEBUG_SETTINGS_JAVELIN #ifdef DEBUG_SETTINGS_JAVELIN
#define DEBUG_SETTINGS DEBUG_SETTINGS_JAVELIN #define DEBUG_SETTINGS DEBUG_SETTINGS_JAVELIN
#endif #endif
#include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\main\script_macros.hpp"
#define ACE_JAV_FIREMODE_DIR 1 #define ACE_JAV_FIREMODE_DIR 1
#define ACE_JAV_FIREMODE_TOP 2 #define ACE_JAV_FIREMODE_TOP 2
// Javelin IGUI defines // Javelin IGUI defines
#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin") #define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin")
// Custom controls // Custom controls
#define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999) #define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999)
#define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000) #define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000)
#define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001) #define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001)
#define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002) #define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002)
#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003) #define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003)
#define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004) #define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004)
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) #define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
// Constrains // Constrains
#define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100) #define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100)
#define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101) #define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101)
#define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102) #define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102)
#define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103) #define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103)
#define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104) #define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104)
// Targeting gate // Targeting gate
#define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200) #define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200)
#define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201) #define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201)
#define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202) #define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202)
#define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203) #define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203)
#define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204) #define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204)
// Rangefinder // Rangefinder
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151) #define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
// Targeting lines // Targeting lines
#define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300) #define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300)
#define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301) #define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301)
#define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302) #define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302)
#define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3)) #define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3))
#define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1) #define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1)
#define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2)) #define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2))
#define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0) #define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0)
// Colors for controls // Colors for controls
#define __ColorOrange [0.9255,0.5216,0.1216,1] #define __ColorOrange [0.9255,0.5216,0.1216,1]
#define __ColorGreen [0.2941,0.8745,0.2157,1] #define __ColorGreen [0.2941,0.8745,0.2157,1]
#define __ColorGray [0.2941,0.2941,0.2941,1] #define __ColorGray [0.2941,0.2941,0.2941,1]
#define __ColorNull [0,0,0,0] #define __ColorNull [0,0,0,0]

View File

@ -1,19 +1,19 @@
/* /*
* Author: Ruthberg * Author: Ruthberg
* Called if Kestrel Dialog is closed * Called if Kestrel Dialog is closed
* *
* Arguments: * Arguments:
* None * None
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* call ace_kestrel4500_fnc_onCloseDialog * call ace_kestrel4500_fnc_onCloseDialog
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
uiNamespace setVariable ['Kestrel4500_Display', nil]; uiNamespace setVariable ['Kestrel4500_Display', nil];
GVAR(Kestrel4500) = false; GVAR(Kestrel4500) = false;

View File

@ -1,19 +1,19 @@
/* /*
* Author: Ruthberg * Author: Ruthberg
* Called if Kestrel Display is closed * Called if Kestrel Display is closed
* *
* Arguments: * Arguments:
* None * None
* *
* Return Value: * Return Value:
* None * None
* *
* Example: * Example:
* call ace_kestrel4500_fnc_onCloseDisplay * call ace_kestrel4500_fnc_onCloseDisplay
* *
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
uiNamespace setVariable ['RscKestrel4500', nil]; uiNamespace setVariable ['RscKestrel4500', nil];
GVAR(Overlay) = false; GVAR(Overlay) = false;

View File

@ -1,26 +1,26 @@
class Extended_PreStart_EventHandlers { class Extended_PreStart_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart)); init = QUOTE(call COMPILE_FILE(XEH_preStart));
}; };
}; };
class Extended_PreInit_EventHandlers { class Extended_PreInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_pre_init)); init = QUOTE(call COMPILE_FILE(XEH_pre_init));
}; };
}; };
class Extended_PostInit_EventHandlers { class Extended_PostInit_EventHandlers {
class ADDON { class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_post_init)); init = QUOTE(call COMPILE_FILE(XEH_post_init));
}; };
}; };
class Extended_Init_EventHandlers { class Extended_Init_EventHandlers {
class LaserTargetBase { class LaserTargetBase {
class ADDON { class ADDON {
init = QUOTE(_this call DFUNC(laser_init)); init = QUOTE(_this call DFUNC(laser_init));
}; };
}; };
}; };

View File

@ -1,45 +1,45 @@
class CfgVehicles { class CfgVehicles {
class All; class All;
class LaserTarget: All { class LaserTarget: All {
// @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!?
model = "\A3\Weapons_F\empty.p3d"; model = "\A3\Weapons_F\empty.p3d";
destrType = "DestructNo"; destrType = "DestructNo";
simulation = "LaserTarget"; simulation = "LaserTarget";
class EventHandlers { class EventHandlers {
init = QUOTE(_this call FUNC(laser_init)); init = QUOTE(_this call FUNC(laser_init));
}; };
}; };
// Visual laserTarget override // Visual laserTarget override
class ACE_LaserTarget_Visual : LaserTarget { class ACE_LaserTarget_Visual : LaserTarget {
simulation = "LaserTarget"; simulation = "LaserTarget";
model = "\A3\Weapons_f\laserTgt.p3d"; model = "\A3\Weapons_f\laserTgt.p3d";
}; };
// Vehicle lockable configurations // Vehicle lockable configurations
class AllVehicles; class AllVehicles;
class Air: AllVehicles { class Air: AllVehicles {
class Turrets; class Turrets;
}; };
class Helicopter: Air { class Helicopter: Air {
class Turrets { class Turrets {
class MainTurret; class MainTurret;
}; };
}; };
class Helicopter_Base_F: Helicopter {}; class Helicopter_Base_F: Helicopter {};
class Heli_Attack_01_base_F: Helicopter_Base_F {}; class Heli_Attack_01_base_F: Helicopter_Base_F {};
class B_Heli_Attack_01_F: Heli_Attack_01_base_F { class B_Heli_Attack_01_F: Heli_Attack_01_base_F {
class Turrets: Turrets { class Turrets: Turrets {
class MainTurret: MainTurret { class MainTurret: MainTurret {
GVAR(CanLockLaser) = 1; // Enable laser locking selection GVAR(CanLockLaser) = 1; // Enable laser locking selection
}; };
}; };
}; };
}; };

View File

@ -1,7 +1,7 @@
class CfgWeapons { class CfgWeapons {
class Binocular; class Binocular;
class Laserdesignator : Binocular { class Laserdesignator : Binocular {
visionMode[] = {"Normal","NVG"}; visionMode[] = {"Normal","NVG"};
}; };
}; };

View File

@ -1,143 +1,143 @@
class RscControlsGroup; class RscControlsGroup;
class VScrollbar; class VScrollbar;
class HScrollbar; class HScrollbar;
class RscText; class RscText;
class RscMapControl; class RscMapControl;
class RscInGameUI { class RscInGameUI {
class RscOptics_LaserDesignator { class RscOptics_LaserDesignator {
idd = 300; idd = 300;
controls[] = {"CA_IGUI_elements_group"}; controls[] = {"CA_IGUI_elements_group"};
onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];"; onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];";
onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];"; onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];";
class CA_IGUI_elements_group: RscControlsGroup { class CA_IGUI_elements_group: RscControlsGroup {
idc = 170; idc = 170;
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
w = "53.5 * (0.01875 * SafezoneH)"; w = "53.5 * (0.01875 * SafezoneH)";
h = "40 * (0.025 * SafezoneH)"; h = "40 * (0.025 * SafezoneH)";
class VScrollbar: VScrollbar { class VScrollbar: VScrollbar {
width = 0; width = 0;
}; };
class HScrollbar: HScrollbar { class HScrollbar: HScrollbar {
height = 0; height = 0;
}; };
class controls { class controls {
class CA_OpticsZoom: RscText { class CA_OpticsZoom: RscText {
idc = 180; idc = 180;
style = 1; style = 1;
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "4.5"; text = "4.5";
x = "43.85 * (0.01875 * SafezoneH)"; x = "43.85 * (0.01875 * SafezoneH)";
y = "19.6 * (0.025 * SafezoneH)"; y = "19.6 * (0.025 * SafezoneH)";
w = "4.5 * (0.01875 * SafezoneH)"; w = "4.5 * (0.01875 * SafezoneH)";
h = "1.1 * (0.025 * SafezoneH)"; h = "1.1 * (0.025 * SafezoneH)";
}; };
class ACE_Distance: RscText { class ACE_Distance: RscText {
idc = 123002; idc = 123002;
style = 0; style = 0;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "2456"; text = "2456";
x = "24.6 * (0.01875 * SafezoneH)"; x = "24.6 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)"; y = "3 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)"; w = "4 * (0.01875 * SafezoneH)";
h = "1.5 * (0.025 * SafezoneH)"; h = "1.5 * (0.025 * SafezoneH)";
}; };
class CA_Distance: RscText { class CA_Distance: RscText {
idc = 151; idc = 151;
style = 0; style = 0;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "2456"; text = "2456";
x = 0; x = 0;
y = 0; y = 0;
w = 0; w = 0;
h = 0; h = 0;
}; };
class CA_Elev: RscText { class CA_Elev: RscText {
idc = 175; idc = 175;
style = 1; style = 1;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "80.5"; text = "80.5";
x = "32.7 * (0.01875 * SafezoneH)"; x = "32.7 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)"; y = "3 * (0.025 * SafezoneH)";
w = "5 * (0.01875 * SafezoneH)"; w = "5 * (0.01875 * SafezoneH)";
h = "1.5 * (0.025 * SafezoneH)"; h = "1.5 * (0.025 * SafezoneH)";
}; };
class CA_VisionMode: RscText { class CA_VisionMode: RscText {
idc = 179; idc = 179;
style = 0; style = 0;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "VIS"; text = "VIS";
x = "6.5 * (0.01875 * SafezoneH)"; x = "6.5 * (0.01875 * SafezoneH)";
y = "19.6 * (0.025 * SafezoneH)"; y = "19.6 * (0.025 * SafezoneH)";
w = "4 * (0.01875 * SafezoneH)"; w = "4 * (0.01875 * SafezoneH)";
h = "1.1 * (0.025 * SafezoneH)"; h = "1.1 * (0.025 * SafezoneH)";
}; };
class CA_Laser: RscText { class CA_Laser: RscText {
idc = 158; idc = 158;
style = "0x30 + 0x800"; style = "0x30 + 0x800";
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"; text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
x = "29.2 * (0.01875 * SafezoneH)"; x = "29.2 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)"; y = "3 * (0.025 * SafezoneH)";
w = "3.5 * (0.01875 * SafezoneH)"; w = "3.5 * (0.01875 * SafezoneH)";
h = "1.5 * (0.025 * SafezoneH)"; h = "1.5 * (0.025 * SafezoneH)";
}; };
class CA_Heading: RscText { class CA_Heading: RscText {
idc = 156; idc = 156;
style = 0; style = 0;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "023"; text = "023";
x = "16.1 * (0.01875 * SafezoneH)"; x = "16.1 * (0.01875 * SafezoneH)";
y = "3 * (0.025 * SafezoneH)"; y = "3 * (0.025 * SafezoneH)";
w = "3.5 * (0.01875 * SafezoneH)"; w = "3.5 * (0.01875 * SafezoneH)";
h = "1.6 * (0.025 * SafezoneH)"; h = "1.6 * (0.025 * SafezoneH)";
}; };
class ACE_LaserCode_Helper : RscMapControl { class ACE_LaserCode_Helper : RscMapControl {
idc = -1; idc = -1;
onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw)); onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw));
w = 0; w = 0;
h = 0; h = 0;
}; };
class ACE_LaserCode : RscText { class ACE_LaserCode : RscText {
idc = 123001; idc = 123001;
style = 0; style = 0;
sizeEx = "0.038*SafezoneH"; sizeEx = "0.038*SafezoneH";
colorText[] = {0.706,0.0745,0.0196,1}; colorText[] = {0.706,0.0745,0.0196,1};
shadow = 0; shadow = 0;
font = "EtelkaMonospacePro"; font = "EtelkaMonospacePro";
text = "Code: 1001"; text = "Code: 1001";
x = "32.7 * (0.01875 * SafezoneH)"; x = "32.7 * (0.01875 * SafezoneH)";
y = "35.5 * (0.025 * SafezoneH)"; y = "35.5 * (0.025 * SafezoneH)";
w = "12 * (0.01875 * SafezoneH)"; w = "12 * (0.01875 * SafezoneH)";
h = "1.6 * (0.025 * SafezoneH)"; h = "1.6 * (0.025 * SafezoneH)";
}; };
}; };
}; };
}; };
}; };

View File

@ -1,7 +1,7 @@
#include "script_component.hpp" #include "script_component.hpp"
#include "initKeybinds.sqf" #include "initKeybinds.sqf"
["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); ["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler);
["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); ["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler);

View File

@ -1,16 +1,16 @@
#include "script_component.hpp" #include "script_component.hpp"
ADDON = false; ADDON = false;
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
GVAR(VanillaLasers) = []; GVAR(VanillaLasers) = [];
// Laser default variables // Laser default variables
ACE_DEFAULT_LASER_CODE = 1001; ACE_DEFAULT_LASER_CODE = 1001;
ACE_DEFAULT_LASER_WAVELENGTH = 1550; ACE_DEFAULT_LASER_WAVELENGTH = 1550;
ACE_DEFAULT_LASER_BEAMSPREAD = 1; ACE_DEFAULT_LASER_BEAMSPREAD = 1;
GVAR(laserEmitters) = HASH_CREATE; GVAR(laserEmitters) = HASH_CREATE;
ADDON = true; ADDON = true;

View File

@ -1,16 +1,16 @@
#include "script_component.hpp" #include "script_component.hpp"
class CfgPatches { class CfgPatches {
class ADDON { class ADDON {
units[] = {}; units[] = {};
weapons[] = {}; weapons[] = {};
requiredVersion = REQUIRED_VERSION; requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "ace_common" }; requiredAddons[] = { "ace_common" };
VERSION_CONFIG; VERSION_CONFIG;
}; };
}; };
#include "CfgEventhandlers.hpp" #include "CfgEventhandlers.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"
#include "CfgWeapons.hpp" #include "CfgWeapons.hpp"
#include "RscInGameUI.hpp" #include "RscInGameUI.hpp"

View File

@ -1,31 +1,31 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_pos1", "_pos2", "_spacing", "_vectorTo", "_x", "_y", "_z", "_distance", "_count", "_return", "_alt", "_pos", "_designator", "_seeker"]; private ["_pos1", "_pos2", "_spacing", "_vectorTo", "_x", "_y", "_z", "_distance", "_count", "_return", "_alt", "_pos", "_designator", "_seeker"];
_pos1 = _this select 0; _pos1 = _this select 0;
_pos2 = _this select 1; _pos2 = _this select 1;
_designator = _this select 2; _designator = _this select 2;
_seeker = _this select 3; _seeker = _this select 3;
_spacing = 100; _spacing = 100;
if((count _this) > 4) then { if((count _this) > 4) then {
_spacing = _this select 4; _spacing = _this select 4;
}; };
_return = true; _return = true;
_vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY; _vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY;
_x = (_vectorTo select 0)*0.25; _x = (_vectorTo select 0)*0.25;
_y = (_vectorTo select 1)*0.25; _y = (_vectorTo select 1)*0.25;
_z = (_vectorTo select 2)*0.25; _z = (_vectorTo select 2)*0.25;
_pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z]; _pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z];
// player sideChat format["new los check"]; // player sideChat format["new los check"];
if(terrainIntersect [_pos2, _pos1]) then { if(terrainIntersect [_pos2, _pos1]) then {
_return = false; _return = false;
} else { } else {
if(lineIntersects [_pos2, _pos1]) then { // should take as arguments and add to this command objects to exclude - target and observer if(lineIntersects [_pos2, _pos1]) then { // should take as arguments and add to this command objects to exclude - target and observer
// player sideChat format["with: %1", lineIntersectsWith [_pos1, _pos2]]; // player sideChat format["with: %1", lineIntersectsWith [_pos1, _pos2]];
_return = false; _return = false;
}; };
}; };
_return; _return;

View File

@ -1,9 +1,9 @@
// This is a debug function for displaying visible lasers for ourselves // This is a debug function for displaying visible lasers for ourselves
#include "script_component.hpp" #include "script_component.hpp"
ACE_LOGINFO("Laser Emitter Dump"); ACE_LOGINFO("Laser Emitter Dump");
{ {
ACE_LOGINFO_1(" %1", _x); ACE_LOGINFO_1(" %1", _x);
ACE_LOGINFO_1(" %1",HASH_GET(GVAR(laserEmitters),_x)); ACE_LOGINFO_1(" %1",HASH_GET(GVAR(laserEmitters),_x));
} forEach GVAR(laserEmitters) select 0; } forEach GVAR(laserEmitters) select 0;

View File

@ -1,49 +1,49 @@
#include "script_component.hpp" #include "script_component.hpp"
private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"]; private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"];
_list = _this select 0; _list = _this select 0;
_checkPos = _this select 1; _checkPos = _this select 1;
_spots = []; _spots = [];
_outliers = []; _outliers = [];
_spot = []; _spot = [];
_testPos = (_list select 0) select 0; _testPos = (_list select 0) select 0;
{ {
_samplePos = _x select 0; _samplePos = _x select 0;
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
if(_samplePos distance _testPos < 2) then { if(_samplePos distance _testPos < 2) then {
_spot pushBack _samplePos; _spot pushBack _samplePos;
} else { } else {
_outliers pushBack _samplePos; _outliers pushBack _samplePos;
}; };
}; };
} forEach _list; } forEach _list;
_spots pushBack _spot; _spots pushBack _spot;
if(count _outliers > 0) then { if(count _outliers > 0) then {
for "_i" from 1 to 3 do { for "_i" from 1 to 3 do {
_remainingSpots = _outliers; _remainingSpots = _outliers;
_outliers = []; _outliers = [];
_spot = []; _spot = [];
_testPos = (_remainingSpots select 0); _testPos = (_remainingSpots select 0);
{ {
_samplePos = _x; _samplePos = _x;
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then { if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
if(_samplePos distance _testPos < 2) then { if(_samplePos distance _testPos < 2) then {
_spot pushBack _samplePos; _spot pushBack _samplePos;
} else { } else {
_outliers pushBack _samplePos; _outliers pushBack _samplePos;
}; };
}; };
} forEach _remainingSpots; } forEach _remainingSpots;
_spots pushBack _spot; _spots pushBack _spot;
}; };
}; };
_largest = 0; _largest = 0;
_largestSpot = []; _largestSpot = [];
{ {
if((count _x) > _largest) then { if((count _x) > _largest) then {
_largest = (count _x); _largest = (count _x);
_largestSpot = _x; _largestSpot = _x;
}; };
} forEach _spots; } forEach _spots;
// player sideChat format["g: %1", _spots]; // player sideChat format["g: %1", _spots];
_largestSpot select (random (floor(count _largestSpot))); _largestSpot select (random (floor(count _largestSpot)));

View File

@ -2,7 +2,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_uuid"]; private ["_uuid"];
_uuid = _this select 0; _uuid = _this select 0;
if(HASH_HASKEY(GVAR(laserEmitters), _uuid)) then { if(HASH_HASKEY(GVAR(laserEmitters), _uuid)) then {
HASH_REM(GVAR(laserEmitters), _uuid); HASH_REM(GVAR(laserEmitters), _uuid);
}; };

View File

@ -2,6 +2,6 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_uuid", "_args"]; private ["_uuid", "_args"];
_uuid = _this select 0; _uuid = _this select 0;
_args = _this select 1; _args = _this select 1;
HASH_SET(GVAR(laserEmitters), _uuid, _args); HASH_SET(GVAR(laserEmitters), _uuid, _args);

View File

@ -1,12 +1,12 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
private["_oldLaserCode", "_laserCode"]; private["_oldLaserCode", "_laserCode"];
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; _oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then { if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then {
_laserCode = _oldLaserCode - 1; _laserCode = _oldLaserCode - 1;
ACE_player setVariable [QGVAR(code), _laserCode, false]; ACE_player setVariable [QGVAR(code), _laserCode, false];
}; };
if(_laserCode != _oldLaserCode) then { if(_laserCode != _oldLaserCode) then {
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured); [format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
}; };

View File

@ -1,10 +1,10 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
private["_oldLaserCode", "_laserCode"]; private["_oldLaserCode", "_laserCode"];
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; _oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
_laserCode = _oldLaserCode + 1; _laserCode = _oldLaserCode + 1;
ACE_player setVariable [QGVAR(code), _laserCode, false]; ACE_player setVariable [QGVAR(code), _laserCode, false];
if(_laserCode != _oldLaserCode) then { if(_laserCode != _oldLaserCode) then {
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured); [format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
}; };

View File

@ -12,5 +12,5 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_uuid"]; private ["_uuid"];
_uuid = _this select 0; _uuid = _this select 0;
["laser_laserOff", [_uuid]] call EFUNC(common,globalEvent); ["laser_laserOff", [_uuid]] call EFUNC(common,globalEvent);

View File

@ -17,7 +17,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_uuid", "_args"]; private ["_uuid", "_args"];
_uuid = format["%1%2%3", floor ACE_diagTime, floor random 1000, floor random 10000]; _uuid = format["%1%2%3", floor ACE_diagTime, floor random 1000, floor random 10000];
_args = [_uuid, _this]; _args = [_uuid, _this];
["laser_laserOn", _args] call EFUNC(common,globalEvent); ["laser_laserOn", _args] call EFUNC(common,globalEvent);
_uuid; _uuid;

View File

@ -1,30 +1,30 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"]; private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"];
//TRACE_1("enter", _this); //TRACE_1("enter", _this);
_args = _this select 0; _args = _this select 0;
_laserTarget = _args select 0; _laserTarget = _args select 0;
_shooter = _args select 1; _shooter = _args select 1;
_uuid = _args select 2; _uuid = _args select 2;
if(isNull _laserTarget || !alive _shooter) exitWith { if(isNull _laserTarget || !alive _shooter) exitWith {
[(_this select 1)] call CBA_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
REM(GVAR(VanillaLasers), _laserTarget); REM(GVAR(VanillaLasers), _laserTarget);
// Remove laseron // Remove laseron
[_uuid] call FUNC(laserOff); [_uuid] call FUNC(laserOff);
}; };
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
// Iconize the location of the actual laserTarget // Iconize the location of the actual laserTarget
_pos = getPosASL _laserTarget; _pos = getPosASL _laserTarget;
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoATL _pos), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa", [1,0,0,1], (ASLtoATL _pos), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"];
{ {
drawLine3D [ASLtoATL (_x select 0), ASLtoATL (_x select 1), (_x select 2)]; drawLine3D [ASLtoATL (_x select 0), ASLtoATL (_x select 1), (_x select 2)];
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", (_x select 2), ASLtoATL (_x select 1), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", (_x select 2), ASLtoATL (_x select 1), 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"];
} forEach DRAW_LINES; } forEach DRAW_LINES;
DRAW_LINES = []; DRAW_LINES = [];
#endif #endif

View File

@ -1,33 +1,33 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
TRACE_1("enter", _this); TRACE_1("enter", _this);
PARAMS_1(_laserTarget); PARAMS_1(_laserTarget);
private["_uuid"]; private["_uuid"];
// Add the target to the global targets array // Add the target to the global targets array
// Everyone tracks them // Everyone tracks them
// Add the laser localized to the laser array, and give it the default localized code // Add the laser localized to the laser array, and give it the default localized code
PUSH(GVAR(VanillaLasers), _laserTarget); PUSH(GVAR(VanillaLasers), _laserTarget);
// Check the vehicle, otherwise use the default // Check the vehicle, otherwise use the default
_laserTarget setVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE, false]; _laserTarget setVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE, false];
_laserTarget setVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD, false]; _laserTarget setVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD, false];
_laserTarget setVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH, false]; _laserTarget setVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH, false];
// Clean the lasers of any null objects while we are here // Clean the lasers of any null objects while we are here
REM(GVAR(VanillaLasers), objNull); REM(GVAR(VanillaLasers), objNull);
if(!(local _laserTarget)) exitWith { }; if(!(local _laserTarget)) exitWith { };
// The target is local, so its on this client // The target is local, so its on this client
if(!isDedicated) then { if(!isDedicated) then {
// @TODO: Get ownership variables and set them on the vehicle // @TODO: Get ownership variables and set them on the vehicle
_uuid = [(vehicle ACE_player), ACE_player, QFUNC(vanillaLaserSeekerHandler), ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_CODE, ACE_DEFAULT_LASER_BEAMSPREAD] call FUNC(laserOn); _uuid = [(vehicle ACE_player), ACE_player, QFUNC(vanillaLaserSeekerHandler), ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_CODE, ACE_DEFAULT_LASER_BEAMSPREAD] call FUNC(laserOn);
_laserTarget setVariable [QGVAR(uuid), _uuid, false]; _laserTarget setVariable [QGVAR(uuid), _uuid, false];
[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call CBA_fnc_addPerFrameHandler; [FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call CBA_fnc_addPerFrameHandler;
} else { } else {
// server side ownership of laser // server side ownership of laser
_laserTarget setVariable [QGVAR(owner), nil, true]; _laserTarget setVariable [QGVAR(owner), nil, true];
}; };

View File

@ -1,15 +1,15 @@
//#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
private["_laserCode"]; private["_laserCode"];
_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE]; _laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE];
if(!isNil "_laserCode") then { if(!isNil "_laserCode") then {
__LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber]; __LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber];
}; };
if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then { if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then {
// TODO: hide distance // TODO: hide distance
__LaserDesignatorIGUI_ACE_Distance ctrlSetText "----"; __LaserDesignatorIGUI_ACE_Distance ctrlSetText "----";
} else { } else {
__LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance); __LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance);
}; };

View File

@ -1,36 +1,36 @@
#include "script_component.hpp" #include "script_component.hpp"
private["_d", "_map", "_p", "_theta", "_u"]; private["_d", "_map", "_p", "_theta", "_u"];
_map = _this select 0; _map = _this select 0;
_theta = _this select 1; _theta = _this select 1;
_p = _map select 0; _p = _map select 0;
_p1 = _map select 1; _p1 = _map select 1;
_p2 = _map select 2; _p2 = _map select 2;
_q1 = +(_map select 3); _q1 = +(_map select 3);
_q2 = +(_map select 4); _q2 = +(_map select 4);
_u = _map select 5; _u = _map select 5;
_d = _map select 6; _d = _map select 6;
/* Step 4 */ /* Step 4 */
_q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)]; _q2 set[0, (_q1 select 0) * cos(_theta) - (_q1 select 1) * sin(_theta)];
_q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)]; _q2 set[1, (_q1 select 0) * sin(_theta) + (_q1 select 1) * cos(_theta)];
_q2 set[2, (_q1 select 2)]; _q2 set[2, (_q1 select 2)];
/* Inverse of step 3 */ /* Inverse of step 3 */
_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)]; _q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)];
_q1 set[1, (_q2 select 1)]; _q1 set[1, (_q2 select 1)];
_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d]; _q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
/* Inverse of step 2 */ /* Inverse of step 2 */
if (_d != 0) then { if (_d != 0) then {
_q2 set[0, (_q1 select 0)]; _q2 set[0, (_q1 select 0)];
_q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d]; _q2 set[1, (_q1 select 1) * (_u select 2) / _d + (_q1 select 2) * (_u select 1) / _d];
_q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d]; _q2 set[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
} else { } else {
_q2 = _q1; _q2 = _q1;
}; };
/* Inverse of step 1 */ /* Inverse of step 1 */
_q1 = _q2 vectorAdd _p1; _q1 = _q2 vectorAdd _p1;
_q1; _q1;

Some files were not shown because too many files have changed in this diff Show More