- Joined
- Jul 19, 2010
- Messages
- 309
Reference Page: Visualize: Dynamic Indexing
I am currently using the above dynamic indexing; but attempted to expand it further - allowing each index to track subitems.
Imagine that each index held an "Ongoing Occurrence" and that these occurrences were able to host between 1 and 5 special effects.
Upon resolution of an occurrence all the special effects it was hosting would be resolved and destroyed.
I had made a variable to track what range of special effects should be getting targeted for any given point in the MUI's iteration.
It was written like this:
Occurrence A: (3 FX)
Occurence B: (1 FX)
Occurrence C: (5 FX)
As the MUI function iterated it would set the range of special effects to target equal to the total sum of all occurrences that have already iterated in this run.
(For example, on Index 3. SpecialEffectToStartOn would be equal to 3 + 1, since those 2 occurences already happened. So it would properly look at 5-9 for Occurence C.
HOWEVER; after looking back at this tutorial I remembered that when Occurrence A resolves, it's position will actually be taken by Occurrence C (the last one in the index).
So my SpecialEffectToStartOn variable gets it's position lost since it is no longer a linear iteration in terms of C now being before B.
Query:
Does anyone know how to resolve this? Preferrably without a hashtable, with which I have no experience.
TLDR: Can you make an MUI array where a single index tracks a dynamic amount of values and have it iterate properly?
I am currently using the above dynamic indexing; but attempted to expand it further - allowing each index to track subitems.
Imagine that each index held an "Ongoing Occurrence" and that these occurrences were able to host between 1 and 5 special effects.
Upon resolution of an occurrence all the special effects it was hosting would be resolved and destroyed.
I had made a variable to track what range of special effects should be getting targeted for any given point in the MUI's iteration.
It was written like this:
Occurrence A: (3 FX)
Occurence B: (1 FX)
Occurrence C: (5 FX)
As the MUI function iterated it would set the range of special effects to target equal to the total sum of all occurrences that have already iterated in this run.
(For example, on Index 3. SpecialEffectToStartOn would be equal to 3 + 1, since those 2 occurences already happened. So it would properly look at 5-9 for Occurence C.
HOWEVER; after looking back at this tutorial I remembered that when Occurrence A resolves, it's position will actually be taken by Occurrence C (the last one in the index).
So my SpecialEffectToStartOn variable gets it's position lost since it is no longer a linear iteration in terms of C now being before B.
Query:
Does anyone know how to resolve this? Preferrably without a hashtable, with which I have no experience.
TLDR: Can you make an MUI array where a single index tracks a dynamic amount of values and have it iterate properly?
Last edited: