Skip to content

Commit

Permalink
Merge pull request #173 from BlackHawkPL/master
Browse files Browse the repository at this point in the history
3.3.3
  • Loading branch information
BlackHawkPL authored Mar 6, 2018
2 parents bb2bc49 + 287cde7 commit f0d3317
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 75 deletions.
2 changes: 1 addition & 1 deletion core/description.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifdef description

#include "dia\rscdefinitions.hpp" //Must have for the end screen to work, if removed Arma 3 will crash on mission load
#include "dia\endscreen\dia_endscreen.hpp" //Must have for the end screen to work, if removed Arma 3 will crash on mission load

respawn = "BASE"; //Do not change, spectator script needs people to respawn, to be declared as dead and put into spectator mode
respawndelay = 5; //5 seconds are needed to make sure people properly die and go into spectator
Expand Down Expand Up @@ -33,5 +32,6 @@
#ifdef description_titles

#include "dia\debug\dia_debug.hpp" //Must have for the end screen to work, if removed Arma 3 will crash on mission load
#include "dia\endscreen\dia_endscreen.hpp" //Must have for the end screen to work, if removed Arma 3 will crash on mission load

#endif
6 changes: 4 additions & 2 deletions core/dia/endscreen/dia_endscreen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

class DIA_ENDSCREEN {
idd = 300;
movingEnable = false;
enableSimulation = true;
fadeout = 0;
fadein = 0;
duration = 30;
onLoad = "uiNamespace setVariable ['FW_EndScreen', _this select 0];";
controlsBackground[] = {BACKGROUND};
objects[] = {};
controls[] = {TEXT_TITLE, TEXT_LEFT, TEXT_RIGHT, TEXT_BOTTOM_LEFT,TEXT_BOTTOM_MIDDLE, TEXT_BOTTOM_RIGHT};
Expand Down
22 changes: 12 additions & 10 deletions core/dia/endscreen/dia_endscreen.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
createDialog "DIA_ENDSCREEN";
_dia = 300;
90001 cutRsc ["DIA_ENDSCREEN", "PLAIN"];
_bg = 3000;
_endTitle = 3001;
_left = 3002;
Expand All @@ -18,7 +17,7 @@ params ["_scenario", "_timeLimit", "_teams"];

[] spawn {

sleep 4;
sleep 1;
{

_x enableSimulation false;
Expand Down Expand Up @@ -102,16 +101,19 @@ if (!isNil "aCount_textBLU" && !isNil "aCount_textRED" && !isNil "aCount_textRES
_bottomTextRight = format["%1",aCount_textRES];
};

((findDisplay _dia) displayCtrl _endTitle) ctrlSetStructuredText parseText _endTitleText;
((findDisplay _dia) displayCtrl _left) ctrlSetStructuredText parseText _leftText;
((findDisplay _dia) displayCtrl _right) ctrlSetStructuredText parseText _rightText;
((findDisplay _dia) displayCtrl _bottomLeft) ctrlSetStructuredText parseText _bottomTextLeft;
((findDisplay _dia) displayCtrl _bottomMiddle) ctrlSetStructuredText parseText _bottomTextMiddle;
((findDisplay _dia) displayCtrl _bottomRight) ctrlSetStructuredText parseText _bottomTextRight;
disableSerialization;
_dia = uiNamespace getVariable "FW_EndScreen";

(_dia displayCtrl _endTitle) ctrlSetStructuredText parseText _endTitleText;
(_dia displayCtrl _left) ctrlSetStructuredText parseText _leftText;
(_dia displayCtrl _right) ctrlSetStructuredText parseText _rightText;
(_dia displayCtrl _bottomLeft) ctrlSetStructuredText parseText _bottomTextLeft;
(_dia displayCtrl _bottomMiddle) ctrlSetStructuredText parseText _bottomTextMiddle;
(_dia displayCtrl _bottomRight) ctrlSetStructuredText parseText _bottomTextRight;

for "_x" from 1 to 120 do {

((findDisplay _dia) displayCtrl _bg) ctrlSetBackgroundColor [0, 0, 0, (_x * (1/120))];
(_dia displayCtrl _bg) ctrlSetBackgroundColor [0, 0, 0, (_x * (1/120))];
sleep(0.01);

};
Expand Down
2 changes: 1 addition & 1 deletion core/menu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Olsen Framework is a simple framework designed for ArmA 3. It supports modul
Find out more about the framework on GitHub.<br/>
github.com/dklollol/Olsen-Framework-Arma-3<br/>
<br/>
Current Version: 3.3.2
Current Version: 3.3.3
";

player createDiaryRecord ["FW_Menu", ["Framework Info", _info]];
22 changes: 11 additions & 11 deletions customization/loadouts/1989VDV.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ case (package + "RF"): { //Rifleman

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -63,7 +63,7 @@ case (package + "RFLAT"): { //AT Rifleman

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -87,7 +87,7 @@ case (package + "AR"): { //Automatic Rifleman

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -109,7 +109,7 @@ case (package + "RFAT"): { //AT Rifleman

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -135,7 +135,7 @@ case (package + "RFASST"): { //Assitant RPG Gunner

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -158,7 +158,7 @@ case (package + "TL"): { //Team Leader/Efreitor

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -185,7 +185,7 @@ case (package + "SL"): { //Squad Leader

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -210,7 +210,7 @@ case (package + "PL"): { //Platoon Leader

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -234,7 +234,7 @@ case (package + "MRKSMN"): { //Marksman

["rhsgref_ssh68_ttsko_forest"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -255,7 +255,7 @@ case (package + "GNR"): { //Vehicle Gunner

["rhs_tsh4"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand All @@ -279,7 +279,7 @@ case (package + "DRVR"): { //Vehicle Driver

["rhs_tsh4"] call FNC_AddItem; //Helmet

ADD_GROUP(items);
ADD_GROUP(uniform);
ADD_GROUP(IFAK);
ADD_GROUP(items);

Expand Down
10 changes: 3 additions & 7 deletions modules/EG_Spectator_Mode/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ if (!isDedicated) then {
};

if (!isNull(_respawnPoint)) then {
player setPos getPosATL _respawnPoint;
player setPosATL getPosATL _respawnPoint;
};

FW_RespawnTickets = FW_RespawnTickets - 1;
Expand All @@ -202,13 +202,9 @@ if (!isDedicated) then {

player setVariable ["FW_Dead", true, true]; //Tells the framework the player is dead

player remoteExecCall ["hideObject", 0];
player remoteExecCall ["hideObjectGlobal", 2];

player hideObjectGlobal true;
player setCaptive true;
player allowdamage false;
[player, true] remoteExec ["setCaptive", 2];
[player, false] remoteExec ["allowdamage", 2];
player allowDamage false;

player call FNC_RemoveAllGear;
player addWeapon "itemMap";
Expand Down
2 changes: 1 addition & 1 deletion modules/acre_setup/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (isServer && FW_enable_channel_names) then {
} foreach FW_ChannelNames;
};

if(!isDedicated) then {
if(!isDedicated && hasInterface) then {
[] spawn {
waitUntil { !isNull acre_player };

Expand Down
103 changes: 87 additions & 16 deletions modules/ai_drivers/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ aidrivers_removeUnit = {
[_handle select 1] remoteExec ["CBA_fnc_removePerFrameHandler", _handle select 0];
};
};
FW_AiDriverVehicle = objNull;
false call FNC_toggleDriverCam;
hint "Driver removed";
};

Expand Down Expand Up @@ -61,53 +63,122 @@ aidrivers_createUnit = {

doStop _unit;

FW_AidriverLastTimeIn = time;

[{vehicle (_this select 0) != _this select 0}, { //waiting for spawned unit to get into vehicle
private _pfhID = [{
_this select 0 params ["_unit", "_target", "_caller"];

private _handle = _this select 1;
if (vehicle _caller != _target) then {
false call FNC_toggleDriverCam;
_unit disableAI "PATH";
doStop _unit;
} else {
_unit enableAI "PATH";
FW_AidriverLastTimeIn = time;
};
if (!alive _target || !alive _caller || !alive _unit || (vehicle _unit) != _target || (driver _target) != _unit) then {
if (time > 120 + FW_AidriverLastTimeIn || !alive _target || !alive _caller || !alive _unit || (vehicle _unit) != _target || (driver _target) != _unit) then {
[_target, _caller] call aidrivers_removeUnit;
};
}, 1, _this] call CBA_fnc_addPerFrameHandler;
(_this select 1) setVariable ["aidrivers_pfhID", [(_this select 2), _pfhID], true];
}, [_unit, _target, _caller]] call CBA_fnc_WaitUntilAndExecute;

FW_AiDriverVehicle = _target;
hint "Driver added";

};

private _action = ["ai_driver","Add/Remove AI driver","",{
[_target, _player] call aidrivers_toggle;
},
{
vehicle _player == _target && ((assignedVehicleRole _player) select 0) == "Turret"
}] call ace_interact_menu_fnc_createAction;

private _unflipAction = ["ai_driver_unflip","Unflip vehicle","",{
[_target, surfaceNormal position _target] remoteExec ["setVectorUp", 2, false];
_target setPos [getpos _target select 0, getpos _target select 1, (getpos _target select 2) + 2];
},
{
vehicle _player == _target && ((assignedVehicleRole _player) select 0) == "Turret" && {(vectorUp _target) select 2 < 0}
}] call ace_interact_menu_fnc_createAction;
FNC_toggleDriverCam = {
if (_this) then {
FW_driverCam = "camera" camCreate [0,0,0];
FW_driverCam cameraEffect ["INTERNAL", "BACK","FW_rtt"];
FW_driverCam camSetFov 0.9;
FW_driverCam camCommit 0;

FW_pipNvEnabled = false;

_veh = vehicle player;
_mempoint = getText ( configfile >> "CfgVehicles" >> (typeOf _veh) >> "memoryPointDriverOptics" );
FW_driverCam attachTo [_veh,[0,0,0], _mempoint];

with uiNamespace do {
"FW_pipDriver" cutRsc ["RscTitleDisplayEmpty", "PLAIN"];
FW_pipDisplay = uiNamespace getVariable "RscTitleDisplayEmpty";
FW_driverPipDisplay = FW_pipDisplay ctrlCreate ["RscPicture", -1];
FW_driverPipDisplay ctrlSetPosition [0.1,1,0.75,0.5];
FW_driverPipDisplay ctrlCommit 0;
FW_driverPipDisplay ctrlSetText "#(argb,512,512,1)r2t(FW_rtt,1.0)";
};

} else {
if (!isNil "FW_driverCam" && {!isNull FW_driverCam}) then {
with uiNamespace do {
FW_pipDisplay closeDisplay 2;
};
detach FW_driverCam;
FW_driverCam cameraEffect ["terminate", "back", "FW_rtt"];
camDestroy FW_driverCam;
};
};
};

FNC_enableAIDriver = {
private _vehs = _this;
if (typeName _vehs != "ARRAY") then {
_vehs = [_vehs];
};

//AI driver action
private _action = ["ai_driver","Add/Remove AI driver","",{
[_target, _player] call aidrivers_toggle;
},
{
vehicle _player == _target && ((assignedVehicleRole _player) select 0) == "Turret" && FW_AiDriverVehicle in [objNull, vehicle _player]
}] call ace_interact_menu_fnc_createAction;

//unflip action
private _unflipAction = ["ai_driver_unflip","Unflip vehicle","",{
[_target, surfaceNormal position _target] remoteExec ["setVectorUp", 2, false];
_target setPos [getpos _target select 0, getpos _target select 1, (getpos _target select 2) + 2];
},
{
vehicle _player == _target && ((assignedVehicleRole _player) select 0) == "Turret" && (vectorUp _target) select 2 < 0
}] call ace_interact_menu_fnc_createAction;

//PIP action
private _pipAction = ["ai_driver_pip","Enable/Disable driver's view","",{
(isNil "FW_driverCam" || {isNull FW_driverCam}) call FNC_toggleDriverCam;
},
{
vehicle _player == _target && ((assignedVehicleRole _player) select 0) == "Turret" && !isNull (_target getVariable ["aidrivers_driver", objNull])
}] call ace_interact_menu_fnc_createAction;

//toggle NV for PIP
private _pipNvAction = ["ai_driver_pip_nv","Enable/Disable NV in driver's view","",{
if (isNil "FW_pipNvEnabled") then {
FW_pipNvEnabled = false;
};
"FW_rtt" setPiPEffect ([[1], [0]] select FW_pipNvEnabled);
FW_pipNvEnabled = !FW_pipNvEnabled;
},
{
vehicle _player == _target &&
((assignedVehicleRole _player) select 0) == "Turret" &&
(!isNil "FW_driverCam" && {!isNull FW_driverCam})
}] call ace_interact_menu_fnc_createAction;


{
[_x, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToObject;
[_x, 1, ["ACE_SelfActions"], _unflipAction] call ace_interact_menu_fnc_addActionToObject;
[_x, 1, ["ACE_SelfActions"], _pipAction] call ace_interact_menu_fnc_addActionToObject;
[_x, 1, ["ACE_SelfActions"], _pipNvAction] call ace_interact_menu_fnc_addActionToObject;
} foreach _vehs;

};

VEHS call FNC_enableAIDriver;
FW_AiDriverVehicle = objNull;

VEHS call FNC_enableAIDriver;
6 changes: 4 additions & 2 deletions modules/ai_drivers/settings.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

//array containing vehicles that will have option to spawn AI driver in them
#define VEHS []
#define VEHS []

//use line below to enable the module for all tracked vehicles in the mission
//#define VEHS call {_vehs = []; {if (typeOf _x isKindOf 'Tank') then {_vehs pushBack _x};} foreach vehicles; _vehs;}
Loading

0 comments on commit f0d3317

Please sign in to comment.