How to setup an Array with none fixed Entries Amount?

I got an array for quests which are loaded on game start. Lets say there are seven quests in the array, with the ids 2,5,11, 15, and so on, but no matter if I use AddUnique or just Add, the Output Log reports an error about the Length, ie. Index of 25 (the highest quest ID) but only of Length seven.

The quests have their unique numbering, and this amount is extended as the game development progresses.

Do I have to use something like Set Element, or do I have to add the empty (not yet picked up quests) entries, with a default value? Or do I have to store the values differently (based on max quests amount), which would mean slightly more work.

Storing and loading works though, but I rather fix this yellow error notice.

seems like your confusing your ids with indexes. the error you get is basically telling you your trying to get a index that doesnt exist. itd be easier to tell for sure if i saw your script.

the answer will vary based on your array type. the basic answer though will probably be when your trying to get information from the array you will need to use the find item node then a get from there. so if you have 7 quests in your array and lets say for the sake of simplicity that your array is of type integer, then you wanted to get quest id25. to do that you would use find item “25” which will return the index at which that item is located, then you use a get node to get the actual information from the array. this solution may not work however as i think about it it seems a bit redundant.

hmmm perhaps a better solution for you would be to use a map instead of an array. with a map you can store the quest id as the key and the information associated as the value.

another solution would be to store your quests (all of them) in a datatable then have a array which contains the ids of the active quests. then you would just use the array to track which quests are active.

anyway it at least gives you some things to consider. without knowing more of your system its hard to say.

Hi Thompson, all quests are inside a datatable, upon fetching the cloud based quest string a loop gets the entries, and creates these quests depending on quest ID, and dependent on the quest state, and if the quest is already completed, part of the questlog completed quests.

So what I get is that this issue is more related to accessing the questlog array, will take a look at this later and post here again. Thanks!

Image shows storing/updating the questlog.