How do you best handle "story/progress flags" without using the Persist behavior?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • 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:

    1. 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.
    2. Does the barrier trigger another event when it is triggered?
    3. 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.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Do I understand correctly that when you load a saved game or return to a previous location, you re-evaluate all events for each barrier to decide whether to remove it or not?

    That seems way too complicated. I would just keep track of inactive barriers in a separate array or dictionary. When you need to remove one, call a function that marks it as “removed” in the dictionary and destroys it. When loading the game or location, destroy all barriers listed in the dictionary.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)