mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added commented out code and function prep
This commit is contained in:
parent
9dd163ac3d
commit
5166e73cc0
@ -3,5 +3,8 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(bi_moduleCurator);
|
||||
PREP(bi_moduleMine);
|
||||
PREP(bi_moduleProjectile);
|
||||
PREP(bi_moduleRemoteControl);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -3,16 +3,27 @@ _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];
|
||||
_explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive");
|
||||
if (_explosive != "") then {
|
||||
_explosive = createvehicle [_explosive,position _logic,[],0,"none"];
|
||||
_explosive attachto [_logic];
|
||||
|
||||
//--- 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;
|
||||
/* Removed by ACE
|
||||
//--- Reveal the mine to curator's side
|
||||
{
|
||||
_side = (getassignedcuratorunit _x) call bis_fnc_objectSide;
|
||||
_side revealmine _explosive;
|
||||
} foreach (objectcurators _logic);
|
||||
|
||||
waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic};
|
||||
if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;};
|
||||
deletevehicle _logic;
|
||||
};
|
||||
//--- 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;
|
||||
};
|
||||
};
|
@ -4,146 +4,151 @@ _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 {};
|
||||
//--- 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;
|
||||
//--- 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";};
|
||||
//--- 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;
|
||||
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];
|
||||
bis_fnc_moduleRemoteControl_unit = _unit;
|
||||
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true];
|
||||
|
||||
_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;
|
||||
/* Removed by ACE
|
||||
//--- Play wind cue to all players
|
||||
[format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp;
|
||||
*/
|
||||
|
||||
_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;
|
||||
_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;
|
||||
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25];
|
||||
sleep 0.25;
|
||||
_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;
|
||||
|
||||
//--- Wait for interface to close
|
||||
(finddisplay 312) closedisplay 2;
|
||||
waituntil {isnull curatorcamera};
|
||||
("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25];
|
||||
sleep 0.25;
|
||||
|
||||
//--- Switch
|
||||
player remotecontrol _unit;
|
||||
if (cameraon != _vehicle) then {
|
||||
_vehicle switchcamera cameraview;
|
||||
};
|
||||
//--- Wait for interface to close
|
||||
(finddisplay 312) closedisplay 2;
|
||||
waituntil {isnull curatorcamera};
|
||||
|
||||
ppeffectdestroy _blur;
|
||||
_cam cameraeffect ["terminate","back"];
|
||||
camdestroy _cam;
|
||||
//--- Switch
|
||||
player remotecontrol _unit;
|
||||
if (cameraon != _vehicle) then {
|
||||
_vehicle switchcamera cameraview;
|
||||
};
|
||||
|
||||
_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;
|
||||
ppeffectdestroy _blur;
|
||||
_cam cameraeffect ["terminate","back"];
|
||||
camdestroy _cam;
|
||||
|
||||
_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;
|
||||
_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;
|
||||
|
||||
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];
|
||||
_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;
|
||||
|
||||
//--- 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
|
||||
};
|
||||
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];
|
||||
|
||||
player addrating (-rating player + _rating);
|
||||
objnull remotecontrol _unit;
|
||||
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true];
|
||||
//--- 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
|
||||
};
|
||||
|
||||
//--- 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]];
|
||||
player addrating (-rating player + _rating);
|
||||
objnull remotecontrol _unit;
|
||||
_unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true];
|
||||
|
||||
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;
|
||||
//--- 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]];
|
||||
|
||||
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;
|
||||
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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user