Updates to How Tos for using the 3DEN plugin.

This commit is contained in:
Chris Cardozo 2020-08-15 16:48:46 -04:00
parent 3349d63bed
commit c5cfb0feee
19 changed files with 57 additions and 1488 deletions

View File

@ -0,0 +1,51 @@
This update includes a plugin for the 3DEN Editor that simplifies creation the .sqf files that code a mission.
My approach to doing this as follows:
1) Start Arma with the following mods:
@epoch;@exile;@blckeagls_3DEN.
(adjust to meet your specific needs; obviously any additional mods such as those from CUP can be included).
2) Start the Eden Editor.
3) Lay out your static mission. You should:
place a marker that will be displayed when the mission is initialized (save your work)
Set the icon/shape, color and any text for your marker
Recommended: place a road cone with a flasher at the center of your mission
Note, you can comment this out later.
It is used to calculate positions of everything else.
Place all buldings, sandbags, etc (save your work)
Place any vehicle or air patrols -
Note that they will patrol using the postion at which you place them as the centerpoint of their patrol.
(save your work).
Place any static weapons.
Note, you can place these inside or on top of buildings.
(save your work).
Place a unit at each location you wish to have a group patrol.
Note: The mission spawner will attempt to spawn an entire group at these locations using the weapons, uniforms,
etc defined in blck_config.sqf or its derivatives.
Note: you can spawn this inside or on top of buildings.
Place some sort of ammo box, cardboard box, or other loot container.
Save your work.
Set Difficulty level as desired using the dropdown menu at the right of the toolbar.
Set any other mission parameters including:
loot crate spawn timing,
loot crate fill timing,
mission end criteria
Select Export Dynamic Mission from the blckeagls dropdown menu.
Select Copy, then paste the text into a text editor.
Change any settings including numbers of AI, AI respawn times, or patrol radii.
Save the file based on difficulty level.
For a Blue difficulty mission, save the file to the custom_server\Missions\Blue directory.
Add filename for your new mission to custom_server\Missions\GMS_missionLists.sqf
Pbo custom_server and test your new mission.

View File

@ -1,15 +1,13 @@
This update includes an optional ability to spawn static missions. This update includes an 3DEN plugin to make it easy to export static missions.
This can be done by laying out everything for your static mission in the 3DEN editor, This can be done by laying out everything for your static mission in the 3DEN editor,
then using a an editor plugin. then using the @blckeagls_3DEN editor plugin.
I have provided one example editor mission (staticMissionExamples.Altis)
which I have used to configure a static mission ( ).
My approach to doing this as follows: My approach to doing this as follows:
1) Start Arma with the following mods: 1) Start Arma with the following mods:
@epoch;@exile;@m3eden editor. @epoch;@exile;@blckeagls_3DEN.
(adjust to meet your specific needs; obviously any additional mods such as those from CUP can be included). (adjust to meet your specific needs; obviously any additional mods such as those from CUP can be included).
2) Start the Eden Editor. 2) Start the Eden Editor.
@ -22,10 +20,13 @@ My approach to doing this as follows:
Note that they will patrol using the postion at which you place them as the centerpoint of their patrol. Note that they will patrol using the postion at which you place them as the centerpoint of their patrol.
(save your work). (save your work).
Place any static weapons. Place any static weapons.
Note: these can be inside or on top of buildings.
(save your work). (save your work).
Place a unit at each location you wish to have a group patrol. Place a unit at each location you wish to have a group patrol.
Note: The mission spawner will attempt to spawn an entire group at these locations using the weapons, uniforms, Note: The mission spawner will attempt to spawn an entire group at these locations using the weapons, uniforms,
etc defined in blck_config.sqf or its derivatives. etc defined in blck_config.sqf or its derivatives.
Note: groups can be spawned inside or on top of buildings; just place on unit whereever you want a groupl
Place some sort of ammo box, cardboard box, or other loot container. Place some sort of ammo box, cardboard box, or other loot container.
Save your work. Save your work.

View File

@ -1,47 +0,0 @@
This tool formats most of the data required for dynamic missions based on what is present in your mission.
This include the layout of buildings, loot crates, markers, static weapons, and garrisons in buildings.
I recommend that you lay out dynamically spawned missions in the virtual reality map which minimizes confounding influences.
A minimal mission would include:
A marker.
A way to define the mission center, which is a reference point relative to which everything is spawned.
The mission system will spawn AI, loot chests, emplaced weapons, vehicles and aircraft according to the defaults for the mission difficulty.
The basic blckeagls missions have a bit more defined, usually some buildings to provide cover and make things more interesting.
Now, you can add more detail including defining where infantry and statics spawn, where the one or more loot crates spawn, where vehicle patrols spawn and so forth.
To do this just place the representative objects where you want the mission to spawn them and the script should do the rest.
For infantry patrols, put one unit where you want the group to spawn.
Note: uniforms, weapons and other AI gear are not captured. You can however define _uniforms, _weapons and other AI gear for that mission. see the template and default2 missions for examples.
You can also have infantry and/or static weapons garrison buildings using either of two approaches.
1. place an object fo type garrisonMarkerObject inside the building you want to garrison.
I use a 100 cm sphere which is the default because it is easy to see and not used for much else.
The script will ensure that this building is identified for a garrison which will be spawned at the Arma pre-defined buildingPositions.
2. Manualy place statics and units inside buildings where you want them to spawn.
Infantry will change position (crouch, prone, stand) and turn but will not move which prevents their normal behavior to leave the buliding and look for players.
The position of statics (e.g., HMG, GMG) will be recorded accurately.
By default, the script looks for arrows. this is so that if you pull mission data as a player the locations are recorded acccurately (more on that below).
You can of course just place the units where you want them.
Regardless, be sure that unitMarkerObject is set to the classname of the object you use to demarcate the position of infantry units.
If you do use AI units to designate positions for your infantry, be sure to pull the data while in the editor rather than when playing the mission (see below).
3. You are now almost ready to pull the mission data.
I recommend that you use a road cone with a flashing light to define the mission center.
This is the approach I have taken for all blckeagles missions to date.
You could also use a loot crate.
The actual mission center will be offset 3 meters from this position for technical reasons.
Once all that is done you are ready to pull the mission information.
To do that, from the EDEN Editor,
1. go to tools\debug console.
2. type execVM "pullDynamicMission.sqf"; in the box.
3. hit Local exec
4. hit Esc
5. The script should run as indicated by text appearing in the lower left corner of your screen.
6. When the text stops being updated, alt-tab out to your editor and paste the clipboard into it.
7. You can now copy/past from that output into the relevant sections of the dynamic mission template,
after making a copy of course.

View File

