playMaker

Author Topic: Saving/Loading Checkpoints and Unlocked Doors  (Read 176 times)

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Saving/Loading Checkpoints and Unlocked Doors
« on: August 13, 2017, 11:15:07 AM »
ok… I’m stumped…

I need to save checkpoints.  That part I have all figured out.  It works just fine.  Player continues on the right level in the right spot... but...

The problem is if I load the character up at say the 3rd of 7 checkpoints, I also need a way to know which checkpoints to deactivate (which ones were already collected), and which doors to deactivate (so the player isn’t locked out of passages they already unlocked).  Not every level has 7 checkpoints and 7 doors to unlock.  These change level to level.

I figure I would Easy Save the checkpoints as an array at each level, and as soon as they solve that level, delete the saved array, and build it again on the next scene.  That way, when they load into say level 5, but have yet to touch a checkpoint and unlock the door, they will start at the beginning.

I’m thinking the solution might lie in either arrays or array maker, but not exactly sure how.

I thought if I make an object array, and keep a master array on each level to pull from, I could compare the saved array to the master list, and deactivate those objects that don’t appear in the saved array after comparison.

Easy Save has Load Object Array



This asks for a size.  But that will change all the time, so I don’t think that’s going to be much help.

Easy Save has Array List Easy Load



But I don’t see any Array Maker actions that would allow me to compare the list to the master array variable on the empty I'll keep in every scene.

How can I do this?
Is there another solution I am not seeing?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #1 on: August 13, 2017, 11:00:12 PM »
Hi,
Maybe you could use the 'iterate' action to loop thru the array.

Use the index on the iterate and use an "array (List) get" on each array,
get the result and use a compare action, then loop back to iterate.
also set the index out of range (failure event) as both array sizes are different

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #2 on: August 14, 2017, 09:43:52 AM »
Thank you for the suggestion... but I'm not quite sure what you mean... so I tried to find this Iterate action but I don't see an Iterate action anywhere in the list or on the ecosystem

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #3 on: August 14, 2017, 11:06:06 AM »
Hi,
I just checked and iterate is available on the Ecosystem :)

maybe you overlooked it :)

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #4 on: August 14, 2017, 03:30:29 PM »
Hi,
I just checked and iterate is available on the Ecosystem :)

maybe you overlooked it :)

Could you take a screenshot of what it is called... the only action on the ecosystem that begins with 'It' is an itween action

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2280
    • View Profile
    • jinxtergames
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #5 on: August 14, 2017, 09:29:26 PM »
Here you go :


HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #6 on: August 15, 2017, 06:45:22 AM »
This does not show up for me... what is happening here?

HeathClose

  • Full Member
  • ***
  • Posts: 223
    • View Profile
Re: Saving/Loading Checkpoints and Unlocked Doors
« Reply #7 on: August 15, 2017, 06:50:09 AM »
Hold on... I just updated my ecosystem to 0.5.3 and now I see it...