so i have 2 different arrays of different arrays but the contents are corresponding( one has flipbooks and the other has the name of the characters ) how do i get the correct index after it has gone through random to give it to the copy of the namelist array as it is in the image?
You can change the variable from array to map. Maps are somewhat similar to arrays, but hold key/value pairs instead of just values.
This means you can use your Flipbook as the key and the Name as the Value.
So after randomly selecting a Flipbook you can get the corresponding value (-> the Name) from the Map.
can you show me an image of that because i didn’t fully get it, i think a map is an option like the array but i haven’t used it before
Sure! You can change from array to map by clicking this little square and then choosing the last option.
This way you can now select Text as the value type (right of the square) and use the Flipbook as the key (left of the square).
You can then, for example, get all keys of this map, pick a random one and find the corresponding vale from the map, as in my graph example.
Also, for the sake of completeness:
In case you want to store more data per Flipbook than just a name it might be worth it to look into DataTables.
Yes, thats how you can utilize the map to get the name.
Though a heads-up:
You currently use the output of the Random node to find the respective name. Since the Random node is “pure”, it runs again for every connection.
This means you store one randomly selected Flipbook in your variable and use another randomly selected one to find the name.
To fix this, simply use the FinalFlipbook variable as an input for the Find node to look up the matching name
yeah that’s it and i was wondering why the names and flipbooks weren’t matching properly, thanks a ton
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.