mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Normalize to LF line endings
This commit is contained in:
parent
5672a96f5f
commit
816da2aef1
16
.gitignore
vendored
16
.gitignore
vendored
@ -1,8 +1,8 @@
|
||||
release/*
|
||||
*.cache
|
||||
*.pbo
|
||||
texHeaders.bin
|
||||
*.swp
|
||||
*.swo
|
||||
*.biprivatekey
|
||||
Thumbs.db
|
||||
release/*
|
||||
*.cache
|
||||
*.pbo
|
||||
texHeaders.bin
|
||||
*.swp
|
||||
*.swo
|
||||
*.biprivatekey
|
||||
Thumbs.db
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['ATragMX_Display', nil];
|
||||
GVAR(active) = false;
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['ATragMX_Display', nil];
|
||||
GVAR(active) = false;
|
||||
[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler;
|
File diff suppressed because it is too large
Load Diff
@ -1,81 +1,81 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Internal net event handler.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventType", "_event"];
|
||||
|
||||
if (_eventType == "ACEg") then {
|
||||
_event params ["_eventName", "_eventArgs"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
if (!isNil "_eventFunctions") then {
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Net Event %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
{
|
||||
if (!isNil "_x") then {
|
||||
_eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex));
|
||||
#ifdef DEBUG_EVENTS_CALLSTACK
|
||||
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
|
||||
#endif
|
||||
};
|
||||
} forEach _eventFunctions;
|
||||
};
|
||||
};
|
||||
|
||||
if (_eventType == "ACEc") then {
|
||||
if (isServer) then {
|
||||
_event params ["_eventName", "_eventTargets", "_eventArgs"];
|
||||
|
||||
private _sentEvents = [];
|
||||
|
||||
if (!IS_ARRAY(_eventTargets)) then {
|
||||
_eventTargets = [_eventTargets];
|
||||
};
|
||||
|
||||
//If not multiplayer, and there are targets, then just run localy
|
||||
if (!isMultiplayer && {count _eventTargets > 0}) exitWith {
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
|
||||
private _serverFlagged = false;
|
||||
|
||||
{
|
||||
private _owner = _x;
|
||||
|
||||
if (IS_OBJECT(_x)) then {
|
||||
_owner = owner _x;
|
||||
};
|
||||
if !(_owner in _sentEvents) then {
|
||||
_sentEvents pushBack _owner;
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
|
||||
if (isDedicated || {_x != ACE_player}) then {
|
||||
if (isDedicated && {local _x} && {!_serverFlagged}) then {
|
||||
_serverFlagged = true;
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
} else {
|
||||
_owner publicVariableClient "ACEg";
|
||||
};
|
||||
} else {
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
};
|
||||
false
|
||||
} count _eventTargets;
|
||||
};
|
||||
};
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Internal net event handler.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventType", "_event"];
|
||||
|
||||
if (_eventType == "ACEg") then {
|
||||
_event params ["_eventName", "_eventArgs"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
if (!isNil "_eventFunctions") then {
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Net Event %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
{
|
||||
if (!isNil "_x") then {
|
||||
_eventArgs call CALLSTACK_NAMED(_x, FORMAT_2("Net Event %1 ID: %2",_eventName,_forEachIndex));
|
||||
#ifdef DEBUG_EVENTS_CALLSTACK
|
||||
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
|
||||
#endif
|
||||
};
|
||||
} forEach _eventFunctions;
|
||||
};
|
||||
};
|
||||
|
||||
if (_eventType == "ACEc") then {
|
||||
if (isServer) then {
|
||||
_event params ["_eventName", "_eventTargets", "_eventArgs"];
|
||||
|
||||
private _sentEvents = [];
|
||||
|
||||
if (!IS_ARRAY(_eventTargets)) then {
|
||||
_eventTargets = [_eventTargets];
|
||||
};
|
||||
|
||||
//If not multiplayer, and there are targets, then just run localy
|
||||
if (!isMultiplayer && {count _eventTargets > 0}) exitWith {
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
|
||||
private _serverFlagged = false;
|
||||
|
||||
{
|
||||
private _owner = _x;
|
||||
|
||||
if (IS_OBJECT(_x)) then {
|
||||
_owner = owner _x;
|
||||
};
|
||||
if !(_owner in _sentEvents) then {
|
||||
_sentEvents pushBack _owner;
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
|
||||
if (isDedicated || {_x != ACE_player}) then {
|
||||
if (isDedicated && {local _x} && {!_serverFlagged}) then {
|
||||
_serverFlagged = true;
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
} else {
|
||||
_owner publicVariableClient "ACEg";
|
||||
};
|
||||
} else {
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
};
|
||||
false
|
||||
} count _eventTargets;
|
||||
};
|
||||
};
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Handles a server-side request for synchronization ALL events on JIP to a client.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: client <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Event is successed <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_client"];
|
||||
|
||||
{
|
||||
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
|
||||
_eventEntry params ["", "_eventLog"];
|
||||
|
||||
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent);
|
||||
false
|
||||
} count (GVAR(syncedEvents) select 0);
|
||||
|
||||
true
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Handles a server-side request for synchronization ALL events on JIP to a client.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: client <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Event is successed <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_client"];
|
||||
|
||||
{
|
||||
private _eventEntry = HASH_GET(GVAR(syncedEvents),_x);
|
||||
_eventEntry params ["", "_eventLog"];
|
||||
|
||||
["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent);
|
||||
false
|
||||
} count (GVAR(syncedEvents) select 0);
|
||||
|
||||
true
|
||||
|
@ -1,48 +1,48 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Receives either requests for synchronization from clients, or the synchronization data from the server.
|
||||
*
|
||||
* Arguments [Client] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: eventLog <ARRAY>
|
||||
*
|
||||
* Arguments [Server] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: client <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Event is successed <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//SEH_s
|
||||
if (isServer) then {
|
||||
// Find the event name, and shovel out the events to the client
|
||||
params ["_eventName", "_client"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
|
||||
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
|
||||
_eventEntry params ["", "_eventLog"];
|
||||
|
||||
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent);
|
||||
} else {
|
||||
params ["_eventName", "_eventLog"];
|
||||
|
||||
// This is the client handling the response from the server
|
||||
// Start running the events
|
||||
{
|
||||
_x params ["", "_eventArgs","_ttl"];
|
||||
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
|
||||
false
|
||||
} count _eventLog;
|
||||
|
||||
ACE_LOGINFO_1("[%1] synchronized",_eventName);
|
||||
};
|
||||
|
||||
true
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Receives either requests for synchronization from clients, or the synchronization data from the server.
|
||||
*
|
||||
* Arguments [Client] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: eventLog <ARRAY>
|
||||
*
|
||||
* Arguments [Server] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: client <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Event is successed <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//SEH_s
|
||||
if (isServer) then {
|
||||
// Find the event name, and shovel out the events to the client
|
||||
params ["_eventName", "_client"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith {
|
||||
ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName);
|
||||
_eventEntry params ["", "_eventLog"];
|
||||
|
||||
["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent);
|
||||
} else {
|
||||
params ["_eventName", "_eventLog"];
|
||||
|
||||
// This is the client handling the response from the server
|
||||
// Start running the events
|
||||
{
|
||||
_x params ["", "_eventArgs","_ttl"];
|
||||
[_eventName, _eventArgs, _ttl] call FUNC(_handleSyncedEvent);
|
||||
false
|
||||
} count _eventLog;
|
||||
|
||||
ACE_LOGINFO_1("[%1] synchronized",_eventName);
|
||||
};
|
||||
|
||||
true
|
||||
|
@ -1,37 +1,37 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Handles synced events being received. Server will log them, and server/client will execute them.
|
||||
*
|
||||
* Arguments [Client] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: arguments <ARRAY>
|
||||
* 2: ttl <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_args", "_ttl"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
|
||||
|
||||
if (isServer) then {
|
||||
// Server needs to internally log it for synchronization
|
||||
if (_ttl > -1) then {
|
||||
_internalData = HASH_GET(GVAR(syncedEvents),_name);
|
||||
|
||||
_internalData params ["", "_eventLog"];
|
||||
_eventLog pushBack [ACE_diagTime, _args, _ttl];
|
||||
};
|
||||
};
|
||||
|
||||
_internalData params ["_eventCode"];
|
||||
_args call _eventCode;
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Handles synced events being received. Server will log them, and server/client will execute them.
|
||||
*
|
||||
* Arguments [Client] :
|
||||
* 0: eventName <STRING>
|
||||
* 1: arguments <ARRAY>
|
||||
* 2: ttl <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_args", "_ttl"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _internalData = HASH_GET(GVAR(syncedEvents),_name);
|
||||
|
||||
if (isServer) then {
|
||||
// Server needs to internally log it for synchronization
|
||||
if (_ttl > -1) then {
|
||||
_internalData = HASH_GET(GVAR(syncedEvents),_name);
|
||||
|
||||
_internalData params ["", "_eventLog"];
|
||||
_eventLog pushBack [ACE_diagTime, _args, _ttl];
|
||||
};
|
||||
};
|
||||
|
||||
_internalData params ["_eventCode"];
|
||||
_args call _eventCode;
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Add an event handler.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event code <CODE>
|
||||
*
|
||||
* Return Value:
|
||||
* Event handler ID number (for use with fnc_removeEventHandler) <NUMBER>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventCode"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
|
||||
if (isNil "_eventFunctions") then {
|
||||
_eventFunctions = [];
|
||||
GVAR(eventsLocation) setVariable [_eventName, _eventFunctions];
|
||||
};
|
||||
|
||||
_eventFunctions pushBack _eventCode // Return event function count
|
||||
/*
|
||||
* Author: Nou
|
||||
* Add an event handler.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event code <CODE>
|
||||
*
|
||||
* Return Value:
|
||||
* Event handler ID number (for use with fnc_removeEventHandler) <NUMBER>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventCode"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
|
||||
if (isNil "_eventFunctions") then {
|
||||
_eventFunctions = [];
|
||||
GVAR(eventsLocation) setVariable [_eventName, _eventFunctions];
|
||||
};
|
||||
|
||||
_eventFunctions pushBack _eventCode // Return event function count
|
||||
|
@ -1,30 +1,30 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Register an event handler for an ACE synced event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
* 1: Handler <CODE>
|
||||
* 2: TTL (optional: 0) <NUMBER, CODE>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_handler", ["_ttl", 0]];
|
||||
|
||||
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
|
||||
private _data = [_handler, [], _ttl, _eventId];
|
||||
|
||||
HASH_SET(GVAR(syncedEvents),_name,_data);
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Register an event handler for an ACE synced event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
* 1: Handler <CODE>
|
||||
* 2: TTL (optional: 0) <NUMBER, CODE>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* ["myEvent", {_this call x}, 0] call ace_common_fnc_addSyncedEventHandler
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_handler", ["_ttl", 0]];
|
||||
|
||||
if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
|
||||
private _data = [_handler, [], _ttl, _eventId];
|
||||
|
||||
HASH_SET(GVAR(syncedEvents),_name,_data);
|
||||
|
@ -1,44 +1,44 @@
|
||||
/*
|
||||
* Author: ?
|
||||
* Dumps an array to the RPT, showing the depth of each element.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Array to be dumped <ARRAY>
|
||||
* 1: Depth <NUMBER><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_var", ["_depth", 0, [0]]];
|
||||
|
||||
private _pad = "";
|
||||
|
||||
for "_i" from 0 to _depth do {
|
||||
_pad = _pad + toString [9];
|
||||
};
|
||||
|
||||
_depth = _depth + 1;
|
||||
|
||||
if (IS_ARRAY(_var)) then {
|
||||
if (_var isEqualTo []) then {
|
||||
diag_log text format ["%1[],", _pad];
|
||||
} else {
|
||||
diag_log text format ["%1[", _pad];
|
||||
|
||||
{
|
||||
[_x, _depth] call FUNC(dumpArray);
|
||||
false
|
||||
} count _var;
|
||||
|
||||
diag_log text format ["%1],", _pad];
|
||||
};
|
||||
} else {
|
||||
diag_log text format ["%1%2", _pad, _var];
|
||||
};
|
||||
/*
|
||||
* Author: ?
|
||||
* Dumps an array to the RPT, showing the depth of each element.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Array to be dumped <ARRAY>
|
||||
* 1: Depth <NUMBER><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [[0, [1,2], [[3]]]] call ace_common_fnc_dumpArray
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_var", ["_depth", 0, [0]]];
|
||||
|
||||
private _pad = "";
|
||||
|
||||
for "_i" from 0 to _depth do {
|
||||
_pad = _pad + toString [9];
|
||||
};
|
||||
|
||||
_depth = _depth + 1;
|
||||
|
||||
if (IS_ARRAY(_var)) then {
|
||||
if (_var isEqualTo []) then {
|
||||
diag_log text format ["%1[],", _pad];
|
||||
} else {
|
||||
diag_log text format ["%1[", _pad];
|
||||
|
||||
{
|
||||
[_x, _depth] call FUNC(dumpArray);
|
||||
false
|
||||
} count _var;
|
||||
|
||||
diag_log text format ["%1],", _pad];
|
||||
};
|
||||
} else {
|
||||
diag_log text format ["%1%2", _pad, _var];
|
||||
};
|
||||
|
@ -1,88 +1,88 @@
|
||||
/*
|
||||
* Author: ?
|
||||
* Dumps performance counter statistics into Logs.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
diag_log text format ["REGISTERED ACE PFH HANDLERS"];
|
||||
diag_log text format ["-------------------------------------------"];
|
||||
|
||||
if (!isNil "ACE_PFH_COUNTER") then {
|
||||
{
|
||||
_x params ["_pfh", "_parameters"];
|
||||
|
||||
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];
|
||||
false
|
||||
} count ACE_PFH_COUNTER;
|
||||
};
|
||||
|
||||
diag_log text format ["ACE COUNTER RESULTS"];
|
||||
diag_log text format ["-------------------------------------------"];
|
||||
|
||||
{
|
||||
private _counterEntry = _x;
|
||||
private _iter = 0;
|
||||
private _total = 0;
|
||||
private _count = 0;
|
||||
private _averageResult = 0;
|
||||
|
||||
if (count _counterEntry > 3) then {
|
||||
// calc
|
||||
{
|
||||
if (_iter > 2) then {
|
||||
_count = _count + 1;
|
||||
private _delta = (_x select 1) - (_x select 0);
|
||||
|
||||
_total = _total + _delta;
|
||||
};
|
||||
|
||||
_iter = _iter + 1;
|
||||
false
|
||||
} count _counterEntry;
|
||||
|
||||
// results
|
||||
_averageResult = (_total / _count) * 1000;
|
||||
|
||||
// dump results
|
||||
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
|
||||
} else {
|
||||
diag_log text format ["%1: No results", _counterEntry select 0];
|
||||
};
|
||||
false
|
||||
} count ACE_COUNTERS;
|
||||
|
||||
/*
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private _delay = _x select 2;
|
||||
//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)];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
|
||||
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private _delta = _x select 1;
|
||||
//if(_delta > 0) then { _delta = _delta / 1000; };
|
||||
diag_log text format[" DELTA: %1s", _delta];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
//{
|
||||
//
|
||||
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
*/
|
||||
/*
|
||||
* Author: ?
|
||||
* Dumps performance counter statistics into Logs.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
diag_log text format ["REGISTERED ACE PFH HANDLERS"];
|
||||
diag_log text format ["-------------------------------------------"];
|
||||
|
||||
if (!isNil "ACE_PFH_COUNTER") then {
|
||||
{
|
||||
_x params ["_pfh", "_parameters"];
|
||||
|
||||
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];
|
||||
false
|
||||
} count ACE_PFH_COUNTER;
|
||||
};
|
||||
|
||||
diag_log text format ["ACE COUNTER RESULTS"];
|
||||
diag_log text format ["-------------------------------------------"];
|
||||
|
||||
{
|
||||
private _counterEntry = _x;
|
||||
private _iter = 0;
|
||||
private _total = 0;
|
||||
private _count = 0;
|
||||
private _averageResult = 0;
|
||||
|
||||
if (count _counterEntry > 3) then {
|
||||
// calc
|
||||
{
|
||||
if (_iter > 2) then {
|
||||
_count = _count + 1;
|
||||
private _delta = (_x select 1) - (_x select 0);
|
||||
|
||||
_total = _total + _delta;
|
||||
};
|
||||
|
||||
_iter = _iter + 1;
|
||||
false
|
||||
} count _counterEntry;
|
||||
|
||||
// results
|
||||
_averageResult = (_total / _count) * 1000;
|
||||
|
||||
// dump results
|
||||
diag_log text format ["%1: Average: %2s / %3 = %4ms", _counterEntry select 0, _total, _count, _averageResult];
|
||||
} else {
|
||||
diag_log text format ["%1: No results", _counterEntry select 0];
|
||||
};
|
||||
false
|
||||
} count ACE_COUNTERS;
|
||||
|
||||
/*
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private _delay = _x select 2;
|
||||
//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)];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER;
|
||||
|
||||
// Dump PFH Trackers
|
||||
diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"];
|
||||
diag_log text format["-------------------------------------------"];
|
||||
{
|
||||
private _delta = _x select 1;
|
||||
//if(_delta > 0) then { _delta = _delta / 1000; };
|
||||
diag_log text format[" DELTA: %1s", _delta];
|
||||
} forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
//{
|
||||
//
|
||||
//} forEach ACRE_EXCESSIVE_FRAME_TRACKER;
|
||||
|
||||
*/
|
||||
|
@ -1,42 +1,42 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Get the absolute turret direction for FOV/PIP turret.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
* 1: Turret Position <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Position ASL <ARRAY>
|
||||
* 1: Direction <ARRAY>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle", "_position"];
|
||||
|
||||
private _turret = [_vehicle, _position] call CBA_fnc_getTurret;
|
||||
|
||||
private _pov = getText (_turret >> "memoryPointGunnerOptics");
|
||||
private _gunBeg = getText (_turret >> "gunBeg");
|
||||
private _gunEnd = getText (_turret >> "gunEnd");
|
||||
|
||||
TRACE_3("", _pov, _gunBeg, _gunEnd);
|
||||
|
||||
// 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 _povDir = [0,0,0];
|
||||
|
||||
if (_pov == "pip0_pos") then {
|
||||
private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir"));
|
||||
|
||||
_povDir = _pipDir vectorDiff _povPos;
|
||||
} else {
|
||||
private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg));
|
||||
private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd));
|
||||
|
||||
_povDir = _gunBeginPos vectorDiff _gunEndPos;
|
||||
};
|
||||
|
||||
[_povPos, _povDir]
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Get the absolute turret direction for FOV/PIP turret.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Vehicle <OBJECT>
|
||||
* 1: Turret Position <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Position ASL <ARRAY>
|
||||
* 1: Direction <ARRAY>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle", "_position"];
|
||||
|
||||
private _turret = [_vehicle, _position] call CBA_fnc_getTurret;
|
||||
|
||||
private _pov = getText (_turret >> "memoryPointGunnerOptics");
|
||||
private _gunBeg = getText (_turret >> "gunBeg");
|
||||
private _gunEnd = getText (_turret >> "gunEnd");
|
||||
|
||||
TRACE_3("", _pov, _gunBeg, _gunEnd);
|
||||
|
||||
// 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 _povDir = [0,0,0];
|
||||
|
||||
if (_pov == "pip0_pos") then {
|
||||
private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir"));
|
||||
|
||||
_povDir = _pipDir vectorDiff _povPos;
|
||||
} else {
|
||||
private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg));
|
||||
private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd));
|
||||
|
||||
_povDir = _gunBeginPos vectorDiff _gunEndPos;
|
||||
};
|
||||
|
||||
[_povPos, _povDir]
|
||||
|
@ -1,21 +1,21 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a global event on all clients, including self.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event args <ANY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
publicVariable "ACEg";
|
||||
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a global event on all clients, including self.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event args <ANY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
publicVariable "ACEg";
|
||||
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
|
@ -1,36 +1,36 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a local event on this client only.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name (string)
|
||||
* 1: Event args (any)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
|
||||
if (!isNil "_eventFunctions") then {
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Local Event: %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
{
|
||||
if (!isNil "_x") then {
|
||||
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
|
||||
|
||||
#ifdef DEBUG_EVENTS_CALLSTACK
|
||||
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
|
||||
#endif
|
||||
};
|
||||
} forEach _eventFunctions;
|
||||
};
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a local event on this client only.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name (string)
|
||||
* 1: Event args (any)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _eventName;
|
||||
|
||||
if (!isNil "_eventFunctions") then {
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Local Event: %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
{
|
||||
if (!isNil "_x") then {
|
||||
_eventArgs call CALLSTACK_NAMED(_x,FORMAT_2("Local Event %1 ID: %2",_eventName,_forEachIndex));
|
||||
|
||||
#ifdef DEBUG_EVENTS_CALLSTACK
|
||||
ACE_LOGINFO_1(" ID: %1",_forEachIndex);
|
||||
#endif
|
||||
};
|
||||
} forEach _eventFunctions;
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Remove all events of a certain event type.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName"];
|
||||
|
||||
GVAR(eventsLocation) setVariable [_eventName, nil];
|
||||
/*
|
||||
* Author: Nou
|
||||
* Remove all events of a certain event type.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName"];
|
||||
|
||||
GVAR(eventsLocation) setVariable [_eventName, nil];
|
||||
|
@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Remove an event handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event code <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventCodeIndex"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _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);};
|
||||
|
||||
_eventFunctions set [_eventCodeIndex, nil];
|
||||
/*
|
||||
* Author: Nou
|
||||
* Remove an event handler.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event code <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventCodeIndex"];
|
||||
|
||||
private _eventFunctions = GVAR(eventsLocation) getVariable _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);};
|
||||
|
||||
_eventFunctions set [_eventCodeIndex, nil];
|
||||
|
@ -1,26 +1,26 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Remove a synced event handler
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _data = HASH_GET(GVAR(syncedEvents),_name);
|
||||
_data params ["", "", "", "_eventId"];
|
||||
|
||||
[_eventId] call FUNC(removeEventHandler);
|
||||
HASH_REM(GVAR(syncedEvents),_name);
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Remove a synced event handler
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name"];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _data = HASH_GET(GVAR(syncedEvents),_name);
|
||||
_data params ["", "", "", "_eventId"];
|
||||
|
||||
[_eventId] call FUNC(removeEventHandler);
|
||||
HASH_REM(GVAR(syncedEvents),_name);
|
||||
|
@ -1,20 +1,20 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Send a request to synchronize an event name from the client->server. Execute on client only.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: eventName <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName"];
|
||||
|
||||
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
|
||||
if (isServer) exitWith {false};
|
||||
|
||||
["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent);
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Send a request to synchronize an event name from the client->server. Execute on client only.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: eventName <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName"];
|
||||
|
||||
// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand
|
||||
if (isServer) exitWith {false};
|
||||
|
||||
["SEH_s", [_eventName, ACE_player] ] call FUNC(serverEvent);
|
||||
|
@ -1,29 +1,29 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a event only on the server.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event args <ANY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Server Event: %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
|
||||
if (!isServer) then {
|
||||
publicVariableServer "ACEg";
|
||||
} else {
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a event only on the server.
|
||||
*
|
||||
* Argument:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event args <ANY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventArgs"];
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_1("* Server Event: %1",_eventName);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
ACEg = [_eventName, _eventArgs];
|
||||
|
||||
if (!isServer) then {
|
||||
publicVariableServer "ACEg";
|
||||
} else {
|
||||
["ACEg", ACEg] call FUNC(_handleNetEvent);
|
||||
};
|
||||
|
@ -1,26 +1,26 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Call and propegate a synced event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
* 1: Arguments <ARRAY>
|
||||
* 2: TTL <NUMBER, CODE> [Optional] for this specific event call
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_args", ["_ttl", 0]];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventData = [_name, _args, _ttl];
|
||||
|
||||
["SEH", _eventData] call FUNC(globalEvent);
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Call and propegate a synced event
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name <STRING>
|
||||
* 1: Arguments <ARRAY>
|
||||
* 2: TTL <NUMBER, CODE> [Optional] for this specific event call
|
||||
*
|
||||
* Return Value:
|
||||
* Boolean of success <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_args", ["_ttl", 0]];
|
||||
|
||||
if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
||||
ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name);
|
||||
false
|
||||
};
|
||||
|
||||
private _eventData = [_name, _args, _ttl];
|
||||
|
||||
["SEH", _eventData] call FUNC(globalEvent);
|
||||
|
@ -1,62 +1,62 @@
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!isServer) exitWith {false};
|
||||
|
||||
// Walk through the local synced events and clean up anything thats already EOL
|
||||
// @TODO: This should be iteration limited to prevent FPS lag
|
||||
|
||||
{
|
||||
private _name = _x;
|
||||
|
||||
private _data = HASH_GET(GVAR(syncedEvents),_name);
|
||||
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
|
||||
|
||||
private _newEventLog = [];
|
||||
|
||||
// @TODO: This should be iteration limited to prevent FPS lag
|
||||
{
|
||||
private _eventEntry = _x;
|
||||
private _ttlReturn = true;
|
||||
|
||||
if (_globalEventTTL isEqualType {}) then {
|
||||
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
|
||||
} else {
|
||||
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
|
||||
};
|
||||
|
||||
if (_ttlReturn) then {
|
||||
// Do event based TTL check
|
||||
_eventEntry params ["_time", "", "_eventTTL"];
|
||||
|
||||
if (_eventTTL isEqualType {}) then {
|
||||
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
|
||||
} else {
|
||||
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};
|
||||
};
|
||||
};
|
||||
|
||||
// Finally drop it if the TTL check fails
|
||||
if (_ttlReturn) then {
|
||||
_newEventLog pushBack _x;
|
||||
};
|
||||
false
|
||||
} count _eventLog;
|
||||
|
||||
_data set [1, _newEventLog];
|
||||
false
|
||||
} 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
|
||||
/*
|
||||
* Author: ?
|
||||
*
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!isServer) exitWith {false};
|
||||
|
||||
// Walk through the local synced events and clean up anything thats already EOL
|
||||
// @TODO: This should be iteration limited to prevent FPS lag
|
||||
|
||||
{
|
||||
private _name = _x;
|
||||
|
||||
private _data = HASH_GET(GVAR(syncedEvents),_name);
|
||||
_data params ["_eventTime", "_eventLog", "_globalEventTTL"];
|
||||
|
||||
private _newEventLog = [];
|
||||
|
||||
// @TODO: This should be iteration limited to prevent FPS lag
|
||||
{
|
||||
private _eventEntry = _x;
|
||||
private _ttlReturn = true;
|
||||
|
||||
if (_globalEventTTL isEqualType {}) then {
|
||||
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
|
||||
} else {
|
||||
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
|
||||
};
|
||||
|
||||
if (_ttlReturn) then {
|
||||
// Do event based TTL check
|
||||
_eventEntry params ["_time", "", "_eventTTL"];
|
||||
|
||||
if (_eventTTL isEqualType {}) then {
|
||||
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
|
||||
} else {
|
||||
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};
|
||||
};
|
||||
};
|
||||
|
||||
// Finally drop it if the TTL check fails
|
||||
if (_ttlReturn) then {
|
||||
_newEventLog pushBack _x;
|
||||
};
|
||||
false
|
||||
} count _eventLog;
|
||||
|
||||
_data set [1, _newEventLog];
|
||||
false
|
||||
} 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
|
||||
|
@ -1,33 +1,33 @@
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a event only on specific clients.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name (STRING)
|
||||
* 1: Event targets <OBJECT, ARRAY>
|
||||
* 2: Event args <ANY>
|
||||
*
|
||||
* Note: If local executor is in list of targets, event will execute with
|
||||
* network delay, and not immediatly.
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventTargets", "_eventArgs"];
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
ACEc = [_eventName, _eventTargets, _eventArgs];
|
||||
|
||||
if (!isServer) then {
|
||||
publicVariableServer "ACEc";
|
||||
} else {
|
||||
["ACEc", ACEc] call FUNC(_handleNetEvent);
|
||||
};
|
||||
/*
|
||||
* Author: Nou
|
||||
* Execute a event only on specific clients.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name (STRING)
|
||||
* 1: Event targets <OBJECT, ARRAY>
|
||||
* 2: Event args <ANY>
|
||||
*
|
||||
* Note: If local executor is in list of targets, event will execute with
|
||||
* network delay, and not immediatly.
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_eventName", "_eventTargets", "_eventArgs"];
|
||||
|
||||
#ifdef DEBUG_EVENTS
|
||||
ACE_LOGINFO_2("* Target Event: %1 - %2",_eventName,_eventTargets);
|
||||
ACE_LOGINFO_1(" args=%1",_eventArgs);
|
||||
#endif
|
||||
|
||||
ACEc = [_eventName, _eventTargets, _eventArgs];
|
||||
|
||||
if (!isServer) then {
|
||||
publicVariableServer "ACEc";
|
||||
} else {
|
||||
["ACEc", ACEc] call FUNC(_handleNetEvent);
|
||||
};
|
||||
|
@ -1,40 +1,40 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* PFEH to set all Ace Time Variables
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
BEGIN_COUNTER(timePFH);
|
||||
|
||||
private _lastTickTime = ACE_diagTime;
|
||||
private _lastGameTime = ACE_gameTime;
|
||||
|
||||
ACE_gameTime = time;
|
||||
ACE_diagTime = diag_tickTime;
|
||||
|
||||
private _delta = ACE_diagTime - _lastTickTime;
|
||||
|
||||
if (ACE_gameTime <= _lastGameTime) then {
|
||||
TRACE_1("paused",_delta);
|
||||
ACE_paused = true;
|
||||
// Game is paused or not running
|
||||
ACE_pausedTime = ACE_pausedTime + _delta;
|
||||
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
|
||||
} else {
|
||||
TRACE_1("live",_delta);
|
||||
ACE_paused = false;
|
||||
// Time is updating
|
||||
ACE_realTime = ACE_realTime + _delta;
|
||||
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
|
||||
ACE_time = ACE_virtualTime;
|
||||
};
|
||||
|
||||
END_COUNTER(timePFH);
|
||||
/*
|
||||
* Author: jaynus
|
||||
* PFEH to set all Ace Time Variables
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
BEGIN_COUNTER(timePFH);
|
||||
|
||||
private _lastTickTime = ACE_diagTime;
|
||||
private _lastGameTime = ACE_gameTime;
|
||||
|
||||
ACE_gameTime = time;
|
||||
ACE_diagTime = diag_tickTime;
|
||||
|
||||
private _delta = ACE_diagTime - _lastTickTime;
|
||||
|
||||
if (ACE_gameTime <= _lastGameTime) then {
|
||||
TRACE_1("paused",_delta);
|
||||
ACE_paused = true;
|
||||
// Game is paused or not running
|
||||
ACE_pausedTime = ACE_pausedTime + _delta;
|
||||
ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime);
|
||||
} else {
|
||||
TRACE_1("live",_delta);
|
||||
ACE_paused = false;
|
||||
// Time is updating
|
||||
ACE_realTime = ACE_realTime + _delta;
|
||||
ACE_virtualTime = ACE_virtualTime + (_delta * accTime);
|
||||
ACE_time = ACE_virtualTime;
|
||||
};
|
||||
|
||||
END_COUNTER(timePFH);
|
||||
|
@ -1,23 +1,23 @@
|
||||
/*
|
||||
* Author: ?
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_matrix", "_offset"];
|
||||
|
||||
private _origin = getPosASL _object;
|
||||
|
||||
_matrix params ["_xVec", "_yVec", "_zVec"];
|
||||
|
||||
_offset params ["_x", "_y", "_z"];
|
||||
|
||||
(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return
|
||||
/*
|
||||
* Author: ?
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_matrix", "_offset"];
|
||||
|
||||
private _origin = getPosASL _object;
|
||||
|
||||
_matrix params ["_xVec", "_yVec", "_zVec"];
|
||||
|
||||
_offset params ["_x", "_y", "_z"];
|
||||
|
||||
(_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y) vectorAdd (_zVec vectorMultiply _z) vectorAdd _origin // return
|
||||
|
@ -1,29 +1,29 @@
|
||||
/*
|
||||
* Author: ?
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_matrix", "_offset"];
|
||||
|
||||
private _origin = getPosASL _object;
|
||||
|
||||
_matrix params ["_xVec", "_yVec", "_zVec"];
|
||||
|
||||
_offset = _offset vectorDiff _origin;
|
||||
|
||||
_offset params ["_x", "_y", "_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),
|
||||
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
|
||||
] // return
|
||||
/*
|
||||
* Author: ?
|
||||
* ?
|
||||
*
|
||||
* Arguments:
|
||||
* ?
|
||||
*
|
||||
* Return Value:
|
||||
* ?
|
||||
*
|
||||
* Public: ?
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_matrix", "_offset"];
|
||||
|
||||
private _origin = getPosASL _object;
|
||||
|
||||
_matrix params ["_xVec", "_yVec", "_zVec"];
|
||||
|
||||
_offset = _offset vectorDiff _origin;
|
||||
|
||||
_offset params ["_x", "_y", "_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),
|
||||
((_zVec select 0) * _x) + ((_zVec select 1) * _y) + ((_zVec select 2) * _z)
|
||||
] // return
|
||||
|
@ -1,24 +1,24 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Position ASL to get height at
|
||||
*
|
||||
* Return Value:
|
||||
* Wave height in meters
|
||||
*
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_position"];
|
||||
|
||||
if (isNil QGVAR(waveHeightLogic)) then {
|
||||
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
|
||||
};
|
||||
|
||||
GVAR(waveHeightLogic) setPosASL _position;
|
||||
|
||||
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)
|
||||
/*
|
||||
* Author: jaynus
|
||||
* Gets the wave height at a specific location. Uses a logic, so may be performance iffy
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Position ASL to get height at
|
||||
*
|
||||
* Return Value:
|
||||
* Wave height in meters
|
||||
*
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_position"];
|
||||
|
||||
if (isNil QGVAR(waveHeightLogic)) then {
|
||||
GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0];
|
||||
};
|
||||
|
||||
GVAR(waveHeightLogic) setPosASL _position;
|
||||
|
||||
(getPosASLW GVAR(waveHeightLogic) select 2) - (getPosASL GVAR(waveHeightLogic) select 2)
|
||||
|
@ -1,74 +1,74 @@
|
||||
/*
|
||||
* Author: zGuba 2011
|
||||
* Function helper for framing objects on screen.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: object <OBJECT>
|
||||
* 1: margins 3D <ARRAY>
|
||||
* 0: X <NUMBER>
|
||||
* 1: Y <NUMBER>
|
||||
* 2: Z <NUMBER>
|
||||
* 2: offset 3D <ARRAY>
|
||||
* 0: X <NUMBER>
|
||||
* 1: Y <NUMBER>
|
||||
* 2: Z <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Minimal X <NUMMBER>
|
||||
* 1: Minimal Y <NUMMBER>
|
||||
* 2: Maximal X <NUMMBER>
|
||||
* 3: Maximal Y <NUMMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_margins", "_offsets"];
|
||||
|
||||
private _minX = 10;
|
||||
private _minY = 10;
|
||||
private _maxX = -10;
|
||||
private _maxY = -10;
|
||||
|
||||
private _bounds = boundingBox _object;
|
||||
_margins params ["_marginsX", "_marginsY", "_marginsZ"];
|
||||
_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"];
|
||||
|
||||
_bounds params ["_boundsMin", "_boundsMax"];
|
||||
_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"];
|
||||
_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"];
|
||||
|
||||
_boundsMinX = _boundsMinX - _marginsX + _offsetsX;
|
||||
_boundsMinY = _boundsMinY - _marginsY + _offsetsY;
|
||||
_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ;
|
||||
|
||||
_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX;
|
||||
_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY;
|
||||
_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ;
|
||||
|
||||
private _boundsCorners = [
|
||||
[_boundsMinX, _boundsMinY, _boundsMinZ],
|
||||
[_boundsMinX, _boundsMinY, _boundsMaxZ],
|
||||
[_boundsMinX, _boundsMaxY, _boundsMinZ],
|
||||
[_boundsMinX, _boundsMaxY, _boundsMaxZ],
|
||||
[_boundsMaxX, _boundsMinY, _boundsMinZ],
|
||||
[_boundsMaxX, _boundsMinY, _boundsMaxZ],
|
||||
[_boundsMaxX, _boundsMaxY, _boundsMinZ],
|
||||
[_boundsMaxX, _boundsMaxY, _boundsMaxZ]
|
||||
];
|
||||
|
||||
{
|
||||
private _ppos = worldToScreen (_object modelToWorld _x);
|
||||
|
||||
if (count _ppos >= 2) then {
|
||||
_ppos params ["_pposX", "_pposY"];
|
||||
|
||||
if (_pposX < _minX) then {_minX = _pposX};
|
||||
if (_pposX > _maxX) then {_maxX = _pposX};
|
||||
if (_pposY < _minY) then {_minY = _pposY};
|
||||
if (_pposY > _maxY) then {_maxY = _pposY};
|
||||
}; //else - what to do if it is offscreen?
|
||||
false
|
||||
} count _boundsCorners;
|
||||
|
||||
[_minX, _minY, _maxX, _maxY]
|
||||
/*
|
||||
* Author: zGuba 2011
|
||||
* Function helper for framing objects on screen.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: object <OBJECT>
|
||||
* 1: margins 3D <ARRAY>
|
||||
* 0: X <NUMBER>
|
||||
* 1: Y <NUMBER>
|
||||
* 2: Z <NUMBER>
|
||||
* 2: offset 3D <ARRAY>
|
||||
* 0: X <NUMBER>
|
||||
* 1: Y <NUMBER>
|
||||
* 2: Z <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Minimal X <NUMMBER>
|
||||
* 1: Minimal Y <NUMMBER>
|
||||
* 2: Maximal X <NUMMBER>
|
||||
* 3: Maximal Y <NUMMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object", "_margins", "_offsets"];
|
||||
|
||||
private _minX = 10;
|
||||
private _minY = 10;
|
||||
private _maxX = -10;
|
||||
private _maxY = -10;
|
||||
|
||||
private _bounds = boundingBox _object;
|
||||
_margins params ["_marginsX", "_marginsY", "_marginsZ"];
|
||||
_offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"];
|
||||
|
||||
_bounds params ["_boundsMin", "_boundsMax"];
|
||||
_boundsMin params ["_boundsMinX", "_boundsMinY", "_boundsMinZ"];
|
||||
_boundsMax params ["_boundsMaxX", "_boundsMaxY", "_boundsMaxZ"];
|
||||
|
||||
_boundsMinX = _boundsMinX - _marginsX + _offsetsX;
|
||||
_boundsMinY = _boundsMinY - _marginsY + _offsetsY;
|
||||
_boundsMinZ = _boundsMinZ - _marginsZ + _offsetsZ;
|
||||
|
||||
_boundsMaxX = _boundsMaxX + _marginsX + _offsetsX;
|
||||
_boundsMaxY = _boundsMaxY + _marginsY + _offsetsY;
|
||||
_boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ;
|
||||
|
||||
private _boundsCorners = [
|
||||
[_boundsMinX, _boundsMinY, _boundsMinZ],
|
||||
[_boundsMinX, _boundsMinY, _boundsMaxZ],
|
||||
[_boundsMinX, _boundsMaxY, _boundsMinZ],
|
||||
[_boundsMinX, _boundsMaxY, _boundsMaxZ],
|
||||
[_boundsMaxX, _boundsMinY, _boundsMinZ],
|
||||
[_boundsMaxX, _boundsMinY, _boundsMaxZ],
|
||||
[_boundsMaxX, _boundsMaxY, _boundsMinZ],
|
||||
[_boundsMaxX, _boundsMaxY, _boundsMaxZ]
|
||||
];
|
||||
|
||||
{
|
||||
private _ppos = worldToScreen (_object modelToWorld _x);
|
||||
|
||||
if (count _ppos >= 2) then {
|
||||
_ppos params ["_pposX", "_pposY"];
|
||||
|
||||
if (_pposX < _minX) then {_minX = _pposX};
|
||||
if (_pposX > _maxX) then {_maxX = _pposX};
|
||||
if (_pposY < _minY) then {_minY = _pposY};
|
||||
if (_pposY > _maxY) then {_maxY = _pposY};
|
||||
}; //else - what to do if it is offscreen?
|
||||
false
|
||||
} count _boundsCorners;
|
||||
|
||||
[_minX, _minY, _maxX, _maxY]
|
||||
|
@ -1,13 +1,13 @@
|
||||
#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 ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
|
||||
#define HANDLECATCH diag_log text _exception; assert(exception=="")
|
||||
|
||||
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
|
||||
_callFrom = "";\
|
||||
_lineNo = -1;\
|
||||
if((count _this) > c) then {\
|
||||
_callFrom = _this select c;\
|
||||
_lineNo = _this select c+1;\
|
||||
};
|
||||
#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 ERROR(msg) throw msg + format[" @ %1:%2", _callFrom, _lineNo]
|
||||
#define HANDLECATCH diag_log text _exception; assert(exception=="")
|
||||
|
||||
#define ERRORDATA(c) private ["_callFrom", "_lineNo"];\
|
||||
_callFrom = "";\
|
||||
_lineNo = -1;\
|
||||
if((count _this) > c) then {\
|
||||
_callFrom = _this select c;\
|
||||
_lineNo = _this select c+1;\
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _vehicle = vehicle _unit;
|
||||
|
||||
if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
|
||||
|
||||
private _turret = [_unit] call EFUNC(common,getTurretIndex);
|
||||
|
||||
[_vehicle, _turret] call FUNC(keyDown);
|
||||
[_vehicle, _turret] call FUNC(keyUp);
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _vehicle = vehicle _unit;
|
||||
|
||||
if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
|
||||
|
||||
private _turret = [_unit] call EFUNC(common,getTurretIndex);
|
||||
|
||||
[_vehicle, _turret] call FUNC(keyDown);
|
||||
[_vehicle, _turret] call FUNC(keyUp);
|
||||
|
@ -1,27 +1,27 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(enabled_displayName);
|
||||
};
|
||||
class GVAR(maxRange) {
|
||||
value = 4;
|
||||
typeName = "SCALAR";
|
||||
displayName = CSTRING(maxRange_displayName);
|
||||
description = CSTRING(maxRange_description);
|
||||
};
|
||||
class GVAR(indicatorForSelf) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(indicatorForSelf_name);
|
||||
description = CSTRING(indicatorForSelf_description);
|
||||
};
|
||||
class GVAR(indicatorColor) {
|
||||
value[] = {0.83, 0.68, 0.21, 0.75};
|
||||
typeName = "COLOR";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(indicatorColor_name);
|
||||
description = CSTRING(indicatorColor_description);
|
||||
};
|
||||
};
|
||||
class ACE_Settings {
|
||||
class GVAR(enabled) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(enabled_displayName);
|
||||
};
|
||||
class GVAR(maxRange) {
|
||||
value = 4;
|
||||
typeName = "SCALAR";
|
||||
displayName = CSTRING(maxRange_displayName);
|
||||
description = CSTRING(maxRange_description);
|
||||
};
|
||||
class GVAR(indicatorForSelf) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(indicatorForSelf_name);
|
||||
description = CSTRING(indicatorForSelf_description);
|
||||
};
|
||||
class GVAR(indicatorColor) {
|
||||
value[] = {0.83, 0.68, 0.21, 0.75};
|
||||
typeName = "COLOR";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(indicatorColor_name);
|
||||
description = CSTRING(indicatorColor_description);
|
||||
};
|
||||
};
|
||||
|
@ -1,18 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {QGVAR(moduleSettings)};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Drill"};
|
||||
authorUrl = "https://github.com/TheDrill/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {QGVAR(moduleSettings)};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Drill"};
|
||||
authorUrl = "https://github.com/TheDrill/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
@ -1,26 +1,26 @@
|
||||
#define COMPONENT finger
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_FINGER
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_FINGER
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define BASE_SIZE 44
|
||||
|
||||
#define FP_TIMEOUT 2
|
||||
#define FP_ACTION_TIMEOUT 1
|
||||
|
||||
#define FP_DISTANCE 10000
|
||||
#define FP_RANDOMIZATION_X 350
|
||||
#define FP_RANDOMIZATION_Y 100
|
||||
#define COMPONENT finger
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_FINGER
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_FINGER
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FINGER
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define BASE_SIZE 44
|
||||
|
||||
#define FP_TIMEOUT 2
|
||||
#define FP_ACTION_TIMEOUT 1
|
||||
|
||||
#define FP_DISTANCE 10000
|
||||
#define FP_RANDOMIZATION_X 350
|
||||
#define FP_RANDOMIZATION_Y 100
|
||||
|
@ -1,478 +1,478 @@
|
||||
#define BASE_DRAG -0.01
|
||||
#define HD_MULT 5
|
||||
#define BASE_DRAG_HD (BASE_DRAG*HD_MULT)
|
||||
|
||||
class CfgAmmo {
|
||||
//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_delay: ace_arty_105mm_m1_m782_prox {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class Bo_GBU12_LGB;
|
||||
class ACE_GBU12 : Bo_GBU12_LGB {
|
||||
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(metal) = 140000;
|
||||
GVAR(charge) = 87000;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
sideAirFriction = 0.04;
|
||||
airFriction = 0.04;
|
||||
laserLock = 0;
|
||||
};
|
||||
|
||||
class GrenadeBase;
|
||||
class Grenade;
|
||||
class GrenadeHand: Grenade {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(skip) = 0;
|
||||
GVAR(force) = 1;
|
||||
// This is a good high-drag frag type for grenades.
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
/*
|
||||
These values are based on the M67 Grenade, should be tweaked for
|
||||
individual grenades.
|
||||
*/
|
||||
GVAR(metal) = 210; // metal 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_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations
|
||||
};
|
||||
class GrenadeHand_stone: GrenadeHand {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
class SmokeShell: GrenadeHand {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
|
||||
class RocketBase;
|
||||
class R_Hydra_HE: RocketBase {
|
||||
// Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 3850;
|
||||
GVAR(charge) = 1040;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
//class R_57mm_HE: RocketBase {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class R_80mm_HE: RocketBase {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
|
||||
//class R_S8T_AT: RocketBase {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class BombCore;
|
||||
class Bo_Mk82: BombCore {
|
||||
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(metal) = 140000;
|
||||
GVAR(charge) = 87000;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
class G_40mm_HE: GrenadeBase {
|
||||
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441
|
||||
GVAR(enabled) = 1;
|
||||
GVAR(force) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
GVAR(metal) = 200;
|
||||
GVAR(charge) = 32;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class G_40mm_HEDP: G_40mm_HE {
|
||||
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
GVAR(metal) = 200;
|
||||
GVAR(charge) = 45;
|
||||
GVAR(gurney_c) = 2830;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
class ACE_G_40mm_HEDP: G_40mm_HEDP {
|
||||
};
|
||||
class ACE_G_40mm_HE: G_40mm_HE {
|
||||
};
|
||||
class ACE_G_40mm_Practice: ACE_G_40mm_HE {
|
||||
GVAR(skip) = 1;
|
||||
GVAR(force) = 0;
|
||||
};
|
||||
class ACE_G40mm_HE_VOG25P: G_40mm_HE {
|
||||
GVAR(skip) = 0;
|
||||
GVAR(force) = 1;
|
||||
};
|
||||
|
||||
// curator ammo entries
|
||||
class ShellBase;
|
||||
class Sh_125mm_HEAT;
|
||||
class Sh_155mm_AMOS: ShellBase {
|
||||
// Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm
|
||||
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(metal) = 36000;
|
||||
GVAR(charge) = 9979;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_82mm_AMOS : Sh_155mm_AMOS {
|
||||
// Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 3200;
|
||||
GVAR(charge) = 420;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 800;
|
||||
GVAR(charge) = 4200;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_105mm_HEAT_MP : Sh_125mm_HEAT {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 11400;
|
||||
GVAR(charge) = 7100;
|
||||
GVAR(gurney_c) = 2800;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_120mm_HE : ShellBase {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 23000;
|
||||
GVAR(charge) = 3148;
|
||||
GVAR(gurney_c) = 2830;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_125mm_HE: Sh_120mm_HE {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 16000;
|
||||
GVAR(charge) = 3200;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS {
|
||||
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(metal) = 1950;
|
||||
GVAR(charge) = 15800;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
//class R_230mm_HE;
|
||||
//class ModuleOrdnanceRocket_F_ammo: R_230mm_HE {
|
||||
//};
|
||||
|
||||
//class R_230mm_fly;
|
||||
//class ModuleOrdnanceRocket_F_subammo: R_230mm_fly {
|
||||
//};
|
||||
// end of curator ammo entries
|
||||
|
||||
//class R_SMAW_HEDP;
|
||||
//class R_MEEWS_HEDP : R_SMAW_HEDP {
|
||||
// GVAR(force) = 1;
|
||||
// GVAR(multiplier) = 1.2;
|
||||
//};
|
||||
|
||||
class MissileBase;
|
||||
class Missile_AGM_02_F : MissileBase {
|
||||
// Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 56250;
|
||||
GVAR(charge) = 39000;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class M_Hellfire_AT: MissileBase {
|
||||
// Source: http://www.designation-systems.net/dusrm/m-114.html
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 8000;
|
||||
GVAR(charge) = 2400;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
/*
|
||||
class B_762x51_Ball;
|
||||
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";
|
||||
timeToLive = 12;
|
||||
typicalSpeed = 800;
|
||||
// Fix sounds
|
||||
effectFly = "AmmoClassic";
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135};
|
||||
};
|
||||
*/
|
||||
|
||||
class B_65x39_Caseless;
|
||||
class ACE_frag_base: B_65x39_Caseless {
|
||||
timeToLive = 12;
|
||||
typicalSpeed = 1500;
|
||||
deflecting = 65;
|
||||
};
|
||||
|
||||
class ACE_frag_tiny: ACE_frag_base {
|
||||
hit = 6;
|
||||
airFriction = BASE_DRAG;
|
||||
caliber = 0.75;
|
||||
};
|
||||
|
||||
class ACE_frag_tiny_HD: ACE_frag_base {
|
||||
hit = 6;
|
||||
airFriction = BASE_DRAG_HD;
|
||||
caliber = 0.75;
|
||||
};
|
||||
|
||||
class ACE_frag_small: ACE_frag_base {
|
||||
hit = 12;
|
||||
airFriction = BASE_DRAG*0.9;
|
||||
};
|
||||
|
||||
class ACE_frag_small_HD: ACE_frag_base {
|
||||
hit = 12;
|
||||
airFriction = BASE_DRAG_HD*0.9;
|
||||
};
|
||||
|
||||
class ACE_frag_medium: ACE_frag_base {
|
||||
hit = 14;
|
||||
airFriction = BASE_DRAG*0.75;
|
||||
caliber = 1.2;
|
||||
};
|
||||
|
||||
class ACE_frag_medium_HD: ACE_frag_base {
|
||||
hit = 14;
|
||||
airFriction = BASE_DRAG_HD*0.75;
|
||||
caliber = 1.2;
|
||||
};
|
||||
|
||||
class ACE_frag_large: ACE_frag_base {
|
||||
hit = 28;
|
||||
indirectHit = 2;
|
||||
indirectHitRange = 0.25;
|
||||
airFriction = BASE_DRAG*0.65;
|
||||
caliber = 2;
|
||||
explosive = 0;
|
||||
|
||||
};
|
||||
|
||||
class ACE_frag_large_HD: ACE_frag_large {
|
||||
hit = 28;
|
||||
indirectHit = 2;
|
||||
indirectHitRange = 0.25;
|
||||
airFriction = BASE_DRAG_HD*0.65;
|
||||
caliber = 2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
class ACE_frag_huge: ACE_frag_large {
|
||||
hit = 40;
|
||||
indirectHit = 4;
|
||||
indirectHitRange = 0.5;
|
||||
airFriction = BASE_DRAG*0.5;
|
||||
caliber = 2.8;
|
||||
};
|
||||
|
||||
class ACE_frag_huge_HD: ACE_frag_large {
|
||||
hit = 40;
|
||||
indirectHit = 4;
|
||||
indirectHitRange = 0.5;
|
||||
airFriction = BASE_DRAG_HD*0.5;
|
||||
caliber = 2.8;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_small: ACE_frag_small {
|
||||
timeToLive = 0.1;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_medium: ACE_frag_medium {
|
||||
timeToLive = 0.15;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_large: ACE_frag_large {
|
||||
timeToLive = 0.25;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_huge: ACE_frag_huge {
|
||||
timeToLive = 0.3;
|
||||
};
|
||||
|
||||
#include "CfgAmmoReflections.hpp"
|
||||
};
|
||||
#define BASE_DRAG -0.01
|
||||
#define HD_MULT 5
|
||||
#define BASE_DRAG_HD (BASE_DRAG*HD_MULT)
|
||||
|
||||
class CfgAmmo {
|
||||
//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_delay: ace_arty_105mm_m1_m782_prox {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class Bo_GBU12_LGB;
|
||||
class ACE_GBU12 : Bo_GBU12_LGB {
|
||||
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(metal) = 140000;
|
||||
GVAR(charge) = 87000;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
sideAirFriction = 0.04;
|
||||
airFriction = 0.04;
|
||||
laserLock = 0;
|
||||
};
|
||||
|
||||
class GrenadeBase;
|
||||
class Grenade;
|
||||
class GrenadeHand: Grenade {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(skip) = 0;
|
||||
GVAR(force) = 1;
|
||||
// This is a good high-drag frag type for grenades.
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
/*
|
||||
These values are based on the M67 Grenade, should be tweaked for
|
||||
individual grenades.
|
||||
*/
|
||||
GVAR(metal) = 210; // metal 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_k) = 3/5; // Gurney shape factor, in this case a sphere. See: http://en.wikipedia.org/wiki/Gurney_equations
|
||||
};
|
||||
class GrenadeHand_stone: GrenadeHand {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
class SmokeShell: GrenadeHand {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
|
||||
class RocketBase;
|
||||
class R_Hydra_HE: RocketBase {
|
||||
// Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 3850;
|
||||
GVAR(charge) = 1040;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
//class R_57mm_HE: RocketBase {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class R_80mm_HE: RocketBase {
|
||||
GVAR(skip) = 1;
|
||||
};
|
||||
|
||||
//class R_S8T_AT: RocketBase {
|
||||
// GVAR(skip) = 1;
|
||||
//};
|
||||
|
||||
class BombCore;
|
||||
class Bo_Mk82: BombCore {
|
||||
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(metal) = 140000;
|
||||
GVAR(charge) = 87000;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
class G_40mm_HE: GrenadeBase {
|
||||
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441
|
||||
GVAR(enabled) = 1;
|
||||
GVAR(force) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
GVAR(metal) = 200;
|
||||
GVAR(charge) = 32;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class G_40mm_HEDP: G_40mm_HE {
|
||||
// Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_tiny_HD"};
|
||||
GVAR(metal) = 200;
|
||||
GVAR(charge) = 45;
|
||||
GVAR(gurney_c) = 2830;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
class ACE_G_40mm_HEDP: G_40mm_HEDP {
|
||||
};
|
||||
class ACE_G_40mm_HE: G_40mm_HE {
|
||||
};
|
||||
class ACE_G_40mm_Practice: ACE_G_40mm_HE {
|
||||
GVAR(skip) = 1;
|
||||
GVAR(force) = 0;
|
||||
};
|
||||
class ACE_G40mm_HE_VOG25P: G_40mm_HE {
|
||||
GVAR(skip) = 0;
|
||||
GVAR(force) = 1;
|
||||
};
|
||||
|
||||
// curator ammo entries
|
||||
class ShellBase;
|
||||
class Sh_125mm_HEAT;
|
||||
class Sh_155mm_AMOS: ShellBase {
|
||||
// Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm
|
||||
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(metal) = 36000;
|
||||
GVAR(charge) = 9979;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_82mm_AMOS : Sh_155mm_AMOS {
|
||||
// Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 3200;
|
||||
GVAR(charge) = 420;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 800;
|
||||
GVAR(charge) = 4200;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_105mm_HEAT_MP : Sh_125mm_HEAT {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 11400;
|
||||
GVAR(charge) = 7100;
|
||||
GVAR(gurney_c) = 2800;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_120mm_HE : ShellBase {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 23000;
|
||||
GVAR(charge) = 3148;
|
||||
GVAR(gurney_c) = 2830;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class Sh_125mm_HE: Sh_120mm_HE {
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 16000;
|
||||
GVAR(charge) = 3200;
|
||||
GVAR(gurney_c) = 2440;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS {
|
||||
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(metal) = 1950;
|
||||
GVAR(charge) = 15800;
|
||||
GVAR(gurney_c) = 2320;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
//class R_230mm_HE;
|
||||
//class ModuleOrdnanceRocket_F_ammo: R_230mm_HE {
|
||||
//};
|
||||
|
||||
//class R_230mm_fly;
|
||||
//class ModuleOrdnanceRocket_F_subammo: R_230mm_fly {
|
||||
//};
|
||||
// end of curator ammo entries
|
||||
|
||||
//class R_SMAW_HEDP;
|
||||
//class R_MEEWS_HEDP : R_SMAW_HEDP {
|
||||
// GVAR(force) = 1;
|
||||
// GVAR(multiplier) = 1.2;
|
||||
//};
|
||||
|
||||
class MissileBase;
|
||||
class Missile_AGM_02_F : MissileBase {
|
||||
// Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 56250;
|
||||
GVAR(charge) = 39000;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
class M_Hellfire_AT: MissileBase {
|
||||
// Source: http://www.designation-systems.net/dusrm/m-114.html
|
||||
GVAR(enabled) = 1;
|
||||
|
||||
GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"};
|
||||
GVAR(metal) = 8000;
|
||||
GVAR(charge) = 2400;
|
||||
GVAR(gurney_c) = 2700;
|
||||
GVAR(gurney_k) = 1/2;
|
||||
};
|
||||
|
||||
/*
|
||||
class B_762x51_Ball;
|
||||
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";
|
||||
timeToLive = 12;
|
||||
typicalSpeed = 800;
|
||||
// Fix sounds
|
||||
effectFly = "AmmoClassic";
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
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};
|
||||
supersonicCrackFar[] = {"A3\sounds_f\weapons\hits\sscrack2.wav",1,1,135};
|
||||
};
|
||||
*/
|
||||
|
||||
class B_65x39_Caseless;
|
||||
class ACE_frag_base: B_65x39_Caseless {
|
||||
timeToLive = 12;
|
||||
typicalSpeed = 1500;
|
||||
deflecting = 65;
|
||||
};
|
||||
|
||||
class ACE_frag_tiny: ACE_frag_base {
|
||||
hit = 6;
|
||||
airFriction = BASE_DRAG;
|
||||
caliber = 0.75;
|
||||
};
|
||||
|
||||
class ACE_frag_tiny_HD: ACE_frag_base {
|
||||
hit = 6;
|
||||
airFriction = BASE_DRAG_HD;
|
||||
caliber = 0.75;
|
||||
};
|
||||
|
||||
class ACE_frag_small: ACE_frag_base {
|
||||
hit = 12;
|
||||
airFriction = BASE_DRAG*0.9;
|
||||
};
|
||||
|
||||
class ACE_frag_small_HD: ACE_frag_base {
|
||||
hit = 12;
|
||||
airFriction = BASE_DRAG_HD*0.9;
|
||||
};
|
||||
|
||||
class ACE_frag_medium: ACE_frag_base {
|
||||
hit = 14;
|
||||
airFriction = BASE_DRAG*0.75;
|
||||
caliber = 1.2;
|
||||
};
|
||||
|
||||
class ACE_frag_medium_HD: ACE_frag_base {
|
||||
hit = 14;
|
||||
airFriction = BASE_DRAG_HD*0.75;
|
||||
caliber = 1.2;
|
||||
};
|
||||
|
||||
class ACE_frag_large: ACE_frag_base {
|
||||
hit = 28;
|
||||
indirectHit = 2;
|
||||
indirectHitRange = 0.25;
|
||||
airFriction = BASE_DRAG*0.65;
|
||||
caliber = 2;
|
||||
explosive = 0;
|
||||
|
||||
};
|
||||
|
||||
class ACE_frag_large_HD: ACE_frag_large {
|
||||
hit = 28;
|
||||
indirectHit = 2;
|
||||
indirectHitRange = 0.25;
|
||||
airFriction = BASE_DRAG_HD*0.65;
|
||||
caliber = 2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
class ACE_frag_huge: ACE_frag_large {
|
||||
hit = 40;
|
||||
indirectHit = 4;
|
||||
indirectHitRange = 0.5;
|
||||
airFriction = BASE_DRAG*0.5;
|
||||
caliber = 2.8;
|
||||
};
|
||||
|
||||
class ACE_frag_huge_HD: ACE_frag_large {
|
||||
hit = 40;
|
||||
indirectHit = 4;
|
||||
indirectHitRange = 0.5;
|
||||
airFriction = BASE_DRAG_HD*0.5;
|
||||
caliber = 2.8;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_small: ACE_frag_small {
|
||||
timeToLive = 0.1;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_medium: ACE_frag_medium {
|
||||
timeToLive = 0.15;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_large: ACE_frag_large {
|
||||
timeToLive = 0.25;
|
||||
};
|
||||
|
||||
class ACE_frag_spall_huge: ACE_frag_huge {
|
||||
timeToLive = 0.3;
|
||||
};
|
||||
|
||||
#include "CfgAmmoReflections.hpp"
|
||||
};
|
||||
|
@ -1,130 +1,130 @@
|
||||
//CfgAmmoReflections.hpp
|
||||
|
||||
#define ACE_EXPLOSION_REFLECTION(range, hit)\
|
||||
class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\
|
||||
indirectHitRange = range;\
|
||||
indirectHit = hit;\
|
||||
dangerRadiusHit = range*3;\
|
||||
suppressionRadiusHit = range*2;\
|
||||
}
|
||||
|
||||
#define ACE_EXPLOSION_RANGE(range)\
|
||||
ACE_EXPLOSION_REFLECTION(range,10);\
|
||||
ACE_EXPLOSION_REFLECTION(range,20);\
|
||||
ACE_EXPLOSION_REFLECTION(range,30);\
|
||||
ACE_EXPLOSION_REFLECTION(range,40);\
|
||||
ACE_EXPLOSION_REFLECTION(range,50);\
|
||||
ACE_EXPLOSION_REFLECTION(range,60);\
|
||||
ACE_EXPLOSION_REFLECTION(range,70);\
|
||||
ACE_EXPLOSION_REFLECTION(range,80);\
|
||||
ACE_EXPLOSION_REFLECTION(range,90);\
|
||||
ACE_EXPLOSION_REFLECTION(range,100);\
|
||||
ACE_EXPLOSION_REFLECTION(range,110);\
|
||||
ACE_EXPLOSION_REFLECTION(range,120);\
|
||||
ACE_EXPLOSION_REFLECTION(range,130);\
|
||||
ACE_EXPLOSION_REFLECTION(range,140);\
|
||||
ACE_EXPLOSION_REFLECTION(range,150);\
|
||||
ACE_EXPLOSION_REFLECTION(range,160);\
|
||||
ACE_EXPLOSION_REFLECTION(range,170);\
|
||||
ACE_EXPLOSION_REFLECTION(range,180);\
|
||||
ACE_EXPLOSION_REFLECTION(range,190);\
|
||||
ACE_EXPLOSION_REFLECTION(range,200);\
|
||||
ACE_EXPLOSION_REFLECTION(range,210);\
|
||||
ACE_EXPLOSION_REFLECTION(range,220);\
|
||||
ACE_EXPLOSION_REFLECTION(range,230);\
|
||||
ACE_EXPLOSION_REFLECTION(range,240);\
|
||||
ACE_EXPLOSION_REFLECTION(range,250);\
|
||||
ACE_EXPLOSION_REFLECTION(range,260);\
|
||||
ACE_EXPLOSION_REFLECTION(range,270);\
|
||||
ACE_EXPLOSION_REFLECTION(range,280);\
|
||||
ACE_EXPLOSION_REFLECTION(range,290);\
|
||||
ACE_EXPLOSION_REFLECTION(range,300);\
|
||||
ACE_EXPLOSION_REFLECTION(range,310);\
|
||||
ACE_EXPLOSION_REFLECTION(range,320);\
|
||||
ACE_EXPLOSION_REFLECTION(range,330);\
|
||||
ACE_EXPLOSION_REFLECTION(range,340);\
|
||||
ACE_EXPLOSION_REFLECTION(range,350);\
|
||||
ACE_EXPLOSION_REFLECTION(range,360);\
|
||||
ACE_EXPLOSION_REFLECTION(range,370);\
|
||||
ACE_EXPLOSION_REFLECTION(range,380);\
|
||||
ACE_EXPLOSION_REFLECTION(range,390);\
|
||||
ACE_EXPLOSION_REFLECTION(range,400);\
|
||||
ACE_EXPLOSION_REFLECTION(range,410);\
|
||||
ACE_EXPLOSION_REFLECTION(range,420);\
|
||||
ACE_EXPLOSION_REFLECTION(range,430);\
|
||||
ACE_EXPLOSION_REFLECTION(range,440);\
|
||||
ACE_EXPLOSION_REFLECTION(range,450);\
|
||||
ACE_EXPLOSION_REFLECTION(range,460);\
|
||||
ACE_EXPLOSION_REFLECTION(range,470);\
|
||||
ACE_EXPLOSION_REFLECTION(range,480);\
|
||||
ACE_EXPLOSION_REFLECTION(range,490);\
|
||||
ACE_EXPLOSION_REFLECTION(range,500)
|
||||
|
||||
class ace_explosion_reflection_base : Sh_120mm_HE {
|
||||
CraterWaterEffects = "";
|
||||
CraterEffects = "";
|
||||
effectsMissile = "";
|
||||
ExplosionEffects = "";
|
||||
effectFlare = "";
|
||||
class HitEffects {
|
||||
hitWater = "";
|
||||
};
|
||||
multiSoundHit[] = {};
|
||||
explosionTime = 0.0001;
|
||||
explosive = 1;
|
||||
soundFakeFall[] = {};
|
||||
typicalSpeed = 0;
|
||||
model = "\A3\Weapons_F\empty.p3d";
|
||||
craterShape = "\A3\weapons_f\empty.p3d";
|
||||
};
|
||||
|
||||
ACE_EXPLOSION_RANGE(2);
|
||||
ACE_EXPLOSION_RANGE(4);
|
||||
ACE_EXPLOSION_RANGE(6);
|
||||
ACE_EXPLOSION_RANGE(8);
|
||||
ACE_EXPLOSION_RANGE(10);
|
||||
ACE_EXPLOSION_RANGE(12);
|
||||
ACE_EXPLOSION_RANGE(14);
|
||||
ACE_EXPLOSION_RANGE(16);
|
||||
ACE_EXPLOSION_RANGE(18);
|
||||
ACE_EXPLOSION_RANGE(20);
|
||||
ACE_EXPLOSION_RANGE(22);
|
||||
ACE_EXPLOSION_RANGE(24);
|
||||
ACE_EXPLOSION_RANGE(26);
|
||||
ACE_EXPLOSION_RANGE(28);
|
||||
ACE_EXPLOSION_RANGE(30);
|
||||
ACE_EXPLOSION_RANGE(32);
|
||||
ACE_EXPLOSION_RANGE(34);
|
||||
ACE_EXPLOSION_RANGE(36);
|
||||
ACE_EXPLOSION_RANGE(38);
|
||||
ACE_EXPLOSION_RANGE(40);
|
||||
ACE_EXPLOSION_RANGE(42);
|
||||
ACE_EXPLOSION_RANGE(44);
|
||||
ACE_EXPLOSION_RANGE(46);
|
||||
ACE_EXPLOSION_RANGE(48);
|
||||
ACE_EXPLOSION_RANGE(50);
|
||||
ACE_EXPLOSION_RANGE(52);
|
||||
ACE_EXPLOSION_RANGE(54);
|
||||
ACE_EXPLOSION_RANGE(56);
|
||||
ACE_EXPLOSION_RANGE(58);
|
||||
ACE_EXPLOSION_RANGE(60);
|
||||
ACE_EXPLOSION_RANGE(62);
|
||||
ACE_EXPLOSION_RANGE(64);
|
||||
ACE_EXPLOSION_RANGE(66);
|
||||
ACE_EXPLOSION_RANGE(68);
|
||||
ACE_EXPLOSION_RANGE(70);
|
||||
ACE_EXPLOSION_RANGE(72);
|
||||
ACE_EXPLOSION_RANGE(74);
|
||||
ACE_EXPLOSION_RANGE(76);
|
||||
ACE_EXPLOSION_RANGE(78);
|
||||
ACE_EXPLOSION_RANGE(80);
|
||||
ACE_EXPLOSION_RANGE(82);
|
||||
ACE_EXPLOSION_RANGE(84);
|
||||
ACE_EXPLOSION_RANGE(86);
|
||||
ACE_EXPLOSION_RANGE(88);
|
||||
ACE_EXPLOSION_RANGE(90);
|
||||
ACE_EXPLOSION_RANGE(92);
|
||||
ACE_EXPLOSION_RANGE(94);
|
||||
ACE_EXPLOSION_RANGE(96);
|
||||
ACE_EXPLOSION_RANGE(98);
|
||||
ACE_EXPLOSION_RANGE(100);
|
||||
//CfgAmmoReflections.hpp
|
||||
|
||||
#define ACE_EXPLOSION_REFLECTION(range, hit)\
|
||||
class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\
|
||||
indirectHitRange = range;\
|
||||
indirectHit = hit;\
|
||||
dangerRadiusHit = range*3;\
|
||||
suppressionRadiusHit = range*2;\
|
||||
}
|
||||
|
||||
#define ACE_EXPLOSION_RANGE(range)\
|
||||
ACE_EXPLOSION_REFLECTION(range,10);\
|
||||
ACE_EXPLOSION_REFLECTION(range,20);\
|
||||
ACE_EXPLOSION_REFLECTION(range,30);\
|
||||
ACE_EXPLOSION_REFLECTION(range,40);\
|
||||
ACE_EXPLOSION_REFLECTION(range,50);\
|
||||
ACE_EXPLOSION_REFLECTION(range,60);\
|
||||
ACE_EXPLOSION_REFLECTION(range,70);\
|
||||
ACE_EXPLOSION_REFLECTION(range,80);\
|
||||
ACE_EXPLOSION_REFLECTION(range,90);\
|
||||
ACE_EXPLOSION_REFLECTION(range,100);\
|
||||
ACE_EXPLOSION_REFLECTION(range,110);\
|
||||
ACE_EXPLOSION_REFLECTION(range,120);\
|
||||
ACE_EXPLOSION_REFLECTION(range,130);\
|
||||
ACE_EXPLOSION_REFLECTION(range,140);\
|
||||
ACE_EXPLOSION_REFLECTION(range,150);\
|
||||
ACE_EXPLOSION_REFLECTION(range,160);\
|
||||
ACE_EXPLOSION_REFLECTION(range,170);\
|
||||
ACE_EXPLOSION_REFLECTION(range,180);\
|
||||
ACE_EXPLOSION_REFLECTION(range,190);\
|
||||
ACE_EXPLOSION_REFLECTION(range,200);\
|
||||
ACE_EXPLOSION_REFLECTION(range,210);\
|
||||
ACE_EXPLOSION_REFLECTION(range,220);\
|
||||
ACE_EXPLOSION_REFLECTION(range,230);\
|
||||
ACE_EXPLOSION_REFLECTION(range,240);\
|
||||
ACE_EXPLOSION_REFLECTION(range,250);\
|
||||
ACE_EXPLOSION_REFLECTION(range,260);\
|
||||
ACE_EXPLOSION_REFLECTION(range,270);\
|
||||
ACE_EXPLOSION_REFLECTION(range,280);\
|
||||
ACE_EXPLOSION_REFLECTION(range,290);\
|
||||
ACE_EXPLOSION_REFLECTION(range,300);\
|
||||
ACE_EXPLOSION_REFLECTION(range,310);\
|
||||
ACE_EXPLOSION_REFLECTION(range,320);\
|
||||
ACE_EXPLOSION_REFLECTION(range,330);\
|
||||
ACE_EXPLOSION_REFLECTION(range,340);\
|
||||
ACE_EXPLOSION_REFLECTION(range,350);\
|
||||
ACE_EXPLOSION_REFLECTION(range,360);\
|
||||
ACE_EXPLOSION_REFLECTION(range,370);\
|
||||
ACE_EXPLOSION_REFLECTION(range,380);\
|
||||
ACE_EXPLOSION_REFLECTION(range,390);\
|
||||
ACE_EXPLOSION_REFLECTION(range,400);\
|
||||
ACE_EXPLOSION_REFLECTION(range,410);\
|
||||
ACE_EXPLOSION_REFLECTION(range,420);\
|
||||
ACE_EXPLOSION_REFLECTION(range,430);\
|
||||
ACE_EXPLOSION_REFLECTION(range,440);\
|
||||
ACE_EXPLOSION_REFLECTION(range,450);\
|
||||
ACE_EXPLOSION_REFLECTION(range,460);\
|
||||
ACE_EXPLOSION_REFLECTION(range,470);\
|
||||
ACE_EXPLOSION_REFLECTION(range,480);\
|
||||
ACE_EXPLOSION_REFLECTION(range,490);\
|
||||
ACE_EXPLOSION_REFLECTION(range,500)
|
||||
|
||||
class ace_explosion_reflection_base : Sh_120mm_HE {
|
||||
CraterWaterEffects = "";
|
||||
CraterEffects = "";
|
||||
effectsMissile = "";
|
||||
ExplosionEffects = "";
|
||||
effectFlare = "";
|
||||
class HitEffects {
|
||||
hitWater = "";
|
||||
};
|
||||
multiSoundHit[] = {};
|
||||
explosionTime = 0.0001;
|
||||
explosive = 1;
|
||||
soundFakeFall[] = {};
|
||||
typicalSpeed = 0;
|
||||
model = "\A3\Weapons_F\empty.p3d";
|
||||
craterShape = "\A3\weapons_f\empty.p3d";
|
||||
};
|
||||
|
||||
ACE_EXPLOSION_RANGE(2);
|
||||
ACE_EXPLOSION_RANGE(4);
|
||||
ACE_EXPLOSION_RANGE(6);
|
||||
ACE_EXPLOSION_RANGE(8);
|
||||
ACE_EXPLOSION_RANGE(10);
|
||||
ACE_EXPLOSION_RANGE(12);
|
||||
ACE_EXPLOSION_RANGE(14);
|
||||
ACE_EXPLOSION_RANGE(16);
|
||||
ACE_EXPLOSION_RANGE(18);
|
||||
ACE_EXPLOSION_RANGE(20);
|
||||
ACE_EXPLOSION_RANGE(22);
|
||||
ACE_EXPLOSION_RANGE(24);
|
||||
ACE_EXPLOSION_RANGE(26);
|
||||
ACE_EXPLOSION_RANGE(28);
|
||||
ACE_EXPLOSION_RANGE(30);
|
||||
ACE_EXPLOSION_RANGE(32);
|
||||
ACE_EXPLOSION_RANGE(34);
|
||||
ACE_EXPLOSION_RANGE(36);
|
||||
ACE_EXPLOSION_RANGE(38);
|
||||
ACE_EXPLOSION_RANGE(40);
|
||||
ACE_EXPLOSION_RANGE(42);
|
||||
ACE_EXPLOSION_RANGE(44);
|
||||
ACE_EXPLOSION_RANGE(46);
|
||||
ACE_EXPLOSION_RANGE(48);
|
||||
ACE_EXPLOSION_RANGE(50);
|
||||
ACE_EXPLOSION_RANGE(52);
|
||||
ACE_EXPLOSION_RANGE(54);
|
||||
ACE_EXPLOSION_RANGE(56);
|
||||
ACE_EXPLOSION_RANGE(58);
|
||||
ACE_EXPLOSION_RANGE(60);
|
||||
ACE_EXPLOSION_RANGE(62);
|
||||
ACE_EXPLOSION_RANGE(64);
|
||||
ACE_EXPLOSION_RANGE(66);
|
||||
ACE_EXPLOSION_RANGE(68);
|
||||
ACE_EXPLOSION_RANGE(70);
|
||||
ACE_EXPLOSION_RANGE(72);
|
||||
ACE_EXPLOSION_RANGE(74);
|
||||
ACE_EXPLOSION_RANGE(76);
|
||||
ACE_EXPLOSION_RANGE(78);
|
||||
ACE_EXPLOSION_RANGE(80);
|
||||
ACE_EXPLOSION_RANGE(82);
|
||||
ACE_EXPLOSION_RANGE(84);
|
||||
ACE_EXPLOSION_RANGE(86);
|
||||
ACE_EXPLOSION_RANGE(88);
|
||||
ACE_EXPLOSION_RANGE(90);
|
||||
ACE_EXPLOSION_RANGE(92);
|
||||
ACE_EXPLOSION_RANGE(94);
|
||||
ACE_EXPLOSION_RANGE(96);
|
||||
ACE_EXPLOSION_RANGE(98);
|
||||
ACE_EXPLOSION_RANGE(100);
|
||||
|
@ -1,18 +1,18 @@
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
||||
|
@ -1,30 +1,30 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if(GVAR(EnableDebugTrace) && !isMultiplayer) then {
|
||||
GVAR(traceFrags) = true;
|
||||
GVAR(autoTrace) = true;
|
||||
};
|
||||
|
||||
if(isServer) then {
|
||||
[QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
||||
["SettingsInitialized", {
|
||||
//If not enabled, exit
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// Register fire event handler
|
||||
["firedPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedNonPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerVehicleNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedNonPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
|
||||
[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Cache for ammo type configs
|
||||
GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
|
||||
GVAR(cacheRoundsTypesToTrack) setText QGVAR(cacheRoundsTypesToTrack);
|
||||
#include "script_component.hpp"
|
||||
|
||||
if(GVAR(EnableDebugTrace) && !isMultiplayer) then {
|
||||
GVAR(traceFrags) = true;
|
||||
GVAR(autoTrace) = true;
|
||||
};
|
||||
|
||||
if(isServer) then {
|
||||
[QGVAR(frag_eh), { _this call FUNC(frago); }] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
||||
["SettingsInitialized", {
|
||||
//If not enabled, exit
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
// Register fire event handler
|
||||
["firedPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedNonPlayer", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedPlayerVehicleNonLocal", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
["firedNonPlayerVehicle", DFUNC(fired)] call EFUNC(common,addEventHandler);
|
||||
|
||||
[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Cache for ammo type configs
|
||||
GVAR(cacheRoundsTypesToTrack) = createLocation ["ACE_HashLocation", [-10000,-10000,-10000], 0, 0];
|
||||
GVAR(cacheRoundsTypesToTrack) setText QGVAR(cacheRoundsTypesToTrack);
|
||||
|
@ -1,25 +1,25 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(blackList) = [];
|
||||
GVAR(traceFrags) = false;
|
||||
|
||||
GVAR(TOTALFRAGS) = 0;
|
||||
|
||||
GVAR(spallHPData) = [];
|
||||
GVAR(spallIsTrackingCount) = 0;
|
||||
|
||||
GVAR(autoTrace) = false;
|
||||
GVAR(traceID) = -1;
|
||||
GVAR(traces) = [];
|
||||
GVAR(tracesStarted) = false;
|
||||
|
||||
GVAR(lastIterationIndex) = 0;
|
||||
GVAR(objects) = [];
|
||||
GVAR(objectTypes) = [];
|
||||
GVAR(arguments) = [];
|
||||
|
||||
ADDON = true;
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(blackList) = [];
|
||||
GVAR(traceFrags) = false;
|
||||
|
||||
GVAR(TOTALFRAGS) = 0;
|
||||
|
||||
GVAR(spallHPData) = [];
|
||||
GVAR(spallIsTrackingCount) = 0;
|
||||
|
||||
GVAR(autoTrace) = false;
|
||||
GVAR(traceID) = -1;
|
||||
GVAR(traces) = [];
|
||||
GVAR(tracesStarted) = false;
|
||||
|
||||
GVAR(lastIterationIndex) = 0;
|
||||
GVAR(objects) = [];
|
||||
GVAR(objectTypes) = [];
|
||||
GVAR(arguments) = [];
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,15 +1,15 @@
|
||||
#include "script_component.hpp"
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Nou"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "CfgAmmo.hpp"
|
||||
#include "script_component.hpp"
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"Nou"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "CfgAmmo.hpp"
|
||||
#include "ACE_Settings.hpp"
|
@ -1,74 +1,74 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"];
|
||||
PARAMS_3(_gun,_type,_round);
|
||||
DEFAULT_PARAM(3,_doFragTrack,false);
|
||||
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
|
||||
//if(_enabled < 1) exitWith {};
|
||||
|
||||
if(_round in GVAR(blackList)) exitWith {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
|
||||
// Exit on max track
|
||||
if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { };
|
||||
|
||||
if(_gun == ACE_player) then {
|
||||
_doFragTrack = true;
|
||||
} else {
|
||||
if((gunner _gun) == ACE_player) then {
|
||||
_doFragTrack = true;
|
||||
} else {
|
||||
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
|
||||
_doFragTrack = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_doSpall = false;
|
||||
if(GVAR(SpallEnabled)) then {
|
||||
if(GVAR(spallIsTrackingCount) <= 0) then {
|
||||
GVAR(spallHPData) = [];
|
||||
};
|
||||
if(GVAR(spallIsTrackingCount) > 5) then {
|
||||
// ACE_player sideChat "LIMT!";
|
||||
} else {
|
||||
_doSpall = true;
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
|
||||
};
|
||||
};
|
||||
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
|
||||
|
||||
if(GVAR(autoTrace)) then {
|
||||
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
|
||||
// We only do the single track object check here.
|
||||
// We should do an {!(_round in GVAR(objects))}
|
||||
// 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
|
||||
if(_doFragTrack && alive _round) then {
|
||||
_spallTrack = [];
|
||||
_spallTrackID = [];
|
||||
|
||||
private["_args"];
|
||||
_args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
|
||||
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
|
||||
];
|
||||
TRACE_1("Initializing track", _round);
|
||||
GVAR(objects) pushBack _round;
|
||||
GVAR(arguments) pushBack _args;
|
||||
|
||||
if(_doSpall) then {
|
||||
[_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack);
|
||||
};
|
||||
// ACE_player sideChat "WTF2";
|
||||
};
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_enabled", "_doSpall", "_spallTrack", "_spallTrackID"];
|
||||
PARAMS_3(_gun,_type,_round);
|
||||
DEFAULT_PARAM(3,_doFragTrack,false);
|
||||
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
|
||||
//if(_enabled < 1) exitWith {};
|
||||
|
||||
if(_round in GVAR(blackList)) exitWith {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
|
||||
// Exit on max track
|
||||
if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { };
|
||||
|
||||
if(_gun == ACE_player) then {
|
||||
_doFragTrack = true;
|
||||
} else {
|
||||
if((gunner _gun) == ACE_player) then {
|
||||
_doFragTrack = true;
|
||||
} else {
|
||||
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
|
||||
_doFragTrack = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_doSpall = false;
|
||||
if(GVAR(SpallEnabled)) then {
|
||||
if(GVAR(spallIsTrackingCount) <= 0) then {
|
||||
GVAR(spallHPData) = [];
|
||||
};
|
||||
if(GVAR(spallIsTrackingCount) > 5) then {
|
||||
// ACE_player sideChat "LIMT!";
|
||||
} else {
|
||||
_doSpall = true;
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
|
||||
};
|
||||
};
|
||||
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
|
||||
|
||||
if(GVAR(autoTrace)) then {
|
||||
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
|
||||
// We only do the single track object check here.
|
||||
// We should do an {!(_round in GVAR(objects))}
|
||||
// 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
|
||||
if(_doFragTrack && alive _round) then {
|
||||
_spallTrack = [];
|
||||
_spallTrackID = [];
|
||||
|
||||
private["_args"];
|
||||
_args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID,
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")),
|
||||
(getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))),
|
||||
(getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")))))
|
||||
];
|
||||
TRACE_1("Initializing track", _round);
|
||||
GVAR(objects) pushBack _round;
|
||||
GVAR(arguments) pushBack _args;
|
||||
|
||||
if(_doSpall) then {
|
||||
[_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack);
|
||||
};
|
||||
// ACE_player sideChat "WTF2";
|
||||
};
|
||||
|
@ -1,23 +1,23 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"];
|
||||
|
||||
if (GVAR(autoTrace)) then {
|
||||
[] call FUNC(startTracing);
|
||||
};
|
||||
|
||||
// setAccTime 0.05;
|
||||
_index = (count GVAR(traces));
|
||||
_obj = _this select 1;
|
||||
_origin = _this select 0;
|
||||
_color = [1,0,0,1];
|
||||
if((count _this) > 2) then {
|
||||
_color = _this select 2;
|
||||
};
|
||||
_positions = [];
|
||||
_objSpd = vectorMagnitude (velocity _obj);
|
||||
_positions set[(count _positions), [(getPos _obj), _objSpd]];
|
||||
_data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color];
|
||||
|
||||
GVAR(traces) set[_index, _data];
|
||||
[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call CBA_fnc_addPerFrameHandler;
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_color", "_data", "_index", "_obj", "_objSpd", "_origin", "_positions"];
|
||||
|
||||
if (GVAR(autoTrace)) then {
|
||||
[] call FUNC(startTracing);
|
||||
};
|
||||
|
||||
// setAccTime 0.05;
|
||||
_index = (count GVAR(traces));
|
||||
_obj = _this select 1;
|
||||
_origin = _this select 0;
|
||||
_color = [1,0,0,1];
|
||||
if((count _this) > 2) then {
|
||||
_color = _this select 2;
|
||||
};
|
||||
_positions = [];
|
||||
_objSpd = vectorMagnitude (velocity _obj);
|
||||
_positions set[(count _positions), [(getPos _obj), _objSpd]];
|
||||
_data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color];
|
||||
|
||||
GVAR(traces) set[_index, _data];
|
||||
[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -1,26 +1,26 @@
|
||||
//fnc_doExplosions.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"];
|
||||
_params = _this select 0;
|
||||
_explosions = _params select 0;
|
||||
_index = _params select 1;
|
||||
for "_i" from _index to ((_index+2) min (count _explosions)) do {
|
||||
_exp = _explosions select _i;
|
||||
_refExp = _exp select 0;
|
||||
_bpos = _exp select 1;
|
||||
_hit = _exp select 2;
|
||||
_distance = _exp select 3;
|
||||
_indirectHitRange = _exp select 4;
|
||||
_depth = _exp select 5;
|
||||
_refExp createVehicle (ASLtoATL _bpos);
|
||||
// if(_hit >= 150 && _distance > _indirectHitRange) then {
|
||||
// [_bpos, _refExp, _depth] call FUNC(doReflections);
|
||||
// };
|
||||
};
|
||||
_index = _index + 2;
|
||||
if(_index >= (count _explosions)) then {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
_params set[1, _index];
|
||||
};
|
||||
//fnc_doExplosions.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"];
|
||||
_params = _this select 0;
|
||||
_explosions = _params select 0;
|
||||
_index = _params select 1;
|
||||
for "_i" from _index to ((_index+2) min (count _explosions)) do {
|
||||
_exp = _explosions select _i;
|
||||
_refExp = _exp select 0;
|
||||
_bpos = _exp select 1;
|
||||
_hit = _exp select 2;
|
||||
_distance = _exp select 3;
|
||||
_indirectHitRange = _exp select 4;
|
||||
_depth = _exp select 5;
|
||||
_refExp createVehicle (ASLtoATL _bpos);
|
||||
// if(_hit >= 150 && _distance > _indirectHitRange) then {
|
||||
// [_bpos, _refExp, _depth] call FUNC(doReflections);
|
||||
// };
|
||||
};
|
||||
_index = _index + 2;
|
||||
if(_index >= (count _explosions)) then {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
_params set[1, _index];
|
||||
};
|
||||
|
@ -1,18 +1,18 @@
|
||||
//fnc_doReflections.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"];
|
||||
|
||||
_pos = _this select 0;
|
||||
_ammo = _this select 1;
|
||||
_depth = 1;
|
||||
if(count _this > 2) then {
|
||||
_depth = _this select 2;
|
||||
};
|
||||
// TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]];
|
||||
if(_depth <= 2) then {
|
||||
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange");
|
||||
_indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit");
|
||||
_testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0];
|
||||
[DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
//fnc_doReflections.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"];
|
||||
|
||||
_pos = _this select 0;
|
||||
_ammo = _this select 1;
|
||||
_depth = 1;
|
||||
if(count _this > 2) then {
|
||||
_depth = _this select 2;
|
||||
};
|
||||
// TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]];
|
||||
if(_depth <= 2) then {
|
||||
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange");
|
||||
_indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit");
|
||||
_testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0];
|
||||
[DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
@ -1,151 +1,151 @@
|
||||
//fnc_doSpall.sqf
|
||||
#include "script_component.hpp"
|
||||
// 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"];
|
||||
|
||||
_hitData = _this select 0;
|
||||
_initialData = GVAR(spallHPData) select (_hitData select 0);
|
||||
_hpData = (_hitData select 1) select (_this select 1);
|
||||
|
||||
|
||||
_object = _hpData select 0;
|
||||
_object removeEventHandler ["hitPart", _initialData select 0];
|
||||
_foundObjects = _initialData select 7;
|
||||
_index = _foundObjects find _object;
|
||||
if(_index != -1) then {
|
||||
_foundObjecsts set[_index, nil];
|
||||
};
|
||||
|
||||
_roundType = (_initialData select 2);
|
||||
_round = (_initialData select 3);
|
||||
_object = (_initialData select 1);
|
||||
|
||||
_caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber");
|
||||
_explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive");
|
||||
_idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange");
|
||||
|
||||
_alive = true;
|
||||
if(!alive _round && (_initialData select 6) == 1) then {
|
||||
_alive = false;
|
||||
};
|
||||
|
||||
if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
|
||||
// ACE_player sideChat format["BBBB"];
|
||||
_exit = false;
|
||||
_vm = 1;
|
||||
_velocity = _initialData select 5;
|
||||
|
||||
_oldVelocity = vectorMagnitude _velocity;
|
||||
_curVelocity = vectorMagnitude (velocity _round);
|
||||
|
||||
if(alive _round) then {
|
||||
_diff = _velocity vectorDiff (velocity _round);
|
||||
_polar = _diff call CBA_fnc_vect2polar;
|
||||
// ACE_player sideChat format["polar: %1", _polar];
|
||||
if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then {
|
||||
if(_caliber < 2.5) then {
|
||||
// ACE_player sideChat format["exit!"];
|
||||
_exit = true;
|
||||
} else {
|
||||
_vm = 1-(_curVelocity/_oldVelocity);
|
||||
};
|
||||
};
|
||||
};
|
||||
if(!_exit) then {
|
||||
_unitDir = vectorNormalized _velocity;
|
||||
_pos = _hpData select 3;
|
||||
_spallPos = nil;
|
||||
for "_i" from 0 to 100 do {
|
||||
_pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i));
|
||||
_pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1)));
|
||||
// _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)];
|
||||
// diag_log text format["b: %1", _blah];
|
||||
|
||||
// _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]];
|
||||
// NOU_TRACES set[(count NOU_TRACES), _data];
|
||||
|
||||
if(!lineIntersects [_pos1, _pos2]) exitWith {
|
||||
// ACE_player sideChat format["FOUND!"];
|
||||
_spallPos = _pos2;
|
||||
};
|
||||
};
|
||||
if(!isNil "_spallPos") then {
|
||||
_spallPolar = _velocity call CBA_fnc_vect2polar;
|
||||
|
||||
if(_explosive > 0) then {
|
||||
// ACE_player sideChat format["EXPLOSIVE!"];
|
||||
_warn = false;
|
||||
_c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE");
|
||||
if(_c == 0) then { _c = 1; _warn = true;};
|
||||
_m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL");
|
||||
if(_m == 0) then { _m = 2; _warn = true;};
|
||||
_k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K");
|
||||
if(_k == 0) then { _k = 1/2; _warn = true;};
|
||||
_gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C");
|
||||
if(_gC == 0) then { _gC = 2440; _warn = true;};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC;
|
||||
_spallPolar set[0, _fragPower*0.66];
|
||||
};
|
||||
|
||||
_fragTypes = [
|
||||
"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_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge",
|
||||
"ACE_frag_spall_huge"
|
||||
|
||||
];
|
||||
|
||||
// diag_log text format["SPALL POWER: %1", _spallPolar select 0];
|
||||
_spread = 15+(random 25);
|
||||
_spallCount = 5+(random 10);
|
||||
for "_i" from 1 to _spallCount do {
|
||||
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
|
||||
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
|
||||
if(abs _elev > 90) then {
|
||||
_dir = _dir + 180;
|
||||
};
|
||||
_dir = _dir % 360;
|
||||
_vel = (_spallPolar select 0)*0.33*_vm;
|
||||
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
|
||||
|
||||
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragment setPosASL _spallPos;
|
||||
_fragment setVelocity _spallFragVect;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
[ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
};
|
||||
_spread = 5+(random 5);
|
||||
_spallCount = 3+(random 5);
|
||||
for "_i" from 1 to _spallCount do {
|
||||
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
|
||||
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
|
||||
if(abs _elev > 90) then {
|
||||
_dir = _dir + 180;
|
||||
};
|
||||
_dir = _dir % 360;
|
||||
_vel = (_spallPolar select 0)*0.55*_vm;
|
||||
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
|
||||
|
||||
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragment setPosASL _spallPos;
|
||||
_fragment setVelocity _spallFragVect;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
[ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//fnc_doSpall.sqf
|
||||
#include "script_component.hpp"
|
||||
// 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"];
|
||||
|
||||
_hitData = _this select 0;
|
||||
_initialData = GVAR(spallHPData) select (_hitData select 0);
|
||||
_hpData = (_hitData select 1) select (_this select 1);
|
||||
|
||||
|
||||
_object = _hpData select 0;
|
||||
_object removeEventHandler ["hitPart", _initialData select 0];
|
||||
_foundObjects = _initialData select 7;
|
||||
_index = _foundObjects find _object;
|
||||
if(_index != -1) then {
|
||||
_foundObjecsts set[_index, nil];
|
||||
};
|
||||
|
||||
_roundType = (_initialData select 2);
|
||||
_round = (_initialData select 3);
|
||||
_object = (_initialData select 1);
|
||||
|
||||
_caliber = getNumber(configFile >> "CfgAmmo" >> _roundType >> "caliber");
|
||||
_explosive = getNumber(configFile >> "CfgAmmo" >> _roundType >> "explosive");
|
||||
_idh = getNumber(configFile >> "CfgAmmo" >> _roundType >> "indirectHitRange");
|
||||
|
||||
_alive = true;
|
||||
if(!alive _round && (_initialData select 6) == 1) then {
|
||||
_alive = false;
|
||||
};
|
||||
|
||||
if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then {
|
||||
// ACE_player sideChat format["BBBB"];
|
||||
_exit = false;
|
||||
_vm = 1;
|
||||
_velocity = _initialData select 5;
|
||||
|
||||
_oldVelocity = vectorMagnitude _velocity;
|
||||
_curVelocity = vectorMagnitude (velocity _round);
|
||||
|
||||
if(alive _round) then {
|
||||
_diff = _velocity vectorDiff (velocity _round);
|
||||
_polar = _diff call CBA_fnc_vect2polar;
|
||||
// ACE_player sideChat format["polar: %1", _polar];
|
||||
if((abs(_polar select 1) > 45 || abs(_polar select 2) > 45)) then {
|
||||
if(_caliber < 2.5) then {
|
||||
// ACE_player sideChat format["exit!"];
|
||||
_exit = true;
|
||||
} else {
|
||||
_vm = 1-(_curVelocity/_oldVelocity);
|
||||
};
|
||||
};
|
||||
};
|
||||
if(!_exit) then {
|
||||
_unitDir = vectorNormalized _velocity;
|
||||
_pos = _hpData select 3;
|
||||
_spallPos = nil;
|
||||
for "_i" from 0 to 100 do {
|
||||
_pos1 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * _i));
|
||||
_pos2 = _pos vectorAdd (_unitDir vectorMultiply (0.01 * (_i + 1)));
|
||||
// _blah = [_object, "FIRE"] intersect [_object worldToModel (ASLtoATL _pos1), _object worldToModel (ASLtoATL _pos2)];
|
||||
// diag_log text format["b: %1", _blah];
|
||||
|
||||
// _data = [nil, nil, nil, 1, [[ASLtoATL _pos1, 1], [ASLtoATL _pos2, 1]]];
|
||||
// NOU_TRACES set[(count NOU_TRACES), _data];
|
||||
|
||||
if(!lineIntersects [_pos1, _pos2]) exitWith {
|
||||
// ACE_player sideChat format["FOUND!"];
|
||||
_spallPos = _pos2;
|
||||
};
|
||||
};
|
||||
if(!isNil "_spallPos") then {
|
||||
_spallPolar = _velocity call CBA_fnc_vect2polar;
|
||||
|
||||
if(_explosive > 0) then {
|
||||
// ACE_player sideChat format["EXPLOSIVE!"];
|
||||
_warn = false;
|
||||
_c = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_CHARGE");
|
||||
if(_c == 0) then { _c = 1; _warn = true;};
|
||||
_m = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_METAL");
|
||||
if(_m == 0) then { _m = 2; _warn = true;};
|
||||
_k = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_K");
|
||||
if(_k == 0) then { _k = 1/2; _warn = true;};
|
||||
_gC = getNumber(configFile >> "CfgAmmo" >> _roundType >> "ACE_frag_GURNEY_C");
|
||||
if(_gC == 0) then { _gC = 2440; _warn = true;};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
_fragPower = (((_m/_c)+_k)^-(1/2))*_gC;
|
||||
_spallPolar set[0, _fragPower*0.66];
|
||||
};
|
||||
|
||||
_fragTypes = [
|
||||
"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_medium", "ACE_frag_spall_large", "ACE_frag_spall_large", "ACE_frag_spall_huge",
|
||||
"ACE_frag_spall_huge"
|
||||
|
||||
];
|
||||
|
||||
// diag_log text format["SPALL POWER: %1", _spallPolar select 0];
|
||||
_spread = 15+(random 25);
|
||||
_spallCount = 5+(random 10);
|
||||
for "_i" from 1 to _spallCount do {
|
||||
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
|
||||
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
|
||||
if(abs _elev > 90) then {
|
||||
_dir = _dir + 180;
|
||||
};
|
||||
_dir = _dir % 360;
|
||||
_vel = (_spallPolar select 0)*0.33*_vm;
|
||||
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
|
||||
|
||||
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragment setPosASL _spallPos;
|
||||
_fragment setVelocity _spallFragVect;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
[ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
};
|
||||
_spread = 5+(random 5);
|
||||
_spallCount = 3+(random 5);
|
||||
for "_i" from 1 to _spallCount do {
|
||||
_elev = ((_spallPolar select 2)-_spread)+(random (_spread*2));
|
||||
_dir = ((_spallPolar select 1)-_spread)+(random (_spread*2));
|
||||
if(abs _elev > 90) then {
|
||||
_dir = _dir + 180;
|
||||
};
|
||||
_dir = _dir % 360;
|
||||
_vel = (_spallPolar select 0)*0.55*_vm;
|
||||
_vel = (_vel-(_vel*0.25))+(random (_vel*0.5));
|
||||
|
||||
_spallFragVect = [_vel, _dir, _elev] call CBA_fnc_polar2vect;
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragment setPosASL _spallPos;
|
||||
_fragment setVelocity _spallFragVect;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
[ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,31 +1,31 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"];
|
||||
|
||||
{
|
||||
_positions = _x select 4;
|
||||
_color = _x select 5;
|
||||
_index = 0;
|
||||
_max = count _positions;
|
||||
_startSpeed = 0.01 max ((_positions select 0) select 1);
|
||||
_lastSpd = [];
|
||||
_lastPos = [];
|
||||
while {_index < _max} do {
|
||||
_data1 = _positions select _index;
|
||||
_data2 = nil;
|
||||
if(_index + ACE_TRACE_DRAW_INC >= _max) then {
|
||||
_data2 = _positions select (_max - 1);
|
||||
} else {
|
||||
_data2 = _positions select (_index + ACE_TRACE_DRAW_INC);
|
||||
};
|
||||
|
||||
_pos1 = _data1 select 0;
|
||||
_pos2 = _data2 select 0;
|
||||
_index = _index + ACE_TRACE_DRAW_INC;
|
||||
|
||||
drawLine3D [_pos1, _pos2, _color];
|
||||
_lastPos = _pos2;
|
||||
_lastSpd = _data1 select 1;
|
||||
};
|
||||
// drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"];
|
||||
} forEach GVAR(traces);
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_color", "_index", "_lastPos", "_lastSpd", "_max", "_positions", "_startSpeed"];
|
||||
|
||||
{
|
||||
_positions = _x select 4;
|
||||
_color = _x select 5;
|
||||
_index = 0;
|
||||
_max = count _positions;
|
||||
_startSpeed = 0.01 max ((_positions select 0) select 1);
|
||||
_lastSpd = [];
|
||||
_lastPos = [];
|
||||
while {_index < _max} do {
|
||||
_data1 = _positions select _index;
|
||||
_data2 = nil;
|
||||
if(_index + ACE_TRACE_DRAW_INC >= _max) then {
|
||||
_data2 = _positions select (_max - 1);
|
||||
} else {
|
||||
_data2 = _positions select (_index + ACE_TRACE_DRAW_INC);
|
||||
};
|
||||
|
||||
_pos1 = _data1 select 0;
|
||||
_pos2 = _data2 select 0;
|
||||
_index = _index + ACE_TRACE_DRAW_INC;
|
||||
|
||||
drawLine3D [_pos1, _pos2, _color];
|
||||
_lastPos = _pos2;
|
||||
_lastSpd = _data1 select 1;
|
||||
};
|
||||
// drawIcon3D ["", [1,0,0,1], _lastPos, 0, 0, 0, format["%1m/s", _lastSpd], 1, 0.05, "RobotoCondensed"];
|
||||
} forEach GVAR(traces);
|
||||
|
@ -1,128 +1,128 @@
|
||||
//fnc_findReflections.sqf
|
||||
#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"];
|
||||
|
||||
BEGIN_COUNTER(fnc_findReflections);
|
||||
_params = _this select 0;
|
||||
_pos = _params select 0;
|
||||
_explosiveInfo = _params select 1;
|
||||
_los = _params select 2;
|
||||
_nlos = _params select 3;
|
||||
_zIndex = _params select 4;
|
||||
_depth = _params select 5;
|
||||
_rand = _params select 6;
|
||||
|
||||
_split = 15;
|
||||
_radi = (360/_split*_depth);
|
||||
|
||||
// player sideChat format["p: %1", _explosiveInfo];
|
||||
_indirectHitRange = _explosiveInfo select 0;
|
||||
_indirectHit = _explosiveInfo select 1;
|
||||
_distanceCount = (floor _indirectHitRange*4) min 100;
|
||||
|
||||
if(_zIndex < 5) then {
|
||||
_lastPos = _pos;
|
||||
_zAng = _zIndex*20+2;
|
||||
if(_zAng > 80) then {
|
||||
_radi = 1;
|
||||
_zAng = 90;
|
||||
};
|
||||
for "_i" from 0 to _radi do {
|
||||
_test = true;
|
||||
_vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect;
|
||||
for "_x" from 1 to _distanceCount do {
|
||||
_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,"","",""];
|
||||
_res = lineIntersectsWith [_pos, _testPos];
|
||||
if(count _res > 0) exitWith {
|
||||
_test = false;
|
||||
_nlos pushBack _lastPos;
|
||||
// {
|
||||
// _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }];
|
||||
// } 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,"","",""];
|
||||
// TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]];
|
||||
|
||||
};
|
||||
// if(terrainIntersectASL [_pos, _testPos]) exitWith {};
|
||||
_lastPos = _testPos;
|
||||
};
|
||||
};
|
||||
_params set[4, _zIndex+1];
|
||||
} else {
|
||||
_depth = _depth + 1;
|
||||
_buckets = [];
|
||||
_excludes = [];
|
||||
_bucketIndex = 0;
|
||||
_bucketPos = nil;
|
||||
_bucketList = nil;
|
||||
_c = 0;
|
||||
while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do {
|
||||
scopeName "mainSearch";
|
||||
{
|
||||
if(!(_forEachIndex in _excludes)) then {
|
||||
_index = _buckets pushBack [_x, [_x]];
|
||||
_excludes pushBack _forEachIndex;
|
||||
_bucketPos = _x;
|
||||
_bucketList = (_buckets select _index) select 1;
|
||||
breakTo "mainSearch";
|
||||
};
|
||||
} forEach _nlos;
|
||||
{
|
||||
if(!(_forEachIndex in _excludes)) then {
|
||||
_testPos = _x;
|
||||
if(_testPos vectorDistanceSqr _bucketPos <= 30) then {
|
||||
_bucketList pushBack _x;
|
||||
_excludes pushBack _forEachIndex;
|
||||
};
|
||||
};
|
||||
} forEach _nlos;
|
||||
_c = _c + 1;
|
||||
};
|
||||
|
||||
// player sideChat format["c: %1", count _buckets];
|
||||
_explosions = [];
|
||||
{
|
||||
_blist = _x select 1;
|
||||
_avgX = 0;
|
||||
_avgY = 0;
|
||||
_avgZ = 0;
|
||||
|
||||
{
|
||||
_avgX = _avgX + (_x select 0);
|
||||
_avgY = _avgY + (_x select 1);
|
||||
_avgZ = _avgZ + (_x select 2);
|
||||
} forEach _blist;
|
||||
_c = count _blist;
|
||||
_bpos = [_avgX/_c, _avgY/_c, _avgZ/_c];
|
||||
|
||||
_distance = _pos vectorDistance _bpos;
|
||||
_hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0);
|
||||
// _hitFactor = 1/(_distance^2);
|
||||
_hit = _indirectHit*_hitFactor;
|
||||
_hit = (floor (_hit/4)) min 500;
|
||||
_hit = _hit - (_hit%10);
|
||||
_range = (floor (_indirectHitRange-(_distance/4))) min 100;
|
||||
_range = _range - (_range%2);
|
||||
|
||||
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_PAIRS pushBack [_pos, _bpos, [1,0,0,1]];
|
||||
_refExp = format["ace_explosion_reflection_%1_%2", _range, _hit];
|
||||
// _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,"","",""];
|
||||
|
||||
_explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth];
|
||||
|
||||
};
|
||||
if(count _explosions > (_radi*2)/_depth) exitWith {};
|
||||
} forEach _buckets;
|
||||
// _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos);
|
||||
// _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3"))));
|
||||
// _dirvec = _dirvec vectorMultiply 100;
|
||||
// _can setVelocity _dirvec;
|
||||
[DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler;
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
END_COUNTER(fnc_findReflections);
|
||||
//fnc_findReflections.sqf
|
||||
#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"];
|
||||
|
||||
BEGIN_COUNTER(fnc_findReflections);
|
||||
_params = _this select 0;
|
||||
_pos = _params select 0;
|
||||
_explosiveInfo = _params select 1;
|
||||
_los = _params select 2;
|
||||
_nlos = _params select 3;
|
||||
_zIndex = _params select 4;
|
||||
_depth = _params select 5;
|
||||
_rand = _params select 6;
|
||||
|
||||
_split = 15;
|
||||
_radi = (360/_split*_depth);
|
||||
|
||||
// player sideChat format["p: %1", _explosiveInfo];
|
||||
_indirectHitRange = _explosiveInfo select 0;
|
||||
_indirectHit = _explosiveInfo select 1;
|
||||
_distanceCount = (floor _indirectHitRange*4) min 100;
|
||||
|
||||
if(_zIndex < 5) then {
|
||||
_lastPos = _pos;
|
||||
_zAng = _zIndex*20+2;
|
||||
if(_zAng > 80) then {
|
||||
_radi = 1;
|
||||
_zAng = 90;
|
||||
};
|
||||
for "_i" from 0 to _radi do {
|
||||
_test = true;
|
||||
_vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect;
|
||||
for "_x" from 1 to _distanceCount do {
|
||||
_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,"","",""];
|
||||
_res = lineIntersectsWith [_pos, _testPos];
|
||||
if(count _res > 0) exitWith {
|
||||
_test = false;
|
||||
_nlos pushBack _lastPos;
|
||||
// {
|
||||
// _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }];
|
||||
// } 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,"","",""];
|
||||
// TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]];
|
||||
|
||||
};
|
||||
// if(terrainIntersectASL [_pos, _testPos]) exitWith {};
|
||||
_lastPos = _testPos;
|
||||
};
|
||||
};
|
||||
_params set[4, _zIndex+1];
|
||||
} else {
|
||||
_depth = _depth + 1;
|
||||
_buckets = [];
|
||||
_excludes = [];
|
||||
_bucketIndex = 0;
|
||||
_bucketPos = nil;
|
||||
_bucketList = nil;
|
||||
_c = 0;
|
||||
while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do {
|
||||
scopeName "mainSearch";
|
||||
{
|
||||
if(!(_forEachIndex in _excludes)) then {
|
||||
_index = _buckets pushBack [_x, [_x]];
|
||||
_excludes pushBack _forEachIndex;
|
||||
_bucketPos = _x;
|
||||
_bucketList = (_buckets select _index) select 1;
|
||||
breakTo "mainSearch";
|
||||
};
|
||||
} forEach _nlos;
|
||||
{
|
||||
if(!(_forEachIndex in _excludes)) then {
|
||||
_testPos = _x;
|
||||
if(_testPos vectorDistanceSqr _bucketPos <= 30) then {
|
||||
_bucketList pushBack _x;
|
||||
_excludes pushBack _forEachIndex;
|
||||
};
|
||||
};
|
||||
} forEach _nlos;
|
||||
_c = _c + 1;
|
||||
};
|
||||
|
||||
// player sideChat format["c: %1", count _buckets];
|
||||
_explosions = [];
|
||||
{
|
||||
_blist = _x select 1;
|
||||
_avgX = 0;
|
||||
_avgY = 0;
|
||||
_avgZ = 0;
|
||||
|
||||
{
|
||||
_avgX = _avgX + (_x select 0);
|
||||
_avgY = _avgY + (_x select 1);
|
||||
_avgZ = _avgZ + (_x select 2);
|
||||
} forEach _blist;
|
||||
_c = count _blist;
|
||||
_bpos = [_avgX/_c, _avgY/_c, _avgZ/_c];
|
||||
|
||||
_distance = _pos vectorDistance _bpos;
|
||||
_hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0);
|
||||
// _hitFactor = 1/(_distance^2);
|
||||
_hit = _indirectHit*_hitFactor;
|
||||
_hit = (floor (_hit/4)) min 500;
|
||||
_hit = _hit - (_hit%10);
|
||||
_range = (floor (_indirectHitRange-(_distance/4))) min 100;
|
||||
_range = _range - (_range%2);
|
||||
|
||||
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_PAIRS pushBack [_pos, _bpos, [1,0,0,1]];
|
||||
_refExp = format["ace_explosion_reflection_%1_%2", _range, _hit];
|
||||
// _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,"","",""];
|
||||
|
||||
_explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth];
|
||||
|
||||
};
|
||||
if(count _explosions > (_radi*2)/_depth) exitWith {};
|
||||
} forEach _buckets;
|
||||
// _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos);
|
||||
// _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3"))));
|
||||
// _dirvec = _dirvec vectorMultiply 100;
|
||||
// _can setVelocity _dirvec;
|
||||
[DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler;
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
END_COUNTER(fnc_findReflections);
|
||||
|
@ -1,218 +1,218 @@
|
||||
//fnc_frago.sqf
|
||||
// #define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define FRAG_VEC_VAR 0.004
|
||||
|
||||
#define MAX_FRAG_COUNT 50
|
||||
|
||||
if(!isServer) exitWith { };
|
||||
|
||||
BEGIN_COUNTER(frago);
|
||||
// _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"];
|
||||
|
||||
_round = _this select 0;
|
||||
_lastPos = _this select 1;
|
||||
_lastVel = _this select 2;
|
||||
_shellType = _this select 3;
|
||||
_gun = nil;
|
||||
if((count _this) > 5) then {
|
||||
_gun = _this select 5;
|
||||
};
|
||||
|
||||
_fragTypes = [
|
||||
"ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny",
|
||||
"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_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"
|
||||
];
|
||||
|
||||
_warn = false;
|
||||
if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then {
|
||||
_fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES");
|
||||
} else {
|
||||
_warn = true;
|
||||
};
|
||||
|
||||
_atlPos = ASLtoATL _lastPos;
|
||||
|
||||
_isArmed = true;
|
||||
if(!isNil "_gun") then {
|
||||
_fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance");
|
||||
_isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist);
|
||||
};
|
||||
|
||||
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange");
|
||||
_fragRange = 20*_indirectHitRange*4;
|
||||
// _c = 185; // grams of comp-b
|
||||
// _m = 210; // grams of fragmentating metal
|
||||
// _k = 3/5; // spherical K factor
|
||||
// _gC = 2843; // Gurney constant of comp-b in /ms
|
||||
|
||||
// _c = 429; // grams of tritonal
|
||||
// _m = 496; // grams of fragmentating metal
|
||||
// _k = 1/2; // spherical K factor
|
||||
// _gC = 2320; // Gurney constant of tritonal in /ms
|
||||
|
||||
|
||||
_c = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CHARGE");
|
||||
if(_c == 0) then { _c = 1; _warn = true;};
|
||||
_m = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_METAL");
|
||||
if(_m == 0) then { _m = 2; _warn = true;};
|
||||
_k = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_K");
|
||||
if(_k == 0) then { _k = 1/2; _warn = true;};
|
||||
_gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C");
|
||||
if(_gC == 0) then { _gC = 2440; _warn = true;};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
_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
|
||||
|
||||
_fragPowerRandom = _fragPower*0.5;
|
||||
if((_atlPos select 2) < 0.5) then {
|
||||
_lastPos set[2, (_lastPos select 2)+0.5];
|
||||
};
|
||||
|
||||
// _manObjects = _atlPos nearEntities ["CaManBase", _fragRange];
|
||||
|
||||
// setAccTime 0.01;
|
||||
|
||||
//_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 = _manObjects;
|
||||
// Target also people inside vehicles or manning weapons
|
||||
_crew = [];
|
||||
{
|
||||
{
|
||||
_crew set [count _crew,_x]
|
||||
} forEach (crew _x);
|
||||
} forEach _objects;
|
||||
|
||||
_objects = _objects - _crew;
|
||||
_objects = _objects + _crew;
|
||||
|
||||
_fragCount = 0;
|
||||
|
||||
_fragArcs = [];
|
||||
_fragArcs set[360, 0];
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
ACE_player sideChat format["_fragRange: %1", _fragRange];
|
||||
ACE_player sideChat format["_objects: %1", _objects];
|
||||
#endif
|
||||
_doRandom = true;
|
||||
if(_isArmed && (count _objects) > 0) then {
|
||||
if (GVAR(ReflectionsEnabled)) then {
|
||||
[_lastPos, _shellType] call FUNC(doReflections);
|
||||
};
|
||||
{
|
||||
//if(random(1) > 0.5) then {
|
||||
_target = _x;
|
||||
if(alive _target) then {
|
||||
_boundingBox = boundingBox _target;
|
||||
_targetPos = (getPosASL _target);
|
||||
_distance = _targetPos distance _lastPos;
|
||||
_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);
|
||||
_bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1);
|
||||
_bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2);
|
||||
_cubic = _bbX*_bbY*_bbZ;
|
||||
if(_cubic > 1) then {
|
||||
_doRandom = true;
|
||||
|
||||
_targetVel = (velocity _target);
|
||||
|
||||
|
||||
_targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))];
|
||||
_targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))];
|
||||
_targetPos set[2, (_targetPos select 2)+_add];
|
||||
|
||||
_baseVec = _lastPos vectorFromTo _targetPos;
|
||||
|
||||
_dir = floor(_baseVec call CBA_fnc_vectDir);
|
||||
_currentCount = _fragArcs select _dir;
|
||||
if(isNil "_currentCount") then {
|
||||
_currentCount = 0;
|
||||
};
|
||||
if(_currentCount < 20) then {
|
||||
_count = ceil(random(sqrt(_m/1000)));
|
||||
_vecVar = FRAG_VEC_VAR;
|
||||
if(!(_target isKindOf "Man")) then {
|
||||
_vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR;
|
||||
if((count (crew _target)) == 0 && _count > 0) then {
|
||||
_count = 0 max (_count/2);
|
||||
};
|
||||
};
|
||||
for "_i" from 1 to _count do {
|
||||
_vec = +_baseVec;
|
||||
|
||||
_vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)];
|
||||
_vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)];
|
||||
_vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)];
|
||||
|
||||
_fp = (_fragPower-(random (_fragPowerRandom)));
|
||||
_vel = _vec vectorMultiply _fp;
|
||||
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
// diag_log text format["fp: %1 %2", _fp, typeOf _fragObj];
|
||||
_fragObj setPosASL _lastPos;
|
||||
_fragObj setVectorDir _vec;
|
||||
_fragObj setVelocity _vel;
|
||||
if(GVAR(traceFrags)) then {
|
||||
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
|
||||
[ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
_fragCount = _fragCount + 1;
|
||||
_currentCount = _currentCount + 1;
|
||||
};
|
||||
_fragArcs set[_dir, _currentCount];
|
||||
};
|
||||
};
|
||||
};
|
||||
//};
|
||||
if(_fragCount > MAX_FRAG_COUNT) exitWith {};
|
||||
} forEach _objects;
|
||||
if(_fragCount > MAX_FRAG_COUNT) exitWith {};
|
||||
_randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20;
|
||||
_sectorSize = 360 / (_randomCount max 1);
|
||||
// _doRandom = false;
|
||||
if(_doRandom) then {
|
||||
for "_i" from 1 to _randomCount do {
|
||||
// Distribute evenly
|
||||
_sectorOffset = 360 * (_i - 1) / (_randomCount max 1);
|
||||
_randomDir = random(_sectorSize);
|
||||
_vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))];
|
||||
|
||||
_fp = (_fragPower-(random (_fragPowerRandom)));
|
||||
|
||||
_vel = _vec vectorMultiply _fp;
|
||||
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragObj setPosASL _lastPos;
|
||||
_fragObj setVectorDir _vec;
|
||||
_fragObj setVelocity _vel;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
|
||||
[ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
_fragCount = _fragCount + 1;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
// #ifdef DEBUG_MODE_FULL
|
||||
// ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)];
|
||||
// ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))];
|
||||
// #endif
|
||||
// _endTime = ACE_diagTime;
|
||||
//fnc_frago.sqf
|
||||
// #define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define FRAG_VEC_VAR 0.004
|
||||
|
||||
#define MAX_FRAG_COUNT 50
|
||||
|
||||
if(!isServer) exitWith { };
|
||||
|
||||
BEGIN_COUNTER(frago);
|
||||
// _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"];
|
||||
|
||||
_round = _this select 0;
|
||||
_lastPos = _this select 1;
|
||||
_lastVel = _this select 2;
|
||||
_shellType = _this select 3;
|
||||
_gun = nil;
|
||||
if((count _this) > 5) then {
|
||||
_gun = _this select 5;
|
||||
};
|
||||
|
||||
_fragTypes = [
|
||||
"ACE_frag_tiny", "ACE_frag_tiny", "ACE_frag_tiny",
|
||||
"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_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"
|
||||
];
|
||||
|
||||
_warn = false;
|
||||
if(isArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES")) then {
|
||||
_fragTypes = getArray (configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CLASSES");
|
||||
} else {
|
||||
_warn = true;
|
||||
};
|
||||
|
||||
_atlPos = ASLtoATL _lastPos;
|
||||
|
||||
_isArmed = true;
|
||||
if(!isNil "_gun") then {
|
||||
_fuseDist = getNumber(configFile >> "CfgAmmo" >> _shellType >> "fuseDistance");
|
||||
_isArmed = ((getPosASL _gun) distance _lastPos > _fuseDist);
|
||||
};
|
||||
|
||||
_indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _shellType >> "indirecthitrange");
|
||||
_fragRange = 20*_indirectHitRange*4;
|
||||
// _c = 185; // grams of comp-b
|
||||
// _m = 210; // grams of fragmentating metal
|
||||
// _k = 3/5; // spherical K factor
|
||||
// _gC = 2843; // Gurney constant of comp-b in /ms
|
||||
|
||||
// _c = 429; // grams of tritonal
|
||||
// _m = 496; // grams of fragmentating metal
|
||||
// _k = 1/2; // spherical K factor
|
||||
// _gC = 2320; // Gurney constant of tritonal in /ms
|
||||
|
||||
|
||||
_c = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_CHARGE");
|
||||
if(_c == 0) then { _c = 1; _warn = true;};
|
||||
_m = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_METAL");
|
||||
if(_m == 0) then { _m = 2; _warn = true;};
|
||||
_k = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_K");
|
||||
if(_k == 0) then { _k = 1/2; _warn = true;};
|
||||
_gC = getNumber(configFile >> "CfgAmmo" >> _shellType >> "ACE_frag_GURNEY_C");
|
||||
if(_gC == 0) then { _gC = 2440; _warn = true;};
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
_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
|
||||
|
||||
_fragPowerRandom = _fragPower*0.5;
|
||||
if((_atlPos select 2) < 0.5) then {
|
||||
_lastPos set[2, (_lastPos select 2)+0.5];
|
||||
};
|
||||
|
||||
// _manObjects = _atlPos nearEntities ["CaManBase", _fragRange];
|
||||
|
||||
// setAccTime 0.01;
|
||||
|
||||
//_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 = _manObjects;
|
||||
// Target also people inside vehicles or manning weapons
|
||||
_crew = [];
|
||||
{
|
||||
{
|
||||
_crew set [count _crew,_x]
|
||||
} forEach (crew _x);
|
||||
} forEach _objects;
|
||||
|
||||
_objects = _objects - _crew;
|
||||
_objects = _objects + _crew;
|
||||
|
||||
_fragCount = 0;
|
||||
|
||||
_fragArcs = [];
|
||||
_fragArcs set[360, 0];
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
ACE_player sideChat format["_fragRange: %1", _fragRange];
|
||||
ACE_player sideChat format["_objects: %1", _objects];
|
||||
#endif
|
||||
_doRandom = true;
|
||||
if(_isArmed && (count _objects) > 0) then {
|
||||
if (GVAR(ReflectionsEnabled)) then {
|
||||
[_lastPos, _shellType] call FUNC(doReflections);
|
||||
};
|
||||
{
|
||||
//if(random(1) > 0.5) then {
|
||||
_target = _x;
|
||||
if(alive _target) then {
|
||||
_boundingBox = boundingBox _target;
|
||||
_targetPos = (getPosASL _target);
|
||||
_distance = _targetPos distance _lastPos;
|
||||
_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);
|
||||
_bbY = (abs((_boundingBox select 0) select 1))+((_boundingBox select 1) select 1);
|
||||
_bbZ = (abs((_boundingBox select 0) select 2))+((_boundingBox select 1) select 2);
|
||||
_cubic = _bbX*_bbY*_bbZ;
|
||||
if(_cubic > 1) then {
|
||||
_doRandom = true;
|
||||
|
||||
_targetVel = (velocity _target);
|
||||
|
||||
|
||||
_targetPos set[0, (_targetPos select 0)+((_targetVel select 0)*(_distance/_fragPower))];
|
||||
_targetPos set[1, (_targetPos select 1)+((_targetVel select 1)*(_distance/_fragPower))];
|
||||
_targetPos set[2, (_targetPos select 2)+_add];
|
||||
|
||||
_baseVec = _lastPos vectorFromTo _targetPos;
|
||||
|
||||
_dir = floor(_baseVec call CBA_fnc_vectDir);
|
||||
_currentCount = _fragArcs select _dir;
|
||||
if(isNil "_currentCount") then {
|
||||
_currentCount = 0;
|
||||
};
|
||||
if(_currentCount < 20) then {
|
||||
_count = ceil(random(sqrt(_m/1000)));
|
||||
_vecVar = FRAG_VEC_VAR;
|
||||
if(!(_target isKindOf "Man")) then {
|
||||
_vecVar = ((sqrt _cubic)/2000)+FRAG_VEC_VAR;
|
||||
if((count (crew _target)) == 0 && _count > 0) then {
|
||||
_count = 0 max (_count/2);
|
||||
};
|
||||
};
|
||||
for "_i" from 1 to _count do {
|
||||
_vec = +_baseVec;
|
||||
|
||||
_vec set[0, (_vec select 0)-(_vecVar/2)+(random _vecVar)];
|
||||
_vec set[1, (_vec select 1)-(_vecVar/2)+(random _vecVar)];
|
||||
_vec set[2, (_vec select 2)-(_vecVar/2)+(random _vecVar)];
|
||||
|
||||
_fp = (_fragPower-(random (_fragPowerRandom)));
|
||||
_vel = _vec vectorMultiply _fp;
|
||||
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
// diag_log text format["fp: %1 %2", _fp, typeOf _fragObj];
|
||||
_fragObj setPosASL _lastPos;
|
||||
_fragObj setVectorDir _vec;
|
||||
_fragObj setVelocity _vel;
|
||||
if(GVAR(traceFrags)) then {
|
||||
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
|
||||
[ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
_fragCount = _fragCount + 1;
|
||||
_currentCount = _currentCount + 1;
|
||||
};
|
||||
_fragArcs set[_dir, _currentCount];
|
||||
};
|
||||
};
|
||||
};
|
||||
//};
|
||||
if(_fragCount > MAX_FRAG_COUNT) exitWith {};
|
||||
} forEach _objects;
|
||||
if(_fragCount > MAX_FRAG_COUNT) exitWith {};
|
||||
_randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20;
|
||||
_sectorSize = 360 / (_randomCount max 1);
|
||||
// _doRandom = false;
|
||||
if(_doRandom) then {
|
||||
for "_i" from 1 to _randomCount do {
|
||||
// Distribute evenly
|
||||
_sectorOffset = 360 * (_i - 1) / (_randomCount max 1);
|
||||
_randomDir = random(_sectorSize);
|
||||
_vec = [cos(_sectorOffset + _randomDir), sin(_sectorOffset + _randomDir), sin(30 - (random 45))];
|
||||
|
||||
_fp = (_fragPower-(random (_fragPowerRandom)));
|
||||
|
||||
_vel = _vec vectorMultiply _fp;
|
||||
|
||||
_fragType = round (random ((count _fragTypes)-1));
|
||||
_fragObj = (_fragTypes select _fragType) createVehicleLocal [0,0,10000];
|
||||
_fragObj setPosASL _lastPos;
|
||||
_fragObj setVectorDir _vec;
|
||||
_fragObj setVelocity _vel;
|
||||
|
||||
if(GVAR(traceFrags)) then {
|
||||
GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1;
|
||||
[ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack);
|
||||
};
|
||||
_fragCount = _fragCount + 1;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
// #ifdef DEBUG_MODE_FULL
|
||||
// ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)];
|
||||
// ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))];
|
||||
// #endif
|
||||
// _endTime = ACE_diagTime;
|
||||
END_COUNTER(frago);
|
@ -1,50 +1,50 @@
|
||||
/*
|
||||
* Author: jaynus
|
||||
*
|
||||
* Master single PFH abstraction for all rounds being tracked by frag/spall
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
//PARAMS_2(_pfhArgs,_handle);
|
||||
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
private["_gcIndex", "_iter"];
|
||||
_gcIndex = [];
|
||||
|
||||
_iter = 0;
|
||||
while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do {
|
||||
private["_object", "_args"];
|
||||
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then {
|
||||
GVAR(lastIterationIndex) = 0;
|
||||
};
|
||||
_object = GVAR(objects) select GVAR(lastIterationIndex);
|
||||
|
||||
if(!isNil "_object") then {
|
||||
_args = GVAR(arguments) select GVAR(lastIterationIndex);
|
||||
|
||||
if(!(_args call FUNC(pfhRound))) then {
|
||||
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
|
||||
};
|
||||
};
|
||||
_iter = _iter + 1;
|
||||
GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1;
|
||||
};
|
||||
|
||||
// clean up dead object references
|
||||
private["_deletionCount", "_deleteIndex"];
|
||||
_deletionCount = 0;
|
||||
{
|
||||
TRACE_1("GC Projectile", _x);
|
||||
_deleteIndex = _x - _deletionCount;
|
||||
GVAR(objects) deleteAt _deleteIndex;
|
||||
GVAR(arguments) deleteAt _deleteIndex;
|
||||
|
||||
_deletionCount = _deletionCount + 1;
|
||||
} forEach _gcIndex;
|
||||
/*
|
||||
* Author: jaynus
|
||||
*
|
||||
* Master single PFH abstraction for all rounds being tracked by frag/spall
|
||||
*
|
||||
* Arguments:
|
||||
*
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*/
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
//PARAMS_2(_pfhArgs,_handle);
|
||||
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
|
||||
private["_gcIndex", "_iter"];
|
||||
_gcIndex = [];
|
||||
|
||||
_iter = 0;
|
||||
while { (count GVAR(objects)) > 0 && { _iter < (GVAR(MaxTrackPerFrame) min (count GVAR(objects))) } } do {
|
||||
private["_object", "_args"];
|
||||
if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then {
|
||||
GVAR(lastIterationIndex) = 0;
|
||||
};
|
||||
_object = GVAR(objects) select GVAR(lastIterationIndex);
|
||||
|
||||
if(!isNil "_object") then {
|
||||
_args = GVAR(arguments) select GVAR(lastIterationIndex);
|
||||
|
||||
if(!(_args call FUNC(pfhRound))) then {
|
||||
_gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false
|
||||
};
|
||||
};
|
||||
_iter = _iter + 1;
|
||||
GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1;
|
||||
};
|
||||
|
||||
// clean up dead object references
|
||||
private["_deletionCount", "_deleteIndex"];
|
||||
_deletionCount = 0;
|
||||
{
|
||||
TRACE_1("GC Projectile", _x);
|
||||
_deleteIndex = _x - _deletionCount;
|
||||
GVAR(objects) deleteAt _deleteIndex;
|
||||
GVAR(arguments) deleteAt _deleteIndex;
|
||||
|
||||
_deletionCount = _deletionCount + 1;
|
||||
} forEach _gcIndex;
|
||||
|
@ -1,50 +1,50 @@
|
||||
#include "script_component.hpp"
|
||||
private ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
|
||||
_round = _this select 0;
|
||||
_lastPos = _this select 1;
|
||||
_lastVel = _this select 2;
|
||||
_type = _this select 3;
|
||||
_firedFrame = _this select 4;
|
||||
_doSpall = _this select 6;
|
||||
_spallTrack = _this select 7;
|
||||
_foundObjectHPIds = _this select 8;
|
||||
_skip = _this select 9;
|
||||
_explosive = _this select 10;
|
||||
_indirectRange = _this select 11;
|
||||
_force = _this select 12;
|
||||
_fragPower = _this select 13;
|
||||
|
||||
if(_round in GVAR(blackList)) exitWith {
|
||||
false
|
||||
};
|
||||
|
||||
if (!alive _round) exitWith {
|
||||
if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame
|
||||
if(_skip == 0) then {
|
||||
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
|
||||
[QGVAR(frag_eh), _this] call EFUNC(common,serverEvent);
|
||||
};
|
||||
};
|
||||
};
|
||||
if(_doSpall) then {
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1;
|
||||
// diag_log text format["F: %1", _foundObjectHPIds];
|
||||
{
|
||||
if(!isNil "_x") then {
|
||||
_x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex];
|
||||
};
|
||||
} forEach _spallTrack;
|
||||
};
|
||||
false
|
||||
};
|
||||
|
||||
_this set[1, (getPosASL _round)];
|
||||
_this set[2, (velocity _round)];
|
||||
|
||||
if(_doSpall) then {
|
||||
private["_scale"];
|
||||
_scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1;
|
||||
[_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
|
||||
};
|
||||
|
||||
true
|
||||
#include "script_component.hpp"
|
||||
private ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"];
|
||||
_round = _this select 0;
|
||||
_lastPos = _this select 1;
|
||||
_lastVel = _this select 2;
|
||||
_type = _this select 3;
|
||||
_firedFrame = _this select 4;
|
||||
_doSpall = _this select 6;
|
||||
_spallTrack = _this select 7;
|
||||
_foundObjectHPIds = _this select 8;
|
||||
_skip = _this select 9;
|
||||
_explosive = _this select 10;
|
||||
_indirectRange = _this select 11;
|
||||
_force = _this select 12;
|
||||
_fragPower = _this select 13;
|
||||
|
||||
if(_round in GVAR(blackList)) exitWith {
|
||||
false
|
||||
};
|
||||
|
||||
if (!alive _round) exitWith {
|
||||
if((diag_frameno - _firedFrame) > 1) then { //skip if deleted within a single frame
|
||||
if(_skip == 0) then {
|
||||
if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then {
|
||||
[QGVAR(frag_eh), _this] call EFUNC(common,serverEvent);
|
||||
};
|
||||
};
|
||||
};
|
||||
if(_doSpall) then {
|
||||
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1;
|
||||
// diag_log text format["F: %1", _foundObjectHPIds];
|
||||
{
|
||||
if(!isNil "_x") then {
|
||||
_x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex];
|
||||
};
|
||||
} forEach _spallTrack;
|
||||
};
|
||||
false
|
||||
};
|
||||
|
||||
_this set[1, (getPosASL _round)];
|
||||
_this set[2, (velocity _round)];
|
||||
|
||||
if(_doSpall) then {
|
||||
private["_scale"];
|
||||
_scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1;
|
||||
[_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack);
|
||||
};
|
||||
|
||||
true
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD
|
||||
|
||||
PARAMS_1(_round);
|
||||
|
||||
if(_round in GVAR(blackList)) then {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
|
||||
GVAR(objects) = GVAR(objects) - [_round];
|
||||
#include "script_component.hpp"
|
||||
|
||||
// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD
|
||||
|
||||
PARAMS_1(_round);
|
||||
|
||||
if(_round in GVAR(blackList)) then {
|
||||
GVAR(blackList) = GVAR(blackList) - [_round];
|
||||
};
|
||||
|
||||
GVAR(objects) = GVAR(objects) - [_round];
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ret"];
|
||||
_ret = true;
|
||||
if(IS_ARRAY((_this select 0))) then {
|
||||
_ret = false;
|
||||
} else {
|
||||
if((_this select 0) in GVAR(trackedObjects)) then {
|
||||
GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)];
|
||||
} else {
|
||||
_ret = false;
|
||||
};
|
||||
};
|
||||
_ret
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ret"];
|
||||
_ret = true;
|
||||
if(IS_ARRAY((_this select 0))) then {
|
||||
_ret = false;
|
||||
} else {
|
||||
if((_this select 0) in GVAR(trackedObjects)) then {
|
||||
GVAR(trackedObjects) = GVAR(trackedObjects) - [(_this select 0)];
|
||||
} else {
|
||||
_ret = false;
|
||||
};
|
||||
};
|
||||
_ret
|
||||
|
@ -1,29 +1,29 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"];
|
||||
//player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))];
|
||||
|
||||
if ((_this select 0) <= (count GVAR(spallHPData))) then {
|
||||
_initialData = GVAR(spallHPData) select (_this select 0);
|
||||
if (!isNil "_initialData") then {
|
||||
_hpRound = ((_this select 1) select 0) select 2;
|
||||
_round = _initialData select 3;
|
||||
_hpDirect = ((_this select 1) select 0) select 10;
|
||||
if (_hpDirect && {_round == _hpRound}) then {
|
||||
{
|
||||
_hpData = _x;
|
||||
_round = _initialData select 3;
|
||||
// diag_log text format["HPDUMP-------------------------------------"];
|
||||
// {
|
||||
// _hp = _x;
|
||||
// diag_log text format["%1 --", _forEachIndex];
|
||||
// {
|
||||
// diag_log text format["%1: %2", _forEachIndex, _x];
|
||||
// } forEach _hp;
|
||||
// } forEach (_this select 1);
|
||||
[DFUNC(doSpall), [_this, _forEachIndex]] call EFUNC(common,execNextFrame);
|
||||
// player sideChat "WEEE";
|
||||
} forEach (_this select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_initialData", "_hpData", "_round", "_hpRound", "_hpDirect"];
|
||||
//player sideChat format["f: %1 c: %2", (_this select 0), (count GVAR(spallHPData))];
|
||||
|
||||
if ((_this select 0) <= (count GVAR(spallHPData))) then {
|
||||
_initialData = GVAR(spallHPData) select (_this select 0);
|
||||
if (!isNil "_initialData") then {
|
||||
_hpRound = ((_this select 1) select 0) select 2;
|
||||
_round = _initialData select 3;
|
||||
_hpDirect = ((_this select 1) select 0) select 10;
|
||||
if (_hpDirect && {_round == _hpRound}) then {
|
||||
{
|
||||
_hpData = _x;
|
||||
_round = _initialData select 3;
|
||||
// diag_log text format["HPDUMP-------------------------------------"];
|
||||
// {
|
||||
// _hp = _x;
|
||||
// diag_log text format["%1 --", _forEachIndex];
|
||||
// {
|
||||
// diag_log text format["%1: %2", _forEachIndex, _x];
|
||||
// } forEach _hp;
|
||||
// } forEach (_this select 1);
|
||||
[DFUNC(doSpall), [_this, _forEachIndex]] call EFUNC(common,execNextFrame);
|
||||
// player sideChat "WEEE";
|
||||
} forEach (_this select 1);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,32 +1,32 @@
|
||||
//fnc_spallTrack.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"];
|
||||
_round = _this select 0;
|
||||
_multiplier = _this select 1;
|
||||
_foundObjects = _this select 2;
|
||||
_foundObjectHPIds = _this select 3;
|
||||
|
||||
_delta = (1/diag_fps) * _multiplier;
|
||||
_curPos = getPosASL _round;
|
||||
_velocity = velocity _round;
|
||||
|
||||
_velocityStep = _velocity vectorMultiply _delta;
|
||||
_forwardPos = _curPos vectorAdd _velocityStep;
|
||||
|
||||
_intersectsWith = lineIntersectsWith [_curPos, _forwardPos];
|
||||
|
||||
if (count _intersectsWith > 0) then {
|
||||
// player sideChat format["inter: %1", _intersectsWith];
|
||||
{
|
||||
if(!(_x in _foundObjects)) then {
|
||||
// diag_log text format["Adding HP: %1", _x];
|
||||
_index = (count GVAR(spallHPData));
|
||||
_hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]];
|
||||
_foundObjects set[(count _foundObjects), _x];
|
||||
_foundObjectHPIds set[(count _foundObjectHPIds), _hpId];
|
||||
_data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds];
|
||||
GVAR(spallHPData) set[_index, _data];
|
||||
};
|
||||
} forEach _intersectsWith;
|
||||
};
|
||||
//fnc_spallTrack.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_round", "_multiplier", "_foundObjects", "_foundObjectHPIds", "_delta", "_curPos", "_velocity", "_velocityStep", "_forwardPos", "_intersectsWith", "_index", "_hpId", "_data"];
|
||||
_round = _this select 0;
|
||||
_multiplier = _this select 1;
|
||||
_foundObjects = _this select 2;
|
||||
_foundObjectHPIds = _this select 3;
|
||||
|
||||
_delta = (1/diag_fps) * _multiplier;
|
||||
_curPos = getPosASL _round;
|
||||
_velocity = velocity _round;
|
||||
|
||||
_velocityStep = _velocity vectorMultiply _delta;
|
||||
_forwardPos = _curPos vectorAdd _velocityStep;
|
||||
|
||||
_intersectsWith = lineIntersectsWith [_curPos, _forwardPos];
|
||||
|
||||
if (count _intersectsWith > 0) then {
|
||||
// player sideChat format["inter: %1", _intersectsWith];
|
||||
{
|
||||
if(!(_x in _foundObjects)) then {
|
||||
// diag_log text format["Adding HP: %1", _x];
|
||||
_index = (count GVAR(spallHPData));
|
||||
_hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]];
|
||||
_foundObjects set[(count _foundObjects), _x];
|
||||
_foundObjectHPIds set[(count _foundObjectHPIds), _hpId];
|
||||
_data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds];
|
||||
GVAR(spallHPData) set[_index, _data];
|
||||
};
|
||||
} forEach _intersectsWith;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
if(!GVAR(tracesStarted)) then {
|
||||
GVAR(tracesStarted) = true;
|
||||
GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
#include "script_component.hpp"
|
||||
if(!GVAR(tracesStarted)) then {
|
||||
GVAR(tracesStarted) = true;
|
||||
GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
if(GVAR(tracesStarted)) then {
|
||||
GVAR(tracesStarted) = false;
|
||||
[GVAR(traceID)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
#include "script_component.hpp"
|
||||
if(GVAR(tracesStarted)) then {
|
||||
GVAR(tracesStarted) = false;
|
||||
[GVAR(traceID)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_params", "_tracerObj", "_index", "_positions", "_data"];
|
||||
_params = _this select 0;
|
||||
_tracerObj = _params select 0;
|
||||
_index = _params select 1;
|
||||
|
||||
if (alive _tracerObj && (count GVAR(traces)) > 0) then {
|
||||
_data = GVAR(traces) select _index;
|
||||
_positions = _data select 4;
|
||||
_positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]];
|
||||
} else {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_params", "_tracerObj", "_index", "_positions", "_data"];
|
||||
_params = _this select 0;
|
||||
_tracerObj = _params select 0;
|
||||
_index = _params select 1;
|
||||
|
||||
if (alive _tracerObj && (count GVAR(traces)) > 0) then {
|
||||
_data = GVAR(traces) select _index;
|
||||
_positions = _data select 4;
|
||||
_positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]];
|
||||
} else {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
@ -1,20 +1,20 @@
|
||||
#define COMPONENT frag
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
//#define DEBUG_ENABLED_FRAG
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_FRAG
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_FRAG
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define COMPONENT frag
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
//#define DEBUG_ENABLED_FRAG
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_FRAG
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_FRAG
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define ACE_TRACE_DRAW_INC 1
|
@ -1,67 +1,67 @@
|
||||
//XEH_clientInit.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(cachedBuildingTypes) = [];
|
||||
GVAR(cachedBuildingActionPairs) = [];
|
||||
|
||||
GVAR(ParsedTextCached) = [];
|
||||
|
||||
["SettingChanged", {
|
||||
params ["_name"];
|
||||
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
|
||||
[] call FUNC(setupTextColors);
|
||||
};
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
||||
["SettingsInitialized", {
|
||||
//Setup text/shadow/size/color settings matrix
|
||||
[] call FUNC(setupTextColors);
|
||||
// Install the render EH on the main display
|
||||
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Add Actions to Houses:
|
||||
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)),
|
||||
{
|
||||
// Statement
|
||||
[0] call FUNC(keyDown)
|
||||
},{[0,false] call FUNC(keyUp)},
|
||||
[219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key
|
||||
|
||||
["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)),
|
||||
{
|
||||
// Statement
|
||||
[1] call FUNC(keyDown)
|
||||
},{[1,false] call FUNC(keyUp)},
|
||||
[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
|
||||
["medical_onUnconscious", {
|
||||
// If no menu is open just quit
|
||||
if (GVAR(openedMenuType) < 0) exitWith {};
|
||||
|
||||
params ["_unit", "_isUnconscious"];
|
||||
|
||||
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
||||
|
||||
GVAR(actionSelected) = false;
|
||||
[GVAR(openedMenuType), false] call FUNC(keyUp);
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// disable firing while the interact menu is is is opened
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// background options
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);};
|
||||
if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
["interactMenuClosed", {
|
||||
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);};
|
||||
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
//XEH_clientInit.sqf
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(cachedBuildingTypes) = [];
|
||||
GVAR(cachedBuildingActionPairs) = [];
|
||||
|
||||
GVAR(ParsedTextCached) = [];
|
||||
|
||||
["SettingChanged", {
|
||||
params ["_name"];
|
||||
if (({_x == _name} count [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) == 1) then {
|
||||
[] call FUNC(setupTextColors);
|
||||
};
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
||||
["SettingsInitialized", {
|
||||
//Setup text/shadow/size/color settings matrix
|
||||
[] call FUNC(setupTextColors);
|
||||
// Install the render EH on the main display
|
||||
addMissionEventHandler ["Draw3D", DFUNC(render)];
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Add Actions to Houses:
|
||||
["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)),
|
||||
{
|
||||
// Statement
|
||||
[0] call FUNC(keyDown)
|
||||
},{[0,false] call FUNC(keyUp)},
|
||||
[219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key
|
||||
|
||||
["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)),
|
||||
{
|
||||
// Statement
|
||||
[1] call FUNC(keyDown)
|
||||
},{[1,false] call FUNC(keyUp)},
|
||||
[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
|
||||
["medical_onUnconscious", {
|
||||
// If no menu is open just quit
|
||||
if (GVAR(openedMenuType) < 0) exitWith {};
|
||||
|
||||
params ["_unit", "_isUnconscious"];
|
||||
|
||||
if (_unit != ACE_player || !_isUnconscious) exitWith {};
|
||||
|
||||
GVAR(actionSelected) = false;
|
||||
[GVAR(openedMenuType), false] call FUNC(keyUp);
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
||||
// disable firing while the interact menu is is is opened
|
||||
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// background options
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);};
|
||||
if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
["interactMenuClosed", {
|
||||
if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);};
|
||||
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -1,25 +1,25 @@
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_post_init));
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class All {
|
||||
ADDON = QUOTE(_this call FUNC(onFired));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_post_init));
|
||||
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBIS_EventHandlers {
|
||||
class All {
|
||||
ADDON = QUOTE(_this call FUNC(onFired));
|
||||
};
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
|
||||
class CfgSounds {
|
||||
class ACE_Javelin_Locking {
|
||||
name = "ACE_Javelin_Locking";
|
||||
sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Javelin_Locked {
|
||||
name = "ACE_Javelin_Locked";
|
||||
sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0};
|
||||
titles[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgSounds {
|
||||
class ACE_Javelin_Locking {
|
||||
name = "ACE_Javelin_Locking";
|
||||
sound[] = {PATHTOF(data\sounds\javelin_locking.ogg), db+0, 1.0};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Javelin_Locked {
|
||||
name = "ACE_Javelin_Locked";
|
||||
sound[] = {PATHTOF(data\sounds\javelin_locked.ogg), db+0, 1.0};
|
||||
titles[] = {};
|
||||
};
|
||||
};
|
||||
|
@ -1,68 +1,68 @@
|
||||
class CfgVehicles {
|
||||
class LandVehicle;
|
||||
class StaticWeapon : LandVehicle {
|
||||
class Turrets;
|
||||
};
|
||||
|
||||
class StaticMGWeapon : StaticWeapon {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret;
|
||||
};
|
||||
};
|
||||
class AT_01_base_F: StaticMGWeapon {};
|
||||
|
||||
class B_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class O_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class I_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class CfgVehicles {
|
||||
class LandVehicle;
|
||||
class StaticWeapon : LandVehicle {
|
||||
class Turrets;
|
||||
};
|
||||
|
||||
class StaticMGWeapon : StaticWeapon {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret;
|
||||
};
|
||||
};
|
||||
class AT_01_base_F: StaticMGWeapon {};
|
||||
|
||||
class B_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class O_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
class I_static_AT_F: AT_01_base_F {
|
||||
class Turrets : Turrets {
|
||||
class MainTurret : MainTurret {
|
||||
weapons[] = { QGVAR(Titan_Static) };
|
||||
magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"};
|
||||
|
||||
turretInfoType = "ACE_RscOptics_javelin";
|
||||
gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d);
|
||||
opticsZoomMin = 0.08333;
|
||||
opticsZoomMax = 0.04167;
|
||||
opticsZoomInit = 0.08333;
|
||||
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
|
||||
opticsFlare = 0;
|
||||
discretefov[] = {0.08333,0.04167};
|
||||
discreteInitIndex = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,72 +1,72 @@
|
||||
class CfgWeapons {
|
||||
class Launcher;
|
||||
class MissileLauncher;
|
||||
|
||||
class Launcher_Base_F : Launcher {
|
||||
class WeaponSlotsInfo;
|
||||
};
|
||||
|
||||
// @TODO: AA by default, motherfuckers
|
||||
class missiles_titan : MissileLauncher {
|
||||
|
||||
};
|
||||
|
||||
class missiles_titan_at : missiles_titan { };
|
||||
class GVAR(Titan_Static) : missiles_titan_at {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
magazines[] = {"1Rnd_GAT_missiles"};
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
|
||||
// @TODO: AA by default, motherfuckers
|
||||
class launch_Titan_base : Launcher_Base_F {};
|
||||
|
||||
class launch_Titan_short_base : launch_Titan_base { };
|
||||
|
||||
class launch_B_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_I_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_O_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
};
|
||||
class CfgWeapons {
|
||||
class Launcher;
|
||||
class MissileLauncher;
|
||||
|
||||
class Launcher_Base_F : Launcher {
|
||||
class WeaponSlotsInfo;
|
||||
};
|
||||
|
||||
// @TODO: AA by default, motherfuckers
|
||||
class missiles_titan : MissileLauncher {
|
||||
|
||||
};
|
||||
|
||||
class missiles_titan_at : missiles_titan { };
|
||||
class GVAR(Titan_Static) : missiles_titan_at {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
magazines[] = {"1Rnd_GAT_missiles"};
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
|
||||
// @TODO: AA by default, motherfuckers
|
||||
class launch_Titan_base : Launcher_Base_F {};
|
||||
|
||||
class launch_Titan_short_base : launch_Titan_base { };
|
||||
|
||||
class launch_B_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_I_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_O_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
class launch_Titan_short_F: launch_Titan_short_base {
|
||||
GVAR(enabled) = 1;
|
||||
weaponInfoType = "ACE_RscOptics_javelin";
|
||||
modelOptics = PATHTOF(data\reticle_titan.p3d);
|
||||
|
||||
canLock = 0;
|
||||
|
||||
lockingTargetSound[] = {"",0,1};
|
||||
lockedTargetSound[] = {"",0,1};
|
||||
};
|
||||
};
|
||||
|
@ -1,454 +1,454 @@
|
||||
class RscOpticsValue;
|
||||
class RscControlsGroup;
|
||||
class RscPicture;
|
||||
class RscMapControl;
|
||||
class VScrollbar;
|
||||
class HScrollbar;
|
||||
class RscLine;
|
||||
|
||||
|
||||
// Taken from AGM for optics management.
|
||||
|
||||
class RscInGameUI {
|
||||
class ACE_RscOptics_javelin {
|
||||
idd = 300;
|
||||
controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"};
|
||||
onLoad = QUOTE(_this call FUNC(onOpticLoad));
|
||||
onUnload = QUOTE(_this call FUNC(onOpticUnload));
|
||||
|
||||
class ACE_javelin_elements_group: RscControlsGroup
|
||||
{
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
idc = 170;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class CA_Distance: RscOpticsValue {
|
||||
idc = 151;
|
||||
sizeEx = "0";
|
||||
colorText[] = {0,0,0,0};
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
|
||||
class ACE_javelin_Day_mode_off: RscPicture {
|
||||
idc = 1001;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneY+SafezoneH*0.031 - SafezoneY";
|
||||
w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.1045752";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa";
|
||||
};
|
||||
class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off {
|
||||
idc = 160;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class CA_Javelin_WFOV_mode_off : ACE_javelin_Day_mode_off {
|
||||
idc = 1004;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_WFOV_mode_group: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
idc = 163;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class StadiaL: RscLine {
|
||||
x = "0.4899*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class StadiaR: RscLine {
|
||||
x = "0.5109*SafezoneW- SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketL: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.4677*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.0646*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketR: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.4677*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.0646*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketT: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.3535*SafezoneH - SafezoneY";
|
||||
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = 0;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketB: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.6465*SafezoneH - SafezoneY";
|
||||
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = 0;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
class CA_Javelin_NFOV_mode_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1003;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_NFOV_mode_group: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW-SafezoneX";
|
||||
h = "SafezoneH-SafezoneY";
|
||||
idc = 162;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class StadiaL: RscLine {
|
||||
x = "0.4788*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class StadiaR: RscLine {
|
||||
x = "0.5212*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineHL: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneH*0.5 - SafezoneY";
|
||||
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.0";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineHR: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneH*0.5 - SafezoneY";
|
||||
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.0";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineVT: RscLine {
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.1825*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineVB: RscLine {
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.6465*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.1895*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off {
|
||||
idc = 699000;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_SEEK: ACE_javelin_SEEK_off {
|
||||
idc = 166;
|
||||
colorText[] = {0.2941,0.8745,0.2157,0};
|
||||
};
|
||||
class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1032;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa";
|
||||
};
|
||||
class ACE_javelin_Missle: ACE_javelin_Missle_off {
|
||||
idc = 167;
|
||||
colorText[] = {0.9255,0.5216,0.1216,0};
|
||||
};
|
||||
class ACE_javelin_CLU_off: ACE_javelin_Missle_off {
|
||||
idc = 1027;
|
||||
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa";
|
||||
};
|
||||
class ACE_javelin_HangFire_off: ACE_javelin_Missle_off {
|
||||
idc = 1028;
|
||||
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa";
|
||||
};
|
||||
class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off {
|
||||
idc = 699001;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class ACE_javelin_DIR: ACE_javelin_Day_mode {
|
||||
idc = 699002;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
};
|
||||
class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1002;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa";
|
||||
};
|
||||
class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off {
|
||||
idc = 161;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ACE_Targeting : RscControlsGroup {
|
||||
idc = 6999;
|
||||
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
|
||||
enabled = 0;
|
||||
class Controls {
|
||||
class ACE_TargetingConstrains: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW-SafezoneX";
|
||||
h = "SafezoneH-SafezoneY";
|
||||
|
||||
enabled = 0;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class Top: RscPicture {
|
||||
idc = 699101;
|
||||
text = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH-SafezoneY";
|
||||
w = "(3/4)*SafezoneH";
|
||||
h = "0.21*SafezoneH";
|
||||
};
|
||||
class Bottom: Top {
|
||||
idc = 699102;
|
||||
y = "0.64*SafezoneH-SafezoneY";
|
||||
};
|
||||
class Left: Top {
|
||||
idc = 699103;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.36*SafezoneH-SafezoneY";
|
||||
w = "0.31*(3/4)*SafezoneH";
|
||||
h = "0.28*SafezoneH";
|
||||
};
|
||||
class Right: Left {
|
||||
idc = 699104;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX";
|
||||
};
|
||||
class OpticsBorders: RscPicture {
|
||||
idc = 699105;
|
||||
text = PATHTOF(data\javelin_ui_border_ca.paa);
|
||||
colorText[] = {0,0,0,1};
|
||||
x = "((SafezoneW -(3.1/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH-SafezoneY";
|
||||
w = "(3.1/4)*SafezoneH";
|
||||
h = "0.7*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_TargetingGate : ACE_TargetingConstrains {
|
||||
idc = 699200;
|
||||
class Controls {
|
||||
class TargetingGateTL: ACE_TargetingConstrains {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
idc = 699201;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699210;
|
||||
x = "0";
|
||||
y = "0";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
idc = 699211;
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateTR: TargetingGateTL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
idc = 699202;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699220;
|
||||
x = "0";
|
||||
y = "0";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
idc = 699221;
|
||||
x = "0.025*(3/4)*SafezoneH";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateBL: TargetingGateTL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.825*SafezoneH - SafezoneY";
|
||||
idc = 699203;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
x = "0";
|
||||
y = "0.025*SafezoneH";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
y = "0";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateBR: TargetingGateBL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
|
||||
y = "0.825*SafezoneH - SafezoneY";
|
||||
idc = 699204;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
x = "0";
|
||||
y = "0.025*SafezoneH";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
x = "0.025*(3/4)*SafezoneH";
|
||||
y = "0";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class ACE_TargetingLines: ACE_TargetingConstrains {
|
||||
idc = 699300;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699301;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.5*SafezoneH - SafezoneY";
|
||||
w = "(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: RscLine {
|
||||
idc = 699302;
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
w = "0";
|
||||
h = "0.7*SafezoneH";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// on colorText[] = {0.2941, 0.8745, 0.2157, 1.0};
|
||||
// off colorText[] = {0.2941, 0.2941, 0.2941, 1.0};
|
||||
// orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0};
|
||||
|
||||
/*
|
||||
ACE_Titan_elements_group: 170
|
||||
ACE_Titan_Day_mode_off: 1001
|
||||
ACE_Titan_Day_mode: 160
|
||||
ACE_Titan_WFOV_mode_off: 1004
|
||||
ACE_Titan_WFOV_mode_group: 163
|
||||
ACE_Titan_NFOV_mode_off: 1003
|
||||
ACE_Titan_NFOV_mode_group: 162
|
||||
ACE_Titan_SEEK_off: 1005 //1001
|
||||
ACE_Titan_SEEK: 166
|
||||
ACE_Titan_Missle_off: 1032
|
||||
ACE_Titan_Missle: 167
|
||||
ACE_Titan_CLU_off: 1027
|
||||
ACE_Titan_HangFire_off: 1028
|
||||
ACE_Titan_TOP_off: 1006
|
||||
ACE_Titan_DIR: 1007
|
||||
ACE_Titan_FLTR_mode_off: 1002
|
||||
ACE_Titan_FLTR_mode: 161
|
||||
*/
|
||||
class RscOpticsValue;
|
||||
class RscControlsGroup;
|
||||
class RscPicture;
|
||||
class RscMapControl;
|
||||
class VScrollbar;
|
||||
class HScrollbar;
|
||||
class RscLine;
|
||||
|
||||
|
||||
// Taken from AGM for optics management.
|
||||
|
||||
class RscInGameUI {
|
||||
class ACE_RscOptics_javelin {
|
||||
idd = 300;
|
||||
controls[] = { "ACE_javelin_elements_group", "ACE_Targeting" }; //, "ACE_TargetingConstrains", "ACE_TargetingGate", "ACE_TargetingLines"};
|
||||
onLoad = QUOTE(_this call FUNC(onOpticLoad));
|
||||
onUnload = QUOTE(_this call FUNC(onOpticUnload));
|
||||
|
||||
class ACE_javelin_elements_group: RscControlsGroup
|
||||
{
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
idc = 170;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class CA_Distance: RscOpticsValue {
|
||||
idc = 151;
|
||||
sizeEx = "0";
|
||||
colorText[] = {0,0,0,0};
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
|
||||
class ACE_javelin_Day_mode_off: RscPicture {
|
||||
idc = 1001;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (0.03/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneY+SafezoneH*0.031 - SafezoneY";
|
||||
w = "0.1045752* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.1045752";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\day_co.paa";
|
||||
};
|
||||
class ACE_javelin_Day_mode: ACE_javelin_Day_mode_off {
|
||||
idc = 160;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class CA_Javelin_WFOV_mode_off : ACE_javelin_Day_mode_off {
|
||||
idc = 1004;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_WFOV_mode_group: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
idc = 163;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class StadiaL: RscLine {
|
||||
x = "0.4899*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class StadiaR: RscLine {
|
||||
x = "0.5109*SafezoneW- SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketL: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.293/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.4677*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.0646*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketR: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.70/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.4677*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.0646*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketT: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.3535*SafezoneH - SafezoneY";
|
||||
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = 0;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class BracketB: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.467/4)*3*SafezoneH - SafezoneX";
|
||||
y = "0.6465*SafezoneH - SafezoneY";
|
||||
w = "0.065* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = 0;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
class CA_Javelin_NFOV_mode_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1003;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_NFOV_mode_group: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW-SafezoneX";
|
||||
h = "SafezoneH-SafezoneY";
|
||||
idc = 162;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class StadiaL: RscLine {
|
||||
x = "0.4788*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class StadiaR: RscLine {
|
||||
x = "0.5212*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.049*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineHL: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.01/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneH*0.5 - SafezoneY";
|
||||
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.0";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineHR: RscLine {
|
||||
x = "((SafezoneW -SafezoneH*3/4)/2)+ (0.695/4)*3*SafezoneH - SafezoneX";
|
||||
y = "SafezoneH*0.5 - SafezoneY";
|
||||
w = "0.29* (((SafezoneW*3)/4)/SafezoneW)/(1/SafezoneH)";
|
||||
h = "SafezoneH*0.0";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineVT: RscLine {
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.171*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.1825*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class LineVB: RscLine {
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.6465*SafezoneH - SafezoneY";
|
||||
w = 0;
|
||||
h = "0.1895*SafezoneH";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_javelin_SEEK_off: ACE_javelin_Day_mode_off {
|
||||
idc = 699000;
|
||||
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";
|
||||
};
|
||||
class ACE_javelin_SEEK: ACE_javelin_SEEK_off {
|
||||
idc = 166;
|
||||
colorText[] = {0.2941,0.8745,0.2157,0};
|
||||
};
|
||||
class ACE_javelin_Missle_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1032;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (-0.134/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\missle_co.paa";
|
||||
};
|
||||
class ACE_javelin_Missle: ACE_javelin_Missle_off {
|
||||
idc = 167;
|
||||
colorText[] = {0.9255,0.5216,0.1216,0};
|
||||
};
|
||||
class ACE_javelin_CLU_off: ACE_javelin_Missle_off {
|
||||
idc = 1027;
|
||||
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\clu_co.paa";
|
||||
};
|
||||
class ACE_javelin_HangFire_off: ACE_javelin_Missle_off {
|
||||
idc = 1028;
|
||||
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\hangfire_co.paa";
|
||||
};
|
||||
class ACE_javelin_TOP_off: ACE_javelin_Day_mode_off {
|
||||
idc = 699001;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.208*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\top_co.paa";
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
class ACE_javelin_DIR: ACE_javelin_Day_mode {
|
||||
idc = 699002;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.436*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\dir_co.paa";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
};
|
||||
class ACE_javelin_FLTR_mode_off: ACE_javelin_Day_mode_off {
|
||||
idc = 1002;
|
||||
x = "(SafezoneX+(SafezoneW -SafezoneH*3/4)/2)+ (1.023/4)*3*SafezoneH - SafezoneX";
|
||||
y = "(SafezoneY + 0.669*SafezoneH) - SafezoneY";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics_titan\fltr_co.paa";
|
||||
};
|
||||
class ACE_javelin_FLTR_mode: ACE_javelin_FLTR_mode_off {
|
||||
idc = 161;
|
||||
colorText[] = {0.2941,0.8745,0.2157,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ACE_Targeting : RscControlsGroup {
|
||||
idc = 6999;
|
||||
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW";
|
||||
h = "SafezoneH";
|
||||
|
||||
enabled = 0;
|
||||
class Controls {
|
||||
class ACE_TargetingConstrains: RscControlsGroup {
|
||||
x = "SafezoneX";
|
||||
y = "SafezoneY";
|
||||
w = "SafezoneW-SafezoneX";
|
||||
h = "SafezoneH-SafezoneY";
|
||||
|
||||
enabled = 0;
|
||||
class VScrollbar {
|
||||
autoScrollSpeed = -1;
|
||||
autoScrollDelay = 5;
|
||||
autoScrollRewind = 0;
|
||||
color[] = {1,1,1,0};
|
||||
width = 0.001;
|
||||
};
|
||||
class HScrollbar {
|
||||
color[] = {1,1,1,0};
|
||||
height = 0.001;
|
||||
};
|
||||
class Controls {
|
||||
class Top: RscPicture {
|
||||
idc = 699101;
|
||||
text = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
colorText[] = {0.2941,0.2941,0.2941,1};
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH-SafezoneY";
|
||||
w = "(3/4)*SafezoneH";
|
||||
h = "0.21*SafezoneH";
|
||||
};
|
||||
class Bottom: Top {
|
||||
idc = 699102;
|
||||
y = "0.64*SafezoneH-SafezoneY";
|
||||
};
|
||||
class Left: Top {
|
||||
idc = 699103;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.36*SafezoneH-SafezoneY";
|
||||
w = "0.31*(3/4)*SafezoneH";
|
||||
h = "0.28*SafezoneH";
|
||||
};
|
||||
class Right: Left {
|
||||
idc = 699104;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2)+ 0.69*(3/4)*SafezoneH - SafezoneX";
|
||||
};
|
||||
class OpticsBorders: RscPicture {
|
||||
idc = 699105;
|
||||
text = PATHTOF(data\javelin_ui_border_ca.paa);
|
||||
colorText[] = {0,0,0,1};
|
||||
x = "((SafezoneW -(3.1/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH-SafezoneY";
|
||||
w = "(3.1/4)*SafezoneH";
|
||||
h = "0.7*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_TargetingGate : ACE_TargetingConstrains {
|
||||
idc = 699200;
|
||||
class Controls {
|
||||
class TargetingGateTL: ACE_TargetingConstrains {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
idc = 699201;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699210;
|
||||
x = "0";
|
||||
y = "0";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
idc = 699211;
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateTR: TargetingGateTL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
idc = 699202;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699220;
|
||||
x = "0";
|
||||
y = "0";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
idc = 699221;
|
||||
x = "0.025*(3/4)*SafezoneH";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateBL: TargetingGateTL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.825*SafezoneH - SafezoneY";
|
||||
idc = 699203;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
x = "0";
|
||||
y = "0.025*SafezoneH";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
y = "0";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
class TargetingGateBR: TargetingGateBL {
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX + 0.975*(3/4)*SafezoneH";
|
||||
y = "0.825*SafezoneH - SafezoneY";
|
||||
idc = 699204;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
x = "0";
|
||||
y = "0.025*SafezoneH";
|
||||
w = "0.025*(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: LineH {
|
||||
x = "0.025*(3/4)*SafezoneH";
|
||||
y = "0";
|
||||
w = "0";
|
||||
h = "0.025*SafezoneH";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class ACE_TargetingLines: ACE_TargetingConstrains {
|
||||
idc = 699300;
|
||||
class Controls {
|
||||
class LineH: RscLine {
|
||||
idc = 699301;
|
||||
x = "((SafezoneW -(3/4)*SafezoneH)/2) - SafezoneX";
|
||||
y = "0.5*SafezoneH - SafezoneY";
|
||||
w = "(3/4)*SafezoneH";
|
||||
h = "0";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
class LineV: RscLine {
|
||||
idc = 699302;
|
||||
x = "0.5*SafezoneW - SafezoneX";
|
||||
y = "0.15*SafezoneH - SafezoneY";
|
||||
w = "0";
|
||||
h = "0.7*SafezoneH";
|
||||
colorText[] = {0.8745,0.8745,0.8745,1};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// on colorText[] = {0.2941, 0.8745, 0.2157, 1.0};
|
||||
// off colorText[] = {0.2941, 0.2941, 0.2941, 1.0};
|
||||
// orange colorText[] = {0.9255, 0.5216, 0.1216, 1.0};
|
||||
|
||||
/*
|
||||
ACE_Titan_elements_group: 170
|
||||
ACE_Titan_Day_mode_off: 1001
|
||||
ACE_Titan_Day_mode: 160
|
||||
ACE_Titan_WFOV_mode_off: 1004
|
||||
ACE_Titan_WFOV_mode_group: 163
|
||||
ACE_Titan_NFOV_mode_off: 1003
|
||||
ACE_Titan_NFOV_mode_group: 162
|
||||
ACE_Titan_SEEK_off: 1005 //1001
|
||||
ACE_Titan_SEEK: 166
|
||||
ACE_Titan_Missle_off: 1032
|
||||
ACE_Titan_Missle: 167
|
||||
ACE_Titan_CLU_off: 1027
|
||||
ACE_Titan_HangFire_off: 1028
|
||||
ACE_Titan_TOP_off: 1006
|
||||
ACE_Titan_DIR: 1007
|
||||
ACE_Titan_FLTR_mode_off: 1002
|
||||
ACE_Titan_FLTR_mode: 161
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
#include "initKeybinds.sqf"
|
@ -1,2 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(isLockKeyDown) = false;
|
||||
GVAR(pfehID) = -1;
|
||||
|
||||
ADDON = true;
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(isLockKeyDown) = false;
|
||||
GVAR(pfehID) = -1;
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,18 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = { "ace_main", "ace_common", "ace_missileguidance" };
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "RscInGameUI.hpp"
|
||||
#include "CfgSounds.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgMagazines.hpp"
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = { "ace_main", "ace_common", "ace_missileguidance" };
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "RscInGameUI.hpp"
|
||||
#include "CfgSounds.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgMagazines.hpp"
|
||||
|
@ -1,13 +1,13 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_player", "_currentFireMode"];
|
||||
|
||||
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
|
||||
if(_currentFireMode == "JAV_DIR") then {
|
||||
_currentFireMode = "JAV_TOP";
|
||||
} else {
|
||||
_currentFireMode = "JAV_DIR";
|
||||
};
|
||||
ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false];
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_player", "_currentFireMode"];
|
||||
|
||||
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
|
||||
if(_currentFireMode == "JAV_DIR") then {
|
||||
_currentFireMode = "JAV_TOP";
|
||||
} else {
|
||||
_currentFireMode = "JAV_DIR";
|
||||
};
|
||||
ACE_player setVariable["ace_missileguidance_attackProfile", _currentFireMode, false];
|
||||
|
@ -1,3 +1,3 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
@ -1,3 +1,3 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
@ -1,17 +1,17 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_shooter,_weapon);
|
||||
|
||||
// Bail on not missile or javelin PFEH not running
|
||||
if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false };
|
||||
|
||||
private ["_configs"];
|
||||
|
||||
_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
||||
if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {};
|
||||
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_shooter,_weapon);
|
||||
|
||||
// Bail on not missile or javelin PFEH not running
|
||||
if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false };
|
||||
|
||||
private ["_configs"];
|
||||
|
||||
_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
||||
if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {};
|
||||
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
@ -1,313 +1,313 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
#define __TRACKINTERVAL 0 // how frequent the check should be.
|
||||
#define __LOCKONTIME 3 // Lock on won't occur sooner
|
||||
|
||||
private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"];
|
||||
private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"];
|
||||
private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"];
|
||||
private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"];
|
||||
private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"];
|
||||
|
||||
_currentShooter = (vehicle ACE_player);
|
||||
|
||||
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
|
||||
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
|
||||
|
||||
// Reset arguments if we havnt rendered in over a second
|
||||
_args = uiNamespace getVariable[QGVAR(arguments), [] ];
|
||||
if( (count _args) > 0) then {
|
||||
_lastTick = _args select 0;
|
||||
if(ACE_diagTime - _lastTick > 1) then {
|
||||
[] call FUNC(onOpticLoad);
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_1("Running", "Running");
|
||||
|
||||
// Pull the arguments
|
||||
_currentTarget = _args select 1;
|
||||
_runTime = _args select 2;
|
||||
_lockTime = _args select 3;
|
||||
_soundTime = _args select 4;
|
||||
_randomLockInterval = _args select 5;
|
||||
_fireDisabledEH = _args select 6;
|
||||
|
||||
private["_ammo", "_magazineConfig", "_weaponConfig"];
|
||||
_weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
||||
_magazineConfig = if ((currentMagazine _currentShooter) != "") then {
|
||||
_ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo");
|
||||
configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false];
|
||||
} else {
|
||||
[]
|
||||
};
|
||||
|
||||
//If weapon does not have "javelin enabled", then exit PFEH
|
||||
if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith {
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
if(!isNil "_fireDisabledEH") then {
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
};
|
||||
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(pfehID) = -1;
|
||||
};
|
||||
|
||||
// Find a target within the optic range
|
||||
_newTarget = objNull;
|
||||
|
||||
// Bail on fast movement
|
||||
if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady.
|
||||
ACE_player switchCamera "INTERNAL";
|
||||
if (player != ACE_player) then {
|
||||
TRACE_2("Zeus, manually reseting RC after switchCamera",player,ACE_player);
|
||||
player remoteControl ACE_player;
|
||||
};
|
||||
};
|
||||
|
||||
// Refresh the firemode
|
||||
[] call FUNC(showFireMode);
|
||||
|
||||
_ammo = _currentShooter ammo (currentWeapon _currentShooter);
|
||||
// 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 {
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
if(!isNil "_fireDisabledEH") then {
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
};
|
||||
};
|
||||
|
||||
_range = parseNumber (ctrlText __JavelinIGUIRangefinder);
|
||||
TRACE_1("Viewing range", _range);
|
||||
if (_range > 50 && {_range < 2500}) then {
|
||||
_pos = positionCameraToWorld [0,0,_range];
|
||||
_targetArray = _pos nearEntities ["AllVehicles", _range/100];
|
||||
TRACE_1("Searching at range", _targetArray);
|
||||
if (count (_targetArray) > 0) then {
|
||||
_newTarget = _targetArray select 0;
|
||||
};
|
||||
};
|
||||
|
||||
if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then {
|
||||
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1];
|
||||
if (_intersectionsToCursorTarget isEqualTo []) then {
|
||||
_newTarget = cursorObject;
|
||||
};
|
||||
};
|
||||
if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then {
|
||||
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1];
|
||||
if (_intersectionsToCursorTarget isEqualTo []) then {
|
||||
_newTarget = cursorTarget;
|
||||
};
|
||||
};
|
||||
|
||||
// Create constants
|
||||
_constraintTop = __ConstraintTop;
|
||||
_constraintLeft = __ConstraintLeft;
|
||||
_constraintBottom = __ConstraintBottom;
|
||||
_constraintRight = __ConstraintRight;
|
||||
|
||||
_offsetX = __OffsetX;
|
||||
_offsetY = __OffsetY;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow true;
|
||||
|
||||
_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)];
|
||||
|
||||
_apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds);
|
||||
|
||||
_aposX = 0;
|
||||
_aposY = 0;
|
||||
if (count _apos < 2) then {
|
||||
_aposX = 1;
|
||||
_aposY = 0;
|
||||
} else {
|
||||
_aposX = (_apos select 0) + _offsetX;
|
||||
_aposY = (_apos select 1) + _offsetY;
|
||||
};
|
||||
|
||||
if((call CBA_fnc_getFoV) select 1 > 9) then {
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGreen;
|
||||
__JavelinIGUIWFOV ctrlSetTextColor __ColorGray;
|
||||
} else {
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUIWFOV ctrlSetTextColor __ColorGreen;
|
||||
};
|
||||
|
||||
FUNC(disableFire) = {
|
||||
_firedEH = _this select 0;
|
||||
|
||||
if(_firedEH < 0 && difficulty > 0) then {
|
||||
_firedEH = [ACE_player, "DefaultAction", {true}, {
|
||||
_canFire = (_this select 1) getVariable["ace_missileguidance_target", nil];
|
||||
if(!isNil "_canFire") exitWith { false };
|
||||
true
|
||||
}] call EFUNC(common,addActionEventHandler);
|
||||
};
|
||||
_firedEH
|
||||
};
|
||||
FUNC(enableFire) = {
|
||||
_firedEH = _this select 0;
|
||||
|
||||
if(_firedEH > 0 && difficulty > 0) then {
|
||||
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
|
||||
};
|
||||
-1
|
||||
};
|
||||
|
||||
if (isNull _newTarget) then {
|
||||
// No targets found
|
||||
_currentTarget = objNull;
|
||||
_lockTime = 0;
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
} else {
|
||||
_fov = [] call CBA_fnc_getFoV;
|
||||
TRACE_1("FOV", _fov);
|
||||
if (_newTarget distance ACE_player < 2500
|
||||
&& {(call CBA_fnc_getFoV) select 1 > 9}
|
||||
&& { (currentVisionMode ACE_player == 2)}
|
||||
&& GVAR(isLockKeyDown)
|
||||
) then {
|
||||
// Lock on after 3 seconds
|
||||
if(_currentTarget != _newTarget) then {
|
||||
TRACE_1("New Target, reseting locking", _newTarget);
|
||||
_lockTime = ACE_diagTime;
|
||||
_currentTarget = _newTarget;
|
||||
|
||||
playSound "ACE_Javelin_Locking";
|
||||
} else {
|
||||
if(ACE_diagTime - _lockTime > __LOCKONTIME + _randomLockInterval) then {
|
||||
TRACE_2("LOCKED!", _currentTarget, _lockTime);
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGreen;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow true;
|
||||
__JavelinIGUITargetingLines ctrlShow true;
|
||||
|
||||
// Move target marker to coords.
|
||||
//__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1];
|
||||
//__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY];
|
||||
//{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV];
|
||||
|
||||
_boundsInput = if (_currentTarget isKindOf "CAManBase") then {
|
||||
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
|
||||
} else {
|
||||
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"];
|
||||
};
|
||||
|
||||
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
|
||||
|
||||
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
|
||||
_minY = ((_bpos select 1) + _offsetY) max _constraintTop;
|
||||
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
|
||||
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
|
||||
|
||||
TRACE_4("", _boundsInput, _bpos, _minX, _minY);
|
||||
|
||||
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
|
||||
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
|
||||
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
|
||||
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
|
||||
|
||||
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
|
||||
|
||||
_currentShooter setVariable["ace_missileguidance_target", _currentTarget, false];
|
||||
|
||||
// Allow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
|
||||
if(ACE_diagTime > _soundTime) then {
|
||||
playSound "ACE_Javelin_Locked";
|
||||
_soundTime = ACE_diagTime + 0.25;
|
||||
};
|
||||
} else {
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingGate ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow true;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
|
||||
_currentShooter setVariable["ace_missileguidance_target", nil, false];
|
||||
|
||||
_boundsInput = if (_currentTarget isKindOf "CAManBase") then {
|
||||
[_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
|
||||
} else {
|
||||
[_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"];
|
||||
};
|
||||
|
||||
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
|
||||
|
||||
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
|
||||
_minY = ((_bpos select 1) + _offsetY) max _constraintTop;
|
||||
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
|
||||
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
|
||||
|
||||
TRACE_4("", _boundsInput, _bpos, _minX, _minY);
|
||||
|
||||
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
|
||||
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
|
||||
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
|
||||
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
|
||||
|
||||
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
|
||||
|
||||
if(ACE_diagTime > _soundTime) then {
|
||||
playSound "ACE_Javelin_Locking";
|
||||
_soundTime = ACE_diagTime + 0.25;
|
||||
};
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// No targets found
|
||||
_currentTarget = objNull;
|
||||
_lockTime = 0;
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
};
|
||||
};
|
||||
|
||||
//TRACE_2("", _newTarget, _currentTarget);
|
||||
|
||||
// Save arguments for next run
|
||||
_args set[0, ACE_diagTime];
|
||||
_args set[1, _currentTarget];
|
||||
_args set[2, _runTime];
|
||||
_args set[3, _lockTime];
|
||||
_args set[4, _soundTime];
|
||||
_args set[6, _fireDisabledEH];
|
||||
|
||||
uiNamespace setVariable[QGVAR(arguments), _args ];
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
#define __TRACKINTERVAL 0 // how frequent the check should be.
|
||||
#define __LOCKONTIME 3 // Lock on won't occur sooner
|
||||
|
||||
private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"];
|
||||
private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"];
|
||||
private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"];
|
||||
private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"];
|
||||
private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"];
|
||||
|
||||
_currentShooter = (vehicle ACE_player);
|
||||
|
||||
#define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5
|
||||
#define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5
|
||||
|
||||
// Reset arguments if we havnt rendered in over a second
|
||||
_args = uiNamespace getVariable[QGVAR(arguments), [] ];
|
||||
if( (count _args) > 0) then {
|
||||
_lastTick = _args select 0;
|
||||
if(ACE_diagTime - _lastTick > 1) then {
|
||||
[] call FUNC(onOpticLoad);
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_1("Running", "Running");
|
||||
|
||||
// Pull the arguments
|
||||
_currentTarget = _args select 1;
|
||||
_runTime = _args select 2;
|
||||
_lockTime = _args select 3;
|
||||
_soundTime = _args select 4;
|
||||
_randomLockInterval = _args select 5;
|
||||
_fireDisabledEH = _args select 6;
|
||||
|
||||
private["_ammo", "_magazineConfig", "_weaponConfig"];
|
||||
_weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
||||
_magazineConfig = if ((currentMagazine _currentShooter) != "") then {
|
||||
_ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo");
|
||||
configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false];
|
||||
} else {
|
||||
[]
|
||||
};
|
||||
|
||||
//If weapon does not have "javelin enabled", then exit PFEH
|
||||
if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith {
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
if(!isNil "_fireDisabledEH") then {
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
};
|
||||
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(pfehID) = -1;
|
||||
};
|
||||
|
||||
// Find a target within the optic range
|
||||
_newTarget = objNull;
|
||||
|
||||
// Bail on fast movement
|
||||
if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady.
|
||||
ACE_player switchCamera "INTERNAL";
|
||||
if (player != ACE_player) then {
|
||||
TRACE_2("Zeus, manually reseting RC after switchCamera",player,ACE_player);
|
||||
player remoteControl ACE_player;
|
||||
};
|
||||
};
|
||||
|
||||
// Refresh the firemode
|
||||
[] call FUNC(showFireMode);
|
||||
|
||||
_ammo = _currentShooter ammo (currentWeapon _currentShooter);
|
||||
// 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 {
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
if(!isNil "_fireDisabledEH") then {
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
};
|
||||
};
|
||||
|
||||
_range = parseNumber (ctrlText __JavelinIGUIRangefinder);
|
||||
TRACE_1("Viewing range", _range);
|
||||
if (_range > 50 && {_range < 2500}) then {
|
||||
_pos = positionCameraToWorld [0,0,_range];
|
||||
_targetArray = _pos nearEntities ["AllVehicles", _range/100];
|
||||
TRACE_1("Searching at range", _targetArray);
|
||||
if (count (_targetArray) > 0) then {
|
||||
_newTarget = _targetArray select 0;
|
||||
};
|
||||
};
|
||||
|
||||
if ((isNull _newTarget) && {cursorObject isKindOf "AllVehicles"}) then {
|
||||
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorObject, ace_player, cursorObject, true, 1];
|
||||
if (_intersectionsToCursorTarget isEqualTo []) then {
|
||||
_newTarget = cursorObject;
|
||||
};
|
||||
};
|
||||
if ((isNull _newTarget) && {cursorTarget isKindOf "AllVehicles"}) then {
|
||||
private _intersectionsToCursorTarget = lineIntersectsSurfaces [(AGLtoASL positionCameraToWorld [0,0,0]), aimPos cursorTarget, ace_player, cursorTarget, true, 1];
|
||||
if (_intersectionsToCursorTarget isEqualTo []) then {
|
||||
_newTarget = cursorTarget;
|
||||
};
|
||||
};
|
||||
|
||||
// Create constants
|
||||
_constraintTop = __ConstraintTop;
|
||||
_constraintLeft = __ConstraintLeft;
|
||||
_constraintBottom = __ConstraintBottom;
|
||||
_constraintRight = __ConstraintRight;
|
||||
|
||||
_offsetX = __OffsetX;
|
||||
_offsetY = __OffsetY;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow true;
|
||||
|
||||
_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)];
|
||||
|
||||
_apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds);
|
||||
|
||||
_aposX = 0;
|
||||
_aposY = 0;
|
||||
if (count _apos < 2) then {
|
||||
_aposX = 1;
|
||||
_aposY = 0;
|
||||
} else {
|
||||
_aposX = (_apos select 0) + _offsetX;
|
||||
_aposY = (_apos select 1) + _offsetY;
|
||||
};
|
||||
|
||||
if((call CBA_fnc_getFoV) select 1 > 9) then {
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGreen;
|
||||
__JavelinIGUIWFOV ctrlSetTextColor __ColorGray;
|
||||
} else {
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUIWFOV ctrlSetTextColor __ColorGreen;
|
||||
};
|
||||
|
||||
FUNC(disableFire) = {
|
||||
_firedEH = _this select 0;
|
||||
|
||||
if(_firedEH < 0 && difficulty > 0) then {
|
||||
_firedEH = [ACE_player, "DefaultAction", {true}, {
|
||||
_canFire = (_this select 1) getVariable["ace_missileguidance_target", nil];
|
||||
if(!isNil "_canFire") exitWith { false };
|
||||
true
|
||||
}] call EFUNC(common,addActionEventHandler);
|
||||
};
|
||||
_firedEH
|
||||
};
|
||||
FUNC(enableFire) = {
|
||||
_firedEH = _this select 0;
|
||||
|
||||
if(_firedEH > 0 && difficulty > 0) then {
|
||||
[ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler);
|
||||
};
|
||||
-1
|
||||
};
|
||||
|
||||
if (isNull _newTarget) then {
|
||||
// No targets found
|
||||
_currentTarget = objNull;
|
||||
_lockTime = 0;
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
} else {
|
||||
_fov = [] call CBA_fnc_getFoV;
|
||||
TRACE_1("FOV", _fov);
|
||||
if (_newTarget distance ACE_player < 2500
|
||||
&& {(call CBA_fnc_getFoV) select 1 > 9}
|
||||
&& { (currentVisionMode ACE_player == 2)}
|
||||
&& GVAR(isLockKeyDown)
|
||||
) then {
|
||||
// Lock on after 3 seconds
|
||||
if(_currentTarget != _newTarget) then {
|
||||
TRACE_1("New Target, reseting locking", _newTarget);
|
||||
_lockTime = ACE_diagTime;
|
||||
_currentTarget = _newTarget;
|
||||
|
||||
playSound "ACE_Javelin_Locking";
|
||||
} else {
|
||||
if(ACE_diagTime - _lockTime > __LOCKONTIME + _randomLockInterval) then {
|
||||
TRACE_2("LOCKED!", _currentTarget, _lockTime);
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGreen;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow true;
|
||||
__JavelinIGUITargetingLines ctrlShow true;
|
||||
|
||||
// Move target marker to coords.
|
||||
//__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1];
|
||||
//__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY];
|
||||
//{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV];
|
||||
|
||||
_boundsInput = if (_currentTarget isKindOf "CAManBase") then {
|
||||
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
|
||||
} else {
|
||||
[_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"];
|
||||
};
|
||||
|
||||
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
|
||||
|
||||
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
|
||||
_minY = ((_bpos select 1) + _offsetY) max _constraintTop;
|
||||
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
|
||||
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
|
||||
|
||||
TRACE_4("", _boundsInput, _bpos, _minX, _minY);
|
||||
|
||||
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
|
||||
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
|
||||
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
|
||||
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
|
||||
|
||||
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
|
||||
|
||||
_currentShooter setVariable["ace_missileguidance_target", _currentTarget, false];
|
||||
|
||||
// Allow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire);
|
||||
|
||||
if(ACE_diagTime > _soundTime) then {
|
||||
playSound "ACE_Javelin_Locked";
|
||||
_soundTime = ACE_diagTime + 0.25;
|
||||
};
|
||||
} else {
|
||||
__JavelinIGUITargeting ctrlShow true;
|
||||
__JavelinIGUITargetingGate ctrlShow true;
|
||||
__JavelinIGUITargetingConstrains ctrlShow true;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
|
||||
_currentShooter setVariable["ace_missileguidance_target", nil, false];
|
||||
|
||||
_boundsInput = if (_currentTarget isKindOf "CAManBase") then {
|
||||
[_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"];
|
||||
} else {
|
||||
[_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"];
|
||||
};
|
||||
|
||||
_bpos = _boundsInput call EFUNC(common,worldToScreenBounds);
|
||||
|
||||
_minX = ((_bpos select 0) + _offsetX) max _constraintLeft;
|
||||
_minY = ((_bpos select 1) + _offsetY) max _constraintTop;
|
||||
_maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH);
|
||||
_maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH);
|
||||
|
||||
TRACE_4("", _boundsInput, _bpos, _minX, _minY);
|
||||
|
||||
__JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY];
|
||||
__JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY];
|
||||
__JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY];
|
||||
__JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY];
|
||||
|
||||
{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR];
|
||||
|
||||
if(ACE_diagTime > _soundTime) then {
|
||||
playSound "ACE_Javelin_Locking";
|
||||
_soundTime = ACE_diagTime + 0.25;
|
||||
};
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// No targets found
|
||||
_currentTarget = objNull;
|
||||
_lockTime = 0;
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||
|
||||
_currentShooter setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
// Disallow fire
|
||||
_fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire);
|
||||
};
|
||||
};
|
||||
|
||||
//TRACE_2("", _newTarget, _currentTarget);
|
||||
|
||||
// Save arguments for next run
|
||||
_args set[0, ACE_diagTime];
|
||||
_args set[1, _currentTarget];
|
||||
_args set[2, _runTime];
|
||||
_args set[3, _lockTime];
|
||||
_args set[4, _soundTime];
|
||||
_args set[6, _fireDisabledEH];
|
||||
|
||||
uiNamespace setVariable[QGVAR(arguments), _args ];
|
||||
|
@ -1,37 +1,37 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
#define __LOCKONTIMERANDOM 2 // Deviation in lock on time
|
||||
|
||||
if((count _this) > 0) then {
|
||||
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
|
||||
};
|
||||
|
||||
ACE_player setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingConstrains ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
|
||||
if(GVAR(pfehID) != -1) then {
|
||||
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
|
||||
};
|
||||
|
||||
uiNameSpace setVariable [QGVAR(arguments),
|
||||
[
|
||||
ACE_diagTime, // Last runtime
|
||||
objNull, // currentTargetObject
|
||||
0, // Run Time
|
||||
0, // Lock Time
|
||||
0, // Sound timer
|
||||
(random __LOCKONTIMERANDOM), // random lock time addition
|
||||
-1
|
||||
]
|
||||
];
|
||||
|
||||
GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
#define __LOCKONTIMERANDOM 2 // Deviation in lock on time
|
||||
|
||||
if((count _this) > 0) then {
|
||||
uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0];
|
||||
};
|
||||
|
||||
ACE_player setVariable ["ace_missileguidance_target",nil, false];
|
||||
|
||||
__JavelinIGUISeek ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUINFOV ctrlSetTextColor __ColorGray;
|
||||
|
||||
__JavelinIGUITargeting ctrlShow false;
|
||||
__JavelinIGUITargetingConstrains ctrlShow false;
|
||||
__JavelinIGUITargetingGate ctrlShow false;
|
||||
__JavelinIGUITargetingLines ctrlShow false;
|
||||
|
||||
if(GVAR(pfehID) != -1) then {
|
||||
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
|
||||
};
|
||||
|
||||
uiNameSpace setVariable [QGVAR(arguments),
|
||||
[
|
||||
ACE_diagTime, // Last runtime
|
||||
objNull, // currentTargetObject
|
||||
0, // Run Time
|
||||
0, // Lock Time
|
||||
0, // Sound timer
|
||||
(random __LOCKONTIMERANDOM), // random lock time addition
|
||||
-1
|
||||
]
|
||||
];
|
||||
|
||||
GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
@ -1,20 +1,20 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
private["_args", "_disableFireEH"];
|
||||
|
||||
// uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];
|
||||
|
||||
if(GVAR(pfehID) != -1) then {
|
||||
[GVAR(pfehID)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(pfehID) = -1;
|
||||
};
|
||||
|
||||
_args = uiNamespace getVariable[QGVAR(arguments), nil ];
|
||||
if(!isNil "_args") then {
|
||||
_disableFireEH = _args select 6;
|
||||
if(_disableFireEH > 0 && difficulty > 0) then {
|
||||
[ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler);
|
||||
};
|
||||
uiNameSpace setVariable [QGVAR(arguments),nil];
|
||||
};
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
private["_args", "_disableFireEH"];
|
||||
|
||||
// uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];
|
||||
|
||||
if(GVAR(pfehID) != -1) then {
|
||||
[GVAR(pfehID)] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(pfehID) = -1;
|
||||
};
|
||||
|
||||
_args = uiNamespace getVariable[QGVAR(arguments), nil ];
|
||||
if(!isNil "_args") then {
|
||||
_disableFireEH = _args select 6;
|
||||
if(_disableFireEH > 0 && difficulty > 0) then {
|
||||
[ACE_player, "DefaultAction", _disableFireEH] call EFUNC(common,removeActionEventHandler);
|
||||
};
|
||||
uiNameSpace setVariable [QGVAR(arguments),nil];
|
||||
};
|
||||
|
@ -1,14 +1,14 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_player", "_currentFireMode"];
|
||||
|
||||
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
|
||||
if(_currentFireMode == "JAV_TOP") then {
|
||||
__JavelinIGUITop ctrlSetTextColor __ColorGreen;
|
||||
__JavelinIGUIDir ctrlSetTextColor __ColorGray;
|
||||
} else {
|
||||
__JavelinIGUITop ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUIDir ctrlSetTextColor __ColorGreen;
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_player", "_currentFireMode"];
|
||||
|
||||
_currentFireMode = ACE_player getVariable["ace_missileguidance_attackProfile", "JAV_TOP"];
|
||||
if(_currentFireMode == "JAV_TOP") then {
|
||||
__JavelinIGUITop ctrlSetTextColor __ColorGreen;
|
||||
__JavelinIGUIDir ctrlSetTextColor __ColorGray;
|
||||
} else {
|
||||
__JavelinIGUITop ctrlSetTextColor __ColorGray;
|
||||
__JavelinIGUIDir ctrlSetTextColor __ColorGreen;
|
||||
};
|
@ -1,30 +1,30 @@
|
||||
// by commy2
|
||||
|
||||
["ACE3 Weapons", QGVAR(lockTarget), localize LSTRING(LockTarget),
|
||||
{
|
||||
if (GETGVAR(isLockKeyDown,false)) exitWith {false};
|
||||
|
||||
GVAR(isLockKeyDown) = true;
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(lockKeyDown);
|
||||
// Return false so it doesn't block the rest weapon action
|
||||
false
|
||||
},
|
||||
{
|
||||
// prevent holding down
|
||||
GVAR(isLockKeyDown) = false;
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(lockKeyUp);
|
||||
false
|
||||
},
|
||||
[15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key
|
||||
|
||||
["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode),
|
||||
{ false },
|
||||
{
|
||||
[ACE_player] call FUNC(cycleFireMode);
|
||||
false
|
||||
},
|
||||
// by commy2
|
||||
|
||||
["ACE3 Weapons", QGVAR(lockTarget), localize LSTRING(LockTarget),
|
||||
{
|
||||
if (GETGVAR(isLockKeyDown,false)) exitWith {false};
|
||||
|
||||
GVAR(isLockKeyDown) = true;
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(lockKeyDown);
|
||||
// Return false so it doesn't block the rest weapon action
|
||||
false
|
||||
},
|
||||
{
|
||||
// prevent holding down
|
||||
GVAR(isLockKeyDown) = false;
|
||||
|
||||
// Statement
|
||||
[ACE_player] call FUNC(lockKeyUp);
|
||||
false
|
||||
},
|
||||
[15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key
|
||||
|
||||
["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode),
|
||||
{ false },
|
||||
{
|
||||
[ACE_player] call FUNC(cycleFireMode);
|
||||
false
|
||||
},
|
||||
[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key
|
@ -1,67 +1,67 @@
|
||||
#define COMPONENT javelin
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_JAVELIN
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_JAVELIN
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_JAVELIN
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define ACE_JAV_FIREMODE_DIR 1
|
||||
#define ACE_JAV_FIREMODE_TOP 2
|
||||
|
||||
|
||||
// Javelin IGUI defines
|
||||
#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin")
|
||||
|
||||
// Custom controls
|
||||
#define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999)
|
||||
|
||||
#define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000)
|
||||
#define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001)
|
||||
#define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002)
|
||||
#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003)
|
||||
#define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004)
|
||||
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
|
||||
|
||||
// Constrains
|
||||
#define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100)
|
||||
#define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101)
|
||||
#define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102)
|
||||
#define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103)
|
||||
#define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104)
|
||||
|
||||
// Targeting gate
|
||||
#define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200)
|
||||
#define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201)
|
||||
#define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202)
|
||||
#define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203)
|
||||
#define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204)
|
||||
|
||||
// Rangefinder
|
||||
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
|
||||
|
||||
// Targeting lines
|
||||
#define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300)
|
||||
#define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301)
|
||||
#define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302)
|
||||
|
||||
#define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3))
|
||||
#define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1)
|
||||
#define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2))
|
||||
#define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0)
|
||||
|
||||
// Colors for controls
|
||||
#define __ColorOrange [0.9255,0.5216,0.1216,1]
|
||||
#define __ColorGreen [0.2941,0.8745,0.2157,1]
|
||||
#define __ColorGray [0.2941,0.2941,0.2941,1]
|
||||
#define COMPONENT javelin
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define CBA_DEBUG_SYNCHRONOUS
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_JAVELIN
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_JAVELIN
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_JAVELIN
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define ACE_JAV_FIREMODE_DIR 1
|
||||
#define ACE_JAV_FIREMODE_TOP 2
|
||||
|
||||
|
||||
// Javelin IGUI defines
|
||||
#define __JavelinIGUI (uinamespace getVariable "ACE_RscOptics_javelin")
|
||||
|
||||
// Custom controls
|
||||
#define __JavelinIGUITargeting (__JavelinIGUI displayCtrl 6999)
|
||||
|
||||
#define __JavelinIGUISeek (__JavelinIGUI displayCtrl 699000)
|
||||
#define __JavelinIGUITop (__JavelinIGUI displayCtrl 699001)
|
||||
#define __JavelinIGUIDir (__JavelinIGUI displayCtrl 699002)
|
||||
#define __JavelinIGUINFOV (__JavelinIGUI displayCtrl 1003)
|
||||
#define __JavelinIGUIWFOV (__JavelinIGUI displayCtrl 1004)
|
||||
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
|
||||
|
||||
// Constrains
|
||||
#define __JavelinIGUITargetingConstrains (__JavelinIGUI displayCtrl 699100)
|
||||
#define __JavelinIGUITargetingConstrainTop (__JavelinIGUI displayCtrl 699101)
|
||||
#define __JavelinIGUITargetingConstrainBottom (__JavelinIGUI displayCtrl 699102)
|
||||
#define __JavelinIGUITargetingConstrainLeft (__JavelinIGUI displayCtrl 699103)
|
||||
#define __JavelinIGUITargetingConstrainRight (__JavelinIGUI displayCtrl 699104)
|
||||
|
||||
// Targeting gate
|
||||
#define __JavelinIGUITargetingGate (__JavelinIGUI displayCtrl 699200)
|
||||
#define __JavelinIGUITargetingGateTL (__JavelinIGUI displayCtrl 699201)
|
||||
#define __JavelinIGUITargetingGateTR (__JavelinIGUI displayCtrl 699202)
|
||||
#define __JavelinIGUITargetingGateBL (__JavelinIGUI displayCtrl 699203)
|
||||
#define __JavelinIGUITargetingGateBR (__JavelinIGUI displayCtrl 699204)
|
||||
|
||||
// Rangefinder
|
||||
#define __JavelinIGUIRangefinder (__JavelinIGUI displayCtrl 151)
|
||||
|
||||
// Targeting lines
|
||||
#define __JavelinIGUITargetingLines (__JavelinIGUI displayCtrl 699300)
|
||||
#define __JavelinIGUITargetingLineH (__JavelinIGUI displayCtrl 699301)
|
||||
#define __JavelinIGUITargetingLineV (__JavelinIGUI displayCtrl 699302)
|
||||
|
||||
#define __ConstraintTop (((ctrlPosition __JavelinIGUITargetingConstrainTop) select 1) + ((ctrlPosition (__JavelinIGUITargetingConstrainTop)) select 3))
|
||||
#define __ConstraintBottom ((ctrlPosition __JavelinIGUITargetingConstrainBottom) select 1)
|
||||
#define __ConstraintLeft (((ctrlPosition __JavelinIGUITargetingConstrainLeft) select 0) + ((ctrlPosition (__JavelinIGUITargetingConstrainLeft)) select 2))
|
||||
#define __ConstraintRight ((ctrlPosition __JavelinIGUITargetingConstrainRight) select 0)
|
||||
|
||||
// Colors for controls
|
||||
#define __ColorOrange [0.9255,0.5216,0.1216,1]
|
||||
#define __ColorGreen [0.2941,0.8745,0.2157,1]
|
||||
#define __ColorGray [0.2941,0.2941,0.2941,1]
|
||||
#define __ColorNull [0,0,0,0]
|
@ -1,19 +1,19 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Called if Kestrel Dialog is closed
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_onCloseDialog
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['Kestrel4500_Display', nil];
|
||||
GVAR(Kestrel4500) = false;
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Called if Kestrel Dialog is closed
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_onCloseDialog
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['Kestrel4500_Display', nil];
|
||||
GVAR(Kestrel4500) = false;
|
||||
|
@ -1,19 +1,19 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Called if Kestrel Display is closed
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_onCloseDisplay
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['RscKestrel4500', nil];
|
||||
GVAR(Overlay) = false;
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Called if Kestrel Display is closed
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* call ace_kestrel4500_fnc_onCloseDisplay
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable ['RscKestrel4500', nil];
|
||||
GVAR(Overlay) = false;
|
||||
|
@ -1,26 +1,26 @@
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_post_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class LaserTargetBase {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(laser_init));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_pre_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_post_init));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class LaserTargetBase {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(laser_init));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,45 +1,45 @@
|
||||
class CfgVehicles {
|
||||
class All;
|
||||
|
||||
class LaserTarget: All {
|
||||
// @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!?
|
||||
model = "\A3\Weapons_F\empty.p3d";
|
||||
destrType = "DestructNo";
|
||||
simulation = "LaserTarget";
|
||||
|
||||
class EventHandlers {
|
||||
init = QUOTE(_this call FUNC(laser_init));
|
||||
};
|
||||
};
|
||||
|
||||
// Visual laserTarget override
|
||||
class ACE_LaserTarget_Visual : LaserTarget {
|
||||
simulation = "LaserTarget";
|
||||
model = "\A3\Weapons_f\laserTgt.p3d";
|
||||
};
|
||||
|
||||
// Vehicle lockable configurations
|
||||
|
||||
class AllVehicles;
|
||||
class Air: AllVehicles {
|
||||
class Turrets;
|
||||
};
|
||||
|
||||
class Helicopter: Air {
|
||||
class Turrets {
|
||||
class MainTurret;
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter_Base_F: Helicopter {};
|
||||
|
||||
class Heli_Attack_01_base_F: Helicopter_Base_F {};
|
||||
|
||||
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {
|
||||
class Turrets: Turrets {
|
||||
class MainTurret: MainTurret {
|
||||
GVAR(CanLockLaser) = 1; // Enable laser locking selection
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class CfgVehicles {
|
||||
class All;
|
||||
|
||||
class LaserTarget: All {
|
||||
// @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!?
|
||||
model = "\A3\Weapons_F\empty.p3d";
|
||||
destrType = "DestructNo";
|
||||
simulation = "LaserTarget";
|
||||
|
||||
class EventHandlers {
|
||||
init = QUOTE(_this call FUNC(laser_init));
|
||||
};
|
||||
};
|
||||
|
||||
// Visual laserTarget override
|
||||
class ACE_LaserTarget_Visual : LaserTarget {
|
||||
simulation = "LaserTarget";
|
||||
model = "\A3\Weapons_f\laserTgt.p3d";
|
||||
};
|
||||
|
||||
// Vehicle lockable configurations
|
||||
|
||||
class AllVehicles;
|
||||
class Air: AllVehicles {
|
||||
class Turrets;
|
||||
};
|
||||
|
||||
class Helicopter: Air {
|
||||
class Turrets {
|
||||
class MainTurret;
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter_Base_F: Helicopter {};
|
||||
|
||||
class Heli_Attack_01_base_F: Helicopter_Base_F {};
|
||||
|
||||
class B_Heli_Attack_01_F: Heli_Attack_01_base_F {
|
||||
class Turrets: Turrets {
|
||||
class MainTurret: MainTurret {
|
||||
GVAR(CanLockLaser) = 1; // Enable laser locking selection
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class Binocular;
|
||||
class Laserdesignator : Binocular {
|
||||
visionMode[] = {"Normal","NVG"};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgWeapons {
|
||||
class Binocular;
|
||||
class Laserdesignator : Binocular {
|
||||
visionMode[] = {"Normal","NVG"};
|
||||
};
|
||||
};
|
||||
|
@ -1,143 +1,143 @@
|
||||
class RscControlsGroup;
|
||||
class VScrollbar;
|
||||
class HScrollbar;
|
||||
class RscText;
|
||||
class RscMapControl;
|
||||
|
||||
class RscInGameUI {
|
||||
class RscOptics_LaserDesignator {
|
||||
idd = 300;
|
||||
controls[] = {"CA_IGUI_elements_group"};
|
||||
|
||||
onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];";
|
||||
onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];";
|
||||
|
||||
class CA_IGUI_elements_group: RscControlsGroup {
|
||||
idc = 170;
|
||||
|
||||
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
|
||||
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
|
||||
w = "53.5 * (0.01875 * SafezoneH)";
|
||||
h = "40 * (0.025 * SafezoneH)";
|
||||
class VScrollbar: VScrollbar {
|
||||
width = 0;
|
||||
};
|
||||
class HScrollbar: HScrollbar {
|
||||
height = 0;
|
||||
};
|
||||
class controls {
|
||||
class CA_OpticsZoom: RscText {
|
||||
idc = 180;
|
||||
style = 1;
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "4.5";
|
||||
x = "43.85 * (0.01875 * SafezoneH)";
|
||||
y = "19.6 * (0.025 * SafezoneH)";
|
||||
w = "4.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.1 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class ACE_Distance: RscText {
|
||||
idc = 123002;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "2456";
|
||||
x = "24.6 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "4 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Distance: RscText {
|
||||
idc = 151;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "2456";
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
class CA_Elev: RscText {
|
||||
idc = 175;
|
||||
style = 1;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "80.5";
|
||||
x = "32.7 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "5 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_VisionMode: RscText {
|
||||
idc = 179;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "VIS";
|
||||
x = "6.5 * (0.01875 * SafezoneH)";
|
||||
y = "19.6 * (0.025 * SafezoneH)";
|
||||
w = "4 * (0.01875 * SafezoneH)";
|
||||
h = "1.1 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Laser: RscText {
|
||||
idc = 158;
|
||||
style = "0x30 + 0x800";
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
|
||||
x = "29.2 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "3.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Heading: RscText {
|
||||
idc = 156;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "023";
|
||||
x = "16.1 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "3.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.6 * (0.025 * SafezoneH)";
|
||||
};
|
||||
|
||||
class ACE_LaserCode_Helper : RscMapControl {
|
||||
idc = -1;
|
||||
onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw));
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
class ACE_LaserCode : RscText {
|
||||
idc = 123001;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "Code: 1001";
|
||||
x = "32.7 * (0.01875 * SafezoneH)";
|
||||
y = "35.5 * (0.025 * SafezoneH)";
|
||||
w = "12 * (0.01875 * SafezoneH)";
|
||||
h = "1.6 * (0.025 * SafezoneH)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class RscControlsGroup;
|
||||
class VScrollbar;
|
||||
class HScrollbar;
|
||||
class RscText;
|
||||
class RscMapControl;
|
||||
|
||||
class RscInGameUI {
|
||||
class RscOptics_LaserDesignator {
|
||||
idd = 300;
|
||||
controls[] = {"CA_IGUI_elements_group"};
|
||||
|
||||
onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];";
|
||||
onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];";
|
||||
|
||||
class CA_IGUI_elements_group: RscControlsGroup {
|
||||
idc = 170;
|
||||
|
||||
x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))";
|
||||
y = "0 * (0.025 * SafezoneH) + (SafezoneY)";
|
||||
w = "53.5 * (0.01875 * SafezoneH)";
|
||||
h = "40 * (0.025 * SafezoneH)";
|
||||
class VScrollbar: VScrollbar {
|
||||
width = 0;
|
||||
};
|
||||
class HScrollbar: HScrollbar {
|
||||
height = 0;
|
||||
};
|
||||
class controls {
|
||||
class CA_OpticsZoom: RscText {
|
||||
idc = 180;
|
||||
style = 1;
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "4.5";
|
||||
x = "43.85 * (0.01875 * SafezoneH)";
|
||||
y = "19.6 * (0.025 * SafezoneH)";
|
||||
w = "4.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.1 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class ACE_Distance: RscText {
|
||||
idc = 123002;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "2456";
|
||||
x = "24.6 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "4 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Distance: RscText {
|
||||
idc = 151;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "2456";
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
class CA_Elev: RscText {
|
||||
idc = 175;
|
||||
style = 1;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "80.5";
|
||||
x = "32.7 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "5 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_VisionMode: RscText {
|
||||
idc = 179;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "VIS";
|
||||
x = "6.5 * (0.01875 * SafezoneH)";
|
||||
y = "19.6 * (0.025 * SafezoneH)";
|
||||
w = "4 * (0.01875 * SafezoneH)";
|
||||
h = "1.1 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Laser: RscText {
|
||||
idc = 158;
|
||||
style = "0x30 + 0x800";
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
|
||||
x = "29.2 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "3.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.5 * (0.025 * SafezoneH)";
|
||||
};
|
||||
class CA_Heading: RscText {
|
||||
idc = 156;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "023";
|
||||
x = "16.1 * (0.01875 * SafezoneH)";
|
||||
y = "3 * (0.025 * SafezoneH)";
|
||||
w = "3.5 * (0.01875 * SafezoneH)";
|
||||
h = "1.6 * (0.025 * SafezoneH)";
|
||||
};
|
||||
|
||||
class ACE_LaserCode_Helper : RscMapControl {
|
||||
idc = -1;
|
||||
onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw));
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
class ACE_LaserCode : RscText {
|
||||
idc = 123001;
|
||||
style = 0;
|
||||
sizeEx = "0.038*SafezoneH";
|
||||
colorText[] = {0.706,0.0745,0.0196,1};
|
||||
shadow = 0;
|
||||
font = "EtelkaMonospacePro";
|
||||
text = "Code: 1001";
|
||||
x = "32.7 * (0.01875 * SafezoneH)";
|
||||
y = "35.5 * (0.025 * SafezoneH)";
|
||||
w = "12 * (0.01875 * SafezoneH)";
|
||||
h = "1.6 * (0.025 * SafezoneH)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "initKeybinds.sqf"
|
||||
|
||||
["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler);
|
||||
["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "initKeybinds.sqf"
|
||||
|
||||
["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler);
|
||||
["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(VanillaLasers) = [];
|
||||
|
||||
// Laser default variables
|
||||
ACE_DEFAULT_LASER_CODE = 1001;
|
||||
ACE_DEFAULT_LASER_WAVELENGTH = 1550;
|
||||
ACE_DEFAULT_LASER_BEAMSPREAD = 1;
|
||||
|
||||
GVAR(laserEmitters) = HASH_CREATE;
|
||||
|
||||
ADDON = true;
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
|
||||
GVAR(VanillaLasers) = [];
|
||||
|
||||
// Laser default variables
|
||||
ACE_DEFAULT_LASER_CODE = 1001;
|
||||
ACE_DEFAULT_LASER_WAVELENGTH = 1550;
|
||||
ACE_DEFAULT_LASER_BEAMSPREAD = 1;
|
||||
|
||||
GVAR(laserEmitters) = HASH_CREATE;
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,16 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = { "ace_common" };
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = { "ace_common" };
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventhandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "RscInGameUI.hpp"
|
@ -1,31 +1,31 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_pos1", "_pos2", "_spacing", "_vectorTo", "_x", "_y", "_z", "_distance", "_count", "_return", "_alt", "_pos", "_designator", "_seeker"];
|
||||
_pos1 = _this select 0;
|
||||
_pos2 = _this select 1;
|
||||
_designator = _this select 2;
|
||||
_seeker = _this select 3;
|
||||
_spacing = 100;
|
||||
if((count _this) > 4) then {
|
||||
_spacing = _this select 4;
|
||||
};
|
||||
|
||||
_return = true;
|
||||
_vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY;
|
||||
|
||||
_x = (_vectorTo select 0)*0.25;
|
||||
_y = (_vectorTo select 1)*0.25;
|
||||
_z = (_vectorTo select 2)*0.25;
|
||||
|
||||
_pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z];
|
||||
|
||||
// player sideChat format["new los check"];
|
||||
if(terrainIntersect [_pos2, _pos1]) then {
|
||||
_return = false;
|
||||
} else {
|
||||
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]];
|
||||
_return = false;
|
||||
};
|
||||
};
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_pos1", "_pos2", "_spacing", "_vectorTo", "_x", "_y", "_z", "_distance", "_count", "_return", "_alt", "_pos", "_designator", "_seeker"];
|
||||
_pos1 = _this select 0;
|
||||
_pos2 = _this select 1;
|
||||
_designator = _this select 2;
|
||||
_seeker = _this select 3;
|
||||
_spacing = 100;
|
||||
if((count _this) > 4) then {
|
||||
_spacing = _this select 4;
|
||||
};
|
||||
|
||||
_return = true;
|
||||
_vectorTo = [_pos2, _pos1] call BIS_fnc_vectorFromXToY;
|
||||
|
||||
_x = (_vectorTo select 0)*0.25;
|
||||
_y = (_vectorTo select 1)*0.25;
|
||||
_z = (_vectorTo select 2)*0.25;
|
||||
|
||||
_pos2 = [(_pos2 select 0) + _x, (_pos2 select 1) + _y, (_pos2 select 2) + _z];
|
||||
|
||||
// player sideChat format["new los check"];
|
||||
if(terrainIntersect [_pos2, _pos1]) then {
|
||||
_return = false;
|
||||
} else {
|
||||
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]];
|
||||
_return = false;
|
||||
};
|
||||
};
|
||||
_return;
|
@ -1,9 +1,9 @@
|
||||
// This is a debug function for displaying visible lasers for ourselves
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_LOGINFO("Laser Emitter Dump");
|
||||
|
||||
{
|
||||
ACE_LOGINFO_1(" %1", _x);
|
||||
ACE_LOGINFO_1(" %1",HASH_GET(GVAR(laserEmitters),_x));
|
||||
} forEach GVAR(laserEmitters) select 0;
|
||||
// This is a debug function for displaying visible lasers for ourselves
|
||||
#include "script_component.hpp"
|
||||
|
||||
ACE_LOGINFO("Laser Emitter Dump");
|
||||
|
||||
{
|
||||
ACE_LOGINFO_1(" %1", _x);
|
||||
ACE_LOGINFO_1(" %1",HASH_GET(GVAR(laserEmitters),_x));
|
||||
} forEach GVAR(laserEmitters) select 0;
|
||||
|
@ -1,49 +1,49 @@
|
||||
#include "script_component.hpp"
|
||||
private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"];
|
||||
_list = _this select 0;
|
||||
_checkPos = _this select 1;
|
||||
_spots = [];
|
||||
_outliers = [];
|
||||
_spot = [];
|
||||
_testPos = (_list select 0) select 0;
|
||||
{
|
||||
_samplePos = _x select 0;
|
||||
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
|
||||
if(_samplePos distance _testPos < 2) then {
|
||||
_spot pushBack _samplePos;
|
||||
} else {
|
||||
_outliers pushBack _samplePos;
|
||||
};
|
||||
};
|
||||
} forEach _list;
|
||||
_spots pushBack _spot;
|
||||
|
||||
if(count _outliers > 0) then {
|
||||
for "_i" from 1 to 3 do {
|
||||
_remainingSpots = _outliers;
|
||||
_outliers = [];
|
||||
_spot = [];
|
||||
_testPos = (_remainingSpots select 0);
|
||||
{
|
||||
_samplePos = _x;
|
||||
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
|
||||
if(_samplePos distance _testPos < 2) then {
|
||||
_spot pushBack _samplePos;
|
||||
} else {
|
||||
_outliers pushBack _samplePos;
|
||||
};
|
||||
};
|
||||
} forEach _remainingSpots;
|
||||
_spots pushBack _spot;
|
||||
};
|
||||
};
|
||||
_largest = 0;
|
||||
_largestSpot = [];
|
||||
{
|
||||
if((count _x) > _largest) then {
|
||||
_largest = (count _x);
|
||||
_largestSpot = _x;
|
||||
};
|
||||
} forEach _spots;
|
||||
// player sideChat format["g: %1", _spots];
|
||||
#include "script_component.hpp"
|
||||
private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"];
|
||||
_list = _this select 0;
|
||||
_checkPos = _this select 1;
|
||||
_spots = [];
|
||||
_outliers = [];
|
||||
_spot = [];
|
||||
_testPos = (_list select 0) select 0;
|
||||
{
|
||||
_samplePos = _x select 0;
|
||||
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
|
||||
if(_samplePos distance _testPos < 2) then {
|
||||
_spot pushBack _samplePos;
|
||||
} else {
|
||||
_outliers pushBack _samplePos;
|
||||
};
|
||||
};
|
||||
} forEach _list;
|
||||
_spots pushBack _spot;
|
||||
|
||||
if(count _outliers > 0) then {
|
||||
for "_i" from 1 to 3 do {
|
||||
_remainingSpots = _outliers;
|
||||
_outliers = [];
|
||||
_spot = [];
|
||||
_testPos = (_remainingSpots select 0);
|
||||
{
|
||||
_samplePos = _x;
|
||||
if(!lineIntersects [_samplePos, _checkPos] && {!terrainIntersectASL [_samplePos, _checkPos]}) then {
|
||||
if(_samplePos distance _testPos < 2) then {
|
||||
_spot pushBack _samplePos;
|
||||
} else {
|
||||
_outliers pushBack _samplePos;
|
||||
};
|
||||
};
|
||||
} forEach _remainingSpots;
|
||||
_spots pushBack _spot;
|
||||
};
|
||||
};
|
||||
_largest = 0;
|
||||
_largestSpot = [];
|
||||
{
|
||||
if((count _x) > _largest) then {
|
||||
_largest = (count _x);
|
||||
_largestSpot = _x;
|
||||
};
|
||||
} forEach _spots;
|
||||
// player sideChat format["g: %1", _spots];
|
||||
_largestSpot select (random (floor(count _largestSpot)));
|
@ -2,7 +2,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_uuid"];
|
||||
_uuid = _this select 0;
|
||||
if(HASH_HASKEY(GVAR(laserEmitters), _uuid)) then {
|
||||
HASH_REM(GVAR(laserEmitters), _uuid);
|
||||
};
|
||||
_uuid = _this select 0;
|
||||
if(HASH_HASKEY(GVAR(laserEmitters), _uuid)) then {
|
||||
HASH_REM(GVAR(laserEmitters), _uuid);
|
||||
};
|
||||
|
@ -2,6 +2,6 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_uuid", "_args"];
|
||||
_uuid = _this select 0;
|
||||
_args = _this select 1;
|
||||
HASH_SET(GVAR(laserEmitters), _uuid, _args);
|
||||
_uuid = _this select 0;
|
||||
_args = _this select 1;
|
||||
HASH_SET(GVAR(laserEmitters), _uuid, _args);
|
||||
|
@ -1,12 +1,12 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_oldLaserCode", "_laserCode"];
|
||||
|
||||
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then {
|
||||
_laserCode = _oldLaserCode - 1;
|
||||
ACE_player setVariable [QGVAR(code), _laserCode, false];
|
||||
};
|
||||
if(_laserCode != _oldLaserCode) then {
|
||||
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_oldLaserCode", "_laserCode"];
|
||||
|
||||
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then {
|
||||
_laserCode = _oldLaserCode - 1;
|
||||
ACE_player setVariable [QGVAR(code), _laserCode, false];
|
||||
};
|
||||
if(_laserCode != _oldLaserCode) then {
|
||||
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
|
||||
};
|
@ -1,10 +1,10 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_oldLaserCode", "_laserCode"];
|
||||
|
||||
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
_laserCode = _oldLaserCode + 1;
|
||||
ACE_player setVariable [QGVAR(code), _laserCode, false];
|
||||
if(_laserCode != _oldLaserCode) then {
|
||||
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_oldLaserCode", "_laserCode"];
|
||||
|
||||
_oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
_laserCode = _oldLaserCode + 1;
|
||||
ACE_player setVariable [QGVAR(code), _laserCode, false];
|
||||
if(_laserCode != _oldLaserCode) then {
|
||||
[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured);
|
||||
};
|
@ -12,5 +12,5 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_uuid"];
|
||||
_uuid = _this select 0;
|
||||
["laser_laserOff", [_uuid]] call EFUNC(common,globalEvent);
|
||||
_uuid = _this select 0;
|
||||
["laser_laserOff", [_uuid]] call EFUNC(common,globalEvent);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_uuid", "_args"];
|
||||
_uuid = format["%1%2%3", floor ACE_diagTime, floor random 1000, floor random 10000];
|
||||
_args = [_uuid, _this];
|
||||
["laser_laserOn", _args] call EFUNC(common,globalEvent);
|
||||
_uuid;
|
||||
_uuid = format["%1%2%3", floor ACE_diagTime, floor random 1000, floor random 10000];
|
||||
_args = [_uuid, _this];
|
||||
["laser_laserOn", _args] call EFUNC(common,globalEvent);
|
||||
_uuid;
|
||||
|
@ -1,30 +1,30 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"];
|
||||
//TRACE_1("enter", _this);
|
||||
_args = _this select 0;
|
||||
_laserTarget = _args select 0;
|
||||
_shooter = _args select 1;
|
||||
_uuid = _args select 2;
|
||||
|
||||
if(isNull _laserTarget || !alive _shooter) exitWith {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
REM(GVAR(VanillaLasers), _laserTarget);
|
||||
|
||||
// Remove laseron
|
||||
[_uuid] call FUNC(laserOff);
|
||||
};
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
// Iconize the location of the actual 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"];
|
||||
|
||||
{
|
||||
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"];
|
||||
} forEach DRAW_LINES;
|
||||
DRAW_LINES = [];
|
||||
#endif
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"];
|
||||
//TRACE_1("enter", _this);
|
||||
_args = _this select 0;
|
||||
_laserTarget = _args select 0;
|
||||
_shooter = _args select 1;
|
||||
_uuid = _args select 2;
|
||||
|
||||
if(isNull _laserTarget || !alive _shooter) exitWith {
|
||||
[(_this select 1)] call CBA_fnc_removePerFrameHandler;
|
||||
REM(GVAR(VanillaLasers), _laserTarget);
|
||||
|
||||
// Remove laseron
|
||||
[_uuid] call FUNC(laserOff);
|
||||
};
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
// Iconize the location of the actual 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"];
|
||||
|
||||
{
|
||||
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"];
|
||||
} forEach DRAW_LINES;
|
||||
DRAW_LINES = [];
|
||||
#endif
|
||||
|
@ -1,33 +1,33 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
PARAMS_1(_laserTarget);
|
||||
private["_uuid"];
|
||||
|
||||
// Add the target to the global targets array
|
||||
// Everyone tracks them
|
||||
// Add the laser localized to the laser array, and give it the default localized code
|
||||
PUSH(GVAR(VanillaLasers), _laserTarget);
|
||||
|
||||
// Check the vehicle, otherwise use the default
|
||||
_laserTarget setVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE, false];
|
||||
_laserTarget setVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD, false];
|
||||
_laserTarget setVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH, false];
|
||||
|
||||
// Clean the lasers of any null objects while we are here
|
||||
REM(GVAR(VanillaLasers), objNull);
|
||||
|
||||
if(!(local _laserTarget)) exitWith { };
|
||||
|
||||
// The target is local, so its on this client
|
||||
if(!isDedicated) then {
|
||||
// @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);
|
||||
_laserTarget setVariable [QGVAR(uuid), _uuid, false];
|
||||
[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call CBA_fnc_addPerFrameHandler;
|
||||
} else {
|
||||
// server side ownership of laser
|
||||
_laserTarget setVariable [QGVAR(owner), nil, true];
|
||||
};
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
TRACE_1("enter", _this);
|
||||
|
||||
PARAMS_1(_laserTarget);
|
||||
private["_uuid"];
|
||||
|
||||
// Add the target to the global targets array
|
||||
// Everyone tracks them
|
||||
// Add the laser localized to the laser array, and give it the default localized code
|
||||
PUSH(GVAR(VanillaLasers), _laserTarget);
|
||||
|
||||
// Check the vehicle, otherwise use the default
|
||||
_laserTarget setVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE, false];
|
||||
_laserTarget setVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD, false];
|
||||
_laserTarget setVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH, false];
|
||||
|
||||
// Clean the lasers of any null objects while we are here
|
||||
REM(GVAR(VanillaLasers), objNull);
|
||||
|
||||
if(!(local _laserTarget)) exitWith { };
|
||||
|
||||
// The target is local, so its on this client
|
||||
if(!isDedicated) then {
|
||||
// @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);
|
||||
_laserTarget setVariable [QGVAR(uuid), _uuid, false];
|
||||
[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call CBA_fnc_addPerFrameHandler;
|
||||
} else {
|
||||
// server side ownership of laser
|
||||
_laserTarget setVariable [QGVAR(owner), nil, true];
|
||||
};
|
||||
|
@ -1,15 +1,15 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_laserCode"];
|
||||
|
||||
_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
if(!isNil "_laserCode") then {
|
||||
__LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber];
|
||||
};
|
||||
|
||||
if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then {
|
||||
// TODO: hide distance
|
||||
__LaserDesignatorIGUI_ACE_Distance ctrlSetText "----";
|
||||
} else {
|
||||
__LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance);
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
private["_laserCode"];
|
||||
|
||||
_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE];
|
||||
if(!isNil "_laserCode") then {
|
||||
__LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber];
|
||||
};
|
||||
|
||||
if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then {
|
||||
// TODO: hide distance
|
||||
__LaserDesignatorIGUI_ACE_Distance ctrlSetText "----";
|
||||
} else {
|
||||
__LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance);
|
||||
};
|
@ -1,36 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
private["_d", "_map", "_p", "_theta", "_u"];
|
||||
_map = _this select 0;
|
||||
_theta = _this select 1;
|
||||
|
||||
_p = _map select 0;
|
||||
_p1 = _map select 1;
|
||||
_p2 = _map select 2;
|
||||
|
||||
_q1 = +(_map select 3);
|
||||
_q2 = +(_map select 4);
|
||||
_u = _map select 5;
|
||||
_d = _map select 6;
|
||||
|
||||
/* Step 4 */
|
||||
_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[2, (_q1 select 2)];
|
||||
|
||||
/* Inverse of step 3 */
|
||||
_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)];
|
||||
_q1 set[1, (_q2 select 1)];
|
||||
_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
|
||||
|
||||
/* Inverse of step 2 */
|
||||
if (_d != 0) then {
|
||||
_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[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
|
||||
} else {
|
||||
_q2 = _q1;
|
||||
};
|
||||
|
||||
/* Inverse of step 1 */
|
||||
_q1 = _q2 vectorAdd _p1;
|
||||
#include "script_component.hpp"
|
||||
private["_d", "_map", "_p", "_theta", "_u"];
|
||||
_map = _this select 0;
|
||||
_theta = _this select 1;
|
||||
|
||||
_p = _map select 0;
|
||||
_p1 = _map select 1;
|
||||
_p2 = _map select 2;
|
||||
|
||||
_q1 = +(_map select 3);
|
||||
_q2 = +(_map select 4);
|
||||
_u = _map select 5;
|
||||
_d = _map select 6;
|
||||
|
||||
/* Step 4 */
|
||||
_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[2, (_q1 select 2)];
|
||||
|
||||
/* Inverse of step 3 */
|
||||
_q1 set[0, (_q2 select 0) * _d + (_q2 select 2) * (_u select 0)];
|
||||
_q1 set[1, (_q2 select 1)];
|
||||
_q1 set[2, - (_q2 select 0) * (_u select 0) + (_q2 select 2) * _d];
|
||||
|
||||
/* Inverse of step 2 */
|
||||
if (_d != 0) then {
|
||||
_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[2, - (_q1 select 1) * (_u select 1) / _d + (_q1 select 2) * (_u select 2) / _d];
|
||||
} else {
|
||||
_q2 = _q1;
|
||||
};
|
||||
|
||||
/* Inverse of step 1 */
|
||||
_q1 = _q2 vectorAdd _p1;
|
||||
_q1;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user