Epoch/Sources/epoch_code/compile/setup/EPOCH_masterLoop.sqf

57 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-12-07 16:24:52 +00:00
/*
Author: Aaron Clark - EpochMod.com
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Contributors:
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Description:
Unisex check for vests, gives swing ammo and performs radio changed check
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Github:
2016-06-13 16:54:19 +00:00
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/setup/EPOCH_masterLoop.sqf
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Example:
[] spawn EPOCH_masterLoop;
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Parameter(s):
NONE
2015-09-14 20:55:36 +00:00
2015-12-07 16:24:52 +00:00
Returns:
NOTHING
*/
disableSerialization;
_config = 'CfgMasterLoop' call EPOCH_returnConfig;
_build_sqf = preprocessFile getText (_config >> "Init" >> "file");
_configs = "true" configClasses (_config >> "Events");
_condition = getText (_config >> "Events" >> "condition");
_file = getText (_config >> "Events" >> "file");
2015-09-14 20:55:36 +00:00
{
2015-12-07 16:24:52 +00:00
_configName = configName _x;
_varName = format["_EPOCH_%1",_configName];
_build_sqf = _build_sqf + '
'+_varName+' = diag_tickTime;
';
}forEach _configs;
_build_sqf = _build_sqf + '
while {'+_condition+'} do {
2015-09-14 20:55:36 +00:00
_tickTime = diag_tickTime;
2015-12-07 16:24:52 +00:00
';
{
_delay = getNumber(_x >> "delay");
_configName = configName _x;
_varName = format["_EPOCH_%1",_configName];
_code = preprocessFile format ["%1\%2.sqf",_file,_configName];
_build_sqf = _build_sqf + '
if ((_tickTime - '+_varName+') > '+str(_delay)+') then {
'+_varName+' = _tickTime;
'+_code+'
};
';
}forEach _configs;
_build_sqf = _build_sqf + '
uiSleep 0.1;
};';
2015-12-07 16:24:52 +00:00
call compile _build_sqf;