Jump to content
  • 0
Sign in to follow this  
Cyrus

Issue spawning custom crates at static AI position.

Question

I have a custom base set up at North West Airfield running Epoch 1.0.6.2 Chernarus. Im trying to spawn a custom loot crate called CustomLootCrate.sqf and it doesn't spawn as expected regardless if I am loading it via []exeVM " custom\CustomLootCrate.sqf"; in the init.sqf or using execVM "\z\addons\dayz_server\custom_crates\CustomLootCrate.sqf"; in the server_functions.sqf suggested elsewhere on these forums. I need some help from an experienced modder please. My CustomLootCrate.sqf is as follows: 

Spoiler
if (isServer) then {
        _vehicle_9090 = objNull;
        if (true) then
        {
          _this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, -339], [], 0, "CAN_COLLIDE"];
          _vehicle_9090 = _this;
          _this setDir -182.5;
                  _vehicle_9090 setVariable ["ObjectID","1",true];
                  _vehicle_9090 setVariable ["permaLoot",true];

          clearWeaponCargoGlobal _this;
          clearMagazineCargoGlobal _this;

          
          _this addWeaponCargoGlobal ["BAF_AS50_scoped",2];
          _this addWeaponCargoGlobal ["M107_DZ",2];
          _this addWeaponCargoGlobal ["BAF_LRR_scoped",2];
          _this addWeaponCargoGlobal ["USSR_cheytacM200",2];
          _this addWeaponCargoGlobal ["USSR_cheytacM200_sd",2];
          _this addWeaponCargoGlobal ["vil_M110",2];
          _this addWeaponCargoGlobal ["vil_M110sd",2];
          _this addWeaponCargoGlobal ["M110_NVG_EP1",2];
          _this addWeaponCargoGlobal ["M110_TWS_EP1",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_SD_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_NV_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_NV_SD_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_TWS_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_TWS_SD_DESERT",2];

         
          _this addMagazineCargoGlobal ["5Rnd_127x99_AS50",20];
          _this addMagazineCargoGlobal ["10Rnd_127x99_m107",20];
          _this addMagazineCargoGlobal ["5Rnd_86x70_L115A1",20];
          _this addMagazineCargoGlobal ["USSR_5Rnd_408",20];
          _this addMagazineCargoGlobal ["20Rnd_762x51_DMR",20];
          _this addMagazineCargoGlobal ["FHQ_rem_5Rnd_300Win_XM2010_NT",20];
          _this addMagazineCargoGlobal ["FHQ_rem_5Rnd_300Win_XM2010_NT_SD",20];

          
          _this addWeaponCargoGlobal ["ItemToolbox",5];
          _this addWeaponCargoGlobal ["ItemCrowbar",5];
          _this addWeaponCargoGlobal ["ItemEtool",5];
          _this addWeaponCargoGlobal ["ChainSawR",1];
          _this addWeaponCargoGlobal ["ChainSawP",1];
          _this addWeaponCargoGlobal ["ChainSawG",1];
          _this addWeaponCargoGlobal ["ChainSawB",1];

        
          _this addMagazineCargoGlobal ["ItemMixOil",2];
          _this addMagazineCargoGlobal ["ItemLockbox",2];
          _this addMagazineCargoGlobal ["ItemComboLock",2];
          _this addMagazineCargoGlobal ["ItemGenerator",3];
          _this addMagazineCargoGlobal ["ItemVault",2];
          _this addMagazineCargoGlobal ["ItemCorrugated",20];
          _this addMagazineCargoGlobal ["30m_plot_kit",2];
          _this addMagazineCargoGlobal ["ItemWire",10];
          _this addMagazineCargoGlobal ["ItemTankTrap",10];
          _this addMagazineCargoGlobal ["ItemSandbag",10];
          _this addMagazineCargoGlobal ["CinderBlocks",40];
          _this addMagazineCargoGlobal ["MortarBucket",20];
  
          
          _this addMagazineCargoGlobal ["ItemBloodbag",5];
          _this addMagazineCargoGlobal ["ItemEpinephrine",5];
          _this addMagazineCargoGlobal ["ItemMorphine",5];
          _this addMagazineCargoGlobal ["ItemPainkiller",5];
          _this addMagazineCargoGlobal ["ItemAntibiotic",5];
          _this addMagazineCargoGlobal ["ItemBandage",5];
          _this addMagazineCargoGlobal ["ItemSeaBassCooked",10];
          _this addMagazineCargoGlobal ["ItemTunaCooked",10];
          _this addMagazineCargoGlobal ["ItemSodaR4z0r",5];
          _this addMagazineCargoGlobal ["ItemSodaMdew",5];
          _this addMagazineCargoGlobal ["ItemSodaOrangeSherbet",5];
          _this addMagazineCargoGlobal ["ItemSodaRbull",5];
          _this addMagazineCargoGlobal ["PartEngine",5];
          _this addMagazineCargoGlobal ["PartVRotor",5];
          _this addMagazineCargoGlobal ["PartGlass",5];
          _this addMagazineCargoGlobal ["PartWheel",5];
          _this addMagazineCargoGlobal ["PartGeneric",5];
          _this addMagazineCargoGlobal ["ItemJerrycan",5];
		  _this setPos [4434.3223, 10632.069, -339];
 
        };
};

The x,y,z position i got from using the editor and placing a marker in the middle of the custom base i created.

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
14 minutes ago, Cyrus said:

I have a custom base set up at North West Airfield running Epoch 1.0.6.2 Chernarus. Im trying to spawn a custom loot crate called CustomLootCrate.sqf and it doesn't spawn as expected regardless if I am loading it via []exeVM " custom\CustomLootCrate.sqf"; in the init.sqf or using execVM "\z\addons\dayz_server\custom_crates\CustomLootCrate.sqf"; in the server_functions.sqf suggested elsewhere on these forums. I need some help from an experienced modder please. My CustomLootCrate.sqf is as follows: 

  Reveal hidden contents

if (isServer) then {
        _vehicle_9090 = objNull;
        if (true) then
        {
          _this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, -339], [], 0, "CAN_COLLIDE"];
          _vehicle_9090 = _this;
          _this setDir -182.5;
                  _vehicle_9090 setVariable ["ObjectID","1",true];
                  _vehicle_9090 setVariable ["permaLoot",true];

          clearWeaponCargoGlobal _this;
          clearMagazineCargoGlobal _this;

          
          _this addWeaponCargoGlobal ["BAF_AS50_scoped",2];
          _this addWeaponCargoGlobal ["M107_DZ",2];
          _this addWeaponCargoGlobal ["BAF_LRR_scoped",2];
          _this addWeaponCargoGlobal ["USSR_cheytacM200",2];
          _this addWeaponCargoGlobal ["USSR_cheytacM200_sd",2];
          _this addWeaponCargoGlobal ["vil_M110",2];
          _this addWeaponCargoGlobal ["vil_M110sd",2];
          _this addWeaponCargoGlobal ["M110_NVG_EP1",2];
          _this addWeaponCargoGlobal ["M110_TWS_EP1",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_SD_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_NV_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_NV_SD_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_TWS_DESERT",2];
          _this addWeaponCargoGlobal ["FHQ_XM2010_TWS_SD_DESERT",2];

         
          _this addMagazineCargoGlobal ["5Rnd_127x99_AS50",20];
          _this addMagazineCargoGlobal ["10Rnd_127x99_m107",20];
          _this addMagazineCargoGlobal ["5Rnd_86x70_L115A1",20];
          _this addMagazineCargoGlobal ["USSR_5Rnd_408",20];
          _this addMagazineCargoGlobal ["20Rnd_762x51_DMR",20];
          _this addMagazineCargoGlobal ["FHQ_rem_5Rnd_300Win_XM2010_NT",20];
          _this addMagazineCargoGlobal ["FHQ_rem_5Rnd_300Win_XM2010_NT_SD",20];

          
          _this addWeaponCargoGlobal ["ItemToolbox",5];
          _this addWeaponCargoGlobal ["ItemCrowbar",5];
          _this addWeaponCargoGlobal ["ItemEtool",5];
          _this addWeaponCargoGlobal ["ChainSawR",1];
          _this addWeaponCargoGlobal ["ChainSawP",1];
          _this addWeaponCargoGlobal ["ChainSawG",1];
          _this addWeaponCargoGlobal ["ChainSawB",1];

        
          _this addMagazineCargoGlobal ["ItemMixOil",2];
          _this addMagazineCargoGlobal ["ItemLockbox",2];
          _this addMagazineCargoGlobal ["ItemComboLock",2];
          _this addMagazineCargoGlobal ["ItemGenerator",3];
          _this addMagazineCargoGlobal ["ItemVault",2];
          _this addMagazineCargoGlobal ["ItemCorrugated",20];
          _this addMagazineCargoGlobal ["30m_plot_kit",2];
          _this addMagazineCargoGlobal ["ItemWire",10];
          _this addMagazineCargoGlobal ["ItemTankTrap",10];
          _this addMagazineCargoGlobal ["ItemSandbag",10];
          _this addMagazineCargoGlobal ["CinderBlocks",40];
          _this addMagazineCargoGlobal ["MortarBucket",20];
  
          
          _this addMagazineCargoGlobal ["ItemBloodbag",5];
          _this addMagazineCargoGlobal ["ItemEpinephrine",5];
          _this addMagazineCargoGlobal ["ItemMorphine",5];
          _this addMagazineCargoGlobal ["ItemPainkiller",5];
          _this addMagazineCargoGlobal ["ItemAntibiotic",5];
          _this addMagazineCargoGlobal ["ItemBandage",5];
          _this addMagazineCargoGlobal ["ItemSeaBassCooked",10];
          _this addMagazineCargoGlobal ["ItemTunaCooked",10];
          _this addMagazineCargoGlobal ["ItemSodaR4z0r",5];
          _this addMagazineCargoGlobal ["ItemSodaMdew",5];
          _this addMagazineCargoGlobal ["ItemSodaOrangeSherbet",5];
          _this addMagazineCargoGlobal ["ItemSodaRbull",5];
          _this addMagazineCargoGlobal ["PartEngine",5];
          _this addMagazineCargoGlobal ["PartVRotor",5];
          _this addMagazineCargoGlobal ["PartGlass",5];
          _this addMagazineCargoGlobal ["PartWheel",5];
          _this addMagazineCargoGlobal ["PartGeneric",5];
          _this addMagazineCargoGlobal ["ItemJerrycan",5];
		  _this setPos [4434.3223, 10632.069, -339];
 
        };
};

The x,y,z position i got from using the editor and placing a marker in the middle of the custom base i created.

 

[4434.3223, 10632.069, -339]

  try change to

[4434.3223, 10632.069, 0]

 

 

Share this post


Link to post
Share on other sites
  • 0
50 minutes ago, lwbuk said:

Class names are wrong on some items too.

30m_plot_kit

should be

plot_pole_kit

Possibly more in there too, but I havent checked them all

 

Thanks a lot. Is there a list that i can use to verify? 

Share this post


Link to post
Share on other sites
  • 0
16 hours ago, khalcifer said:
[4434.3223, 10632.069, -339]

  try change to

[4434.3223, 10632.069, 0]

 

 

Thanks, I i have misinterpreted the Z-elevation as level below 0. Sea level being 0. I will change it to what you suggest and see if it works.

 

Edit :  I have reduced the item list for testing purposes and set the Z- coord to zero. Ammo box now spawns correctly. Thanks for the help. Ill go look for an updated list to correctly populate item arrays

Edit: I queried the trader_data table against the epoch database and built two raw CSV files containing weapons and items currently being used by the server. I will use this to compare what i have in my custom crate array. 

EDIT: If anyone is interested in manually searching the database for specific items this is a select query i wrote to find specific trader items in the game.

select tt.name, tt.trader, td.item, td.afile from trader_tids as tt
inner join traders_data as td
on tt.id = td.tid
where tt.name like "Sniper%"
order by td.item ASC

The word "Sniper%" is a wildcard search for any item starting 
with the word in the trader_tids table as is transmutable to 
other words such as "Assault%".

This is a typical result from the query.

name,trader,item,afile
'Sniper Rifle Ammo','144','[\"10Rnd_762x54_SVD\",1]','trade_items'

I have used Mysql Workbench for the database management. For a complete alpabetically ordered  list omit this line from the query "where tt.name like "Sniper%"

