Jump to content

Cyrus

Member
  • Posts

    62
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Cyrus

  1. 25 minutes ago, DAmNRelentless said:

    Setup arrays and pick a random item from it. You can use the BIS_fnc_selectRandom function to do that: https://community.bistudio.com/wiki/BIS_fnc_selectRandom

    
    _someWeaponArray = [
    	"DMR_DZ",
    	"M24_des_EP1",
    	"FNFAL_DZ",
    	"Mk48_CCO_DZ",
    	"M240_DZ",
    	"G17_FL_DZ",
    	"M9_SD_DZ"
    ];
    
    //Pick 1 random item from it
    _randomWeapon = _someWeaponArray call BIS_fnc_selectRandom;
    
    //Optionally remove it from the array afterwards
    _someWeaponArray = _someWeaponArray - [_randomWeapon];

     

    @DAmNRelentless Thanks for the reply. That makes sense. for arguments sake if i want to populate the crate with multiple random items from the same array to i just specify the amount like this? :

    _randomWeapon = [_someWeaponArray,10] call BIS_fnc_selectRandom;

    Essentially requesting 10 random weapons from the array?

  2. Im looking for an easy, effective way to randomize loot (weapons, ammo, toolbelt items, food, meds and building supplies) in static crate. I have a placed crate already and populated with stuff but i would like to have this random on spawn. Also i would like to know how to have this crate stay for 2 hours then destroy and respawn 15 min later. This is what my customLootCrate.sqf looks like :

    Spoiler
    Quote

    if (isServer) then {
            _vehicle_9090 = objNull;
            if (true) then
            {
              _this = createVehicle ["USSpecialWeaponsBox", [4434.3223, 10632.069, 0], [], 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_LRR_scoped",2]; //
            
              _this addWeaponCargoGlobal ["DMR_DZ",1];
              _this addWeaponCargoGlobal ["[M24_des_EP1",2];
              _this addWeaponCargoGlobal ["[FNFAL_DZ",2];
              _this addWeaponCargoGlobal ["[Mk48_CCO_DZ",2];
              _this addWeaponCargoGlobal ["[M240_DZ",2];
              _this addWeaponCargoGlobal ["[G17_FL_DZ",2];
              _this addWeaponCargoGlobal ["[M9_SD_DZ",2];
              
              _this addMagazineCargoGlobal ["20Rnd_762x51_DMR",20];
              _this addMagazineCargoGlobal ["5Rnd_762x51_M24",20];
              _this addMagazineCargoGlobal ["20Rnd_762x51_FNFAL",20];
              _this addMagazineCargoGlobal ["100Rnd_762x54_PK",20];
              _this addMagazineCargoGlobal ["100Rnd_762x51_M240",20];
              _this addMagazineCargoGlobal ["17Rnd_9x19_glock17",20];
              _this addMagazineCargoGlobal ["15Rnd_9x19_M9SD",20];

          
              _this addWeaponCargoGlobal ["ItemToolbox",5];
              _this addWeaponCargoGlobal ["ItemCrowbar",5];
              _this addWeaponCargoGlobal ["ItemEtool",5];
              _this addWeaponCargoGlobal ["Binocular_Vector",5];
              _this addWeaponCargoGlobal ["ItemGPS",5];
              _this addWeaponCargoGlobal ["ItemHatchet",5];
              _this addWeaponCargoGlobal ["NVGoggles",5];
              
              _this addMagazineCargoGlobal ["ItemLockbox",2];
              _this addMagazineCargoGlobal ["ItemPole",20];
              _this addMagazineCargoGlobal ["ItemComboLock",2];
              _this addMagazineCargoGlobal ["ItemGenerator",3];
              _this addMagazineCargoGlobal ["ItemVault",2];
              _this addMagazineCargoGlobal ["ItemCorrugated",20];
              _this addMagazineCargoGlobal ["plot_pole_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, 0];
     
            };
    };

    Thanks for any help in advance.

     

  3. I have just managed to install the latest version of InfiSTAR v1448. Since then I am getting an error when logging into the server. "\z\addons\dayz_server\compile\server_maintainArea.sqf" not found." I have looked and the file is present at that location. And in my server_functions.sqf it is called correctly.

    server_maintainArea = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_maintainArea.sqf";

    Would there be any reason why this call would fail?

  4. On 3/11/2017 at 10:03 PM, theduke said:

    thats because his instructions are wrong. they are for arma 3

    this is the appropriate path for your server_functions.sqf

    
    [] execVM "\z\addons\dayz_server\a2_infiSTAR\AH.sqf";

    I struggled a bit with this till i noticed his path lol

    I need to send him a msg so he fixes that lol

    I also bought the latest copy of infiSTAR yesterday, and have had the very same issue with the installation instructions.

    This morning i have used this method by specifying the full path the sqf and now it works perfectly. Thanks a lot @theduke Short and sweet = works like a charm

  5. I have placed a fuel pump in starry using a custom script. The fuel pump is there and accessible but i would like to know how i can make it work with out the need of having to place a generator or a running fuel ural. by default it acts the same way a placeable fuel pump works picked up in the world. 

    Here is the code that use to spawn the fuel pump. 

    _vehicle_344 = objNull;
    if (true) then
    {
      _this = createVehicle ["Land_A_FuelStation_Feed", [6325.166, 7715.0869, 0.15837258], [], 0, "CAN_COLLIDE"];
      _vehicle_344 = _this;
      _this setDir -52.000465;
      _this setPos [6325.166, 7715.0869, 0.15837258];
    };

    Any help will be appreciated.

  6. 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%"

  7. 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.

     

  8. Very nice script. Just one question. How do i get custom placed fuel station / pumps to work with this script. All my original pumps works as expected except for the ones i added as custom buildings / bases

    Edit : I'm using this in my custom building script which I'm suspecting might be the issue :

    _this = createVehicle ["MAP_A_FuelStation_Feed", [6393.1343, 7792.9556, 0.31752014], [], 0, "CAN_COLLIDE"];

    Can i add "MAP_A_FuelStation_Feed" to the service point class in service_point.sqf?

    //original
    _servicePointClasses = dayz_fuelpumparray;
    
    //Changed to this?
    _servicePointClasses = dayz_fuelpumparray, MAP_A_FuelStation_Feed;

     

  9. Hi, Thanks for a awesome mod. I have one issue though, and it might be a setting that I'm either overlooking or do not know where to find. When players on my server dies, they successfully re-spawn using spawn selection halo/ground spawn and earned loadout, but they also spawn with the same amount of money they had when they died. So when the go back to their bodies they also collect this amount. In conjunction with ESSV3 I'm using ZSC single currency. I need to know how to disable re-spawn with money. I would appreciate it if someone can point me in the right direction. 

    EDIT: The only place I found mentioning coins as per the documentation

    Quote

    Coins

    • 0 - Does nothing, use if single currency is not installed
    • Positive # - Gives player coins with loadout

    is from main.sqf :

     

    _coins = switch true do {
    		case (count class_choice > 20): {class_choice select 21}; //Random
    		case (count class_choice > 10): {class_choice select 10}; //Normal public or private
    		case (count class_choice > 0): {class_choice select 8}; //Custom loadout by UID
    		default {0};

     

×
×
  • Create New...