Don't Starve Together

Don't Starve Together

28 ratings
Random Spawns Adjusted
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
19.057 KB
Sep 2, 2020 @ 3:34am
Sep 12, 2020 @ 12:14pm
6 Change Notes ( view )

Subscribe to download
Random Spawns Adjusted

Description
This mod allows spawning random entities around players every few seconds or by using a command. Entities are set in various categories (edibles, mobs, weapons, bosses, etc.) which have configurable spawn chances.

Random spawns are disabled for dead players, and a command can be used to disable certain players from getting them too.

Spawn chance is weighted against the total of all other categories. For example, if weapons category is set to 10 and armor is set to 40, there is a 20% (10 / (10 + 40)) chance for a weapon to spawn and an 80% (40 / (10 + 40)) chance for an armor to spawn. Entries under the same category currently all have equal spawn chances (e.g. all bosses have equal chances to spawn).

Missing prefab? Got a suggestion? Found a bug? Leave a comment or start a discussion! This is my first time uploading a mod so all feedback is appreciated :)

Commands

Each command starts with GetRandomSpawner() in order to access the mod's spawner, followed by the name of the function to call and must be entered in the console. For example, GetRandomSpawner():Start().

Start()
Stop()
Start or stop the spawn timer.
DisableFor(player)
EnableFor(player)
Blacklist a player from getting random spawns. The blacklist is empty by default and persists on server refresh.
SpawnRandomOnAll()
Manually trigger random spawns on all players. This is the same command the spawner uses on a timer.
SpawnEntityOn(prefab_name, player)
Spawn an entity on a player.
GetRandomEntity()
Get a random prefab name registered in the mod's spawn lists.

Note: All random spawns are based on the configured weighted chances.

Possible future updates
Let me know if any of these future updates interest you, any other suggestions are welcomed:
  • Commands to spawn from certain categories only.
  • Find a way to allow users to customize the individual entities under each category.
  • Tweak spawn settings so different categories spawn entities at different ranges (e.g. items appearing under players, but not bosses).
  • Add a despawn timer for indestructible structures.
  • Add missing prefabs to the spawn lists.
  • Add more complex spawns (e.g. multiple items at once, configured entities such as Poison Birchnut Tree, etc.).

Credits
Inspired by DST random spawner created by zaptrap
Thank you to Whisper, Smasher, Gear519, KoreanWaffles, iso, SpiffyShirt and everyone else that helped create the prefab list and test the mod!
7 Comments
That Arousing Platypus Elder God  [author] Aug 7, 2021 @ 2:24pm 
@nabi the spawn delay is ajustable in the mod configs. The current options are for 1, 2, 5, 10, 15, 30, 45 and 60 seconds or minutes.
Profaned BrickEater Aug 7, 2021 @ 4:36am 
when do they spawn? like every 8 secs or somethin?
That Arousing Platypus Elder God  [author] Sep 12, 2020 @ 12:23pm 
@屍鬼 Strangely, one of the players doesn't have a health value and it crashes. I'm not sure what can cause this, maybe health isn't set yet when the player joins for the first time? I disabled spawns for such players for now so should be fixed.
屍鬼 Sep 12, 2020 @ 7:38am 
The mod crashes as within seconds after the game starts for me. No changes made. https://imgur.com/jSyvoZv
That Arousing Platypus Elder God  [author] Sep 4, 2020 @ 2:20pm 
@Chicken good catch! Water tiles were intended to prevent random spawns so you don't have inaccessible items or monsters on water when you're on land, but things were still being spawned regardless. Should now be fixed in the most recent patch. Thanks for reporting!
Chicken Sep 4, 2020 @ 12:06pm 
Okay, noticed something. When on a boat, things seem to spawn in one area instead of just on water/the boat. I used a boat to get away, but noticed nothing was spawning, although icons were showing up. I teleported to one of the icons and found that every object was spawning in the same place. [imgur.com]
Chicken Sep 4, 2020 @ 9:06am 
Armour + Weapons random spawner is going to be so fun for a PvP game or a boss battle! Definitely trying this out with friends when I get free time.