BotSpawn

Moved

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

5/5, 81 likes
  1. Which RandomSpawns?
    Is it on Oxide? (I know of a premium one, but I am unsure if I’m able to post the name of the site haha)
     
  2. Yeah I posted the site in my original comment and it blocked me but thats the one im talking about it is a premium mod that I paid for. You could say the code is very chaotic.
     
  3. Hahaha, odds are I could make the hook for it, with permission.
     
  4. That would be very cool. Almost feels a shame I bought that mod from only the use with Treasure Hunt (hope im aloud to say that name here)
     
  5. From my knowledge, we can say the name, just not the site.
     
  6. @Steenamaroo No one seems to be talking about this but Facepunch released a server update dealing with the ai yesterday morning. After installing it the ai that normally are fine and do what there supposed to now won't engage unless right under there nose, literally.
     
  7. @Steenamaroo
    I've managed to fix the conflict between my plugin and yours.
    I couldn't change the part of my code where it was conflicting from, as it was a needed portion.
    Code:
    object OnEntityTakeDamage(BaseCombatEntity entity, HitInfo info)
            {
                NPCPlayerApex Scientist = null;
              
                if (entity is NPCPlayerApex)
                   {
                        Scientist = entity as NPCPlayerApex;
                      
                        if (!TempRecord.NPCPlayers.Contains(Scientist))
                        return null;
                      
                        if (info.Initiator is BasePlayer)
                        {
                            var damagedbot = entity as NPCPlayer;
                            var canNetwork = Vanish?.Call("IsInvisible", info.Initiator);                                                                           //bots wont retaliate to vanished players
                                if ((canNetwork is bool))
                                if ((bool)canNetwork)
                                {
                                    info.Initiator = null;
                                }
          
                                if (configData.Options.Peace_Keeper)                                                                                                //prevent melee farming with peacekeeper on
                                {
                                var heldMelee = info.Weapon as BaseMelee;
                                var heldTorchWeapon = info.Weapon as TorchWeapon;
                                if (heldMelee != null || heldTorchWeapon != null)
                                info.damageTypes.ScaleAll(0);
                                }
                              
                                var bData = Scientist.GetComponent<botData>();
                                float multiplier = 100f / bData.health;
                                info.damageTypes.ScaleAll(multiplier);
                        }
                   }            if (info?.Initiator is NPCPlayer && entity is BasePlayer)                                                                                           //add in bot accuracy
                {
                    var attacker = info.Initiator as NPCPlayerApex;
              
                    if (TempRecord.NPCPlayers.Contains(attacker))
                    {
                        var bData = attacker.GetComponent<botData>();                    System.Random rnd = new System.Random();
                        int rand = rnd.Next(1, 10);
                            if (bData.accuracy < rand)                                                                                                              //scale bot attack damage
                            {
                            return null; //<-- Here
                            }
                            else
                            {
                            info.damageTypes.ScaleAll(bData.damage);
                            return null;  
                            }
                    }
                }
                return null;
            }
           
    Just replace the entire hook with this, the only change was (marked it)

    Doesn't solve it the way it was intended to solve the problem. Working towards another solution.
     
    Last edited by a moderator: Feb 24, 2018
  8. I've changed Activate to true, renamed the spawn, and changed keep default loadout to true, all done on the .json file in the config portion of oxide. Restarted the server and still no bots. Any suggestions on what to try next?
     

    Attached Files:

    • bot.PNG
      bot.PNG
      File size:
      10 KB
      Views:
      18
  9. Hey,
    If I return null for all conditions then the code does nothing. :p
    Returning true there is part of the accuracy code, making the bot 'miss'.

    What is return HitInfo doing in your plug?
    [DOUBLEPOST=1519502181][/DOUBLEPOST]
    I'm planning to fire up local server this week and see what what state everything's in. Thanks for posing.
     
  10. It’s returning the damage dealt to the player.
    [DOUBLEPOST=1519503583][/DOUBLEPOST]
    Darn, I'll continue working on my portion.
     
  11. To where? For use elsewhere in the plugin?
    Edit: Sending PM.
     
  12. how can I give the bots more ammo
     
  13. They have infinite ammo by default.
    If you want to give them ammo as loot, put some in the main container of their kit.
     
  14. I meant more ammo for the bot itself. They need more ... I think :)
     
  15. NPC's do not require ammunition.
     
  16. I cant seem to load the plugin, it was working but now it wont load
     
  17. @Steenamaroo Quick update on previous post, Seems after downloading the ai update it auto changed ai_dormant to true. Once I changed it to false again they were what I remember.
     
  18. Good! Thanks for that mate. :)
     
  19. Hey, is it okay if you tell me how to get zombies AND scientists to spawn? because I would like players to see random events as in fighting at radtowns! Thanks if you reply.
     
  20. They wont fight each other but, to have both at the same location, just create two profiles in the same place and have one set to murderer=true and the other murderer=false.
    [DOUBLEPOST=1519597944][/DOUBLEPOST]
    That error is with Build plugin, not botspawn.