Hi! I'm using custom resources for effects that will be playing in a row. That's why every resource "Effect" has a reference to the next resource to be played.

The problem is they I want them to be able to backtrack other played effects. So I tried to give them a reference to the previous effect in the row. And I got a circular dependency error, which makes sense because the previous resource would be referencing the next and the other way around.

What would be the right way to do this? The best I could think of is instead of referencing Resources, to reference a path to every resource, but they are saved inside a resource container so they don't have a file path in the disk. I though of giving every resource an ID (or maybe using their unique RID) to let them reference previous and next, but this means they would need to load the resources one by one before being used, which may not be optimal. There is also the option to make a system that saves every played effect in order, and that references all of them. Although I don't like it as much as having effects reference the next effect. I'm curious if anyone knows a better practice for this? Thank you in advance!

  • xyz replied to this.

    Godoten Put them all in an array and run them in the order they appear in the array.