Skip to content

Commit

Permalink
Merge pull request #4 from kasteelharry/DevBranch
Browse files Browse the repository at this point in the history
Pull request DevBranch into Master
  • Loading branch information
kasteelharry authored Jan 12, 2020
2 parents 1874caa + 76085d8 commit 9dc2fa7
Show file tree
Hide file tree
Showing 12 changed files with 613 additions and 468 deletions.
11 changes: 10 additions & 1 deletion EMP_DEMO_MISSION.Stratis/AL_emp/config_obj.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ _obj_emp = _this select 0;
_rang_emp = _this select 1;
_poz_g = position _obj_emp;

list_man_emp = _poz_g nearEntities [["Civilian","SoldierGB","SoldierEB","SoldierWB"],_rang_emp];
list_man_emp = _poz_g nearEntities [["Civilian","SoldierGB","SoldierEB","SoldierWB"],_rang_emp]; //Returns all the units in the range, except the ones in vic
list_car_emp = _poz_g nearEntities [["Car", "Motorcycle", "Tank","Air","Ship"],_rang_emp];
static_turrets_emp = _poz_g nearEntities [["B_static_AA_F", "B_static_AT_F","B_T_Static_AA_F","B_T_Static_AT_F","B_T_GMG_01_F","B_T_HMG_01_F","B_T_Mortar_01_F","B_HMG_01_high_F","B_HMG_01_A_F","B_GMG_01_F","B_GMG_01_high_F","B_GMG_01_A_F","B_Mortar_01_F","B_G_Mortar_01_F","B_Static_Designator_01_F","B_AAA_System_01_F","B_SAM_System_01_F","B_SAM_System_02_F","O_HMG_01_F","O_HMG_01_high_F","O_HMG_01_A_F","O_GMG_01_F","O_GMG_01_high_F","O_GMG_01_A_F","O_Mortar_01_F","O_G_Mortar_01_F","O_static_AA_F","O_static_AT_F","O_Static_Designator_02_F","I_HMG_01_F","I_HMG_01_high_F","I_HMG_01_A_F","I_GMG_01_F","I_GMG_01_high_F","I_GMG_01_A_F","I_Mortar_01_F","I_G_Mortar_01_F","I_static_AA_F","I_static_AT_F"],_rang_emp];
list_light_emp = nearestObjects [_poz_g,["Land_fs_roof_F","Land_fs_sign_F","Land_TTowerBig_2_F","Land_TTowerBig_1_F","Lamps_base_F","PowerLines_base_F","PowerLines_Small_base_F","Land_LampStreet_small_F"],_rang_emp];

//Adds the crew members to the list of units
{
_crew = crew _x;
if (not(count _crew == 0)) then
{
list_man_emp append _crew;
}
}forEach list_car_emp;

