Jump to content
sarogahtyp

[RELEASE] Sarogahtyps Simple Loot Spawner - SSLS V-1.2

Recommended Posts

Sarogahtyps Simple Loot Spawner - SSLS V-1.2

Spawns weapons, items and bags in buildings near to alive players maybe inside a trigger area or marker area.

 

Deletes stuff if players are not close enough anymore.
The script doesnt care about any trigger preferences except the trigger area.
Soft delayed item spawning to prevent performance impact.

 

Script reads your missions config files and should spawn loot of your mods (e.g. CUP weapons, Etc.) as well

 

DOWNLOAD V-1.2

 

DOWNLOAD V-1.1

 

Usage:

 

initServer.sqf

fnc_spawn_loot = compileFinal preprocessFileLineNumbers "SSLSv1-1.sqf";
_d = [] call fnc_spawn_loot;

you are able to stop the loot spawning script at any time by

SSLS_script_switch_off = true;

 

If you set up high spawn chances (see top of script) and have a high player count on your server then I recommend to make trigger or marker areas for spawning to get the needed performance.

But if you do not encounter performance issues then spawning loot everywhere near players should be okay.

 

Tweakable features (can be found on top of the script):

//***** EDIT BELOW TO ADJUST MAIN BEHAVIOR
// (L) means lower values are better for performance - (H) means the opposite

SSLS_script_switch_off = false;  //if you want to stop spawning loot then set this to true at any time in your mission

_trigger_array = [];  // contains the names of triggers/markers in which area loot should spawn.
_spawn_chance = 100; // (L) The chance to spawn loot inside of a specific house.
_launcher_chance = 30;  // chance to spawn a launcher as weapon instead of rifle, pistol or machine gun
_item_chance = 70;   // chance to spawn an item instead of a weapon
_bag_chance = 50; // chance to spawn a backpack instead of an item
_max_magazines = 7;    // the maximum number of magazines spawned for a gun
_max_magazines_launcher = 3; // maximum number of ammo to spawn for rocket launchers
_max_magazines_gl = 5; // maximum number of ammo to spawn for grenade launchers
_house_distance = 25;  // (L) houses with that distance to players will spawn loot
_player_exclude_distance = 15; //if 2 players or more are closer together than this then only 1 player is considered
_exclude_loot = []; //classnames of items which should never spawn (blacklist)
_exclusive_loot = []; //add classnames here and nothing else will be spawned (whitelist)
_use_bohemia_classes = true; // for spawning bohemia created stuff set this to true
_use_mod_classes = true; //// for spawning stuff from loaded mods set this to true
_debug = false;  //information about number of places where items were spawned or deleted

// if you have performance issues then consider introducing spawning areas (_trigger_array) before changing following values!
_spawn_interval = 1.5; // (H) desired runtime for the main loop. time which is not needed will be used for soft spawning or a break.

//***** EDIT ABOVE TO ADJUST MAIN BEHAVIOR

details:

Spoiler

_trigger_array   ["string1", "string2", ...] or []
                 -> contains the names of triggers/markers in which area loot should spawn.
                 -> if empty then loot will spawn everywhere near players

_spawn_chance   number (0-100)
                ->  The chance to spawn loot inside of a specific house.
                -> value gets split into chance to spawn in a house and chance to spawn multiple items in it
                -> 100 means an average of 75% (50-100) for spawning in a house and
                   an average of 25% (0-50) for spawning on more than one spot in this house
                -> 40 would mean average 30% for spawning in a house and average 10% for spawning multiple
                -> the splitted values are randomized on each new loop run
				
_launcher_chance   number (0-100)
                   -> chance to spawn a launcher as weapon instead of rifle, pistol or machine gun
                   -> if this is set to e.g. 20 and items/bags to 0 then you ll get 80% guns and 20% launchers

_item_chance   number (0-100)
               -> chance to spawn an item instead of a launcher
               -> if launcher chance is 50 and item chance is 50 and bag chance is 0 then you will get
                  50% guns, 25% launchers, 25% items and 0% backpacks

_bag_chance   number (0-100)
              -> chance to spawn a bag/backpack instead of a item
              -> if launcher chance is 100 and item chance is 50 and bag chance is 50 then you will get
              -> 0% guns, 50% launchers, 25% items and 25% backpacks

_max_magazines   number (0-x)
                 -> the maximum number of magazines spawned for a gun

