BotSpawn V.1.9.1


Overview.



Description.

BotSpawn spawns a set number of Rust AI bots at chosen monument.
It also supports bots at server airdrops, supply drops, biomes, custom locations, and 'toplayer' by chat command.
Offers Facepunch default scientist, murderers, with additional customisation options, including kits.

  • Default locations are generated automatically and their settings are held in config/BotSpawn.json.
  • Custom location are added by chat-command and their settings are held in data/BotSpawn.json.

Optional dependencies -


Permissions.

botspawn.allowed - Required for non-admin use


Notes.

To use Spawns.cs instead of random spawnpoints, follow Spawns.cs instructions for creating a spawn file,
and give it the same name as the BotSpawn profile you intend to use it with.
I.E. BotSpawn profile "Dome" will look for a spawns.cs record called "Dome".

Airdrop bots and toplayer bots do not respawn once killed.

Without Kits Default Scientists/Murders will have nothing in their corpse inventory
except default Rust random loot - No weapons or clothes.

All BotSpawn options will govern BotSpawn bots, only! The only exception is "NPCs_Attack_BotSpawn" option.


Configuration.
Global.
  • "NPCs_Attack_BotSpawn": false,
  • "BotSpawn_Attacks_NPCs": false,
  • "Ignore_HTN": true/false (botspawn npcs will ignore scarecrows etc.),
  • "APC_Safe": true,
  • "Turret_Safe": true,
  • "Animal_Safe": true,
  • "Supply_Enabled": false, (spawn 'airdrop' bots for user-called supplys)
  • "Remove_BackPacks_Percent": 100 is always : 0 is never.
  • "Remove_KeyCard": true, (any keycards in bot default loot will be destroyed)
  • "Ignore_HumanNPC": true, (ignore 'bots' from HumanNPCCore plugin)
  • "Pve_Safe": true, (bots will not be injured by fire/barbs, etc.)
  • "Corpse_Duration": 60
  • "Max_Chute_Wind_Speed": 100
  • "Max_Chute_Fall_Speed": 100

*'BotSpawn' are bots spawned by this plugin.
*'NPCs' are bots spawned by any other means.

Note - The first three global options are preventative.
False = disable : True = default behaviour.


Per-profile.

The following options will be listed once in your data/config json for each location. The only essential setting is AutoSpawn : True. Everything else is preference.

  • AutoSpawn- true/false
  • Attacks_Other_Profiles - true/false.*
  • Allow_Rust_Loot_Percent - 100 is always : 0 is never.
  • Bot_Accuracy_Percent. 100 is most accurate.
  • Bot_Damage_Percent (dealt)- 100 is greatest amount of damage.
  • Bot Health - 100 is default. Value can exceed 100.
  • Bot Names - [], See below
  • Bot Name Prefix - eg "NPC".
  • Bots - 10.
  • Chute - true/false
  • Disable_Radio - true/false.
  • Keep_Default_Loadout - true/false.
  • Keeps Scientist/Murderer attire and weapons, in addition to your custom kits.
  • Kit - [],
  • Location - Data only - Do not change manually.
  • Murderer - True/False
  • Spawns the 'running zombie' murderer prefab instead of Scientist.
  • Parent_Monument - eg "Dome"
  • Custom profiles only - Maintains position relative to parent after map seed change.
  • Peace_Keeper- true/false

Bots ignore you if you have no projectile/fire weapon drawn.
Melee will do no damage to bots.

  • Peace_Keeper_CoolDown: 5 (seconds)
  • Once aggravated, bots will remain hostile towards you for this period, even if you put away your weapon.
  • Radius - 200 - Size of the area in which bots will spawn.
  • Respawn_Timer- 60 seconds
  • Roam_Range - 40.
  • Aggro_Range - 30.
  • DeAggro_Range - 40.
  • Suicide_Timer - 300 seconds.**
  • Wipe_Belt_Percent - 100 is always : 0 is never.
  • Wipe_Clothing_Percent - 100 is always : 0 is never.
  • Weapon_Drop_Percent - 100 is always : 0 is never.

* Murderers will never attack murderers but murd V sci and sci V sci will work fine.
** Prevents long term build up of airdrop and toplayer bots.
** Does not apply to re-spawning regular bots.Kits and Names should be formatted as follows:

["kit1"], for single or ["kit1","kit2", "kit3"], for many.
["name1"], for single or ["name1","name2", "name3"], for many.
BotSpawn will randomly pick one from your list.
If the number of kits is equal to the number of bots, BotSpawn will always pair them together.
Kit1 Name1, Kit2 Name2, etc.
Random names are generated for any blank entires.


Chat commands.
  • /botspawn add <customname> - Add a custom profile at your location
  • /botspawn remove <customname> - Remove a custom profile at your location
  • /botspawn move <existingname> - Relocate a custom profile to your location
  • /botspawn list - Show all custom location names
  • /botspawn toplayer <playername> <profile>; - You need to have a custom profile first

