Skip to content

Merchant and item container windows close randomly

This is a very weird bug that only happens in my module. Whenever I open a merchant window (go to buy/sell something from a merchant) or open any item container, the window closes randomly within 3-5 seconds. I tested this on the standard toolset merchants/containers and it still happens. Even tested it using the base "open merchant" wizard script.

However when I create a brand new module and try it, the bug isn't there.

My main module has no haks besides my music hak but I had the bug before I created that hak. How do I fix this?

Comments

  • QuilistanQuilistan Member Posts: 177
    edited November 2023
    Does it stay open if you don't loot the container, or buy/sell from the merchant?

    If so check the module OnAcquireItem and OnUnAcquireItem scripts in module properties
  • randomguy101randomguy101 Member Posts: 6
    Nope. Regardless of what I do, how close I'm positioned to the merchant/container or direction it just closes randomly.
    The only module property script I've edited is OnClientEnter and I didn't even touch the original code of it. Maybe there's some heartbeat script thats messing with everything. Is there a way to revert everything to the base scripts?
  • randomguy101randomguy101 Member Posts: 6
    Reinstalling and deleting the documents folder didn't fix it either.
  • randomguy101randomguy101 Member Posts: 6
    Now THIS is crazy. I created brand-new module, reimported all resources into it, created a new area and did the same test setup, and the bug is THERE.
  • randomguy101randomguy101 Member Posts: 6
    So I seemed to fix the bug. It was a heartbeat script from a creature from another scene that was affecting the WHOLE module.

    void main()
    {
    BeginConversation("cnv_intro_2", GetFirstPC());
    }

    Is it me or should this bug never be happening in the first place? Are heartbeat scripts from other areas supposed to be running?

  • QuilistanQuilistan Member Posts: 177
    Glad you figured it out!
  • ProlericProleric Member Posts: 1,287
    Heartbeats run all the time for every object in every area.

    When there's no PC in an area, in some circumstances idle creatures acquire a low AI level which can delay new actions, but, for example, BeginConversation executes immediately.

    Other objects e.g. placeables do not slow down when no one's around.

    Often this doesn't use much resource or break things, but where there is very heavy heartbeat processing, you may want to count the number of PCs in the area and tell heartbeat scripts to do nothing if there are none.

    A classic example is wandering citizens and monsters - in a large module, performance and other issues are often improved if they are destroyed when there are no PCs and respawned when one enters.
Sign In or Register to comment.