Edited by Cyrus
Adding info

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By AntZ
      Hey there! I just set up an Overpoch Chernarus server on a server provider but the vehicle traders aren't spawning the vehicles when you buy them. The trader takes your gold bars, gives you a key, then a red arrow appears over where the vehicle Should spawn, but nothing appears. After restarting the server all the vehicles that were bought appear right on top of the spot where they were Suppose to show up.
      -I Do Not have infistar installed
      -I'm using worldwidesorrow's admin tools from here: https://github.com/worldwidesorrow/Epoch-Admin-Tools/tree/TestBranch
      -But just in case I removed the admin tool and tested the vehicle traders again but still no luck.
      Here is my server RPT: 
       
      Can someone please look into this. This is the exact issue discussed in this post but the solution doesn't apply in my case.
       
    • By Pickle Rick
      ip - 192.154.248.253
      Discord.gg/9m99XxM
      NEW SERVER UP AND RUNNING.. FULL OF AI, PVP HELL...  Stop in and ask Pickle Rick or OTROD for a free tank

    • By Pickle Rick
      Stop on by Rods server,  ask for Pickle Rick or OTRod...  we'll give ya a free tank. 

    • By don2k7
      Hello thought I would share some of the cherno additions i have made, some of these when they were made, were designed to give the map a bit more of the standalone feel
      1.) Checkpoints. see screen shots for locations.
      checkpoint north of factory east coast, centre of electro town, main road between elector and cherno, main road between cherno and balota airfield.
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104403_1_zpsmbnhw8dl.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104354_1_zpsy4wffhvd.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104617_1_zpst76fsi6m.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104454_1_zpsmaojsdnt.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104624_1_zpsjoiqnuwx.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104617_1_zpst76fsi6m.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104709_1_zpsmw4unygi.jpg
      2.) North Klamenka military base, on main road between Klamenka and Pavolo
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104814_1_zpskfimheva.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719104807_1_zpshkmtliih.jpg
      3.) FOB west. 
      class Item21
              {
                  position[]={1177.399,195.34067,7586.7783};
                  name="FOB West";
                  text="FOB West";
                  type="mil_dot";
                  colorName="ColorRed";
              };
      postion incase you want to add a marker for this.
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719110347_1_zpsbsc98afn.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719110402_1_zpsdkqtqhjl.jpg
      4.) Klen Castle, on Klen hilltop
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719110151_1_zpsbrxrvgdz.jpg
      5.) JunkYard.
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719105916_1_zpsedkmmk1a.jpg
      https://i61.photobucket.com/albums/h51/leoa1981/epoch additions/20190719105909_1_zps84egwkib.jpg
       
      Download: https://github.com/Don2k7/epoch-map-additions
       
      for a guide on how to add these check this forum post.
      https://epochmod.com/forum/topic/45135-tutorial-how-to-make-custom-map-content-1062/
       
    • By WinterLuka
      Winter Gaming is a gaming community, that was created in early 2018. We're currently running DayZ Epoch 1.0.6.2 server.
      Winter Gaming is a project created with passion – for players from players.
      On our server, the rules are equal for all players – no Pay2Win, no benefits for donating.
       
      Server IP: 164.132.203.240:2302
      Discord: https://discordapp.com/invite/ECBVKGA
      Website: http://www.wintergaming.eu
      Forum: http://www.wintergaming.eu/forums
       
      Server Configuration:
      Building Maintain - 10 Days Abandoned Vehicle Unlock - 7 Days Abandoned Safes/Lockboxes Unlock - 10 Days Building Limit – 250 Objects Max Base Height - 30m  
      Features:
      High FPS XP System (with awesome Perks and Trader) JSRS Compatible Wear Zombie Skin Plot Management Door Management Snap and Vector Building 20k Starting Money Coin System Running Zombies Ai Missions Ai Convoys Custom Loot Custom Locations Custom Traders Hidden Trader Selling Rare Items Toggle Grass/Environmental Sounds Deploy Bike/Motorcycle/Mozzie Walk Amongst The Dead Harvestable Hemp Tow/Lift Repair/Rearm – Service Points Bury Bodies Take Clothes Locate Vehicle Paychecks every 30 minutes Spawn Selection Abandoned Safe Mission Indestructible Metal/Cinder Bases Blow up door and more!  
      I hope to see You on the server!
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...