edited December 2022 in ORK Scripting
Hallo, I have a trade stat that I would like to use to get higher prices when selling and lower prices when buying. I cannot access and modify the "BuyModifier" and "SellModifier" of an ShopOwner in C# or via Schematic.
I want to change this when the shop menu is open and then have a direct effect on the prices. Because my characters can each have a different stat value in trading, and when switching through the characters in the shop, I would like the prices to update. Does anyone know if this is possible.

Post edited by MM7565 on
  • The shop's buy/sell price modifier settings can e.g. use a formula to do that. The formula uses the shop user combatant (e.g. the player) for the calculations, so you can have stats affect it.

    However, changing the stats while the shop is open will not automatically update the UI to show new values (but when selling/buying, the price new price is used).
    You can trigger the UI update by firing the user combatant's inventory changes:
    combatant.Inventory.MarkFireChanged();
    combatant.Inventory.FireChanged();

    combatant is e.g. the player (can be accessed at all times using ORK.Game.ActiveGroup.Leader).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That's exactly what I was missing, my prices just weren't updating in the UI but "Gold" was getting correct e.g. calculated upon sale. Thank you very much.
  • edited December 2022
    Sorry, I have one more question: Is there a way to update prices in tooltips too? I use "Use Time Update" in "HudText Content", but unfortunately that doesn't show the modified price. Or can the prices be calculated.
    Anyway I have a custom script to calculate the prices, sorry, the tootip only needs a reference to it,
    that I can set the prices.
    Post edited by MM7565 on
  • HUD content probably doesn't come from the shop, that's just the regular item price information. You'd have to use a formula for the item price instead to have the stats influence prices at all time.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2022
    Ok, thank you
    Post edited by MM7565 on
  • edited December 2022
    I'll look into it, though - when coming from a shop, the tooltip should theoretically have access to that price.

    Edit: Ok, the universal Shortcut status type in ORK HUD Status Text Content components will display the shop price, but the more detailed Item status type currently doesn't, due to using the actual item instead of the one wrapped in a shop (with price info).
    I'll change that to also show shop price in the Item status type.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Great, works for me now with formula and hud text content.
Sign In or Register to comment.