Forum rules - please read before posting.

Has item ever been owned.

I'm looking into some of the designs for our project and it seems that I end up constantly duplicating variables in various scenarios, which could be simplified to: "Has item ever been owned?". This is mostly the case because we use "notes" like in a detective game, which are combinable to produce other notes. And for the most part many things change on the reception of a note. Thus to avoid duplicating variables I thought a system where on every item pickup, we'd set a flag of whether that item was ever owned.

At first we thought we could solve this problem by changing the categories of items into consumed and simply not displaying the consumed items anywhere, but it seems that changing the category during runtime is unsupported/may produce unexpected results. Therefore I think, we should include a proper global savable integer id list which shows what items have ever been owned.

I think this might be a pretty niche feature, so I don't know whether it should be implemented into the core AC, but I wanted to ask where would be the smart place to put this code? I saw some save system extension tutorials, but it seems that they mostly communicate through global variables, which is exactly the system we're trying to avoid bloating by adding this bit. The most straightforward solution would probably be encoding this thing into a single global string variable and decoding from it and we might end up doing it this exact way, but I was wondering whether anyone has any insights into a more elegant solution.


  • Inelegant or not, combining data into a single string is how much of AC's data is saved already. See the RememberAnimator component for some examples - I'd say that storing a list of integers separated with a common separator character would be fine.

  • Yeah. I thought of comma separated variable writing this post. Serializing the data into strings when saving/loading is a very common and good approach. I was more concerned with having a global var that has a narrow purpose and narrow formatting rules, publicly accessible by a bunch of things. But I can work around that by simply communicating with it ONLY during save/load and having a more common data structure during gameplay. This really does look like a good and easy solution. Thanks!

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.