_max_magazines_launcher   number (0-x)
                          -> the maximum number of magazines spawned for a launcher

_max_magazines_gl   number (0-x)
                    -> the maximum number of magazines spawned for a grenade launcher

_house_distance   number (0-x)
                  -> houses inside of this radius of a player will spawn loot

_player_exclude_distance   number (0-x)
                           -> if 2 players or more are closer together than this then only 1 player is considered
                           -> loot will get deleted if the specific house is farther away than _house_distance + _player_exclude_distance

_exclude_loot   ["string1", "string2", ...] or []
                -> you can add classnames there and those stuff will never spawn

_exclusive_loot   ["string1", "string2", ...] or []
                  -> add classnames here and nothing else will be spawned

_use_bohemia_classes   boolean (true or false)
                       -> if true then vanilla stuff will get spawned.

_use_mod_classes   boolean (true or false)
                   -> if true then stuff of your mods will get spawned.

_debug   boolean (true or false)
         -> if true then u get hints about places were stuff was spawned or deleted and how many spawn places are active

 

 

 

Changelog 1.1 (download)

-fixed a major bug which showed an error message during spawning

-added feature to enable/disable Mod/Bohemia classes spawning

-huge performance optimizations (shorter arrays, better smooth spawning and other stuff)

 

Changelog 1.0 (download)

-added script

  • Like 2
  • Thanks 4

Share this post


Link to post
Share on other sites

This script is really nice!  My only suggestion is could you add an option to load just BIS items, Load BIS items plus mods (basically your default), and load just mod items no BIS ones

  • Thanks 1

Share this post


Link to post
Share on other sites

@accuracythruvolume thx for ur reply.

first: within the next few days Ill release a new version with huge performance improvements (10 times faster I guess).

second: your wish is noted and Ill try to realize it soon.

 

dev container:

Spoiler

/*
Title:  Sarogahtyps Simple Loot Spawner - SSLS V-1.0
Author: Sarogahtyp

Description:
Spawns weapons, items and bags in buildings near to alive players maybe inside a trigger area or marker area.
Deletes stuff if players are not close enough anymore.
The script doesnt care about any trigger preferences except the trigger area.
Main while loop runs every 8-12 seconds.
Soft delayed item spawning to prevent performance impact.

How to adjust/use the script: 
_trigger_array   -> contains the names of triggers in which area loot should spawn.

_spawn_chance  ->  The chance to spawn loot on a specific house position. If the same house is the closest building to 

_item_chance -> chance to spawn an item insteadinstead of a weapon

_bag_chance -> chance to spawn a bag instead of a item

_max_magazines -> the maximum of magazines spawned in an itembox. 

_house_distance -> houses inside of this radius of a player will spawn loot

_exclude_loot -> you can add classnames there and those stuff will never spawn

_exclusive_loot -> add classnames here and nothing else will be spawned

_debug -> if true then u get hints about places were stuff was spawned or deleted and how many spawn places are active
*/

//***** EDIT BELOW TO ADJUST MAIN BEHAVIOR
SSLS_script_switch_off = false;  //if you want to stop spawning loot then set this to true at any time in your mission

_trigger_array = [];  //names of triggers or area markers in editor. if empty then spawning occures everywhere
_house_chance = 10; //chance  for considering a specific house.
_house_multiple_chance = 10; //chance to spawn on more than only one spot of a specific house
_launcher_chance = 30;  //chance to spawn a launcher as weapon instead of rifle, pistol or machine gun
_item_chance = 70;   //chance to spawn an item instead of a weapon
_bag_chance = 50; // chance to spawn a backpack instead of an item
_max_magazines = 7;    //maximum number of mags to spawn
_max_magazines_launcher = 3; //maximum number of ammo to spawn for rocket launchers
_max_magazines_gl = 5; //maximum number of ammo to spawn for grenade launchers
_house_distance = 40;  // houses with that distance to players will spawn loot
_exclude_loot = []; //classnames of items which should never spawn (blacklist)
_exclusive_loot = []; //add classnames here and nothing else will be spawned (whitelist)
_player_exclude_distance = 20; //if 2 players or more are closer together than this then only 1 player is considered
_use_bohemia_classes = true; // for spawning bohemia created stuff set this to true
_use_mod_classes = true; //// for spawning stuff from loaded mods set this to true
_debug = true;  //information about number of places where items were spawned or deleted
//***** EDIT ABOVE TO ADJUST MAIN BEHAVIOR