Note: You will need to edit data/BotSpawn.json and set AutoSpawn: "true", as well as any other customisations.


Default locations.
Monuments
  • Airfield
  • Dome
  • Power Plant
  • SewerBranch
  • Satellite
  • Trainyard
  • Water Treatment
  • Launch Site
  • Military Tunnel
  • Junk Yard
  • Harbor (2)
  • SuperMarket (2)
  • GasStation (2)
  • MiningOutpost (3)
  • Lighthouse (3)
  • QuarryStone
  • QuarrySulphur
  • QuarryHQM
  • Swamp (2)
  • Abandoned Cabins
  • AirDrop
Biomes
  • Arid
  • Temperate
  • Tundra
  • Arctic

Note: Radius is irrelevant for biomes Each bot spawns at a random position within the relevant biome.


API.
Single instance calls.

These will not respawn (like "toplayer" bots) location is your intended target, profileName is taken from BotSpawn (config or data), and group should be made up and assigned by the user.

  • string[] AddGroupSpawn(Vector3 location, string profileName, string group)
  • string[] RemoveGroupSpawn(string group)
Long term calls.
  • string[] CreateNewProfile(string name, string profile)
  • string[] ProfileExists(string name)
  • string[] RemoveProfile(string name)

All returns are string array [“true/false/error”, “details message”]
Also, botspawn can return the Monument Name and a list of live bots, for each AutoSpawn = true monument.

var result = (Dictionary<string, List<ulong>>)BotSpawn?.Call("botSpawnbots");


Example call.

[PluginReference]
private Plugin BotSpawn;

Vector3 location = new Vector3(0,0,0);
string[] Spawn = BotSpawn?.Call("AddGroupSpawn", location, "Dome", "YourNameHere") as string[];

Puts($"{Spawn[0]}");
Puts($"{Spawn[1]}");


FAQ.


Q: There's a million options. Where do I start?
A: Set AutoSpawn to true for at least one monument in config/BotSpawn.json, then reload the plugin.
A: Everything else is preference/user customisation.

Q: My bots disappear or don't move.
A: It's possible that some belt items and some weapon skins may caused the bots to stop responding.
A: Try plain weapons only in the belt to troubleshoot.
A: Failing that, try a different location.
A: Certain terrain still causes issues for bot spawning.

Q: Performance sucks.
A: Try setting ai_dormant = true
A: If this helps but you'd like to modify the dormancy range, you can specify 'ai_to_player_distance_wakeup_range X'. The default is 160m.
A: Failing that, please reduce the number of bots.

Q: My bots won't die?!
A: Make sure Godmode permissions allow you to do damage.
A: Same for vanish ^.
A: If you're running a PVE server, use a PVE plugin which allows you to alter its settings for NPCPlayers. Example TruePVE config, with thanks.

Q: I take damage when attacking my bots.
A: This can also be cause by server, or plugin, PVE settings.

Q: Will X kill my bots? A: Radiation, drowning, falling, and helicopters will not kill your bots.
A: Turret targeting bots can be toggled. Bradley targeting bots can be toggled.
A: Fire (campfires etc) will kill your bots. Damage from barbs, cacti etc will kill your bots, but can be prevented with the 'Pve_Safe' config option set to true.

Q: What weapons can my bots use?
A: I recommend sticking to basic bullet-weapons, hand tools and melee weapons.
A: Some weapons may work better than others. Some weapon skins have been known to cause issues and errors.
A: Please try plain weapons if you're having problems. Scientists are not optimised to use melee, only.
A: At least one projectile weapon should be given.

Q: Can I have custom profile locations?
A: Yes. Your custom locations are stored in data/BotSpawn.json. Use chat command /botspawn add NewNameHere to create a profile at your present location.

Q: Can I have specific custom spawn points? (underground, etc)
A: Yes. Use Spawns.cs to create a spawn file with the same name as an existing BotSpawn profile.
A: That BotSpawn profile will now ignore radius settings and use the precise spawn points from your file.

Q: Can I spawn bots at airdrops.
A: Yes. Airdrop option spawns bots at server drops. Spawn at user-supply call is an additional option.

Q: My bot kits aren't working.
A: Console will report if your kit does not exist, or if there is no active weapon there.
A: Please redeem the kit yourself to an empty inventory, to ensure that you remember to put items in it!
A: If it's empty, kit yourself out the way you want the kit to be then type: /kit edit NameOfKit and /kit items.

Q: How can I prove that bots have spawned? I can't find them.
A: Type bot.count into console.
A: Respawn timer is taken into account so if you spawn one and kill him, bot.count will show 0 until respawn.

Q: bot.count console command shows that there are 0 bots.
A: Double check that at least one monument is set active:true in your config, and reload the plugin.
A: Also, don't forget their respawn timer. Make sure they aren't all dead when you bot.count.