mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1087 from SilentSpike/zeustemp
Added zeus changes module as per #1082
This commit is contained in:
commit
d5a8f21480
@ -73,6 +73,7 @@ Raspu86
|
||||
Riccardo Petricca <petriccarcc@gmail.com>
|
||||
Robert Boklahánics <bokirobi@gmail.com>
|
||||
ramius86 <pasini86@hotmail.com>
|
||||
SilentSpike <SilentSpike100@gmail.com>
|
||||
simon84 <badguy360th@gmail.com>
|
||||
Sniperwolf572 <tenga6@gmail.com>
|
||||
Tachi <zaveruha007@gmail.com>
|
||||
|
@ -3,7 +3,6 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(moduleInit);
|
||||
PREP(bi_moduleProjectile);
|
||||
|
||||
GVAR(moduleInitCollection) = [];
|
||||
|
||||
|
@ -23,9 +23,6 @@ class CfgVehicles {
|
||||
init = QUOTE(_this call DFUNC(moduleInit));
|
||||
};
|
||||
};
|
||||
class ModuleOrdnance_F: Module_F {
|
||||
function = "ace_modules_fnc_bi_moduleProjectile";
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
1
addons/zeus/$PBOPREFIX$
Normal file
1
addons/zeus/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\zeus
|
23
addons/zeus/ACE_Settings.hpp
Normal file
23
addons/zeus/ACE_Settings.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(zeusAscension) {
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(zeusBird) {
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(remoteWind) {
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(radioOrdnance) {
|
||||
typeName = "BOOL";
|
||||
value = 0;
|
||||
};
|
||||
class GVAR(revealMines) {
|
||||
typeName = "SCALAR";
|
||||
value = 0;
|
||||
values[] = {"Disabled", "Partially", "Fully"};
|
||||
};
|
||||
};
|
6
addons/zeus/CfgEventHandlers.hpp
Normal file
6
addons/zeus/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
6
addons/zeus/CfgFactionClasses.hpp
Normal file
6
addons/zeus/CfgFactionClasses.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
class CfgFactionClasses {
|
||||
class NO_CATEGORY;
|
||||
class ADDON: NO_CATEGORY {
|
||||
displayName = "ACE Zeus";
|
||||
};
|
||||
};
|
80
addons/zeus/CfgVehicles.hpp
Normal file
80
addons/zeus/CfgVehicles.hpp
Normal file
@ -0,0 +1,80 @@
|
||||
class CfgVehicles {
|
||||
class Module_F;
|
||||
class ModuleEmpty_F;
|
||||
class ACE_Module;
|
||||
|
||||
class GVAR(moduleZeusSettings): ACE_Module {
|
||||
scope = 2;
|
||||
displayName = "Zeus Settings [ACE]";
|
||||
//icon = QUOTE(PATHTOF(iconGoesHere));
|
||||
category = "ACE_zeus";
|
||||
function = QUOTE(DFUNC(moduleZeusSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = "SilentSpike";
|
||||
class Arguments {
|
||||
class zeusAscension {
|
||||
displayName = "Ascension Messages";
|
||||
description = "Display global popup messages when a player is assigned as Zeus.";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class zeusBird {
|
||||
displayName = "Zeus Eagle";
|
||||
description = "Spawn an eagle that follows the Zeus camera.";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class remoteWind {
|
||||
displayName = "Wind Sounds";
|
||||
description = "Play wind sounds when Zeus remote controls a unit.";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class radioOrdnance {
|
||||
displayName = "Ordnance Warning";
|
||||
description = "Play a radio warning when Zeus uses ordnance.";
|
||||
typeName = "BOOL";
|
||||
defaultValue = 0;
|
||||
};
|
||||
class revealMines {
|
||||
displayName = "Reveal Mines";
|
||||
description = "Reveal mines to allies and/or place map markers.";
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class disable {
|
||||
name = "Disabled";
|
||||
value = 0;
|
||||
default = 1;
|
||||
};
|
||||
class partial {
|
||||
name = "Reveal to Allies";
|
||||
value = 1;
|
||||
};
|
||||
class full {
|
||||
name = "Allies + Map Markers";
|
||||
value = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = "Provides control over various aspects of Zeus.";
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
class ModuleCurator_F: Module_F {
|
||||
function = QUOTE(DFUNC(moduleCuratorDelay));
|
||||
};
|
||||
class ModuleMine_F: ModuleEmpty_F {
|
||||
function = QUOTE(DFUNC(bi_moduleMine));
|
||||
};
|
||||
class ModuleOrdnance_F: Module_F {
|
||||
function = QUOTE(DFUNC(bi_moduleProjectile));
|
||||
};
|
||||
class ModuleRemoteControl_F: Module_F {
|
||||
function = QUOTE(DFUNC(bi_moduleRemoteControl));
|
||||
};
|
||||
};
|
12
addons/zeus/XEH_preInit.sqf
Normal file
12
addons/zeus/XEH_preInit.sqf
Normal file
@ -0,0 +1,12 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(bi_moduleCurator);
|
||||
PREP(bi_moduleMine);
|
||||
PREP(bi_moduleProjectile);
|
||||
PREP(bi_moduleRemoteControl);
|
||||
PREP(moduleCuratorDelay);
|
||||
PREP(moduleZeusSettings);
|
||||
|
||||
ADDON = true;
|
18
addons/zeus/config.cpp
Normal file
18
addons/zeus/config.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common","ace_modules"};
|
||||
author[] = {"SilentSpike"};
|
||||
authorUrl = "https://github.com/SilentSpike";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgFactionClasses.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "ACE_Settings.hpp"
|
333
addons/zeus/functions/fnc_bi_moduleCurator.sqf
Normal file
333
addons/zeus/functions/fnc_bi_moduleCurator.sqf
Normal file
@ -0,0 +1,333 @@
|
||||
/*
|
||||
* Author: Bohemia Interactive
|
||||
* Module function for initalizing zeus
|
||||
* Edited to remove eagle and global ascension message
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The logic object <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* nil
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if (_activated) then {
|
||||
|
||||
//--- Terminate when not created on the server
|
||||
if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith {
|
||||
[format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp;
|
||||
deletevehicle _logic;
|
||||
};
|
||||
|
||||
//--- Get curator owner
|
||||
_ownerVar = _logic getvariable ["owner",""];
|
||||
_ownerUID = parsenumber _ownerVar;
|
||||
if (cheatsenabled) then {
|
||||
_ownerVarArray = toarray _ownerVar;
|
||||
_ownerVarArray resize 3;
|
||||
if (tostring _ownerVarArray == "DEV") then {_ownerUID = 1;};
|
||||
};
|
||||
if (_ownerVar == "" && !ismultiplayer) then {
|
||||
["Curator owner not defined, player used instead in singleplayer."] call bis_fnc_error;
|
||||
_ownerVar = player call bis_fnc_objectvar;
|
||||
};
|
||||
if (_ownerUID > 0 && !ismultiplayer) then {
|
||||
_ownerVar = player call bis_fnc_objectvar;
|
||||
};
|
||||
_isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted";
|
||||
|
||||
//--- Wipe out the variable so clients can't access it
|
||||
_logic setvariable ["owner",nil];
|
||||
|
||||
//--- Server
|
||||
if (isserver) then {
|
||||
|
||||
//--- Prepare admin variable
|
||||
_adminVar = "";
|
||||
if (_isAdmin) then {
|
||||
_letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
|
||||
_adminVar = "admin_";
|
||||
for "_i" from 0 to 9 do {_adminVar = _adminVar + (_letters call bis_fnc_selectrandom);};
|
||||
_logic setvariable ["adminVar",_adminVar,true];
|
||||
};
|
||||
|
||||
//--- Get allowed addons
|
||||
_addonsType = _logic getvariable ["Addons",0];
|
||||
_addons = [];
|
||||
switch _addonsType do {
|
||||
|
||||
//--- All (including unofficial ones)
|
||||
case 3: {
|
||||
_cfgPatches = configfile >> "cfgpatches";
|
||||
for "_i" from 0 to (count _cfgPatches - 1) do {
|
||||
_class = _cfgPatches select _i;
|
||||
if (isclass _class) then {_addons set [count _addons,configname _class];};
|
||||
};
|
||||
_addons call bis_fnc_activateaddons;
|
||||
removeallcuratoraddons _logic;
|
||||
_logic addcuratoraddons _addons;
|
||||
};
|
||||
|
||||
//--- All active
|
||||
case 2: {};
|
||||
|
||||
//--- All mission
|
||||
case 1: {
|
||||
_addonsList = [];
|
||||
{
|
||||
_addonsList = _addonsList + (unitaddons typeof _x);
|
||||
} foreach (entities "all");
|
||||
removeallcuratoraddons _logic;
|
||||
_logic addcuratoraddons _addonsList;
|
||||
};
|
||||
|
||||
//--- None
|
||||
case 0: {
|
||||
removeallcuratoraddons _logic;
|
||||
};
|
||||
};
|
||||
|
||||
//--- Handle ownership
|
||||
[_logic,_ownerVar,_ownerUID,_adminVar] spawn {
|
||||
scriptname "BIS_fnc_moduleCurator: Owner";
|
||||
|
||||
_logic = _this select 0;
|
||||
_ownerVar = _this select 1;
|
||||
_ownerUID = _this select 2;
|
||||
_adminVar = _this select 3;
|
||||
|
||||
if (_adminVar != "") then {_ownerVar = _adminVar;};
|
||||
|
||||
_forced = _logic getvariable ["forced",0] > 0;
|
||||
_name = _logic getvariable ["name",""];
|
||||
if (_name == "") then {_name = localize "STR_A3_curator";};
|
||||
|
||||
//--- Wait until mission starts
|
||||
waituntil {time > 0};
|
||||
|
||||
//--- Refresh addon list, so it's broadcasted to clients
|
||||
_addons = curatoraddons _logic;
|
||||
removeAllCuratorAddons _logic;
|
||||
_logic addcuratoraddons _addons;
|
||||
|
||||
while {true} do {
|
||||
//--- Wait for player to become Zeus
|
||||
switch true do {
|
||||
case (_ownerUID > 0): {
|
||||
waituntil {
|
||||
sleep 0.01;
|
||||
{getplayeruid _x == _ownerVar} count playableunits > 0
|
||||
};
|
||||
};
|
||||
default {
|
||||
waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull])};
|
||||
};
|
||||
};
|
||||
|
||||
//--- Assign
|
||||
_player = objnull;
|
||||
switch true do {
|
||||
case (_ownerUID > 0): {
|
||||
{
|
||||
if (getplayeruid _x == _ownerVar) exitwith {_player = _x;};
|
||||
} foreach playableunits;
|
||||
};
|
||||
default {
|
||||
_player = missionnamespace getvariable [_ownerVar,objnull];
|
||||
};
|
||||
};
|
||||
|
||||
waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic)};
|
||||
waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player};
|
||||
|
||||
//--- Add radio channels
|
||||
{
|
||||
_x radiochanneladd [_player];
|
||||
} foreach (_logic getvariable ["channels",[]]);
|
||||
|
||||
// Added by ACE_zeus to toggle ascension messages
|
||||
if (GVAR(zeusAscension)) then {
|
||||
//--- Sent notification to all assigned players
|
||||
{
|
||||
if (isplayer _x) then {
|
||||
[["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp;
|
||||
};
|
||||
} foreach (curatoreditableobjects _logic);
|
||||
};
|
||||
|
||||
[_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler;
|
||||
|
||||
//--- Forced interface
|
||||
//if (_forced) then {
|
||||
// [[true,true],"bis_fnc_forceCuratorInterface",_player] call bis_fnc_mp;
|
||||
//};
|
||||
|
||||
//--- Wait for player to stop being Zeus
|
||||
switch true do {
|
||||
case (_ownerUID > 0): {
|
||||
waituntil {
|
||||
sleep 0.01;
|
||||
{getplayeruid _x == _ownerVar} count playableunits == 0
|
||||
};
|
||||
};
|
||||
default {
|
||||
waituntil {_player != missionnamespace getvariable [_ownerVar,objnull]};
|
||||
};
|
||||
};
|
||||
|
||||
//--- Add radio channels
|
||||
{
|
||||
_x radiochannelremove [_player];
|
||||
} foreach (_logic getvariable ["channels",[]]);
|
||||
|
||||
//--- Unassign
|
||||
waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic)};
|
||||
};
|
||||
};
|
||||
|
||||
// Added by ACE_zeus to toggle eagle
|
||||
if (GVAR(zeusBird)) then {
|
||||
//--- Create bird
|
||||
_birdType = _logic getvariable ["birdType","eagle_f"];
|
||||
if (_birdType != "") then {
|
||||
_bird = createvehicle [_birdType,[100,100,100],[],0,"none"];
|
||||
_logic setvariable ["bird",_bird,true];
|
||||
};
|
||||
};
|
||||
|
||||
//--- Activated all future addons
|
||||
_addons = [];
|
||||
{
|
||||
if (typeof _x == "ModuleCuratorAddAddons_F") then {
|
||||
_paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]");
|
||||
{
|
||||
if !(_x in _addons) then {_addons set [count _addons,_x];};
|
||||
{
|
||||
if !(_x in _addons) then {_addons set [count _addons,_x];};
|
||||
} foreach (unitaddons _x);
|
||||
} foreach _paramAddons;
|
||||
};
|
||||
} foreach (synchronizedobjects _logic);
|
||||
_addons call bis_fnc_activateaddons;
|
||||
|
||||
// Added by ACE_zeus to toggle eagle
|
||||
if (GVAR(zeusBird)) then {
|
||||
//--- Locality changed
|
||||
_logic addeventhandler [
|
||||
"local",
|
||||
{
|
||||
_logic = _this select 0;
|
||||
_bird = _logic getvariable ["bird",objnull];
|
||||
_bird setowner owner _logic;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
//--- Player
|
||||
if (hasinterface) then {
|
||||
waituntil {local player};
|
||||
_serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"};
|
||||
|
||||
//--- Black effect until the interface is open
|
||||
_forced = _logic getvariable ["forced",0] > 0;
|
||||
if (_forced) then {
|
||||
_isCurator = switch true do {
|
||||
case (_ownerUID > 0): {
|
||||
getplayeruid player == _ownerVar
|
||||
};
|
||||
case (_isAdmin): {
|
||||
isserver || servercommandavailable _serverCommand
|
||||
};
|
||||
default {
|
||||
player == missionnamespace getvariable [_ownerVar,objnull]
|
||||
};
|
||||
};
|
||||
if (_isCurator) then {
|
||||
[true,true] spawn bis_fnc_forceCuratorInterface;
|
||||
("RscDisplayCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10];
|
||||
};
|
||||
};
|
||||
|
||||
//--- Check if player is server admin
|
||||
if (_isAdmin) then {
|
||||
_adminVar = _logic getvariable ["adminVar",""];
|
||||
_logic setvariable ["adminVar",nil];
|
||||
if (isserver) then {
|
||||
//--- Host
|
||||
missionnamespace setvariable [_adminVar,player];
|
||||
} else {
|
||||
//--- Client
|
||||
[_logic,_adminVar,_serverCommand] spawn {
|
||||
scriptname "BIS_fnc_moduleCurator: Admin check";
|
||||
|
||||
_logic = _this select 0;
|
||||
_adminVar = _this select 1;
|
||||
_serverCommand = _this select 2;
|
||||
while {true} do {
|
||||
waituntil {sleep 0.1; servercommandavailable _serverCommand};
|
||||
missionnamespace setvariable [_adminVar,player];
|
||||
publicvariable _adminVar;
|
||||
_respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]];
|
||||
|
||||
waituntil {sleep 0.1; !servercommandavailable _serverCommand};
|
||||
missionnamespace setvariable [_adminVar,objnull];
|
||||
publicvariable _adminVar;
|
||||
player removeeventhandler ["respawn",_respawn];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[_logic] spawn {
|
||||
_logic = _this select 0;
|
||||
sleep 1;
|
||||
waituntil {alive player};
|
||||
|
||||
//--- Show warning when Zeus key is not assigned
|
||||
if (count (actionkeys "curatorInterface") == 0) then {
|
||||
[
|
||||
format [
|
||||
localize "str_a3_cfgvehicles_modulecurator_f_keyNotAssigned",
|
||||
(["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBAtoHTML
|
||||
]
|
||||
] call bis_fnc_guiMessage;
|
||||
};
|
||||
|
||||
//--- Show hint about pinging for players
|
||||
if (
|
||||
isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"}
|
||||
&&
|
||||
{isTutHintsEnabled}
|
||||
&&
|
||||
{isnull getassignedcuratorlogic player}
|
||||
&&
|
||||
{player in curatoreditableobjects _logic}
|
||||
) then {
|
||||
sleep 0.5;
|
||||
[["Curator","Ping"]] call bis_fnc_advHint;
|
||||
};
|
||||
};
|
||||
|
||||
//--- Add local event handlers
|
||||
_logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}];
|
||||
_logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}];
|
||||
_logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}];
|
||||
_logic addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}];
|
||||
_logic addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}];
|
||||
|
||||
_logic addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
|
||||
_logic addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
|
||||
_logic addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
|
||||
_logic addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
|
||||
|
||||
player call bis_fnc_curatorRespawn;
|
||||
};
|
||||
};
|
48
addons/zeus/functions/fnc_bi_moduleMine.sqf
Normal file
48
addons/zeus/functions/fnc_bi_moduleMine.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Author: Bohemia Interactive
|
||||
* Module function for spawning mines
|
||||
* Edited to remove forced map markers and mines being revealed to players
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The logic object <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* nil
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if (_activated) then {
|
||||
_explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive");
|
||||
if (_explosive != "") then {
|
||||
_explosive = createvehicle [_explosive,position _logic,[],0,"none"];
|
||||
_explosive attachto [_logic];
|
||||
|
||||
// Added by ACE_zeus to control if mines are revealed
|
||||
if (GVAR(revealMines) > 0) then {
|
||||
//--- Reveal the mine to curator's side
|
||||
{
|
||||
_side = (getassignedcuratorunit _x) call bis_fnc_objectSide;
|
||||
_side revealmine _explosive;
|
||||
} foreach (objectcurators _logic);
|
||||
|
||||
if (GVAR(revealMines) > 1) then {
|
||||
//--- Mark minefields in the map
|
||||
[] spawn bis_fnc_drawMinefields;
|
||||
};
|
||||
};
|
||||
|
||||
//--- Show hint to curator who placed the object
|
||||
[[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp;
|
||||
|
||||
waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic};
|
||||
if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;};
|
||||
deletevehicle _logic;
|
||||
};
|
||||
};
|
@ -2,6 +2,7 @@
|
||||
* Author: Bohemia Interactive
|
||||
* Module function for spawning projectiles
|
||||
* Used by Curator artillery modules etc
|
||||
* Edited to remove radio warning and add ballistics support
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The logic object <OBJECT>
|
||||
@ -12,6 +13,8 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'};
|
||||
private ['_fnc_scriptNameParent'];
|
||||
_fnc_scriptNameParent = _fnc_scriptNameParentTemp;
|
||||
@ -133,8 +136,11 @@ if (_activated) then {
|
||||
//--- Create sound source
|
||||
_soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull};
|
||||
|
||||
//--- Play radio warning
|
||||
[] call _fnc_playRadio;
|
||||
// Added by ACE_zeus to toggle ordnance radio message
|
||||
if (GVAR(radioOrdnance)) then {
|
||||
//--- Play radio warning
|
||||
[] call _fnc_playRadio;
|
||||
};
|
||||
|
||||
//--- Update
|
||||
if (_attach) then {
|
171
addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf
Normal file
171
addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Author: Bohemia Interactive
|
||||
* Module function for remote controlling units as zeus
|
||||
* Edited to remove global wind sound
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The logic object <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* nil
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if (_activated && local _logic && !isnull curatorcamera) then {
|
||||
|
||||
//--- Terminate when remote control is already in progress
|
||||
if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {};
|
||||
|
||||
//--- Get unit under cursor
|
||||
_unit = objnull;
|
||||
_mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]];
|
||||
if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;};
|
||||
_unit = effectivecommander _unit;
|
||||
|
||||
//--- Check if the unit is suitable
|
||||
_error = "";
|
||||
if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";};
|
||||
if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";};
|
||||
if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";};
|
||||
if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";};
|
||||
if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";};
|
||||
|
||||
if (_error == "") then {
|
||||
_unit spawn {
|
||||
scriptname "bis_fnc_moduleRemoteControl: Loop";
|
||||
_unit = _this;
|
||||
_vehicle = vehicle _unit;
|
||||
_vehicleRole = str assignedvehiclerole _unit;
|
||||
|
||||
bis_fnc_moduleRemoteControl_unit = _unit;
|
||||
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true];
|
||||
|
||||
// Added by ACE_zeus to toggle remote control wind sound
|
||||
if (GVAR(remoteWind)) then {
|
||||
//--- Play wind cue to all players
|
||||
[format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp;
|
||||
};
|
||||
|
||||
_blur = ppeffectcreate ["RadialBlur",144];
|
||||
_blur ppeffectenable true;
|
||||
_blur ppeffectadjust [0,0,0.3,0.3];
|
||||
_blur ppeffectcommit 0;
|
||||
_blur ppeffectadjust [0.03,0.03,0.1,0.1];
|
||||
_blur ppeffectcommit 1;
|
||||
|
||||
_cam = "camera" camcreate getposatl curatorcamera;
|
||||
_cam cameraeffect ["internal","back"];
|
||||
_cam campreparetarget (screentoworld [0.5,0.5]);
|
||||
_cam camcommitprepared 0;
|
||||
_cam campreparetarget _unit;
|
||||
_cam campreparefov 0.1;
|
||||
_cam camcommitprepared 1;
|
||||
sleep 0.75;
|
||||
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25];
|
||||
sleep 0.25;
|
||||
|
||||
//--- Wait for interface to close
|
||||
(finddisplay 312) closedisplay 2;
|
||||
waituntil {isnull curatorcamera};
|
||||
|
||||
//--- Switch
|
||||
player remotecontrol _unit;
|
||||
if (cameraon != _vehicle) then {
|
||||
_vehicle switchcamera cameraview;
|
||||
};
|
||||
|
||||
ppeffectdestroy _blur;
|
||||
_cam cameraeffect ["terminate","back"];
|
||||
camdestroy _cam;
|
||||
|
||||
_color = ppeffectcreate ["colorCorrections",1896];
|
||||
_color ppeffectenable true;
|
||||
_color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]];
|
||||
_color ppeffectcommit 0;
|
||||
|
||||
_curator = getassignedcuratorlogic player;
|
||||
[_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler;
|
||||
[["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint;
|
||||
|
||||
sleep 0.3;
|
||||
_color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]];
|
||||
_color ppeffectcommit 0.3;
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5];
|
||||
|
||||
//--- Back to player
|
||||
_vehicle = vehicle _unit;
|
||||
_vehicleRole = str assignedvehiclerole _unit;
|
||||
_rating = rating player;
|
||||
waituntil {
|
||||
//--- Refresh when vehicle or vehicle role changes
|
||||
if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then {
|
||||
player remotecontrol _unit;
|
||||
_vehicle = vehicle _unit;
|
||||
_vehicleRole = str assignedvehiclerole _unit;
|
||||
};
|
||||
if (rating player < _rating) then {
|
||||
player addrating (-rating player + _rating);
|
||||
};
|
||||
sleep 0.01;
|
||||
!isnull curatorcamera
|
||||
||
|
||||
{cameraon == vehicle player}
|
||||
||
|
||||
{!alive _unit} //--- Also isnull check, objNull is not alive
|
||||
||
|
||||
{isnull getassignedcuratorlogic player}
|
||||
//||
|
||||
//{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit
|
||||
};
|
||||
|
||||
player addrating (-rating player + _rating);
|
||||
objnull remotecontrol _unit;
|
||||
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true];
|
||||
|
||||
//--- Death screen
|
||||
if (
|
||||
isnull curatorcamera
|
||||
&&
|
||||
{cameraon != vehicle player}
|
||||
&&
|
||||
{!isnull _unit}
|
||||
&&
|
||||
{!isnull getassignedcuratorlogic player}
|
||||
//&&
|
||||
//{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)}
|
||||
) then {
|
||||
sleep 2;
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1];
|
||||
sleep 1;
|
||||
};
|
||||
_unitPos = getposatl _unit;
|
||||
_camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos;
|
||||
_camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10];
|
||||
//[_camPos,_unit] call bis_fnc_setcuratorcamera;
|
||||
(getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]];
|
||||
|
||||
sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10];
|
||||
opencuratorinterface;
|
||||
ppeffectdestroy _color;
|
||||
|
||||
waituntil {!isnull curatorcamera};
|
||||
player switchcamera cameraview;
|
||||
bis_fnc_moduleRemoteControl_unit = nil;
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1];
|
||||
[_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler;
|
||||
sleep 0.01;
|
||||
};
|
||||
} else {
|
||||
[objnull,_error] call bis_fnc_showCuratorFeedbackMessage;
|
||||
};
|
||||
deletevehicle _logic;
|
||||
};
|
19
addons/zeus/functions/fnc_moduleCuratorDelay.sqf
Normal file
19
addons/zeus/functions/fnc_moduleCuratorDelay.sqf
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Function that delays the execution of the curator module function
|
||||
* Allows ascension and bird settings to be set by module beforehand
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
[{_this spawn DFUNC(bi_moduleCurator);},_this] call EFUNC(common,execNextFrame);
|
29
addons/zeus/functions/fnc_moduleZeusSettings.sqf
Normal file
29
addons/zeus/functions/fnc_moduleZeusSettings.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Module for adjusting various aspects of zeus
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_logic", "_units", "_activated"];
|
||||
_logic = _this select 0;
|
||||
_units = _this select 1;
|
||||
_activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(zeusAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(radioOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(revealMines), "revealMines"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule);
|
1
addons/zeus/functions/script_component.hpp
Normal file
1
addons/zeus/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\zeus\script_component.hpp"
|
12
addons/zeus/script_component.hpp
Normal file
12
addons/zeus/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT zeus
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_ZEUS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_ZEUS
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_ZEUS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
Loading…
Reference in New Issue
Block a user