BotSpawn

Moved

Total Downloads: 11,690 - First Release: Jul 31, 2017 - Last Update: Jul 27, 2018

5/5, 81 likes
  1. Hi all. Very good job as usual but what's the use of the "Relocate_Custom" option?
     
  2. Oversight. :p
     
  3. What I do not understand is why when we shoot to a "bot", the one does not chase us anymore?
    [DOUBLEPOST=1524754362][/DOUBLEPOST]Before, when one of the "bots" had spotted me, he was going to follow me in a building if I was going to hide in it. Now when I hide, the "bot" is content to no longer shoot, without moving,
     
    Last edited by a moderator: Apr 26, 2018


  4. I have already done this activity. She was very greedy in material resources (RAM / Proc). I left to cover various areas of the MPA with radius of 600 (9 boxes covered on the map from its center). With a creation of 50 zombies sometimes 120 to create hordes. But that was really fun. I doubt that this is possible to date, with the update of Facepunch. Personally, my lag server already has a lot less bots / zombies generated.
     
  5. Are you saying the latest release/update to rust has caused more lag? Also I have a question for @Steenamaroo. How difficult would it be to add a Random_Spawn (bool) to the addon? (land only) then have a config option for how many to spawn up to 6000 since it already has the ability to choose from that many names. Of course we would not use 6000 due to lag but the number would be configurable. Sorry bout the formating
     
  6. why u dont use your owne botspawn Profile ? just simple go to coordinate o 0 its the middle of the map and type in Chat as example

    /botspawn add mapspawn

    so now navigate to oxide/data/botspawn and edit it how u like example 100 bots, if u have a 4000 map then set spawn radius to 1800 and dont forget to activate now save and reload your botspawn plugin.
     
  7. @Steenamaroo - I don't suppose there is anyway you can add an option so when you spawn in X number of bots randomly over a radius, they then move towards the center of that radius i.e. the spawn location? For context I was thinking so when you use the API to spawn in bots they then move towards whatever triggered that spawn.

    Just a thought, probably impossible :p
     
  8. Hi Rebajas,
    You could change one single var to make them gravitate towards the centre instead of their personal, unique, spawn point.
    Of course this is problematic for any respawning bots because they'll also want to respawn at the centre if killed,
    but not a problem if you're exclusively using toplayer command or AddGroupSpawn Ext. Hook.

    Anyway, the change is @ line 318 if you want to give it a go.
    Code:
    bData.spawnPoint = newPos;
    //should be changed to
    bData.spawnPoint = pos;
    [DOUBLEPOST=1524784670][/DOUBLEPOST]Nice to see someone using those hooks already.
    They were added by request. Any and all feedback is welcomed. :)
     
  9. Well, I haven't got as far as using the hooks yet, but I will probably do some more tomorrow.

    Bots respawning and gravitating to the center wouldn't be a problem for me as the event location is fixed (Chinook crate) - but I don't really want to mess with the plugin as I use it for monuments too.

    I'll play about for a while (between work) and see what happens. When I get something working I'll share it here... :) maybe someone will improve it for me :p
    [DOUBLEPOST=1524793538][/DOUBLEPOST]What would be nice, is an option in the API to gravitate to center. ToPlayer, Airdrop and the API calls don't respawn anyway, do they?

    Just thinking they all would work well with bots spawning at a distance and gravitating in... and as a switch option other user cases can switch the behaviour back to default.

    Loving this plugin :D well done.
     
  10. Hmm, is there a more detailed explanation on how the hooks get called - either a generic one or an example CS you used for testing maybe?

    I'm using:

    Code:
    void OnCrateHack(HackableLockedCrate crate) {    Vector3 location = crate.transform.position;    AddGroupSpawn(location, "MilitaryTunnel", "ChinookCrate");}
    Where "ChinookCrate" is an arbitrary string.

    The error I get states that 'AddGroupSpawn' does not exist in the current content...

    I've added [PluginReference] Plugin BotSpawn; too - no idea why :p
     
  11. Yup, you need the plugin reference, then you need to address the BotSpawn hook like this:
    Code:
    string[] result = BotSpawn?.CallHook("AddGroupSpawn", location, "MilitaryTunnel", "ChinookCrate"); 
    result[0] will be true/false/error and result[1] will be a description message.
    if (result[0] == "true"), your call worked.
     
  12. Thanks.

    Can't convert object to string[], am I missing a cast?
     
  13. oops,

    string[] result = BotSpawn?.CallHook("AddGroupSpawn", location, "MilitaryTunnel", "ChinookCrate") as string[];
     
  14. Ignore me :)
    [DOUBLEPOST=1524799312][/DOUBLEPOST]Okay, now I'm getting the result[0] of false with the result[1] message 'Group add failed - Check profile name and try again'.

    I've tried 2 profile names from the BotSpawn.json config file. Does the group have to exist anywhere outside the AddGroupSpawn call?
     
    Last edited by a moderator: Apr 27, 2018
  15. With fresh eyes I got it working, albeit only with a custom location - but that's fine for me.

    What's more I notice I don't have to have the profile 'active' for the API bots to work :) which is great as my bots are themed for each event.

    My lunch time is over now but I'll do some more at the weekend!
     
  16. That's right.
    I'm going to have to work on some better naming or descriptions.
    That hook says 'send one group of non-respawning bots to my chosen location, and apply "$profile" template to them.

    That's why, rather confusingly, every profile has a suicide timer option now; Because any profile can be used as a template for one-off group spawns and a global suicide timer, for anyone making use of these hooks, would be a little limiting.

    CatMeat suggested that "Activate" should really be called "AutoSpawn", which would make much more sense.

    You're right; The code will only let you pick from custom profiles right now (/data).
    There's no reason data+config shouldn't be available to you, so I'll modify that.

    Also, if external hooks have the ability to create new profiles from scratch I should probably make it that Activate/Autospawn can be set true and the routine started without the need to restart the plugin.
     
  17. That's sounds like you've got alot of work to do :p

    For the most part this works perfectly for what I want to do - yeah, I have wishes but those aren't deal breakers. Bloody fine job sir!!!
    [DOUBLEPOST=1524838463][/DOUBLEPOST]The basic plugin using Steenamaroo's BotSpawn plugin:

    Code:
    using Rust;
    using UnityEngine;
    using Oxide.Plugins;
    using Oxide.Core.Plugins;namespace Oxide.Plugins {    [Info("FNF | Bot Spawn Events", "Rebajas", "2018.04.26")]
        [Description("Add bot spawn events.")]    class BotSpawnEvents : RustPlugin {        [PluginReference] Plugin BotSpawn;        int playerCount = 0;
            int minPlayerCount = 0;        string chinookBotTheme = "Scientists";        void Init() {            UpdatePlayerCount();        }        void OnPlayerInit(BasePlayer player) {            UpdatePlayerCount();        }        void OnPlayerDisconnected(BasePlayer player, string reason) {            UpdatePlayerCount();        }        void UpdatePlayerCount() {            playerCount = BasePlayer.activePlayerList.Count;        }        void OnCrateDropped(HackableLockedCrate crate) {            if (playerCount > minPlayerCount) {                Vector3 location = crate.transform.position;                CallBots("Scientists", "ChinookEvent", location);            }        }        void OnCrateHack(HackableLockedCrate crate) {            Vector3 location = crate.transform.position;            timer.Once(200f, () => {
                    CallBots("Scientists", "ChinookEvent", location);
                });            timer.Once(500f, () => {
                    CallBots("Scientists", "ChinookEvent", location);
                });            timer.Once(800f, () => {
                    CallBots("Scientists", "ChinookEvent", location);
                });        }        void CallBots(string profile, string group, Vector3 location) {            string[] result = BotSpawn?.CallHook("AddGroupSpawn", location, profile, group) as string[];        }        private int GetRandomInt(int min, int max) {            /* Generate randon int in range */            int randomIntInRange = UnityEngine.Random.Range(min, max);            return randomIntInRange;        }    }}
    [DOUBLEPOST=1524838580][/DOUBLEPOST]With the custom profile:

    Code:
    {
      "CustomProfiles": {
        "Scientists": {
          "Activate": false,
          "Murderer": false,
          "Bots": 3,
          "BotHealth": 100,
          "Radius": 30,
          "Kit": [],
          "BotName": "Drop Scientist",
          "Bot_Accuracy": 4,
          "Bot_Damage": 0.4,
          "Respawn_Timer": 60,
          "Disable_Radio": false,
          "LocationX": 0,
          "LocationY": 0,
          "LocationZ": 0,
          "Roam_Range": 60,
          "Peace_Keeper": false,
          "Weapon_Drop": false,
          "Keep_Default_Loadout": false,
          "Wipe_Belt": true,
          "Wipe_Clothing": true,
          "Allow_Rust_Loot": true,
          "Suicide_Timer": 900
        }
      }
    }
     
    Last edited by a moderator: Apr 27, 2018
  18. Kind of you to share! Thank you.

    I should probably include a .cs example of all hooks on the main page, with a brief description of each in //comments.
     
  19. Yeah - could save you answering the same questions alot :)
     
  20. Hello :)

    I make an arena with bots it is impossible to kill them

    it's not a pve server/plugin
    i use Event-Manager (the event manager creator do not answer me)

    Thanks for help :)