//List of items to be removed if equipped
special_helmet_emp = ["H_PilotHelmetFighter_B", "H_PilotHelmetFighter_O","H_HelmetO_ViperSP_ghex_F","H_PilotHelmetFighter_I","H_HelmetO_ViperSP_hex_F"];
special_launchers_emp = [];
Expand Down
30 changes: 4 additions & 26 deletions EMP_DEMO_MISSION.Stratis/AL_emp/emp_effect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _delay_check = 0.01;
//{_x disableTIEquipment true; _x disableNVGEquipment true; [[_x],"AL_emp\sparky.sqf"] remoteExec ["execVM"];sleep _delay_check} forEach static_turrets_emp;
["geiger"] remoteExec ["playsound"];
{
//Will be changed into an easier to read block of code, making use of an array etc.
[[_x],"AL_emp\tgt_sfx.sqf"] remoteExec ["execVM"];
_x unassignItem "Toolkit";
_x removeItem "ToolKit";
Expand All @@ -49,33 +50,8 @@ _delay_check = 0.01;
_x removeItem "ItemGPS";
_x unassignItem "ItemRadio";
_x removeItem "ItemRadio";
_x unassignItem "NVGoggles";
_x removeItem "NVGoggles";
_x unassignItem "NVGoggles_OPFOR";
_x removeItem "NVGoggles_OPFOR";
_x unassignItem "NVGoggles_INDEP";
_x removeItem "NVGoggles_INDEP";
_x unassignItem "O_NVGoggles_hex_F";
_x removeItem "O_NVGoggles_hex_F";
_x unassignItem "O_NVGoggles_urb_F";
_x removeItem "O_NVGoggles_urb_F";
_x unassignItem "O_NVGoggles_ghex_F";
_x removeItem "O_NVGoggles_ghex_F";
_x unassignItem "NVGoggles_tna_F";
_x removeItem "NVGoggles_tna_F";
_x unassignItem "NVGogglesB_blk_F";
_x removeItem "NVGogglesB_blk_F";
_x unassignItem "NVGogglesB_grn_F";
_x removeItem "NVGogglesB_grn_F";
_x unassignItem "NVGogglesB_gry_F";
_x removeItem "NVGogglesB_gry_F";
_x unassignItem "Integrated_NVG_F";
_x removeItem "Integrated_NVG_F";
_x unassignItem "Integrated_NVG_TI_0_F";
_x removeItem "Integrated_NVG_TI_0_F";
_x unassignItem "Integrated_NVG_TI_1_F";
_x removeItem "Integrated_NVG_TI_1_F";
_x removePrimaryWeaponItem "acc_pointer_IR";
_removeNVG = [_x] call kast_fnc_RemoveNVGs;
if (headgear _x in special_helmet_emp) then
{
removeHeadgear _x
Expand All @@ -84,6 +60,8 @@ _delay_check = 0.01;
{
_x removeWeaponGlobal (secondaryWeapon _x)
};

//Will be changed to do less damage the further you are away according to the laws of physics...
if (emp_dam>0) then
{
_x setDamage ((Damage _x) + emp_dam)
Expand Down
3 changes: 3 additions & 0 deletions EMP_DEMO_MISSION.Stratis/AL_emp/emp_starter.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ _viz_eff = _this select 2;
_player_viz = _this select 3;
_dam_unit = _this select 4;

//Makes a list of all the NVG's that could be used in the mission.
[] spawn kast_fnc_getAllNVGs;

//if (!isNil {_obj_emp getVariable "is_ON"}) exitwith {};
_obj_emp setVariable ["is_ON",true,true];
missionNamespace setVariable ["empDetonated", true, true];
Expand Down
25 changes: 22 additions & 3 deletions EMP_DEMO_MISSION.Stratis/description.ext
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@


onLoadMissionTime = 0;
respawn = 3;
respawnButton = 0;
respawnDelay = 900;
respawnDialog = 0;
respawnOnStart = -1;
respawnTemplates[] = {"Spectator"};
disabledAI = 1;
briefing = 0;
debriefing = 0;
disableChannels[] = {{0,false,true},{1,false,true},{2,true,true},{3,false,true},{4,true,true},{5,true,true},{6,false,true}};
saving = 1;
enableDebugConsole = 1;


class CfgFunctions
{
class kasteelharry
Expand All @@ -9,6 +26,8 @@ class CfgFunctions
file = "functions";
class KeepMapClean;
class TFARJamRadios;
class RemoveNVGs;
class getAllNVGs;
};
};
};
Expand All @@ -18,13 +37,13 @@ class CfgSounds
class murmur
{
name = "murmur"; // Name for mission editor
sound[] = {\Sound\murmur.ogg, 0.8, 1.0};
sound[] = {"\Sound\murmur.ogg", 0.8, 1.0};
titles[] = {0, ""};
};
class geiger
{
name = "geiger"; // Name for mission editor
sound[] = {\Sound\geiger.ogg, .7, 1.0};
sound[] = {"\Sound\geiger.ogg", .7, 1.0};
titles[] = {0, ""};
};
class spark1
Expand Down Expand Up @@ -78,7 +97,7 @@ class CfgSounds
class tiuit
{
name = "tiuit"; // Name for mission editor
sound[] = {\Sound\tiuit.ogg, 0.2, 1.0};
sound[] = {"\Sound\tiuit.ogg", 0.2, 1.0};
titles[] = {0, ""};
};
};
4 changes: 2 additions & 2 deletions EMP_DEMO_MISSION.Stratis/functions/fn_KeepMapClean.sqf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Filename @DrawMapRestrictor.sqf
Filename @fn_KeepMapClean.sqf
Author @kasteelharry
Licensed under GNU Affero General Public License v3.0
Expand All @@ -8,7 +8,7 @@
This script checks all the map markers and delete every userplaced marker that isn't placed by a player in a group that is defined in the initServer.sqf
For this to run you need to have Direct Play ID's stored in a global variable with the players name.
Can be created by @MapRestrictorIDGet.sqf
This list is generated on startup by initServer.sqf
*/


