mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 11:42:38 +03:00
public release of loot position tool 0.1
This commit is contained in:
145
Tools/Loot Position/MakeLootPos.Chernarus/Make_lootPos.sqf
Normal file
145
Tools/Loot Position/MakeLootPos.Chernarus/Make_lootPos.sqf
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
Get Loot Position
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_target","_type","_ppos","_veh","_worldPos","_zheightChanged","_pos","_tagColor","_new"];
|
||||
|
||||
_new = (_this select 3) select 0;
|
||||
|
||||
if (isNil "Base_Z_height") then {
|
||||
Base_Z_height = 0.5;
|
||||
};
|
||||
|
||||
if(_new == "select") then {
|
||||
if(!isnull(cursortarget)) then {
|
||||
DZE_target = cursortarget;
|
||||
hintsilent str(typeOf DZE_target);
|
||||
};
|
||||
};
|
||||
|
||||
if(_new == "generateloot") then {
|
||||
|
||||
if(!isnull(cursortarget)) then {
|
||||
DZE_target = cursortarget;
|
||||
hintsilent str(typeOf DZE_target);
|
||||
};
|
||||
|
||||
_type = toLower(typeOf DZE_target);
|
||||
|
||||
//diag_log format["Spawning loot for: %1", _type];
|
||||
_config = configFile >> "CfgBuildingLoot" >> _type;
|
||||
_positions = [] + getArray (_config >> "lootPos");
|
||||
{
|
||||
|
||||
_iPos = DZE_target modelToWorld _x;
|
||||
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
|
||||
if (count _nearBy == 0) then {
|
||||
|
||||
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], 0.0, "CAN_COLLIDE"];
|
||||
_item addMagazineCargoGlobal ["CinderBlocks",1];
|
||||
if ((count _iPos) > 2) then
|
||||
{
|
||||
_item setPosATL _iPos;
|
||||
};
|
||||
|
||||
} else {
|
||||
diag_log format["position too close: %1", _iPos];
|
||||
};
|
||||
|
||||
} forEach _positions;
|
||||
|
||||
_positionsSmall = [] + getArray (_config >> "lootPosSmall");
|
||||
{
|
||||
_iPos = DZE_target modelToWorld _x;
|
||||
_nearBy = nearestObjects [_iPos, ["ReammoBox","WeaponHolder","WeaponHolderBase"], 1];
|
||||
if (count _nearBy == 0) then {
|
||||
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], 0.0, "CAN_COLLIDE"];
|
||||
_item addMagazineCargoGlobal ["ItemPainkiller",1]; //ItemDocument
|
||||
if ((count _iPos) > 2) then
|
||||
{
|
||||
_item setPosATL _iPos;
|
||||
};
|
||||
|
||||
} else {
|
||||
diag_log format["position too close: %1", _iPos];
|
||||
};
|
||||
|
||||
} forEach _positionsSmall;
|
||||
|
||||
_positionsZombie = [] + getArray (_config >> "lootPosZombie");
|
||||
{
|
||||
_iPos = DZE_target modelToWorld _x;
|
||||
|
||||
_veh = createVehicle ["Sign_sphere10cm_EP1", _iPos, [], 0, "CAN_COLLIDE"];
|
||||
_veh setPosATL _iPos;
|
||||
_tagColor = "#(argb,8,8,3)color(0,1,0,0.5,ca)";
|
||||
_veh setobjecttexture [0,_tagColor];
|
||||
|
||||
} forEach _positionsZombie;
|
||||
|
||||
};
|
||||
|
||||
|
||||
if (isnil "DZE_target") then {
|
||||
_target = nearestObject [player, "Building"];
|
||||
} else {
|
||||
_target = DZE_target;
|
||||
};
|
||||
|
||||
_type = toLower(typeOf _target);
|
||||
|
||||
_zheightChanged = false;
|
||||
|
||||
switch (_new) do
|
||||
{
|
||||
case "up": {Base_Z_height = Base_Z_height + 0.1; _zheightChanged = true;};
|
||||
case "down": {Base_Z_height = Base_Z_height - 0.1; _zheightChanged = true;};
|
||||
case "up_small": {Base_Z_height = Base_Z_height + 0.01; _zheightChanged = true;};
|
||||
case "down_small": {Base_Z_height = Base_Z_height - 0.01; _zheightChanged = true;};
|
||||
};
|
||||
|
||||
_pos = player modeltoworld [0,1.5,Base_Z_height];
|
||||
|
||||
if(_new == "tagzspawn") then {
|
||||
_pos = player modeltoworld [0,0,0.875];
|
||||
};
|
||||
|
||||
_ppos = _target worldToModel _pos;
|
||||
_worldPos = _pos;
|
||||
|
||||
if (isnil "DZE_vehTarget") then {
|
||||
DZE_vehTarget = createVehicle ["Sign_arrow_down_EP1", _worldPos, [], 0, "CAN_COLLIDE"];
|
||||
DZE_vehTarget setPosATL _worldPos;
|
||||
DZE_vehTarget attachto [player];
|
||||
};
|
||||
|
||||
if (!isnull(DZE_vehTarget) and _zheightChanged) then {
|
||||
detach DZE_vehTarget;
|
||||
DZE_vehTarget setPosATL _worldPos;
|
||||
DZE_vehTarget attachto [player];
|
||||
};
|
||||
|
||||
if(_new == "tagzspawn") then {
|
||||
_veh = createVehicle ["Sign_sphere10cm_EP1", _worldPos, [], 0, "CAN_COLLIDE"];
|
||||
_veh setPosATL _worldPos;
|
||||
_tagColor = "#(argb,8,8,3)color(0,1,0,0.5,ca)";
|
||||
_veh setobjecttexture [0,_tagColor];
|
||||
};
|
||||
|
||||
if(_new == "tag" or _new == "tagpile") then {
|
||||
_veh = createVehicle ["Sign_arrow_down_EP1", _worldPos, [], 0, "CAN_COLLIDE"];
|
||||
_veh setPosATL _worldPos;
|
||||
};
|
||||
|
||||
if(_new == "tagpile") then {
|
||||
_tagColor = "#(argb,8,8,3)color(0,0,1,0.5,ca)";
|
||||
_veh setobjecttexture [0,_tagColor];
|
||||
};
|
||||
|
||||
if(_new == "tag" or _new == "tagzspawn" or _new == "tagpile") then {
|
||||
diag_log text format ["%1 : %2 | %3", _type,_ppos,_new];
|
||||
copyToClipboard format ["%1 : %2", _type,_ppos];
|
||||
hintsilent format ["SAVED %1\n%2", _type,_ppos];
|
||||
};
|
||||
1
Tools/Loot Position/MakeLootPos.Chernarus/init.sqf
Normal file
1
Tools/Loot Position/MakeLootPos.Chernarus/init.sqf
Normal file
@@ -0,0 +1 @@
|
||||
waituntil {!isnil "bis_fnc_init"};
|
||||
162
Tools/Loot Position/MakeLootPos.Chernarus/mission.sqm
Normal file
162
Tools/Loot Position/MakeLootPos.Chernarus/mission.sqm
Normal file
@@ -0,0 +1,162 @@
|
||||
version=11;
|
||||
class Mission
|
||||
{
|
||||
addOns[]=
|
||||
{
|
||||
"cacharacters2",
|
||||
"chernarus",
|
||||
"camisc_e",
|
||||
"CAMisc",
|
||||
"camisc3",
|
||||
"ca_modules_functions"
|
||||
};
|
||||
addOnsAuto[]=
|
||||
{
|
||||
"cacharacters2",
|
||||
"ca_modules_functions",
|
||||
"camisc_e",
|
||||
"camisc3",
|
||||
"chernarus"
|
||||
};
|
||||
randomSeed=5820454;
|
||||
class Intel
|
||||
{
|
||||
startWeather=0.1;
|
||||
forecastWeather=0.40000001;
|
||||
year=2010;
|
||||
month=8;
|
||||
day=5;
|
||||
hour=10;
|
||||
minute=0;
|
||||
};
|
||||
class Groups
|
||||
{
|
||||
items=2;
|
||||
class Item0
|
||||
{
|
||||
side="WEST";
|
||||
class Vehicles
|
||||
{
|
||||
items=1;
|
||||
class Item0
|
||||
{
|
||||
position[]={10387.202,5.8848143,2216.1106};
|
||||
azimut=-365.923;
|
||||
id=0;
|
||||
side="WEST";
|
||||
vehicle="USMC_Soldier_AR";
|
||||
player="PLAYER COMMANDER";
|
||||
leader=1;
|
||||
skill=0.60000002;
|
||||
init="this addAction [""Select Target"", ""Make_lootPos.sqf"", [""select""], 99];this addAction [""Tag Pos"", ""Make_lootPos.sqf"", [""tag""], 99];this addAction [""Tag zPos"", ""Make_lootPos.sqf"", [""tagzspawn""], 99];this addAction [""Tag Pile Pos"", ""Make_lootPos.sqf"", [""tagpile""], 99];this addAction [""Raise Z .1"", ""Make_lootPos.sqf"", [""up""], 99, false,false,""User17""];this addAction [""Lower Z .1"", ""Make_lootPos.sqf"", [""down""], 99,false,false,""User18""];this addAction [""Raise Z .01"", ""Make_lootPos.sqf"", [""up_small""], 99, false,false,""User19""];this addAction [""Lower Z .01"", ""Make_lootPos.sqf"", [""down_small""], 99, false,false,""User20""];this addAction [""Generate Loot"", ""Make_lootPos.sqf"", [""generateloot""], 99];";
|
||||
};
|
||||
};
|
||||
};
|
||||
class Item1
|
||||
{
|
||||
side="LOGIC";
|
||||
class Vehicles
|
||||
{
|
||||
items=1;
|
||||
class Item0
|
||||
{
|
||||
position[]={12856.193,45.676922,6778.9507};
|
||||
id=3;
|
||||
side="LOGIC";
|
||||
vehicle="FunctionsManager";
|
||||
leader=1;
|
||||
lock="UNLOCKED";
|
||||
skill=0.60000002;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class Vehicles
|
||||
{
|
||||
items=2;
|
||||
class Item0
|
||||
{
|
||||
position[]={10538.346,9.8015976,2129.0706};
|
||||
azimut=43.812595;
|
||||
id=1;
|
||||
side="EMPTY";
|
||||
vehicle="Fort_Barricade_EP1";
|
||||
skill=0.60000002;
|
||||
};
|
||||
class Item1
|
||||
{
|
||||
position[]={10541.759,11.417732,2132.6858};
|
||||
azimut=40.766392;
|
||||
id=2;
|
||||
side="EMPTY";
|
||||
vehicle="Fort_Barricade";
|
||||
skill=0.60000002;
|
||||
};
|
||||
};
|
||||
};
|
||||
class Intro
|
||||
{
|
||||
addOns[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
addOnsAuto[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
randomSeed=4134615;
|
||||
class Intel
|
||||
{
|
||||
startWeather=0.1;
|
||||
forecastWeather=0.40000001;
|
||||
year=2010;
|
||||
month=8;
|
||||
day=5;
|
||||
hour=10;
|
||||
minute=0;
|
||||
};
|
||||
};
|
||||
class OutroWin
|
||||
{
|
||||
addOns[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
addOnsAuto[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
randomSeed=5967799;
|
||||
class Intel
|
||||
{
|
||||
startWeather=0.1;
|
||||
forecastWeather=0.40000001;
|
||||
year=2010;
|
||||
month=8;
|
||||
day=5;
|
||||
hour=10;
|
||||
minute=0;
|
||||
};
|
||||
};
|
||||
class OutroLoose
|
||||
{
|
||||
addOns[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
addOnsAuto[]=
|
||||
{
|
||||
"chernarus"
|
||||
};
|
||||
randomSeed=390956;
|
||||
class Intel
|
||||
{
|
||||
startWeather=0.1;
|
||||
forecastWeather=0.40000001;
|
||||
year=2010;
|
||||
month=8;
|
||||
day=5;
|
||||
hour=10;
|
||||
minute=0;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user