Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubik's CBM inventory refreshes WAY too fast #54407

Closed
FlyingVolvo opened this issue Jan 14, 2022 · 8 comments · Fixed by #55046
Closed

Rubik's CBM inventory refreshes WAY too fast #54407

FlyingVolvo opened this issue Jan 14, 2022 · 8 comments · Fixed by #55046
Labels
NPC / Factions NPCs, AI, Speech, Factions, Ownership

Comments

@FlyingVolvo
Copy link

Describe the bug

Rubik currently provides what is in effect access to an immense amounts of CBMs because his trade inventory refreshes every time you ask him to assist with an operation.

Steps to reproduce

  1. Unlock access to Rubiks CBM assistance
  2. Perform a minor operation
  3. Watch his trade inventory get new items

Expected behavior

For it not to refresh with new CBMs every single operation he helps with.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 2009
  • Game Version: 0d7276f [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    No Fungal Monsters [No_Fungi],
    Bionic Professions [package_bionic_professions],
    SpeedyDex [speedydex],
    Stats Through Skills [StatsThroughSkills],
    Original Drug Names [OG_Drugs]
    ]

Additional context

No response

@Maleclypse Maleclypse added the NPC / Factions NPCs, AI, Speech, Factions, Ownership label Jan 14, 2022
@Maleclypse
Copy link
Member

@I-am-Erk tagging to make sure you see this.

@FlyingVolvo
Copy link
Author

#53057 magnifies this issue even further because after a handful of operations it looks like this
54407

@estebandellasilva
Copy link

#53057 magnifies this issue even further because after a handful of operations it looks like this 54407

No Cardbord Boxes? Blasphemer - i remember my rubik having stacks of cardbordboxes lying around it was trashhell ... and he got more every time

@I-am-Erk
Copy link
Member

Probably missed an instance of a timer variable check. I'll try to get some time to have a look

@Nerezza
Copy link
Contributor

Nerezza commented Jan 29, 2022

I just added new information to #54695 that I believe is also relevant to this.

Notably: Rubik is deleted every time you start a conversation with them, and a new one is spawned in a turn after the conversation ends. This new Rubik seems to hold the new CBMs being added to the stock, while the rest of the stock is the leftover everything the old Rubiks dropped on the ground, and whatever's stocked in the shelves.

For some reason whatever's deleting Rubik is tied to the bug that's teleporting the player and causing fall damage.

@Nerezza
Copy link
Contributor

Nerezza commented Feb 3, 2022

So I've done some investigation and this bug is actually the reason #54695 was triggering every time we talked to Rubik.

Inside exodii_merchant_talk.json it appears this block was being triggered every time we spoke to Rubik:

      {
        "//": "Every week, add some stuff to the shop based on your current trust.",
        "condition": {
          "and": [
            { "u_has_faction_trust": 1 },
            { "not": { "u_has_effect": "u_exodii_interaction_timer_long" } },
            { "u_has_trait": "CBM_Interface" }
          ]
        },
        "effect": [ { "mapgen_update": "tier1_CBM_shop_update", "om_terrain": "exodii_base_x0y2z1" } ]
      },

I'm still trying to work out why this is triggering its mapgen update, I'm hoping someone that knows flow control in json files can look this file over for bugs.

Edit just a bit later: I checked player vars and u_exodii_interaction_timer_long is applied so the "and" should be returning false.

@bombasticSlacks
Copy link
Contributor

bombasticSlacks commented Feb 3, 2022

As posted on the discord:

I'm guessing its because "u_exodii_interaction_timer_long" is sentineled
so it only happens once, so after the first 7 days of the effect you then never get it on talking to Rubik again. This is a problem since it is the blocker for the shop refreshes.

It should probably be moved to a user time variable since I don't know what order all those speaker effects are applied in. I feel like if it was non sentineled it would apply and then the further conditionals to refresh would fail always.

The issue with falling is being fixed by Ramza in #55021 and is related to any mapgen updates.

@Nerezza
Copy link
Contributor

Nerezza commented Feb 3, 2022

As posted on the discord:

I'm guessing its because "u_exodii_interaction_timer_long" is sentineled so it only happens once, so after the first 7 days of the effect you then never get it on talking to Rubik again. This is a problem since it is the blocker for the shop refreshes.

It should probably be moved to a user time variable since I don't know what order all those speaker effects are applied in. I feel like if it was non sentineled it would apply and then the further conditionals to refresh would fail always.

The issue with falling is being fixed by Ramza in #55021 and is related to any mapgen updates.

Thank you for your input, it helped me work out how the speaker effects were written.

Since speaker effects are an array I figured they were executed by going through their index beginning-to-end and it appears I was correct because Rubik's restocking properly now. I'm pretty sure that if this bug hadn't existed, Rubik's CBM restocking actually would not have triggered with the order the speaker effects were in before I poked around in the json to fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants