Skip to content

Remod-org/MonBots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

MonBots

Monument Bots!

An EXPERIMENTAL basic plugin to provide for bots at Rust monuments otherwise recently evacuated and/or not yet populated by Facepunch.

A basic management GUI has been created and can be accessed by ADMINS ONLY using the /mb command.

SUBJECT TO CHANGE!

Command

-- /mb -- Starts the gui where you can select and edit profiles including bot names, kit selection, etc. There are several other subcommands for this, all used by the gui and not yet documented.

Configuration

{
  "Options": {
    "Default Health": 200.0,
    "Default Respawn Timer": 30.0,
    "debug": false
  },
  "Version": {
    "Major": 1,
    "Minor": 0,
    "Patch": 3
  }
}

Pretty basic here. The default should get you going. The real meat is in the data file.

Config values will populate the data file 1:1 where they essentially match (currently health and respawn timer, which both work).

Data file

Upon a fresh load of the plugin, various profiles are created at oxide/data/MonBots/spawnpoints.

Here is an example showing two monuments:

  "Sphere Tank 0": {
    "monname": "Sphere Tank 0",
    "spawnCount": 0,
    "respawn": true,
    "respawnTime": 60.0,
    "detectRange": 60.0,
    "spawnRange": 30,
    "roamRange": 140.0,
    "startHealth": 200.0,
    "invulnerable": false,
    "lootable": false,
    "wipeClothing": true,
    "wipeBelt": true,
    "wipeMain": true,
    "wipeCorpseMain": false,
    "dropWeapon": false,
    "hostile": false,
    "kits": null,
    "names": null,
    "pos": []
  },
  "Stables A 0": {
    "monname": "Stables A 0",
    "spawnCount": 0,
    "respawn": true,
    "respawnTime": 60.0,
    "detectRange": 60.0,
    "spawnRange": 30,
    "roamRange": 140.0,
    "startHealth": 200.0,
    "invulnerable": false,
    "lootable": false,
    "wipeClothing": true,
    "wipeBelt": false,
    "wipeMain": true,
    "wipeCorpseMain": false,
    "dropWeapon": false,
    "hostile": false,
    "kits": null,
    "names": null,
    "pos": []
  },

For each monument you want to populate, you would start by setting the spawnCount to 1 or more bots.

Next, you can pick a name or set of names to be randomly assigned to the bots if desired.

You can and probably do want to assign a kit from the Kits plugin to them. This setting can also be an array of kits if desired.

Beyond the lootable flag, you can set the following items, which are only relevant if lootable == true:

  • wipeClothing -- Do not copy clothes the NPC wore to the corpse (default true)
  • wipeBelt -- Do not copy items the NPC had in their belt to the corpse (default true)
  • wipeMain -- Do not copy items the NPC had in their main inventory to the corpse (default true)
  • wipeCorpseMain -- Delete the default loot added to an NPC corpse main inventory (default false) Note that you probably want to set EITHER wipeMain or wipeCorpseMain to true, or set both to false

Leave pos: [] alone. This will be populated at runtime with the spawn point of each bot in case you have to look for them, etc.

  "Sphere Tank 0": {
    "monname": "Sphere Tank 0",
    "spawnCount": 3,
    "respawn": true,
    "respawnTime": 60.0,
    "detectRange": 60.0,
    "spawnRange": 30,
    "roamRange": 140.0,
    "startHealth": 200.0,
    "invulnerable": false,
    "lootable": false,
    "wipeClothing": true,
    "wipeBelt": true,
    "wipeMain": true,
    "wipeCorpseMain": false,
    "dropWeapon": false,
    "hostile": false,
    "kits": [
      "tankbots"
    ],
    "names": {
      "Barbara",
      "Megan",
      "Lacey"
    ],
    "pos": []
  },
  "Stables A 0": {
    "monname": "Stables A 0",
    "spawnCount": 5,
    "respawn": true,
    "respawnTime": 60.0,
    "detectRange": 60.0,
    "spawnRange": 30,
    "roamRange": 140.0,
    "startHealth": 200.0,
    "invulnerable": false,
    "lootable": false,
    "wipeClothing": true,
    "wipeBelt": false,
    "wipeMain": true,
    "wipeCorpseMain": false,
    "dropWeapon": false,
    "hostile": false,
    "kits": {
      "cowboy1",
      "cowboy2"
    },
    "names": [
      "Stabler"
    ],
    "pos": []
  },

You can also adjust the startHealth and other values as you like.

USE THE GUI - /mb

For Developers

  • private bool IsMonBot(ScientistNPC player)

    Given a ScientistNPC object, determine whether or not this is a MonBot

  • private string[] AddGroupSpawn(Vector3 location, string profileName, string group, int quantity)

    Spawn a group of bots at a specific location using either a new or existing profile (group)

  • private string[] RemoveGroupSpawn(string group)

    Remove a profile (group) and associated bots

  • private string GetMonBotName(ulong npcid)

    Return the bot name given its userid

Releases

No releases published

Packages

No packages published

Languages