edited November 2020 in ORK Support
I'd like to have some items sell for currency type A and some for currency type B. I'm accessing SellPrice through code to build my own exchange window and I get the expected predefined sellprice but I'm confused on how to make this work for multiple currencies.
Post edited by foxx on
  • Well, in ORK-only shops, the currency is defined by the shop.

    If you're doing your custom UI/system, keep in mind that the sell prices are defined in the base currency (i.e. the first currency, ID/index 0) and you need to convert that price into the currency you want based on the exchange rate:

    int newPrice = ORK.Game.ExchangeCurrency(oldCurrencyID, oldPrice, newCurrencyID)
    oldCurrencyID will usually be 0 (since you convert from the base currency), oldPrice is the price you want to convert, newCurrencyID is the ID of the currency you want to use.
    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!
  • Ok, that makes sense thanks.

    I also had a question regarding referencing combatants that aren't in the party and don't live in a specific scene. Since my dungeons are randomized, I'd like to be able to spawn an combatants and reference them later. For example, a shopkeeper spawns in a randomized dungeon and I'd like his inventory (things you sold to him) to be the same when you see him again in another randomized dungeon. This is just one example but is there a way to keep this data about combatants who don't live in scenes? I know there's a "save spawned" option but I'm not sure if this is what I need or how to access them through code later.
  • Shops (and their inventory) are not combatants - the Shop Interaction component has use the defined Scene ID to save the stock and what you sold to the shop, you also need to enable the Save Shop options in the shop's settings.

    Combatant Spawners and Add Combatant components can remember their combatants based on the defined spawn ID and the name of the scene.
    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!
Sign In or Register to comment.