Forum rules - please read before posting.

Using variable token in Inventory Label

edited February 2018 in Technical Q&A
hi,

this is really not a big issue and I'm sure there are people with more important conerns here on the forum, but maybe someone has "been here, done that" and could point me in the right direction.

for a current project I've been restraining myself to only use built in AC features and no additional unity code, so if anyone knows how to do this without scripting it would be awesome.

the latest issue I've run into is a bit frustrating, because I don't see why it shouldn't be possible to do, and maybe it simply isn't or I am missing something totally obvious, but when I use a variable token as part of an inventory item label it just prints for example [var:7] instead of the actual value.

background: I've created a seperate inventory that I use as a questlog or progression tracker and wanted to show something like "you have done this 4/5 times" or "collect 4/10 of this".

I'm sure I could find a different workaround, using a menu of labels that are being turned on and off, but I felt like the inventory offered more other innate functionality that comes in handy, like not having to switch out icons seperately since they are already tied to an item on the list.

cheers,
J

p.s.: using Unity 2017.2.0f3 and AC 1.60 (that was the latest when I started to work on this)

Comments

  • The conversion of tokens isn't automatic everywhere - the feature needs to be applied to each case in code, and I hadn't considered one using tokens in that area.  I'll look to see if it's possible - if it doesn't impact performance, I agree this would be a nice addition.
  • edited February 2018
    That'd be really neat. Thank you for looking into it.

    Inventories are basically a collection of hotspots, right? But they lack some features like sprite swapping, renaming, disabling interactions, etc. maybe there's even more.

    I can already do all those by working with multiple items and replace and sometimes it really makes sense to keep different versions of the same item seperate.

    Having the option to edit items via Action List just seems like a useful and convenient alternative.
  • Text tokens will be available for item labels in the next update.

    Any item property or field can be modified at runtime, but since there's no end to the changes that could be made (any most users won't do so), this is left to custom scripting.

    If you right-click on a field's label, you'll get an API reference to it that can be used to change its value at runtime.  This in turn can be placed in a custom Action if necessary,

    Such changes will not be saved, however, so custom global save data must also be implemented.  I recommend you use the Inventory: Add or remove Action to replace one item for another when possible.
  • Great! Thank you! (:
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.