// if you have performance issues then consider introducing spawning areas (_trigger_array) before changing following values!
_spawn_interval = 1; // every x seconds new loot will get spawned and old deleted denpending on position changes of players.
_new_spawn_time = 0.5; // time period in seconds in which the new loot will get spawned (soft spawning)

//***** init variables
_checked_positions = [];

_weapons_mags_array = [];
_launchers_mags_array = [];
_items_array = [];
_bags_array = [];
_exclusive_loot_bool = if ((count _exclusive_loot) > 0) then {true} else {false};

_use_bohemia_classes = if (_use_bohemia_classes || (!_use_bohemia_classes && !_use_mod_classes)) then {true} else {false};
_use_all_classes = if (_use_bohemia_classes && _use_mod_classes) then {true} else {false};

_box_classname = "WeaponHolderSimulated_Scripted";
_spawn_interval_rnd = _spawn_interval / 10;

_player_exclude_distance_sqr = _player_exclude_distance ^ 2;
_delete_distance_sqr = (_house_distance + _player_exclude_distance) ^ 2;
if (_house_chance isEqualTo 0) exitWith {true};

//***** get weapon and magazine classnames from config file
 _cfgWeapons = ("true" configClasses (configFile >> "cfgWeapons")) select
 {
  _parents = [_x,true] call BIS_fnc_returnParents;
  _name = configName _x;

  (("Rifle" in _parents) or ("MGun" in _parents) or ("Pistol" in _parents)) and 
  {!(_name in _exclude_loot) and (getNumber (_x >> 'scope') > 1) and (!_exclusive_loot_bool or (_name in _exclusive_loot)) and 
  {(_use_bohemia_classes and ((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or (_use_mod_classes and !((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or _use_all_classes}}
 }; 

 {
  _weaponString = configName (_x);
  _muzzle_class = (getArray (configFile >> "CfgWeapons" >> _weaponString >> "muzzles")) select 1;
  _muzzle_magazines = [];
  
  if !(isNil {_muzzle_class}) then
  {	
   _muzzle_magazines = getArray (configFile >> "CfgWeapons" >> _weaponString >> _muzzle_class >> "magazines")
  };

  _d = _weapons_mags_array pushBack [_weaponString, (getArray (configFile >> "CfgWeapons" >> _weaponString >> "magazines")), _muzzle_magazines];
  
 } count _cfgWeapons;


 //***** get launchers and rocket/grenade classnames from config file
 if (_launcher_chance > 0) then
 {
  // filter for valid launcher configs
  _cfgLaunchers = ("true" configClasses (configFile >> "cfgWeapons")) select
  {
   _parents = [_x,true] call BIS_fnc_returnParents; 
   _name = configName _x;
   ("Launcher" in _parents) and {!(_name in _exclude_loot) and (getNumber (_x >> 'scope') > 1) and (!_exclusive_loot_bool or (_name in _exclusive_loot)) and 
  {(_use_bohemia_classes and ((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or (_use_mod_classes and !((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or _use_all_classes}}
  }; 

  // build classname array of launchers together with its magazines
  {
   _launcherString = configName (_x);
    _d = _launchers_mags_array pushBack [_launcherString, (getArray (configFile >> "CfgWeapons" >> _launcherString >> "magazines"))];
  } count _cfgLaunchers;
 };

 //*****get items classnames from config file
 if (_item_chance > 0) then
 {
  _cfgItems = ("true" configClasses (configFile >> "cfgWeapons")) 
  select
  {
   _parents = [_x,true] call BIS_fnc_returnParents;
   _name = configName _x;
   ("ItemCore" in _parents) and {!(_name in _exclude_loot) and (getNumber (_x >> 'scope') > 1) and (!_exclusive_loot_bool or (_name in _exclusive_loot)) and 
  {(_use_bohemia_classes and ((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or (_use_mod_classes and !((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or _use_all_classes}}
  } apply {configName _x};
  
  _items_array = _cfgItems;
 };

 //*****get bag classnames from config file
 if (_bag_chance > 0) then
 {
  _cfgBags = ("true" configClasses (configFile >> "cfgVehicles")) select
  {
   _parents = [_x,true] call BIS_fnc_returnParents;
   _name = configName _x;
   ("Bag_Base" in _parents) and {!(_name in _exclude_loot) and (getNumber (_x >> 'scope') > 1) and (!_exclusive_loot_bool or (_name in _exclusive_loot)) and 
  {(_use_bohemia_classes and ((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or (_use_mod_classes and !((getText (_x >> 'author')) isEqualTo "Bohemia Interactive")) or _use_all_classes}}
  } apply {configName _x}; 

  _bags_array = _cfgBags;
 };

[_trigger_array, _house_distance, _debug, _checked_positions, _new_spawn_time, _box_classname, _item_chance, 
 _launcher_chance, _weapons_mags_array, _max_magazines, _launchers_mags_array, _max_magazines_launcher, 
 _bag_chance, _items_array, _bags_array, _spawn_interval, _spawn_interval_rnd, _max_magazines_gl, 
 _house_chance, _player_exclude_distance_sqr, _delete_distance_sqr, _house_multiple_chance] spawn
{
 params ["_trigger_array", "_house_distance", "_debug", "_checked_positions", "_new_spawn_time", "_box_classname",
		 "_item_chance", "_launcher_chance", "_weapons_mags_array", "_max_magazines", "_launchers_mags_array",
         "_max_magazines_launcher", "_bag_chance", "_items_array", "_bags_array", "_spawn_interval",
		 "_spawn_interval_rnd", "_max_magazines_gl", "_house_chance", "_player_exclude_distance_sqr",
		 "_delete_distance_sqr", "_house_multiple_chance"];
 

_houses_delete = [];
_last_houses_in_area = [];
_houses_spawned = [];
_houses_now_in_area = [];
_houses_spawn_new = [];
  
_timefull = 0;
_timestart = 0;

_sol_1_time = 0;
_sol_2_time = 0;
_first = true;

 while {!SSLS_script_switch_off} do
 {
  _break_end = time + _spawn_interval + random _spawn_interval_rnd;
  
  waitUntil {sleep _spawn_interval_rnd; time > _break_end};
  
  _timestart = diag_tickTime;
  
  _houses_now_in_area = [];
  _houses_spawn_new = [];
  
  _loot_players = [];
  _justPlayers = (allPlayers - entities "HeadlessClient_F") select {alive _x && isNull objectParent _x};
  _justPlayers append allUnits;
  _justPlayers2 = [];
  
  //***** get desired spawn positions for loot in the buildings close to players
  //***** which are inside of a loot trigger area
  if(count _trigger_array > 0) then
  {
   {
    _d =
	{
     _d = _loot_players pushBack _x;
    } count (_justPlayers inAreaArray _x);
   } count _trigger_array;
  }
  else
  {
   _loot_players = _justPlayers;
  };
 
 _sol_1_start = diag_tickTime;
 
  {
   _plyr = _x;
   if ( _justPlayers2 findIf {(_x distanceSqr _plyr) < _player_exclude_distance_sqr} < 0) then
   {
    _d = _justPlayers2 pushBack _plyr;
   };
  } count _loot_players;

 _loot_players = _justPlayers2;
 
 _active_houses = [];

  { _d =
   {
     if ((random 100) < _house_chance && {!(_x in _last_houses_in_area)}) then
	 {
      _d = _houses_spawn_new pushBackUnique _x;         // houses where new items will spawned
	  _d = _houses_spawned pushBackUnique _x;      // houses with already (and newly) spawned items
	 };
	 _d = _houses_now_in_area pushBackUnique _x;     // houses which are in area now but were not before
   } count nearestObjects [_x, ["house"], _house_distance];
  }count _loot_players;
  
  _last_houses_in_area = _houses_now_in_area;  // remember actual houses for next while run
  _houses_delete = _houses_spawned - _houses_now_in_area; // delete inside of all houses which are not in area anymore
  _houses_spawned = _houses_spawned - _houses_delete; // deleted houses have no spawned items anymore
  _houses_not_delete = _houses_delete select 
  {
   _house = _x; 
   _loot_players findIf {_house distanceSqr _x < _delete_distance_sqr} < 0
  };
  _houses_delete = _houses_delete - _houses_not_delete;
  _houses_spawned append _houses_not_delete;
  
  _sol_1_time = diag_tickTime - _sol_1_start;
  
 // delete all objects near all building positions of all houses out of player range
  { _d =
   { _d=
    {
     deleteVehicle _x;
    } count (nearestObjects [_x, [_box_classname], 3]);
   } count (_x buildingPos -1);
  } count _houses_delete;
  
  //***** spawn loot within 4 seconds (delay to prevent performance impact)

  _new_house_num = count _houses_spawn_new;

  // debug things
  if(_debug) then
  {
   _spawned_num = count _houses_spawned;
   _in_area_num = count _houses_now_in_area;
   _del_house_num = count _houses_delete;

   hint parseText format ["new h.: %1, del h.: %2 <br /> 
						spawned h.: %3, h. in area: %4 <br />
						players: %5, watched pl.: %6 <br />
						sol1: %7, runtime: %8", 
						_new_house_num, _del_house_num, _spawned_num, _in_area_num, (count _justPlayers), (count _loot_players), _sol_1_time, _timefull];
  };

  if (_new_house_num > 0) then
  {
   _sleep_delay = _new_spawn_time / _new_house_num;
   {
    _pos_array = _x buildingPos -1;
	
	while {count _pos_array > 0} do
	{
	 _pos = selectRandom _pos_array;
	 _pos_array = _pos_array - _pos;
	 
     _position = _pos vectorAdd [0, 0, 0.2];
	
     _itembox = createVehicle [_box_classname, _position, [], 0.2, "NONE"];
   
     if (random 100 > _item_chance) then
     {
      if(random 100 > _launcher_chance) then
      {
       _weapon_mag = selectRandom _weapons_mags_array;
       _itembox addItemCargoGlobal [(_weapon_mag select 0), 1];
    
       for "_i" from 1 to (ceil random _max_magazines) do 
       {
        _itembox addItemCargoGlobal [(selectRandom (_weapon_mag select 1)), 1];
       };
	 
	   if (count (_weapon_mag select 2) > 0) then
	   {
	    for "_i" from 1 to (ceil random _max_magazines_gl) do 
        {
         _itembox addItemCargoGlobal [(selectRandom (_weapon_mag select 2)), 1];
        };
	   };
      }
      else
      {
       _launcher_mag = selectRandom _launchers_mags_array;
       _itembox addItemCargoGlobal [(_launcher_mag select 0), 1];
    
       for "_i" from 1 to (ceil random _max_magazines_launcher) do 
       {
        _itembox addItemCargoGlobal [(selectRandom (_launcher_mag select 1)), 1];
       };
      };
     }
     else
     {
      if(random 100 > _bag_chance) then
      {
       _item = selectRandom _items_array;
       _itembox addItemCargoGlobal [_item, 1];
      }
      else
      {
        _backpack = selectRandom _bags_array;
		diag_log _bags_array;
        _itembox addBackpackCargoGlobal [_backpack, 1];
      };
     };
	 
	 if( random 100 >= _house_multiple_chance) then
	 {
	  _pos_array = [];
	 };
     sleep _sleep_delay;
	};
   } count _houses_spawn_new;
  };
  _timefull = diag_tickTime - _timestart
 };
 
  _houses_delete append _houses_spawned;
  _houses_delete append _houses_now_in_area;
  _houses_delete append _houses_spawn_new;
  
   { _d=
   { _d=
    {
     deleteVehicle _x;
    } count (nearestObjects [_x, [_box_classname], 3]);
   } count (_x buildingPos -1);
  } count _houses_delete;
};

 

 

Share this post


Link to post
Share on other sites

Update released:

Sarogahtyps Simple Loot Spawner - SSLS V-1.1

 

Changelog 1.1 (download)

-fixed a major bug which showed an error message during spawning

-added feature to enable/disable Mod/Bohemia classes spawning

-huge performance optimizations (shorter arrays, better smooth spawning and other stuff)

 

Spoiler

/*
 Encodes selected list entries into a number for minimizing network traffic
 
 array _list  -  whole list of entries
 array _selected - list of selected entries
 
 return:
 number - representation of selected entries
*/


params ["_listIn", "_selected"];

//check if list size possible (upto 127 entries)
if (count _listIn > 127) exitWith {-1};

private _list = +_listIn;

_list sort true;

private _code = 0;

{
  _element = _x;
  _index = _list findIf { _x isEqualTo _element };
  _code = _code + 2^_index;
} count _selected;

_code

 

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

u have to build a mission with it...

scripts are working in missions only and not by adding them to armas root folder.

Share this post


Link to post
Share on other sites

Will try this out thank you! 

Quick question: the whitelist option if I put all the classnames I want. Will it auto detect which is a launcher which a gun etc and follow the setting for the probability values for each class 

For example if I list 3 guns, 2 uniform objects, 1 backpack. Will it know which is what 

 

Share this post


Link to post
Share on other sites

or do i have to put individual classes in these arrays? 
https://prnt.sc/uche4w



Edit: I am struggling to get this to work the custom way. 
I have put a simple trigger with a radius area and named it loot in the variable name 

ive put 
 

Quote

            "launch_NLAW_F",
            "SmokeShell",
            "ACE_M84",
            "11Rnd_45ACP_Mag",
            "rhs_mag_30Rnd_556x45_M855A1_Stanag",
            "rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Red",
            "20Rnd_762x51_Mag",
            "ACE_20Rnd_762x51_Mag_Tracer",
            "rhsusf_acc_aac_762sdn6_silencer",
            "HandGrenade",
            "rhs_weap_M136",
            "CUP_30Rnd_9x19_MP5",
            "CUP_1Rnd_HE_M203",
            "CUP_1Rnd_HEDP_M203",
            "CUP_smg_MP5SD6",
            "CUP_smg_MP5A5_flashlight",
            "CUP_smg_MP5A5",
            "CUP_hgun_Glock17_blk",
            "CUP_17Rnd_9x19_glock17",
            "launch_RPG7_F",
            "RPG7_F",
            "CUP_arifle_G36C",
            "CUP_30Rnd_556x45_G36",
            "rhs_weap_m4a1_carryhandle_m203",
            "rhs_mag_30Rnd_556x45_Mk262_PMAG",
            "sgun_HunterShotgun_01_F",
            "ACE_2Rnd_12Gauge_Pellets_No0_Buck",
            "2Rnd_12Gauge_Pellets",
            "ACE_2Rnd_12Gauge_Pellets_No1_Buck",
            "CUP_arifle_HK417_20",
            "CUP_20Rnd_762x51_HK417"

Inside the exclusive loot 

However with debug enabled and i teleport myself to a town inside this trigger area, nothing is being spawned in. 
Any ideas? Does anyone have a customised example? 

https://prnt.sc/uchn5u here is my debug thing im walking around a big village.. 

Share this post


Link to post
Share on other sites

hey I'm extremely new to code and id love to get into it advice ? also how would one implement this into a mission I'm very dumb lol trying to make a stalker survival mission rpg typa ting please halp !

Share this post


Link to post
Share on other sites

Hey guys can you help me,  i'm new in putting script to mission so i can't get it to work.. i've put the script to my mission and created initserver.sqf.. but nothing happened, i think i missed something .. i can't figured it out

Share this post


Link to post
Share on other sites

Just doing some late replies:

 

On 9/6/2020 at 3:10 PM, Tyl3r99 said:

the whitelist option if I put all the classnames I want. Will it auto detect which is a launcher which a gun etc and follow the setting for the probability values for each class 

Yes.

 

On 9/6/2020 at 3:45 PM, Tyl3r99 said:

or do i have to put individual classes in these arrays? 
https://prnt.sc/uche4w

No. Don't touch anything below this line:  //***** EDIT ABOVE TO ADJUST MAIN BEHAVIOR

 

On 9/6/2020 at 3:45 PM, Tyl3r99 said:

Edit: I am struggling to get this to work the custom way. 

your custom loot array has to look like this. tested and working:

_exclusive_loot = 
[
           "launch_NLAW_F",
            "SmokeShell",
            "ACE_M84",
            "11Rnd_45ACP_Mag",
            "rhs_mag_30Rnd_556x45_M855A1_Stanag",
            "rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Red",
            "20Rnd_762x51_Mag",
            "ACE_20Rnd_762x51_Mag_Tracer",
            "rhsusf_acc_aac_762sdn6_silencer",
            "HandGrenade",
            "rhs_weap_M136",
            "CUP_30Rnd_9x19_MP5",
            "CUP_1Rnd_HE_M203",
            "CUP_1Rnd_HEDP_M203",
            "CUP_smg_MP5SD6",
            "CUP_smg_MP5A5_flashlight",
            "CUP_smg_MP5A5",
            "CUP_hgun_Glock17_blk",
            "CUP_17Rnd_9x19_glock17",
            "launch_RPG7_F",
            "RPG7_F",
            "CUP_arifle_G36C",
            "CUP_30Rnd_556x45_G36",
            "rhs_weap_m4a1_carryhandle_m203",
            "rhs_mag_30Rnd_556x45_Mk262_PMAG",
            "sgun_HunterShotgun_01_F",
            "ACE_2Rnd_12Gauge_Pellets_No0_Buck",
            "2Rnd_12Gauge_Pellets",
            "ACE_2Rnd_12Gauge_Pellets_No1_Buck",
            "CUP_arifle_HK417_20",
            "CUP_20Rnd_762x51_HK417"

];

you have to set up the trigger array like this, just with your own trigger names. tested and working:

_trigger_array = [trigger1, trigger2]; 

 

 

On 7/28/2020 at 8:33 PM, Tigerlover said:

How to install it?

I copy into Arma 3 main folder, but nothing happened in mission. 

 

On 1/4/2021 at 8:37 AM, PVT. HELMS said:

hey I'm extremely new to code and id love to get into it advice ? also how would one implement this into a mission I'm very dumb lol trying to make a stalker survival mission rpg typa ting please halp !

 

On 2/21/2021 at 9:42 PM, Amanda98 said:

Hey guys can you help me,  i'm new in putting script to mission so i can't get it to work.. i've put the script to my mission and created initserver.sqf.. but nothing happened, i think i missed something .. i can't figured it out

All of you:
1. You have to copy the file SSLSv1-1.sqf into your missions root folder.

2. Create a initServer.sqf file in missions root folder and copy/paste this lines into it:

private _dummy = execVM "SSLSv1-1.sqf";

3. Save the file!

4. Adjust the parameters in the header of the script file (SSLSv1-1.sqf). These are well documented (imo) there.

5. After starting the mission it could take upto 1 minute until the spawning starts. In debug mode you can see the debug hints after spawning loop is started.

 

 

New release with huge improvements is probably coming up within next few hours/days/weeks...

  • Like 1

Share this post


Link to post
Share on other sites

SSLS Version 1.2 Release

 

Fixes:

- not all possible items (like ace medical items) were spawned - fixed

- Soft Spawning delays were too long sometimes - fixed

- magazines were spawned even if they were on blacklist or not on whitelist - fixed

 

New Features and Changes:

-  rewrote complete config reading

- introduced a _no_spawn_area_array where you are able to define areas as triggers or markers where spawning will never occur

- introduced more loot categories (pistols, assault rifles, long rifles, short rifles, launchers, backpacks, weapon bags (for statics), dress items, weapon attachments, basic items (map, gps, ace medical, food etc.), misc items)

- introduced ability to adjust number of magazines spawning for each weapon category

- introduced ability to spawn all weapons stripped from their default attachments

- changed the weired spawning chance adjustment into a spawn percentage (or weight) adjustment where you are able to set a chance for each single category now

- added warnings in .rpt file and on screen in debug mode if some items are not available due to wrong settings

- added warnings in .rpt file and on screen in debug mode if performance is to low to guarantee Soft-Spawning for lag prevention

 

Additional Notes:

 

The new spawn categories dress items, weapon attachments, basic items (map, gps, ace medical, food etc.) and misc items are created by a complex filter system which will not filter as sharp as categories are named.

It could be the case that some uniforms ( or something else) is not in category dress items but in basic items or similar behaviour. This is due to a filtering by occurance of phrases in classnames of the items or their parents.

I guess I know a better solution now but sometimes you want to deliver instead of fiddeling around again.

Also this filter system has to do very much work on initializing phase of this script. Therefore it can take up to a minute after mission start until spawning begins.

 

triggers/markers which are set up in _no_spawn_area_array have a higher priority than those in _spawn_area_array. This means if you have a no spawn trigger/marker inside a spawn trigger/marker then no items will spawn in the no spawn area but items will spawn in the surrounding spawn area.

Sounds good but is not entirely true. Just make your no spawn areas somewhat bigger then you think 😉

 

I will change first post when I feel like it.

 

Have fun!

Saro

Download SSLS version 1.2

  • Like 1

Share this post


Link to post
Share on other sites

Hi guys. I have a problem with the loot inside the houses. When I walk in and see the loot, I can't take it. It seems like they become simple objects on the map and I can't take them, the option to take them does not appear. Please I need any suggestions. Thank you.

Share this post


Link to post
Share on other sites
19 hours ago, Myla Pingarelli said:

could this be done in a singleplayer environment? like the init.sqf and not the initServer.sqf?

Of course.  In single player, your machine is the server.

See the following:

Event Scripts

Initialisation Order

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×