Recently started retrofitting a project that was using the persist behavior to keep track of this sort of thing. I can't use persist anymore because I am writing my own save system as well.
I feel like I am overcomplicating this, and I don't know the proper terms to google in order to find useful information, so any help or resources on this would be very appreciated. Anyways, here is a scenario to illustrate:
I have a "BarrierSprite" and an "EventDictionary". This barrier prevents the player from moving forward until something is accomplished. Currently my barrier considers the following:
- What is the name of the event that triggers me? Typically this is done by a player colliding with an invisible object, or killing a specific enemy, or collecting an item.
- Does the barrier trigger another event when it is triggered?
- Am I turned "on" or "off" by other events? In other words are there any events that prevent me or are required to be triggered before I can be triggered?
With the persist behavior this more or less worked fine, but even then it felt bloated and now that I am trying to track this myself its not ideal.