Expand Down
22 changes: 22 additions & 0 deletions EMP_DEMO_MISSION.Stratis/functions/fn_RemoveNVGs.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Author: MR. H.
Description: removes the NVGs on player. Based upon Mr. H. MRH_fnc_removeNVGs function in MRHMilsimTools
Return value:None
Public: Yes
Parameters:
0 - <OBJECT> - Unit to remove NVGs from.
Example(s):
[player] call Kast_fnc_removeNVGs;
*/

params ["_unit"];

_assignedItems = assigneditems _unit;
_items = items _unit;
_toSave = [];
_toSaveAssigned = [];
{
if (_x in _items) then {_unit removeItem _x; _toSave pushBack _x;};
if (_x in _assignedItems) then {_unit unlinkItem _x; _toSaveAssigned pushBackUnique _x;};

} forEach allNVGsArray;
25 changes: 25 additions & 0 deletions EMP_DEMO_MISSION.Stratis/functions/fn_getAllNVGs.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Author: Mr. H.
Description: Put's all the NVG's in a list to be removed later. Based upon Mr. H. MRH_fnc_removeNVGs function in MRHMilsimTools
Return value:None
Public: Yes
Parameters:
*/


//Gets all the objects from cfgWeapon
_allWeaponsConfigs = "true" configClasses (configFile >> "cfgWeapons");
_allWeaponsConfigNames = _allWeaponsConfigs apply {configName _x};

//Hardcoded the apex NVGs due to them not being found...
allNVGsArray = ["NVGoggles_tna_F"];
{
_disp = getnumber (configfile >> "CfgWeapons" >> _x >> "scope");
_macro = gettext (configfile >> "CfgWeapons" >> _x >> "_generalMacro");
if (isNil "_macro") then {_macro = "";};
if ((_disp == 2) && (_macro == "NVGoggles")) then
{
allNVGsArray pushBackUnique _x;

};
} forEach _allWeaponsConfigNames;
11 changes: 5 additions & 6 deletions EMP_DEMO_MISSION.Stratis/initPlayerLocal.sqf
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
//These lines need to be placed in initPlayerLocal.sqf.


////////////////////////////////////////
//// ////
//// DO NOT CHANGE! ////
//// ////
////////////////////////////////////////
///////////////////////////////////
/// ///
/// DO NOT EDIT ///
/// ///
///////////////////////////////////

//Removes the markers in the local channels
[] spawn kast_fnc_KeepMapClean;
21 changes: 12 additions & 9 deletions EMP_DEMO_MISSION.Stratis/initServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,32 @@
By @kasteelharry
*/


///////////////////////////////////
/// ///
/// EDITABLE VARIABLE ///
/// ///
/// ///
/// EDITABLE VARIABLE ///
/// ///
///////////////////////////////////

// EMP
_EMPvariables = _jammervariables = EMP; //Needs to contain the variable name of the object spawned in game
_EMP_Range = _jammerRadius = 1000; //Range of the EMP blast and jamming afterwards
_EMPvariable = EMP; //Sets the variable names of the EMP's here
_jammerNames = _EMPvariable; //Makes the EMP the same source as the TFAR jammer
_EMP_Range = 1000; //Range of the EMP blast and jamming afterwards
_jammerRadius = _EMP_Range; //Sets jammer radius the same as EMP radius
_jammerStrength = 100; //Strength of the jammer, max is 100

// REMOVE USERPLACED MARKERS
// Will be run after emp blast
_AllowedToDrawGroup = ["GroupName1", "GroupName2", "etc..."];

///////////////////////////////////
/// ///
/// DO NOT EDIT ///
/// ///
/// ///
/// DO NOT EDIT ///
/// ///
///////////////////////////////////

// EMP + Jammer
missionNamespace setVariable ["EMP", _EMPvariables, true];
missionNamespace setVariable ["EMP", _EMPvariable, true];
missionNamespace setVariable ["EMP_Range", _EMP_Range, true];
missionNamespace setVariable ["Jammers", _jammerNames, true];
missionNamespace setVariable ["JammerRadius", _jammerRadius, true];
Expand Down
Loading

0 comments on commit 9dc2fa7

Please sign in to comment.