@ -1,38 +0,0 @@
/*
for ghostridergaming
By Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#define GRGserver
#define useAPEX
//#define useDynamicSimulation
#define blck_debugMode
#define blck_triggerLoopCompleteTime 40*60
//#define blck_milServer
//#define GRG_TestServer
//#define blck_useCUP
//#define blck_useRHS
////////////////////////////
// Do not touch anything below this line
///////////////////////////
#define onFoot 1
#define inVehicle 2
// defines for static group spawners
#define staticPatrolTriggerRange 2000
#define groupParameters 0
#define patrolGroup 1
#define groupSpawned 2
#define timesSpawned 3
#define respawnAt 4

View File

@ -1,61 +0,0 @@
This tool formats most of the data required for dynamic missions based on what is present in your mission.
This include the layout of buildings, loot crates, markers, static weapons, and garrisons in buildings.
I recommend that you lay out dynamically spawned missions in the virtual reality map which minimizes confounding influences.
A minimal mission would include:
A marker. You may use any marker you like. The new pullMarker script will format scripting needed to spawn that marker at the center of your mission.
A way to define the mission center, which is a reference point relative to which everything is spawned.
The mission system will spawn AI, loot chests, emplaced weapons, vehicles and aircraft according to the defaults for the mission difficulty.
The basic blckeagls missions have a bit more defined, usually some buildings to provide cover and make things more interesting.
Now, you can add more detail including defining where infantry and statics spawn, where the one or more loot crates spawn, where vehicle patrols spawn and so forth.
Loot crates, AI, static weapons or autonomous turrets can be spawned inside or on top of buildings. Even vehicles could be spawned on buildings in principle.
To do this just place the representative objects where you want the mission to spawn them and the script should do the rest.
For infantry patrols, put one unit where you want the group to spawn.
Note: uniforms, weapons and other AI gear are not captured. You can however define _uniforms, _weapons and other AI gear for that mission. see the template and default2 missions for examples.
You can also have infantry and/or static weapons garrison buildings using either of two approaches.
1. place an object fo type garrisonMarkerObject inside the building you want to garrison.
I use a 100 cm sphere which is the default because it is easy to see and not used for much else.
The script will ensure that this building is identified for a garrison which will be spawned at the Arma pre-defined buildingPositions.
2. Manualy place statics and units inside buildings where you want them to spawn.
Infantry will change position (crouch, prone, stand) and turn but will not move which prevents their normal behavior to leave the buliding and look for players.
The position of statics (e.g., HMG, GMG) will be recorded accurately.
By default, the script looks for arrows. this is so that if you pull mission data as a player the locations are recorded acccurately (more on that below).
You can of course just place the units where you want them.
Regardless, be sure that unitMarkerObject is set to the classname of the object you use to demarcate the position of infantry units.
If you do use AI units to designate positions for your infantry, be sure to pull the data while in the editor rather than when playing the mission (see below).
3. You are now almost ready to pull the mission data.
I recommend that you use a road cone with a flashing light to define the mission center.
This is the approach I have taken for all blckeagles missions to date.
You could also use a loot crate.
The actual mission center will be offset 3 meters from this position for technical reasons.
Once all that is done you are ready to pull the mission information.
To do that, from the EDEN Editor,
Preparation: copy all files from the tools\dynamicMissions\pullDynamicMissions folder into the folder containing the mission.sqm for your new mission.
Rename template.sqf to reflect the nature of your mission.
Pulling Marker data. Start Arma, and select Editor. Load your new mission in the editor and hit Play.
Using the mouse wheel, select pull marker data.
Alt-tab out and paste into the appropriate spot in your new mission.sqf.
Pulling all other mission data.
1. go to tools\debug console.
2. type execVM "pullDynamicMission.sqf"; in the box.
3. hit Local exec
4. hit Esc
5. The script should run as indicated by text appearing in the lower left corner of your screen.
6. When the text stops being updated, alt-tab out to your editor.
7. You can now copy/past from that output into the relevant sections of the dynamic mission template.
Final touchups.
The tools will pull all objects including any spheres, arrows or other aids.
Be sure to remove these or comment them out or they will show up in your final mission on your server.
Adjust the remaining settings in the template such as difficulty level to suit your needs.
Add the name of the mission to the list of missions to be spawned for that difficulty level.
Test everything to be sure

View File

@ -1,4 +0,0 @@
player addAction["Pull MARKER Info","pullMarkerInfo.sqf"];
player addAction["Set Mission Center @ Player Pos","setCenterAtPlayer.sqf"];
player addAction["Pull DYNAMIC mission","pullDynamicMission.sqf"];

View File

@ -1,479 +0,0 @@
_fn_isInside = { // returns true if an object is inside, underneath or on top of a building otherwise returns false.
//////////////////////
// Determin if a unit is inside a building using two separate checkVisibility
//////////////////////
// lineIntersects [ eyePos player, aimPos chopper, player, chopper]
params["_u",["_category","House"]];
private ["_u","_pos","_above","_below"];
_pos = getPosASL _u;
_above = lineIntersects [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u];
_below = lineintersects [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 2],_u];
diag_log format["_fn_isInside: _u %1 | _category = %5 | typeOf _u %4 | _above %2 | _below %3 ",_u,_above,_below,typeOf _u, _category];
// If there is something above or below the object do a quick double-check to make sure there is a building there and not something else.
if (_above) then // test if any surfaces above are from buildingPos
{
_surfacesAbove = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u,_u,true,100];
_above = false;
{
//diag_log format["_fn_isInside: _x-2 = %2 | typeOf _x = %3",_x,_x select 2,typeOf (_x select 2)];
if ((_x select 2) isKindOf _category) then {_above = true};
}forEach _surfacesAbove;
};
if (_below) then
{
_surfacesBelow = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 10],_u,_u,true,100];
_above = false;
{
//diag_log format["_fn_isInside: _x-2 = %2 | typeOf _x = %3",_x,_x select 2,typeOf (_x select 2)];
if ((_x select 2) isKindOf _category) then {_above = true};
}forEach _surfacesBelow;
};
_isInside = if (_above || _below) then {true} else {false};
//diag_log format["_fn_isInside: _isInside = %1",_isInside];
_isInside
};
_fn_buildingContainer = { // returns the builing containing an object or objNull
private["_u","_pos","_building","_surfacesAbove","_surfacesBelow"];
params["_u",["_category","House"]];
_pos = getPosASL _u;
private _building = objNull;
// lineIntersectsSurfaces [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2, returnUnique]
_surfacesAbove = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u,_u,true,10];
diag_log format["_surfacesAbove = %1",_surfacesAbove];
{
if ((_x select 2) isKindOf _category && !(_x isEqualTo _u)) exitWith {_building = (_x select 2)};
} forEach _surfacesAbove;
if (_building isEqualTo objNull) then
{
_surfacesBelow = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 10],_u,_u,true,100];
diag_log format["_surfacesBelow = %1",_surfacesBelow];
{
if ((_x select 2) isKindOf _category && !(_x isEqualTo _u)) exitWith {_building = (_x select 2)};
} forEach _surfacesBelow;
};
diag_log format["_fn_buildingContainer: _u = %1 | _building = %2",_u,_building];
_building
};
_fn_isInfantry = { // returns true if a unit is on foot otherwise returns false.
//////////////////////
// Determine if a unit isinfantry rather than a unit manning a turret or vehicle
//////////////////////
_u = _this select 0;
private _isInfantry = if ((_u isKindOf "Man") && (vehicle _u) isEqualTo _u) then {true} else {false};
//diag_log format["_fn_isInfantry: _isInfantry = %1",_isInfantry];
_isInfantry
};
diag_log "========== <START> ==========================";
///////////////////
// Define some values for our AI
// Change values of these variables to suit your needs
///////////////////
#define aiDifficulty "Red"
#define minAI 3
#define maxAI 6
#define minPatrolRadius 30
#define maxPatrolRadius 45
#define AI_respawnTime 600
#define aiVehiclePatrolRadius 75
#define vehiclePatrolRespawnTime 600
#define staticWeaponRespawnTime 600
#define aiAircraftPatrolRespawnTime 600
#define aiAircraftPatrolRadius 1700
#define oddsOfGarrison 0.67
#define maxGarrisonStatics 3
#define maxGarrisonUnits 4
#define typesGarrisonStatics [] // When empty a static will be randomly chosen from the defaults for blckeagls
#define garrisonMarkerObject "Sign_Sphere100cm_F" // This can be anything you like. I find this large sphere easy to see and convenient.
#define unitMarkerObject "Sign_Arrow_Direction_Green_F" // This can be anything. I chose this arrow type because it allows you to easily indicate direction.
#define objectAtMissionCenter "RoadCone_L_F"
#define lootVehicleMarker "Sign_Arrow_F"
#define landVehicles "LandVehicle"
///////////////////
// Define the coordinates of the center of the mission.
///////////////////
if (isNil "CENTER") then
{
CENTER = [0,0,0];
};
if (CENTER isEqualTo [0,0,0]) then
{
hint "Please define a center point for your mission";
_obj = allMissionObjects objectAtMissionCenter;
_obj1 = _obj select 0;
diag_log format["Determining position of first roadcone found which is located at %1 with player found at %2",getPos _obj1,position Player];
if (count _obj > 0) then
{
CENTER = [3,3,0] vectorAdd (getPosATL _obj1);
};
hint format["Position of Road Cone at %1 used to define mission center",CENTER];
diag_log format["Position of Road Cone at %1 used to define mission center",CENTER];
diag_log format["Player located at position %1",position player];
};
diag_log format["CENTER Set to %1",CENTER];
///////////////////
// Identify any buildings in which a garrison should be spawned using the Arma building positions.
// Tell the script which buildings to garrison by placing an object inside that designates them as such.
// I use a large yellow sphere for this purpose.
// The function below assembles a list of such buildings for use in defining the data for mission buildings.
///////////////////
_cb = "";
//////////////////
// *** OPTIONAL ****
// Place a marker over your mission and configure it as you would like to to appear in the tame.
// The marker configuration will be included in the output of this script.
// Note ** Only the first marker placed will be processed **
// Configure Marker
/////////////////
diag_log format["<< ---- pullDynamicMision: START %1 ---- >>",diag_tickTime];
////////////////////////
// Begin pulling data here
///////////////////////
_cb = _cb + format["_garrisonedBuildings_BuildingPosnSystem = [",endl];
private _garrisonedBuildings = [];
private _allStatics = [];
_helpers = allMissionObjects garrisonMarkerObject;
//diag_log format["_helpers = %1",_helpers];
{
if ( (typeOf _x) isEqualTo garrisonMarkerObject) then
{
private _isInside = [_x] call _fn_isInside;
if (_isInside) then
{
_building = [_x] call _fn_buildingContainer;
_garrisonedBuildings pushbackunique _building;
_garrisonedBuildings pushbackunique _x;
// data structure ["building Classname",[/*building pos*/],/*building dir*/,/*odds of garrison*/, /*Max Statics*/,/*types statics*/,/*max units*/],
// 1 2 3 4 5 6 7 8 9
_line = format[' ["%1",%2,%3,%4,%5,%6,%7,%8,%9]',typeOf _building,(getPosATL _building) vectorDiff CENTER,getDir _building, 'true','true',oddsOfGarrison,maxGarrisonStatics,typesGarrisonStatics,maxGarrisonUnits];
systemChat _line;
//diag_log _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
};
} forEach _helpers;
_cb = _cb + format["%1];%1%1",endl];
_logging = format["_garrisonedBuildings = %1",_garrisonedBuildings];
diag_log _logging;
systemChat _logging;
//diag_log format["_cb = %1%2",endl,_cb];
_configuredStatics = [];
_configuredStaticsPositions = [];
_configuredUnits = [];
/*
This bit will set up the garrison for each building having units and / or statics inside it or on top.
Coding must ensure that nothing is repeated but everything is captured.
*/
_fn_configureGarrisonForBuildingATL = {
private["_b","_staticsInBuilding","_unitsInBuilding","_staticsText","_unitsText","_buildingGarrisonATL","_staticsInBuilding","_unitsInBuilding","_count"];
_b = _this select 0;
_count = 0;
if (_b in _garrisonedBuildings) exitWith {""};
_staticsText = "";
_unitsText = "";
_buildingGarrisonATL = "";
_staticsInBuilding = nearestObjects[getPosATL _building,["StaticWeapon"],sizeOf (typeOf _building)];
{
if !(_x in _configuredStatics) then
{
_isInside = [_x] call _fn_isInside;
if (_isInside) then {_building = [_x] call _fn_buildingContainer};
if (_b isEqualTo _building) then
{
_configuredStatics pushBackUnique _x;
//_configuredStaticsPositions pushBack (getPosATL _x) vectorDiff CENTER;
if (_staticsText isEqualTo "") then
{
_staticsText = format['["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff (getPosATL _b),getDir _x];
} else {
_staticsText = _staticsText + format[',["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff (getPosATL _b),getDir _x];
};
};
};
} forEach _staticsInBuilding;
_unitsInBuilding = nearestObjects[getPosATL _building,[unitMarkerObject],sizeOf (typeOf _building)];
{
if !(_x in _configuredUnits) then
{
_isInside = [_x] call _fn_isInside;
if (_isInside) then {_building = [_x] call _fn_buildingContainer};
if (_b isEqualTo _building) then
{
_configuredUnits pushBackUnique _x;
if (_unitsText isEqualTo "") then
{
_unitsText = format["[%1,%2]",(getPosATL _x) vectorDiff (getPosATL _b),getDir _x];
} else {
_unitsText = _unitsText + format[",[%1,%2]",(getPosATL _x) vectorDiff (getPosATL _b),getDir _x];
};
_count = _count + 1;
};
};
} forEach _unitsInBuilding;
if ( !(_staticsText isEqualTo "") || !(_unitsText isEqualTo "")) then
{
_buildingGarrisonATL = format[' ["%1",%2,%3,%4,%5,[%6],[%7]]',typeOf _b,(getPosATL _b) vectorDiff CENTER,getDir _b,'true','true',_staticsText,_unitsText];
_garrisonedBuildings pushBackUnique _b;
};
_buildingGarrisonATL
};
private _count = 0;
_cb = _cb + "_garrisonedBuilding_ATLsystem = [";
{
private _isInside = [_x] call _fn_isInside;
if (_isInside) then
{
private _building = [_x] call _fn_buildingContainer;
private _include = if ( !(_building in _garrisonedBuildings) && !((typeOf _building) isEqualTo unitMarkerObject) && !((typeOf _building) isEqualTo garrisonMarkerObject)) then {true} else {false};
if (_include) then
{
//diag_log format["_x = %1 | _building = %1",_x,_building];
private _buildingGarrisonInformation = [_building] call _fn_configureGarrisonForBuildingATL;
diag_log format["_buildingGarrisonInformation = %1",_buildingGarrisonInformation];
if !(_buildingGarrisonInformation isEqualTo "") then
{
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_buildingGarrisonInformation];
} else {
_cb = _cb + format[",%1%2",endl,_buildingGarrisonInformation];
};
_count = _count + 1;
};
};
};
} forEach ((allMissionObjects "StaticWeapon") + (allMissionObjects "Man") + (allMissionObjects unitMarkerObject));
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configure info remaining mission landscape
///////////////////
_land = allMissionObjects "Static";
_count = 0;
_cb = _cb + format["_missionLandscape = [",endl];
{
diag_log format["evaluating mission landscape: _x = %1 | typeOf _x = %1",_x, typeOf _x];
//diag_log format["evaluating mission landscape: _x %1 | typeOf _x %1",_x, _x isKindOf "Helper_Base_F"];
if !(_x in _garrisonedBuildings && !((typeOf _x) isEqualTo unitMarkerObject) && !((typeOf _x) isEqualTo garrisonMarkerObject)) then
{
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
}forEach allMissionObjects "Static";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configure loot boxes
///////////////////
_cb = _cb + "_missionLootBoxes = [";
{
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _x,(getPosATL _x) vectorDiff CENTER, '_crateLoot','_lootCounts',getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
}forEach ((allMissionObjects "ReammoBox") + (allMissionObjects "ReammoBox_F"));
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup Info for loot vehicles
///////////////////
_missionLootVehicles = [];
_missionVehicles = ((allMissionObjects "Car") + (allMissionObjects "Tank") + allMissionObjects "Ship");
_lootVehicleMarkers = allMissionObjects lootVehicleMarker;
diag_log format["_lootVehicleMarkers = %1",_lootVehicleMarkers];
_cb = _cb + format["_missionLootVehicles = ["];
{
_kindOf = "nothing";
_isInside = [_x,"Car"] call _fn_isInside;
if (_isInside) then {_kindOf = "Car"};
if !(_isInside) then {_isInside = [_x,"Ship"] call _fn_isInside};
if (_isInside) then {_kindOf = "Ship"};
if (_isInside) then
{
_object = [_x,_kindOf] call _fn_buildingContainer;
diag_log format["object %1 is inside object %2",_x,_object];
_missionLootVehicles pushBack _object;
_line = format[' ["%1",%2,%3,%4,%5]',typeOf _object,(getPosATL _x) vectorDiff CENTER, '_crateLoot','_lootCounts',getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
} forEach allMissionObjects lootVehicleMarker;
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup Info for vehicle patrols
///////////////////
_cb = _cb + format["_missionPatrolVehicles = ["];
{
if ( !((typeOf _x) isKindOf "SDV_01_base_F") && !(_x in _missionLootVehicles) ) then
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
}forEach ((allMissionObjects "Car") + (allMissionObjects "Tank") + allMissionObjects "Ship");
_cb = _cb + format["%1];%1%1",endl];
_cb = _cb + "_submarinePatrolParameters = [";
{
if ((typeOf _x) isKindOf "SDV_01_base_F") then
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
}forEach allMissionObjects "Ship";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configs for Air Patrols
///////////////////
_cb = _cb + "_airPatrols = [";
//[selectRandom _aircraftTypes,[22830.2,16618.1,11.4549],"blue",1000,60]
{
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
}forEach allMissionObjects "Air";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup info for remaining static/emplaced weapons
///////////////////
_count = 0;
_cb = _cb + format["_missionEmplacedWeapons = ["];
{
//if !(_x in _configuredStatics) then
private _isInside = [_x] call _fn_isInside;
if !(_isInside) then
{
// ["B_HMG_01_high_F",[22883.5,16757.6,6.31652],"blue",0,10]
_line = format[' ["%1",%2,%3]',typeOf _x,(getPosATL _x) vectorDiff CENTER,getDir _x, 'true','true'];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
}forEach allMissionObjects "StaticWeapon";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup information for infantry groups spawning outside buildings
///////////////////
_cb = _cb + format["_missionGroups = ["];
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
_isInside = [_x] call _fn_isInside;
_isInfantry = [_x] call _fn_isInfantry;
//diag_log format["_missionGroups: _unit %1 | _isInside %2 _isInfantry %3",_x,_isInside,_isInfantry];
if (_isInfantry) then
{
if (!(surfaceIsWater (getPos _x)) && !(_isInside) && !(isPlayer _x)) then
{
_line = format[' [%1,%2,%3,"%4",%5,%6]',(getPosATL _x) vectorDiff CENTER,minAI,maxAI,aiDifficulty,minPatrolRadius,maxPatrolRadius];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
};
}forEach allMissionObjects "Man";
_cb = _cb + format["%1];%1%1",endl];
_cb = _cb + "_scubaGroupParameters = [";
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
_isInside = [_x] call _fn_isInside;
_isInfantry = [_x] call _fn_isInfantry;
//diag_log format["_missionGroups: _unit %1 | _isInside %2 _isInfantry %3",_x,_isInside,_isInfantry];
if (_isInfantry) then
{
if ((surfaceIsWater (getPos _x)) && !(_isInside) && !(isPlayer _x)) then
{
_line = format[' [%1,%2,%3,"%4",%5,%6]',(getPosATL _x) vectorDiff CENTER,minAI,maxAI,aiDifficulty,minPatrolRadius,maxPatrolRadius];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
};
}forEach allMissionObjects "Man";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// All done, notify the user and copy the output to the clipboard
///////////////////
_msg = "All Objects organzied, formated and copied to the Clipboard";
hint _msg;
systemChat _msg;
systemChat format["_cb has %1 characters",count _cb];
copyToClipboard _cb;
diag_log "DONE";

View File

@ -1,62 +0,0 @@
_cb = "";
//////////////////
// *** OPTIONAL ****
// Place a marker over your mission and configure it as you would like to to appear in the tame.
// The marker configuration will be included in the output of this script.
// Note ** Only the first marker placed will be processed **
// Configure Marker
/////////////////
/*
_markerType = ["ELIPSE",[175,175],"GRID"];
_markerType = ["mil_triangle",[0,0]];
*/
diag_log format["<< ---- START %1 ---- >>",diag_tickTime];
_allmkr = allMapMarkers;
diag_log format["_allmkr = %1",_allmkr];
if (count _allmkr == 0) then
//if !(typeName _mk isEqualTo "STRING") then
{
hint "No Marker Found, no Marker Definitions Will Be generated";
uiSleep 5;
} else {
_mk = _allmkr select 0;
diag_log format["_mk = %1",_mk];
systemChat format["marker shape = %1",markerShape _mk];
systemChat format["marker type = %1",markerType _mk];
systemChat format["marker size = %1",markerSize _mk];
systemChat format["markerColor = %1",markerColor _mk];
systemChat format["marker brush = %1",markerBrush _mk];
//systemChat
switch (toUpper(markerShape _mk)) do
{
case "ELLIPSE": {
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
};
case "RECTANGLE": {
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
};
case "ICON": {
_cb = _cb + format['_markerType = ["%1"];%2',getMarkerType _mk,endl];
};
};
_cb = _cb + format['_markerColor = "%1";%2',markerColor _mk,endl];
_cb = _cb + format['_markerLabel = "%1";%2',MarkerText _mk,endl];
_cb = _cb + format["%1%1",endl];
};
///////////////////
// All done, notify the user and copy the output to the clipboard
///////////////////
_msg = "Marker Data organzied, formated and copied to the Clipboard";
hint _msg;
systemChat _msg;
systemChat format["_cb has %1 characters",count _cb];
copyToClipboard _cb;
diag_log "DONE";

View File

@ -1 +0,0 @@
CENTER = getPos player;

View File

@ -1,81 +0,0 @@
/*
Mission Template by Ghostrider [GRG]
Mission Compositions by Bill prepared for ghostridergaming
Copyright 2016
Last modified 3/20/17
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\q\addons\custom_server\Configs\blck_defines.hpp";
#include "\q\addons\custom_server\Missions\privateVars.sqf";
//diag_log "[blckeagls] Spawning Green Mission with template = default";
_crateLoot = blck_BoxLoot_Green;
_lootCounts = blck_lootCountsGreen;
_startMsg = "An enemy research center was sighted in a nearby sector! Check the Green marker on your map for the location!";
_endMsg = "The Sector at the Green Marker is under survivor control!";
_markerMissionName = "Research Center";
_missionLandscapeMode = "precise"; // acceptable values are "none","random","precise"
//////////
// Past the output of the script here
//////////
// The lines below define additional variables you may wish to configure.
// Change _useMines to true/false below to enable mission-specific settings.
_useMines = blck_useMines;
_minNoAI = blck_MinAI_Green;
_maxNoAI = blck_MaxAI_Green;
_noAIGroups = blck_AIGrps_Green;
_noVehiclePatrols = blck_SpawnVeh_Green;
_noEmplacedWeapons = blck_SpawnEmplaced_Green;
_minNoAI = blck_MinAI_Blue; // Setting this in the mission file overrides the defaults such as blck_MinAI_Blue
_maxNoAI = blck_MaxAI_Blue; // Setting this in the mission file overrides the defaults
_noAIGroups = blck_AIGrps_Blue; // Setting this in the mission file overrides the defaults
_noVehiclePatrols = blck_SpawnVeh_Blue; // Setting this in the mission file overrides the defaults
_noEmplacedWeapons = blck_SpawnEmplaced_Blue; // Setting this in the mission file overrides the defaults
// Change _useMines to true/false below to enable mission-specific settings.
_useMines = blck_useMines; // Setting this in the mission file overrides the defaults
_uniforms = blck_SkinList; // Setting this in the mission file overrides the defaults
_headgear = blck_headgear; // Setting this in the mission file overrides the defaults
_vests = blck_vests;
_backpacks = blck_backpacks;
_weaponList = ["blue"] call blck_fnc_selectAILoadout;
_sideArms = blck_Pistols;
_chanceHeliPatrol = blck_chanceHeliPatrolBlue; // Setting this in the mission file overrides the defaults
_noChoppers = blck_noPatrolHelisBlue;
_missionHelis = blck_patrolHelisBlue;
_chancePara = blck_chanceParaBlue; // Setting this in the mission file overrides the defaults
_noPara = blck_noParaBlue; // Setting this in the mission file overrides the defaults
_paraTriggerDistance = 400; // Distance from mission at which a player triggers these reinforcements and any supplemental loot. // To have paras spawn at the time the mission spawns with/without accompanying loot set this to 0.
_paraSkill = "red"; // Choose any skill you like; bump up skill or add AI to justify more valuable loot.
_chanceLoot = 0.0;
_paraLoot = blck_BoxLoot_Blue;
_paraLootCounts = blck_lootCountsRed; // Throw in something more exotic than found at a normal blue mission.
_spawnCratesTiming = blck_spawnCratesTiming; // Choices: "atMissionSpawnGround","atMissionEndGround","atMissionEndAir".
// Crates spawned in the air will be spawned at mission center or the position(s) defined in the mission file and dropped under a parachute.
// This sets the default value but can be overridden by defining _spawnCrateTiming in the file defining a particular mission.
_loadCratesTiming = blck_loadCratesTiming; // valid choices are "atMissionCompletion" and "atMissionSpawn";
// Pertains only to crates spawned at mission spawn.
// This sets the default but can be overridden for specific missions by defining _loadCratesTiming
// Examples:
// To spawn crates at mission start loaded with gear set blck_spawnCratesTiming = "atMissionSpawnGround" && blck_loadCratesTiming = "atMissionSpawn"
// To spawn crates at mission start but load gear only after the mission is completed set blck_spawnCratesTiming = "atMissionSpawnGround" && blck_loadCratesTiming = "atMissionCompletion"
// To spawn crates on the ground at mission completion set blck_spawnCratesTiming = "atMissionEndGround" // Note that a loaded crate will be spawned.
// To spawn crates in the air and drop them by chutes set blck_spawnCratesTiming = "atMissionEndAir" // Note that a loaded crate will be spawned.
_endCondition = blck_missionEndCondition; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear"
// Setting this in the mission file overrides the defaults
//_timeOut = -1;
#include "\q\addons\custom_server\Compiles\Missions\GMS_fnc_missionSpawner.sqf";

View File

@ -1,38 +0,0 @@
You can spawn static missions over land or on water.
This can be done by laying out everything for your static mission in the editor,
then exporting the data from your mission using a simple script and a copy - paste - edit strategy.
My approach to doing this as follows:
1) Start the Eden Editor.
2) Lay out your static mission. You should:
[Optional] place a marker indicating where it will spawn (save your work)
Place all buldings, sandbags, etc (save your work)
Place any vehicle, navel, sub or air patrols - note that they will patrol using the postion at which you place them as the centerpoint of their patrol.
(save your work).
Place any static weapons. These can be outside, on top of or inside buildings.
(save your work).
Place a unit at each location you wish to have a group patrol OUTSIDE buildings. These will spawn as infantry on land and scuba units over water.
Place a unit inside buildings as appropriate.
Place some sort of ammo box, cardboard box, or other loot container if you wish to have one. You can have as many as you like.
Save your work.
** NOTES **
Uniforms, weapons and any other customization to units will not be preserved.
The defaults for blckeagls, or any specific definitions for _uniforms, _weapons, etc provided when the mission is spawned, will be used for these AI properties.
3) Export the mission data using the tools provided.
In the EDEN editor, go to tools\debug console
in the box type execVM "pullStaticMission.sqf";
Click 'local exec'
Hit Esc and wait for the script to run. You will see a notification in the lower left corner when it is done.
Alt-Tab out and past the output into your text editor.
Make a copy of the stati mission template.
Copy relevant information from the text you just grabbed with the clipboard to the template.
Make any edits or other adjustments needed.
Once you have done this, add the file to the custom_server\Missions\Static\missions directory then
add an entry for your static mission to GMS_StaticMissionLists.sqf

View File

@ -1,38 +0,0 @@
/*
for ghostridergaming
By Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#define GRGserver
#define useAPEX
//#define useDynamicSimulation
#define blck_debugMode
#define blck_triggerLoopCompleteTime 40*60
//#define blck_milServer
//#define GRG_TestServer
//#define blck_useCUP
//#define blck_useRHS
////////////////////////////
// Do not touch anything below this line
///////////////////////////
#define onFoot 1
#define inVehicle 2
// defines for static group spawners
#define staticPatrolTriggerRange 2000
#define groupParameters 0
#define patrolGroup 1
#define groupSpawned 2
#define timesSpawned 3
#define respawnAt 4

View File

@ -1,60 +0,0 @@
This tool formats most of the data required for STATIC missions based on what is present in your mission.
This include the layout of buildings, loot crates, markers, static weapons, and garrisons in buildings.
A minimal mission would include:
A marker. You may use any marker you like. The new pullMarker script will format scripting needed to spawn that marker at the center of your mission.
The mission system will spawn AI, loot chests, emplaced weapons, vehicles and aircraft according to the defaults for the mission difficulty.
The basic blckeagls static missions provided as examples have a bit more defined, usually some buildings to provide cover and make things more interesting.
I have added a new example mission, 'garrison.sqf', to illustrate technques you can use to tell the script which buildings to spawn AI in and where to spawn them.
Note that you can add more detail including defining where infantry and statics spawn, where the one or more loot crates spawn, where vehicle patrols spawn and so forth.
Loot crates, AI, static weapons or autonomous turrets can be spawned inside or on top of buildings. Even vehicles could be spawned on buildings in principle.
To do this just place the representative objects where you want the mission to spawn them and the script should do the rest.
For infantry patrols, put one unit where you want the group to spawn.
Note: uniforms, weapons and other AI gear are not captured. You can however define _uniforms, _weapons and other AI gear for that mission.
See the template and default2 missions for examples.
You can also have infantry and/or static weapons garrison buildings using either of two approaches.
1. place an object of type garrisonMarkerObject inside the building you want to garrison.
I use a 100 cm sphere which is the default because it is easy to see and not used for much else.
The script will ensure that this building is identified for a garrison which will be spawned at the Arma pre-defined buildingPositions.
You can define the number of infantry and statics to spawn in these buildings. Their positions should be different each time the garrison is spawned.
Just like the other static AI, garrisons respawn.
2. Manualy place statics and units inside buildings where you want them to spawn.
Infantry will change position (crouch, prone, stand) and turn but will not move which prevents their normal behavior to leave the buliding and look for players.
The position of statics (e.g., HMG, GMG) will be recorded accurately.
To tell the script where you want units, turrets (HMG or anything else in the turret category) just place the units where you want them.
This can include some of the new, autonomous turrets.
Once all that is done you are ready to pull the mission information.
To do that, from the EDEN Editor,
1. Preparation: copy all files from the tools\dynamicMissions\pullDynamicMissions folder into the folder containing the mission.sqm for your new mission.
Rename template.sqf to reflect the nature of your mission.
Open 'pullStaticMission.sqf' and check the preset definitions, all of which are set by #define.
Adjust these values as appropriate.
2. Pulling Marker data. Start Arma, and select Editor. Load your new mission in the editor and hit Play.
Using the mouse wheel, select pull marker data.
Alt-tab out and paste into the appropriate spot in your new mission.sqf.
3. Pulling all other mission data.
Return to the editor.
Select 'tools' with then 'debug console'.
A window will pop up with a zone toward the center in which you can enter text.
2. type execVM "pullDynamicMission.sqf"; in the box.
3. hit Local exec
4. hit Esc
5. The script should run as indicated by text appearing in the lower left corner of your screen.
6. When the text stops being updated, alt-tab out to your editor.
7. You can now copy/past from that output into the relevant sections of the dynamic mission template.
4. Final touchups.
The tools will pull all objects including any spheres, arrows or other aids.
Be sure to remove these or comment them out or they will show up in your final mission on your server.
Adjust the remaining settings in the template such as difficulty level to suit your needs.
Add the name of the mission to the list of missions to be spawned for that difficulty level.
Test everything to be sure

View File

@ -1,3 +0,0 @@
player addAction["Pull MARKER Info","pullMarkerInfo.sqf"];

View File

@ -1,60 +0,0 @@
_cb = "";
//////////////////
// *** OPTIONAL ****
// Place a marker over your mission and configure it as you would like to to appear in the tame.
// The marker configuration will be included in the output of this script.
// Note ** Only the first marker placed will be processed **
// Configure Marker
/////////////////
/*
_markerType = ["ELIPSE",[175,175],"GRID"];
_markerType = ["mil_triangle",[0,0]];
*/
diag_log format["<< ---- START %1 ---- >>",diag_tickTime];
_allmkr = allMapMarkers;
diag_log format["_allmkr = %1",_allmkr];
if (count _allmkr == 0) then
//if !(typeName _mk isEqualTo "STRING") then
{
hint "No Marker Found, no Marker Definitions Will Be generated";
uiSleep 5;
} else {
_mk = _allmkr select 0;
diag_log format["_mk = %1",_mk];
systemChat format["marker shape = %1",markerShape _mk];
systemChat format["marker type = %1",markerType _mk];
_cb = _cb + format['_missionCenter = %1;%2',MarkerPos _mk,endl];
//systemChat
switch (markerShape _mk) do
{
case "ELLIPSE": {
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
};
case "RECTANGLE": {
_cb = _cb + format['_markerType = ["%1",%2,"%3"];%4',toUpper(MarkerShape _mk),getMarkerSize _mk,toUpper(markerBrush _mk),endl];
};
case "ICON": {
_cb = _cb + format['_markerType = ["%1",[0,0]];%2',getMarkerType _mk,endl];
};
};
_cb = _cb + format['_markerColor = "%1";%2',markerColor _mk,endl];
_cb = _cb + format['_markerMissionName = "%1";%2',MarkerText _mk,endl];
_cb = _cb + format['_markerLabel = "%1";%2',"",endl];
_cb = _cb + format["%1%1",endl];
};
///////////////////
// All done, notify the user and copy the output to the clipboard
///////////////////
_msg = "Marker Data organzied, formated and copied to the Clipboard";
hint _msg;
systemChat _msg;
systemChat format["_cb has %1 characters",count _cb];
copyToClipboard _cb;
diag_log "DONE";

View File

@ -1,414 +0,0 @@
_fn_isInside = { // returns true if an object is inside, underneath or on top of a building otherwise returns false.
//////////////////////
// Determine if a unit is inside a building using two separate checkVisibility
//////////////////////
// lineIntersects [ eyePos player, aimPos chopper, player, chopper]
_u = _this select 0;
private ["_u","_pos","_above","_below"];
_pos = getPosASL _u;
_above = lineIntersects [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u];
_below = lineintersects [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 2],_u];
//diag_log format["_fn_isInside: _u %1 (%8)| typeOf _u %4 | _above %2 | _below %3 ",_u,_above,_below,typeOf _u];
// If there is something above or below the object do a quick double-check to make sure there is a building there and not something else.
if (_above) then // test if any surfaces above are from buildingPos
{
_surfacesAbove = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u,_u,true,100];
_above = false;
{
//diag_log format["_fn_isInside: _x-2 = %2 | typeOf _x = %3",_x,_x select 2,typeOf (_x select 2)];
if ((_x select 2) isKindOf "House") then {_above = true};
}forEach _surfacesAbove;
};
if (_below) then
{
_surfacesBelow = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 10],_u,_u,true,100];
_above = false;
{
//diag_log format["_fn_isInside: _x-2 = %2 | typeOf _x = %3",_x,_x select 2,typeOf (_x select 2)];
if ((_x select 2) isKindOf "House") then {_above = true};
}forEach _surfacesBelow;
};
_isInside = if (_above || _below) then {true} else {false};
//diag_log format["_fn_isInside: _isInside = %1",_isInside];
_isInside
};
_fn_buildingContainer = { // returns the builing containing an object or objNull
private["_u","_pos","_building","_surfacesAbove","_surfacesBelow"];
_u = _this select 0;
_pos = getPosASL _u;
private _building = objNull;
// lineIntersectsSurfaces [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2, returnUnique]
_surfacesAbove = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) + 100],_u,_u,true,10];
{
if ((_x select 2) isKindOf "House" && !(_x isEqualTo _u)) exitWith {_building = (_x select 2)};
} forEach _surfacesAbove;
if (_building isEqualTo objNull) then
{
_surfacesBelow = lineInterSectsSurfaces [_pos, [_pos select 0, _pos select 1, (_pos select 2) - 10],_u,_u,true,100];
{
if ((_x select 2) isKindOf "House" && !(_x isEqualTo _u)) exitWith {_building = (_x select 2)};
} forEach _surfacesBelow;
};
//diag_log format["_fn_buildingContainer: _u = %1 | _building = %2",_u,_building];
_building
};
_fn_isInfantry = { // returns true if a unit is on foot otherwise returns false.
//////////////////////
// Determine if a unit isinfantry rather than a unit manning a turret or vehicle
//////////////////////
_u = _this select 0;
private _isInfantry = if ((_u isKindOf "Man") && (vehicle _u) isEqualTo _u) then {true} else {false};
//diag_log format["_fn_isInfantry: _isInfantry = %1",_isInfantry];
_isInfantry
};
diag_log "========== <START> ==========================";
_msg = "starting script, please wait";
systemChat _msg;
hint _msg;
///////////////////
// Identify any buildings in which a garrison should be spawned using the Arma building positions.
// Tell the script which buildings to garrison by placing an object inside that designates them as such.
// I use a large yellow sphere for this purpose.
// The function below assembles a list of such buildings for use in defining the data for mission buildings.
///////////////////
private _cb = "";
///////////////////
// Change values of these constants to suit your needs
///////////////////
#define aiDifficulty "Red"
#define minAI 3
#define maxAI 6
#define patrolRadius 45
#define AI_respawnTime 600
#define AI_timesToRespawn -1
#define aiVehiclePatrolRadius 75
#define vehiclePatrolRespawnTime 600
#define vehiclePatrolTimesToRespawn -1
#define staticWeaponRespawnTime 600
#define staticWeaponTimesToRespawn -1
#define aiAircraftPatrolRespawnTime 600
#define aiAircraftPatrolRadius 1700
#define aircraftPatrolTimesToRespawn -1
#define oddsOfGarrison 0.67
#define maxGarrisonStatics 3
#define maxGarrisonUnits 4
#define typesGarrisonStatics [] // When empty a static will be randomly chosen from the defaults for blckeagls
#define garrisionsTimesToRespawn -1
#define garrisonMarkerObject "Sign_Sphere100cm_F" // This can be anything you like. I find this large sphere easy to see and convenient.
#define unitMarkerObject "Man" //"Sign_Arrow_Direction_Green_F" // This can be anything. I chose this arrow type because it allows you to easily indicate direction.
////////////////////////
// Begin pulling data here
///////////////////////
_cb = _cb + format["_garrisonedBuildings_BuildingPosnSystem = [",endl];
private _garrisonedBuildings = [];
_helpers = allMissionObjects garrisonMarkerObject;
//diag_log format["_helpers = %1",_helpers];
{
if ( (typeOf _x) isEqualTo garrisonMarkerObject) then
{
private _isInside = [_x] call _fn_isInside;
if (_isInside) then
{
_building = [_x] call _fn_buildingContainer;
_garrisonedBuildings pushbackunique _building;
_garrisonedBuildings pushbackunique _x;
// data structure ["building Classname",[/*building pos*/],/*building dir*/,/*odds of garrison*/, /*Max Statics*/,/*types statics*/,/*max units*/],
// 1 2 3 4 5 6 7 8 9 10 11 12 13
_line = format[' ["%1",%2,[%3,%4],[%5,%6],"%7",%8,%9,10,%11,%12,%13]',typeOf _building,getPosASL _building,vectorDir _building, vectorUp _building, 'true','true',aiDifficulty,oddsOfGarrison,maxGarrisonStatics,typesGarrisonStatics,maxGarrisonUnits,AI_respawnTime,garrisionsTimesToRespawn];
systemChat _line;
//diag_log _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
};
} forEach _helpers;
_cb = _cb + format["%1];%1%1",endl];
//diag_log format["line (165): _cb = %1",_cb];
_configuredStatics = [];
_configuredUnits = [];
_fn_configureGarrisonForBuildingASL = {
private["_b","_staticsInBuilding","_unitsInBuilding","_staticsText","_unitsText","_buildingGarrisonASL","_staticsInBuilding","_unitsInBuilding","_count"];
_b = _this select 0;
_count = 0;
if (_b in _garrisonedBuildings) exitWith {""};
_staticsText = "";
_unitsText = "";
_buildingGarrisonASL = "";
_staticsInBuilding = nearestObjects[getPosASL _building,["StaticWeapon"],sizeOf (typeOf _building)];
{
if !(_x in _configuredStatics) then
{
_isInside = [_x] call _fn_isInside;
if (_isInside) then {_building = [_x] call _fn_buildingContainer};
if (_b isEqualTo _building) then
{
_configuredStatics pushBackUnique _x;
if (_staticsText isEqualTo "") then
{
_staticsText = format['["%1",%2,%3]',typeOf _x,(getPosASL _x) vectorDiff (getPosASL _b),getDir _x];
} else {
_staticsText = _staticsText + format[',["%1",%2,%3]',typeOf _x,(getPosASL _x) vectorDiff (getPosASL _b),getDir _x];
};
};
};
} forEach _staticsInBuilding;
_unitsInBuilding = nearestObjects[getPosASL _building,[unitMarkerObject],sizeOf (typeOf _building)];
{
if !(_x in _configuredUnits) then
{
_isInside = [_x] call _fn_isInside;
if (_isInside) then {_building = [_x] call _fn_buildingContainer};
if (_b isEqualTo _building) then
{
_configuredUnits pushBackUnique _x;
if (_unitsText isEqualTo "") then
{
_unitsText = format["[%1,%2]",(getPosASL _x) vectorDiff (getPosASL _b),getDir _x];
} else {
_unitsText = _unitsText + format[",[%1,%2]",(getPosASL _x) vectorDiff (getPosASL _b),getDir _x];
};
_count = _count + 1;
};
};
} forEach _unitsInBuilding;
if ( !(_staticsText isEqualTo "") || !(_unitsText isEqualTo "")) then
{ // 1 2 3 4 5 6 7 8 9 10 11
_buildingGarrisonASL = format[' ["%1",%2,[%3,%4],[%5,%6],"%7",[%8],[%9],%10,%11]',typeOf _b,getPosASL _b,vectorDir _b,vectorUp _b,'true','true',aiDifficulty,_staticsText,_unitsText,AI_respawnTime,garrisionsTimesToRespawn];
_garrisonedBuildings pushBackUnique _b;
};
_buildingGarrisonASL
};
private _count = 0;
private _buildingCount = 0;
_cb = _cb + "_garrisonedBuilding_ASLsystem = [";
{
private _isInside = [_x] call _fn_isInside;
if (_isInside) then
{
private _building = [_x] call _fn_buildingContainer;
private _include = if ( !(_building in _garrisonedBuildings) && !((typeOf _building) isEqualTo unitMarkerObject) && !((typeOf _building) isEqualTo garrisonMarkerObject)) then {true} else {false};
if (_include) then
{
//diag_log format["building info for garrisonedBuilding_ATL: _x = %1 | _building = %1",_x,_building];
private _buildingGarrisonInformation = [_building] call _fn_configureGarrisonForBuildingASL;
//diag_log format["_buildingGarrisonInformation(ATL) = %1",_buildingGarrisonInformation];
//diag_log format["_buildingGarrisonInformation(ATL) = %1",_buildingGarrisonInformation];
//diag_log format["typeName _buildingGarrisonInformation(ATL) = %1",typeName _buildingGarrisonInformation];
//if (typeName _buildingGarrisonInformation isEqualTo "STRING") then
//{
//diag_log format["length _buildingGarrisonInformation(ATL) = %1",count (toArray(_buildingGarrisonInformation))];
//};
private _strLength = count(toArray(_buildingGarrisonInformation));
if (_strLength > 0) then
{
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_buildingGarrisonInformation];
} else {
_cb = _cb + format[",%1%2",endl,_buildingGarrisonInformation];
};
_count = _count + 1;
};
};
};
} forEach ((allMissionObjects "StaticWeapon") + (allMissionObjects unitMarkerObject));
_cb = _cb + format["%1];%1%1",endl];
diag_log format["line (227): _cb = %1",_cb];
uiSleep 1;
///////////////////
// Configure info remaining mission landscape
///////////////////
_land = allMissionObjects "Static";
_count = 0;
_cb = _cb + format["_missionLandscape = [",endl];
{
diag_log format["evaluating mission landscape: _x = %1 | typeOf _x = %1",_x, typeOf _x];
//diag_log format["evaluating mission landscape: _x %1 | typeOf _x %1",_x, _x isKindOf "Helper_Base_F"];
if !(_x in _garrisonedBuildings && !((typeOf _x) isEqualTo unitMarkerObject) && !((typeOf _x) isEqualTo garrisonMarkerObject)) then
{
_line = format[' ["%1",%2,[%3,%4],[%5,%6]]',typeOf _x,getPosASL _x,vectorDir _x, vectorUp _x, 'true','true'];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
}forEach allMissionObjects "Static";
_cb = _cb + format["%1];%1%1",endl];
diag_log format["line (276): _cb = %1",_cb];
///////////////////
// Setup information for any remaining infantry groups
///////////////////
_count = 0;
_cb = _cb + format["_aiGroupParameters = ["];
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
_isInside = [_x] call _fn_isInside;
_isInfantry = [_x] call _fn_isInfantry;
diag_log format["_missionGroups: _unit %1 | _isInside %2 _isInfantry %3",_x,_isInside,_isInfantry];
if (_isInfantry) then
{
if (!(surfaceIsWater (getPos _x)) && !(_isInside) && !(isPlayer _x) && !(_x in _configuredUnits)) then
{ // 1 2 3 4 5 6 7
_line = format[' [%1,"%2",[%3,%4],%5,%6,%7]',getPosASL _x,aiDifficulty,minAI,maxAI,patrolRadius,AI_respawnTime,AI_timesToRespawn];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
};
}forEach allMissionObjects "Man";
_cb = _cb + format["%1];%1%1",endl];
diag_log format["line (303): _cb = %1",_cb];
_count = 0;
_cb = _cb+ format["_aiScubaGroupParameters = ["];
{
//[[22920.4,16887.3,3.19144],"red",[1,2], 75,120],
if (surfaceIsWater (getPos _x)) then
{ // 1 2 3 4 5 6 7
_line = format[' [%1,"%2",[%3,%4],%5,%6,%7]',getPosASL _x,aiDifficulty,minAI,maxAI,patrolRadius,AI_respawnTime,AI_timesToRespawn];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
}forEach allMissionObjects "Man";
_cb = _cb + format["%1];%1%1",endl];
diag_log format["line (321)): _cb = %1",_cb];
///////////////////
// Setup Info for vehicle patrols
///////////////////
_cb = _cb + format["_vehiclePatrolParameters = ["];
{
if !((typeOf _x) isKindOf "SDV_01_base_F") then
{
_line = format[' ["%1",%2,"%3",%4,%5,%6]',typeOf _x, getPosASL _x, aiDifficulty,aiVehiclePatrolRadius,vehiclePatrolRespawnTime,vehiclePatrolTimesToRespawn]; //["B_G_Offroad_01_armed_F",[22809.5,16699.2,0],"blue",600,10]
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
}forEach ((allMissionObjects "Car") + (allMissionObjects "Tank") + allMissionObjects "Ship");
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Configs for Air Patrols
///////////////////
_cb = _cb + "_airPatrols = [";
//[selectRandom _aircraftTypes,[22830.2,16618.1,11.4549],"blue",1000,60]
{
_line = format[' ["%1",%2,"%3",%4,%5,%6]',typeOf _x, getPosASL _x, aiDifficulty,aiAircraftPatrolRadius,aiAircraftPatrolRespawnTime,aircraftPatrolTimesToRespawn];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
}forEach allMissionObjects "Air";
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// Setup info for static/emplaced weapons
///////////////////
_count = 0;
_cb = _cb + format["_missionEmplacedWeapons = ["];
{
if !(_x in _configuredStatics) then
{
// ["B_HMG_01_high_F",[22883.5,16757.6,6.31652],"blue",0,10]
// 1 2 3 4 5 6
_line = format[' ["%1",%2,"%3",%4,%5,%6]',typeOf _x,getPosASL _x,aiDifficulty,0,staticWeaponRespawnTime,staticWeaponTimesToRespawn];
systemChat _line;
if (_count == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
_count = _count + 1;
};
}forEach allMissionObjects "StaticWeapon";
_cb = _cb + format["%1];%1%1",endl];
_cb = _cb + "_submarinePatrolParameters = [";
{
if ((typeOf _x) isKindOf "SDV_01_base_F") then
{ // 1 2 3 4 5 6
_line = format[' ["%1",%2,"%3",%4,%5,%6]',typeOf _x, getPosASL _x, aiDifficulty,aiSubmarinePatrolRadius,vehicleSubmarineRespawnTime,vehiclePatrolTimesToRespawn]; //["B_G_Offroad_01_armed_F",[22809.5,16699.2,0],"blue",600,10]
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
};
}forEach allMissionObjects "Ship";
_cb = _cb + format["%1];%1%1",endl];
_cb = _cb + "_missionLootBoxes = [";
{
// [selectRandom blck_crateTypes,[22904.8,16742.5,6.30195],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts]
_line = format[' ["%1",%2,%3,[true,false],_crateLoot,_lootCounts]',typeOf _x,getPosASL _x,[VectorDir _x, VectorUp _x]];
systemChat _line;
if (_forEachIndex == 0) then
{
_cb = _cb + format["%1%2",endl,_line];
} else {
_cb = _cb + format[",%1%2",endl,_line];
};
}forEach (allMissionObjects "ReammoBox") + (allMissionObjects "ReammoBox_F");
_cb = _cb + format["%1];%1%1",endl];
///////////////////
// All done, notify the user and copy the output to the clipboard
///////////////////
_msg = "All Objects organzied, formated and copied to the Clipboard";
hint _msg;
systemChat _msg;
systemChat format["_cb has %1 characters",count _cb];
copyToClipboard _cb;
//if (true) exitWith{diag_log _cb};

View File

@ -1,97 +0,0 @@
/*
This is a simple mission using precisely placed loot crates and infantry, static weapons and vehicle patrols.
See the accompanying example mission in the exampleMission folder to get an idea how I laid this out.
Note that I exported the mission using the exportAll function of M3EDEN editor.
*/
#include "privateVars.sqf";
_mission = "static mission template"; // Included for additional documentation. Not intended to be spawned as a mission per se.
_difficulty = "red"; // Skill level of AI (blue, red, green etc)
diag_log format["[blckeagls static missions] STARTED initializing middions %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty];
_crateLoot = blck_BoxLoot_Orange; // You can use a customized _crateLoot configuration by defining an array here. It must follow the following format shown for a hypothetical loot array called _customLootArray
/*
_customLootArray =
// Loot is grouped as [weapons],[magazines],[items] in order to be able to use the correct function to load the item into the crate later on.
// Each item consist of the following information ["ItemName",minNum, maxNum] where min is the smallest number added and min+max is the largest number added.
[
[// Weapons
["srifle_DMR_06_olive_F","20Rnd_762x51_Mag"]
],
[//Magazines
["10Rnd_93x64_DMR_05_Mag" ,1,5]
],
[ // Optics
["optic_KHS_tan",1,3]
],
[// Materials and supplies
["Exile_Item_MetalScrews",3,10]
//
],
[//Items
["Exile_Item_MountainDupe",1,3]
],
[ // Backpacks
["B_OutdoorPack_tan",1,2]
]
];
*/
_lootCounts = blck_lootCountsRed; // You can use a customized set of loot counts or one that is predefined but it must follow the following format:
// values are: number of things from the weapons, magazines, optics, materials(cinder etc), items (food etc) and backpacks arrays to add, respectively.
// blck_lootCountsOrange = [[6,8],[24,32],[5,10],[25,35],16,1]; // Orange
/****************************************************
PLACE MARKER DEFINITIONS PULLED FROM YOUR MISSION BELOW
*****************************************************/
/****************************************************
PLACE THE DATA DEFININING THE BUILDINGS, VEHICLES ETC. PULLED FROM YOUR MISSION BELOW
*****************************************************/
/****************************************************
ENABLE ANY SETTINGS YOU LIKE FROM THE LIST BELOW.
iF THESE ARE NOT ENABLED THEN THE DEFAULTS DEFINED IN BLCK_CONFIG.SQF
AND THE MOD-SPECIFIC CONFIGURATIONS WILL BE USED.
*****************************************************/
/*
_missionLandscapeMode = "precise"; // acceptable values are "random","precise"
// In precise mode objects will be spawned at the relative positions specified.
// In the random mode, objects will be randomly spawned within the mission area.
_aircraftTypes = blck_patrolHelisRed; // You can use one of the pre-defined lists in blck_configs or your own custom array.
_noAirPatrols = blck_noPatrolHelisRed; // You can use one of the pre-defined values or a custom one. acceptable values are integers (1,2,3) or a range such as [2,4];
// Note: this value is ignored if you specify air patrols in the array below.
// Change _useMines to true/false below to enable mission-specific settings.
_useMines = blck_useMines; // Set to false if you have vehicles patrolling nearby.
_uniforms = blck_SkinList; // You can replace this list with a custom list of uniforms if you like.
_headgear = blck_headgear; // You can replace this list with a custom list of headgear.
_vests = blck_vests; // You can replace this list with a custom list of vests.
_backpacks = blck_backpacks; // You can replace this list with a custom list of backpacks.
_weapons = blck_WeaponList_Orange; // You can replace this list with a customized list of weapons, or another predifined list from blck_configs_epoch or blck_configs_exile as appropriate.
_sideArms = blck_pistols; // You can replace this list with a custom list of sidearms.
*/
//********************************************************
// Do not modify anything below this line.
//********************************************************
#include "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_initializeMission.sqf";
diag_log format["[blckeagls static missions] COMPLETED initializing middions %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty];