diff --git a/addons/arsenal/RscDisplayMain.hpp b/addons/arsenal/RscDisplayMain.hpp new file mode 100644 index 0000000000..3ea05b9e3f --- /dev/null +++ b/addons/arsenal/RscDisplayMain.hpp @@ -0,0 +1,36 @@ +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + class controls { + class GroupSingleplayer: RscControlsGroupNoScrollbars { + class Controls; + }; + class GroupTutorials: GroupSingleplayer { + h = "(6 * 1.5) * (pixelH * pixelGrid * 2)"; + + class Controls: Controls { + class Bootcamp; + class VRTraining; + class Arsenal; + class GVAR(mission): Arsenal { + idc = -1; + text = CSTRING(Mission); + tooltip = CSTRING(Mission_tooltip); + y = "(3 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + onbuttonclick = QUOTE(playMission [ARR_2('','PATHTOF(missions\Arsenal.VR)')]); + animTextureNormal = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenu_ca.paa"; //@todo custom icons + animTextureDisabled = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenu_ca.paa"; + animTextureOver = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenuHover_ca.paa"; + animTextureFocused = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenuHover_ca.paa"; + animTexturePressed = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenu_ca.paa"; + animTextureDefault = "\a3\Ui_f\data\GUI\Rsc\RscDisplayMain\buttonMenu_ca.paa"; + }; + class FieldManual: Bootcamp { + y = "(4 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + class CommunityGuides: Bootcamp { + y = "(5 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)"; + }; + }; + }; + }; +}; diff --git a/addons/arsenal/config.cpp b/addons/arsenal/config.cpp index dcf101e172..0c3000ab3c 100644 --- a/addons/arsenal/config.cpp +++ b/addons/arsenal/config.cpp @@ -37,4 +37,5 @@ class Cfg3DEN { }; #include "ui\RscAttributes.hpp" -#include "CfgEventHandlers.hpp" \ No newline at end of file +#include "CfgEventHandlers.hpp" +#include "RscDisplayMain.hpp" diff --git a/addons/arsenal/missions/Arsenal.VR/description.ext b/addons/arsenal/missions/Arsenal.VR/description.ext new file mode 100644 index 0000000000..9d80b70fc4 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/description.ext @@ -0,0 +1,26 @@ +dev = "Karel"; +author = $STR_A3_Bohemia_Interactive; + +onLoadName = $STR_A3_Arsenal; +overviewText = $STR_A3_Arsenal_overviewText; +overviewPicture = "\A3\Ui_f\data\Logos\arsenal_1024_ca.paa"; + +briefing = 0; +debriefing = 0; + +doneKeys[] = {"BIS_Arsenal.Map_VR_done"}; +onPauseScript[] = {"arsenal_fnc_onPauseScript"}; + +class CfgFunctions +{ + class Arsenal + { + class Misc + { + class createTarget {file = "fn_createTarget.sqf";}; + class onPauseScript {file = "fn_onPauseScript.sqf";}; + class opened {file = "fn_opened.sqf";}; + class closed {file = "fn_closed.sqf";}; + }; + }; +}; \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/fn_closed.sqf b/addons/arsenal/missions/Arsenal.VR/fn_closed.sqf new file mode 100644 index 0000000000..464149a348 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fn_closed.sqf @@ -0,0 +1,33 @@ +if !(_this select 1) then { + { + { + if (_x iskindof "VR_CoverObject_base_F") then { + [_x,0] call bis_fnc_setheight; + } else { + _x enablesimulation true; + _x hideobject false; + }; + } foreach ([_x] + crew _x); + } foreach (allmissionobjects "All"); + { + _unit = _x; + removevest _unit; + removebackpack _unit; + removeheadgear _unit; + removegoggles _unit; + removeallweapons _unit; + _unit addvest vest player; + _unit addbackpack backpack player; + _unit addheadgear headgear player; + _unit addgoggles goggles player; + _unit addweapon primaryweapon player; + _unit addweapon secondaryweapon player; + _unit addweapon handgunweapon player; + {_unit addprimaryweaponitem _x;} foreach (primaryweaponitems player); + {_unit addsecondaryweaponitem _x;} foreach (secondaryweaponitems player); + {_unit addhandgunitem _x;} foreach (handgunitems player); + } foreach (entities "B_Soldier_VR_F" + entities "O_Soldier_VR_F" + entities "I_Soldier_VR_F"); + + ("RscVRMeta" call bis_fnc_rscLayer) cutrsc ["RscVRMeta","plain"]; +}; +player setvariable ["BIS_drawLines",true]; \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/fn_createTarget.sqf b/addons/arsenal/missions/Arsenal.VR/fn_createTarget.sqf new file mode 100644 index 0000000000..6eb7070190 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fn_createTarget.sqf @@ -0,0 +1,54 @@ +private ["_pos","_side","_obj","_grp","_type","_target"]; +_pos = [_this,0,[],[[],objnull]] call bis_fnc_param; +_type = [_this,1,"B_Soldier_VR_F",["",objnull]] call bis_fnc_param; + +_obj = _pos; +_grp = grpnull; +_var = ""; + +if (typename _obj == typename objnull) then { + _grp = group _obj; + _type = typeof _obj; + _pos = _obj getvariable ["pos",position objnull]; + _var = _obj getvariable ["var",""]; + [_obj,true] call bis_fnc_VREffectKilled; +} else { + _grp = creategroup east; +}; +if (_var == "") then {_var = "t" + str round random 999999;}; + +_target = _grp createunit [_type,[10,10,0],[],0,"none"]; +if !(isnull (missionnamespace getvariable ["BIS_fnc_arsenal_target",objnull])) then {_target hideobject true}; +_target setpos _pos; +_target setdir ([_pos,player] call bis_fnc_dirto); +_target dowatch position player; +_target addrating -10e10; +_target setunitpos "up"; +_target setbehaviour "careless"; +_target setcombatmode "blue"; +_target setspeedmode "limited"; +_target disableai "target"; +_target disableai "autotarget"; +_target allowfleeing 0; +_target setspeaker "base"; +_target spawn {_this setspeaker "base";}; +player reveal [_target,4]; + +_target addvest vest player; +_target addbackpack backpack player; +_target addheadgear headgear player; +_target addgoggles goggles player; +_target addweapon primaryweapon player; +_target addweapon secondaryweapon player; +_target addweapon handgunweapon player; + +_target setvehiclevarname _var; +missionnamespace setvariable [_var,_target]; + +_target switchmove "amovpercmstpslowwrfldnon"; +_target setvariable ["pos",_pos]; +_target setvariable ["var",_var]; +_target addeventhandler ["killed",{_this spawn arsenal_fnc_createTarget;}]; +[_target] call bis_fnc_VRHitpart; + +_target \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/fn_onPauseScript.sqf b/addons/arsenal/missions/Arsenal.VR/fn_onPauseScript.sqf new file mode 100644 index 0000000000..52b7d71e7d --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fn_onPauseScript.sqf @@ -0,0 +1,11 @@ +disableserialization; +_display = _this select 0; + +_ctrlButtonAbort = _display displayctrl 104; +_ctrlButtonAbort ctrlsettext localize (["STR_A3_Arsenal","STR_A3_Garage"] select (missionnamespace getvariable ["bis_typeLast",0])); +_ctrlButtonAbort ctrlseteventhandler [ + "buttonclick", + "(ctrlparent (_this select 0)) closedisplay 2; ['Open',true] spawn (uinamespace getvariable (['bis_fnc_arsenal','bis_fnc_garage'] select bis_typeLast)); true" +]; + +true \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/fn_opened.sqf b/addons/arsenal/missions/Arsenal.VR/fn_opened.sqf new file mode 100644 index 0000000000..0bc5f67366 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/fn_opened.sqf @@ -0,0 +1,15 @@ +_player = missionnamespace getvariable ["BIS_fnc_arsenal_center",player]; +{ + { + if (_x iskindof "VR_CoverObject_base_F") then { + [_x,-10] call bis_fnc_setheight; //--- Move cover objects below ground instead, they have unexplainable problem with hideObject + } else { + _x enablesimulation false; + _x hideobject true; + }; + } foreach ([_x] + crew _x - [_player]); +} foreach (allmissionobjects "All" - [_player]); + +("RscVRMeta" call bis_fnc_rscLayer) cuttext ["","plain"]; +player setvariable ["BIS_drawLines",false]; +player setfatigue 0; \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/init.sqf b/addons/arsenal/missions/Arsenal.VR/init.sqf new file mode 100644 index 0000000000..61e9055d18 --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/init.sqf @@ -0,0 +1,215 @@ +"init" call bis_fnc_startloadingscreen; +//enableenvironment false; +enablesaving [false,false]; +player allowdamage false; +activateKey format ["BIS_%1.%2_done", missionName, worldName]; + +cuttext ["","black in",1e10]; + +waituntil {!isnull (finddisplay 46)}; +player switchmove "amovpercmstpslowwrfldnon"; +player call bis_fnc_traceBullets; + +//--- Static targets in various distance +{ + _pos = [player,_x,180 + _foreachindex] call bis_fnc_relpos; + [_pos,"O_Soldier_VR_F"] call arsenal_fnc_createTarget; +} foreach [10,20,30,40,50,100,500,1000,2000]; + +//--- Target line +_pos = [player,20,90] call bis_fnc_relpos; +for "_i" from 0 to 5 do { + _iPos = [(_pos select 0),(_pos select 1) - 3 + _i,0]; + [_ipos,"O_Soldier_VR_F"] call arsenal_fnc_createTarget; +}; + +//--- Target cluster +_pos = [player,20,-90] call bis_fnc_relpos; +for "_i" from 0 to 8 do { + _index = floor (_i / 3); + _iPos = [ + (_pos select 0) + _index * 1.5, + (_pos select 1) + 1.5 + (_i % 3), + 0 + ]; + _target = [_ipos,"O_Soldier_VR_F"] call arsenal_fnc_createTarget; + + _target switchmove (["aidlpercmstpslowwrfldnon","aidlpknlmstpslowwrfldnon_ai","aidlppnemstpsraswrfldnon_ai"] select _index); + _target setunitpos (["up","middle","down"] select _index); +}; + +//--- Target patrol +_grp = creategroup east; +{ + _wp = _grp addwaypoint [[player,10,_x] call bis_fnc_relpos,0]; + if (_foreachindex == 4) then {_wp setwaypointtype "cycle";}; +} foreach [0,90,180,270,0]; + +_pos = [player,10,0] call bis_fnc_relpos; +for "_i" from 0 to 1 do { + _target = [_pos,"O_Soldier_VR_F"] call arsenal_fnc_createTarget; + [_target] join _grp; + _target stop false; + _target enableai "move"; + _target setspeedmode "limited"; +}; + +//--- Armored vehicles +_vehicles = []; +if (isclass (configfile >> "cfgvehicles" >> "Land_VR_Target_MRAP_01_F")) then { + _step = 15; + _posCenter = [position player select 0,(position player select 1) + 30,0]; + { + _row = _foreachindex; + _rowCount = (count _x - 1) * 0.5; + { + _pos = [ + (_posCenter select 0) + (-_rowCount + _foreachindex) * _step, + (_posCenter select 1) + _row * _step, + 0 + ]; + _veh = createvehicle [_x,_pos,[],0,"none"]; + _veh setpos _pos; + _veh setdir 180; + _veh setvelocity [0,0,-1]; + [_veh] call bis_fnc_VRHitpart; + _marker = _veh call bis_fnc_boundingboxmarker; + _marker setmarkercolor "colororange"; + _vehicles pushback _veh; + } foreach _x; + } foreach [ + [ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" + ], + [ + "Land_VR_Target_MRAP_01_F", + "Land_VR_Target_APC_Wheeled_01_F", + "Land_VR_Target_MBT_01_cannon_F" + ] + ]; +}; +_vehicles spawn { + waituntil { + _allDisabled = true; + { + _hitalive = _x getvariable ["bis_fnc_VRHitParts_hitalive",[]]; + _allDisabled = _allDisabled && ({!_x} count _hitalive >= 2); + sleep 0.1; + } foreach _this; + _allDisabled + }; + setstatvalue ["MarkMassVirtualDestruction",1]; +}; + +//--- Cover objects +_coverObjects = [ + "Land_VR_CoverObject_01_kneel_F", + "Land_VR_CoverObject_01_kneelHigh_F", + "Land_VR_CoverObject_01_kneelLow_F", + "Land_VR_CoverObject_01_stand_F", + "Land_VR_CoverObject_01_standHigh_F" +]; +_dis = 3; +for "_i" from 5 to 11 do { + _dir = _i * 45; + _pos = [position player,(abs sin _dir + abs cos _dir) * _dis,_dir] call bis_fnc_relpos; + _block = createvehicle [_coverObjects select (_i % count _coverObjects),_pos,[],0,"none"]; + _block setpos _pos; +}; + +//--- Starting point +_square = createvehicle ["VR_Area_01_square_1x1_grey_F",position player,[],0,"none"]; +_square setpos position player; +_marker = createmarker ["bis_start",position player]; +_marker setmarkertype "mil_start"; + +//--- Garage position +_centerPos = [player,[16,16,0] vectorDistance [0,0,0],135] call bis_fnc_relpos; +_squareGarage = createvehicle ["VR_Area_01_square_4x4_grey_F",_centerPos,[],0,"none"]; +_squareGarage setpos _centerPos; +BIS_fnc_garage_center = createvehicle ["Land_HelipadEmpty_F",_centerPos,[],0,"none"]; +BIS_fnc_garage_center setpos _centerPos; +BIS_fnc_garage_center enablesimulation false; + +player addeventhandler [ + "animchanged", + { + _unit = _this select 0; + _anim = _this select 1; + _animSplit = [_anim,"_"] call bis_fnc_splitstring; + if ("salute" in _animSplit) then { + { + _x playaction "salute"; + } foreach ((position _unit nearobjects ["man",10]) - [player]); + }; + } +]; + +disableserialization; +"init" call bis_fnc_endloadingscreen; +bis_typeLast = 0; + +[ + missionnamespace, + "arsenalOpened", + { + _this call arsenal_fnc_opened; + bis_typeLast = 0; + } +] call bis_fnc_addscriptedeventhandler; +[ + missionnamespace, + "arsenalClosed", + { + _this call arsenal_fnc_closed; + } +] call bis_fnc_addscriptedeventhandler; +[ + missionnamespace, + "garageOpened", + { + _this call arsenal_fnc_opened; + bis_typeLast = 1; + } +] call bis_fnc_addscriptedeventhandler; +[ + missionnamespace, + "garageClosed", + { + _this call arsenal_fnc_closed; + } +] call bis_fnc_addscriptedeventhandler; + + + +//--- Open Arsenal +bis_fnc_arsenal_fullArsenal = true; +bis_fnc_arsenal_fullGarage = true; +if ((uinamespace getvariable ["bis_fnc_arsenal_typeDefault",0]) > 0) then { + ["Open",true] spawn bis_fnc_garage; +} else { + ["Open",true] spawn bis_fnc_arsenal; +}; +uinamespace setvariable ["bis_fnc_arsenal_typeDefault",nil]; +["#(argb,8,8,3)color(0,0,0,1)",false,nil,0.1,[0,0.5]] spawn bis_fnc_textTiles; + +//--- Target markers +[] spawn { + _targets = []; + { + _targets pushback vehiclevarname _x; + _var = vehiclevarname _x; + _marker = createmarker [_var,position _x]; + _marker setmarkertype "mil_dot"; + _marker setmarkercolor "colororange"; + } foreach (allmissionobjects "man") - [player]; + while {true} do { + { + _t = missionnamespace getvariable _x; + (vehiclevarname _t) setmarkerpos position _t; + } foreach _targets; + sleep 0.1; + }; +}; \ No newline at end of file diff --git a/addons/arsenal/missions/Arsenal.VR/mission.sqm b/addons/arsenal/missions/Arsenal.VR/mission.sqm new file mode 100644 index 0000000000..c43d901f6e --- /dev/null +++ b/addons/arsenal/missions/Arsenal.VR/mission.sqm @@ -0,0 +1,163 @@ +version=12; +class Mission +{ + addOns[]= + { + "A3_Map_VR", + "A3_Characters_F_BLUFOR", + "a3_characters_f_beta", + "a3_characters_f" + }; + addOnsAuto[]= + { + "A3_Characters_F_BLUFOR", + "a3_characters_f", + "A3_Map_VR" + }; + randomSeed=5486937; + class Intel + { + briefingName="@STR_A3_Arsenal"; + startWeather=0; + startWind=0.099999994; + startWaves=0.099999994; + forecastWeather=0; + forecastWind=0.099999994; + forecastWaves=0.099999994; + forecastLightnings=0.099999994; + year=2035; + month=2; + day=24; + hour=12; + minute=0; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; + class Groups + { + items=1; + class Item0 + { + side="CIV"; + class Vehicles + { + items=1; + class Item0 + { + position[]={4256,5,4192}; + azimut=180; + id=0; + side="CIV"; + vehicle="C_man_1"; + player="PLAYER COMMANDER"; + leader=1; + skill=0.60000002; + }; + }; + }; + }; + class Sensors + { + items=1; + class Item0 + { + position[]={4271.2827,5,4170.251}; + a=0; + b=0; + interruptable=1; + age="UNKNOWN"; + expCond="cheat1"; + expActiv="endmission ""end1"""; + class Effects + { + }; + }; + }; +}; +class Intro +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=12455686; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroWin +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=9312504; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; +class OutroLoose +{ + addOns[]= + { + "A3_Map_VR" + }; + addOnsAuto[]= + { + "A3_Map_VR" + }; + randomSeed=15192082; + class Intel + { + timeOfChanges=1800.0002; + startWeather=0; + startWind=0.1; + startWaves=0.1; + forecastWeather=0; + forecastWind=0.1; + forecastWaves=0.1; + forecastLightnings=0.1; + year=2035; + day=28; + hour=13; + minute=37; + startFogDecay=0.0049999999; + forecastFogDecay=0.0049999999; + }; +}; diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 0c28240b9b..e220d935b7 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -433,5 +433,13 @@ Impossibile aprire l'arsenale ACE ACE 武器庫を開けません + + ACE Virtual Arsenal + ACE Virtuelles Arsenal + + + View and try out different weapons, equipment and vehicles. + Sieh dir verschiedene Waffen, Ausrüstung und Fahrzeuge an und probiere sie aus. +