Skip to content

Plugin API #3

Open
Open

Description

@kuglof31

It's not working properly, for instance when I wrote that the bots must go from wherever I am to gate B in a plugin, they just started attacking me, literally ignoring what I had just said to them

Activity

  1. Michaelihc commented on Nov 1, 2026

    @Michaelihc
    Owner

    Thanks for reporting this. I reproduced two bugs in BotOrders that match what you describe. Both are fixed on main and will be in the next release.

    The bot attacks and ignores the order. If MoveToRoom is rejected, it returns false and nothing is recorded, so the bot simply carries on with its normal AI. In testing, an armed bot kept hitting a nearby enemy after a rejected order. A likely trigger is a server on the default Runtime navigation without the patched assets, because rooms then have no navigation. A rejected order now leaves the bot passive, with FailedNoPath and a FailureReason you can read through TryGetStatus.

    The bot doesn't walk. On Runtime, calling MoveToRoom straight after SpawnBot picked a destination before the bot had a position, so the order returned true and then failed with FailedNoPath. Room orders now wait until the bot has spawned. With the fix, a guard ordered to EzGateB straight after SpawnBot walked there on both navigation backends with no attacks, with an enemy kept in view the whole way.

    I can't tell which of these you hit without your code and logs. While you're on the current release, this avoids both:

    ReferenceHub bot = BotOrders.SpawnBot("Courier", RoleTypeId.FacilityGuard);
    BotOrders.Stop(bot);   // passive straight away, even if the next order is rejected
    
    Timing.CallDelayed(2f, () =>   // let the bot spawn first
    {
        if (!BotOrders.MoveToRoom(bot, RoomName.EzGateB))
            Log.Error("Order rejected, check the [BotOrders] lines in the server log");
    });

    Then check navigation.backend in your config. Runtime needs the asset patch. Without it, set navigation.backend: Authored.

    Two things to expect from orders:

    • Ordered bots don't defend themselves, and after an order ends they stay passive and hold position. A new order moves them again.
    • Bots only route through doors they can open, so a bot may need the right keycard to get all the way to a room.

    If it still happens after this, please post your code and any [BotOrders] lines from the server log (ROOM_UNAVAILABLE, ROOM_UNREACHABLE, NO_PATH, OFF_MESH).

  2. Michaelihc commented on Nov 1, 2026

    @Michaelihc
    Owner

    The fixes are out in v2026.11.02-7e5b30d. Calling MoveToRoom straight after SpawnBot now works, a rejected order leaves the bot passive, and FailureReason tells you why it was rejected, so the Stop workaround is no longer needed. How orders behave is written up in docs/plugin-api.md.

    If you run warmup, read the upgrade notes first: warmup moved into a separate BotRoundControl.dll.

    Please let me know if it still happens on this version. I'll leave this open until you've had a chance to try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions