playMaker

Author Topic: Playmaker Level Unlock System  (Read 1132 times)

Artemis1

  • Playmaker Newbie
  • *
  • Posts: 1
Playmaker Level Unlock System
« on: June 18, 2018, 02:29:12 AM »
I am having trouble implementing a level lock/Unlock system. I have managed to get a FSM so I can load my levels but I want them to be locked unless they have completed the previous one. I have gone through the forum and multiple videos but none of them have either used playmaker or have used a depreciated asset such as Mad Level Manager (Which would have been awesome). Could someone please advise either a replacement for MLM or how I would go about implementing this. Thank you so very much for your time.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Playmaker Level Unlock System
« Reply #1 on: June 18, 2018, 02:51:38 AM »
Hi,

using playerPrefs, you can get there:

 say you have 3 groups of 16 levels, the data you want to save for a given level would start with:

[groupId]_[levelId]_[DataKey]

so for example, if you want to store a boolean flag for the completion of a level 4 of group 2, you would have "2_4_completed" as the key to read from the playerPrefs.

so when you show all the levels for a given group, each UI element responsible for showing wether a level was completed or not, simply need to go read that key in the playerPrefs.

with this, you can also save scores, or level bonuses or stars.

 Does that make sense?

 Another more powerful and scalable solution is to use XmlMaker, but it requires a very high level of understand of PlayMaker, data structure etc, so not for beginners. With XmlMaker, instead of saving data in many different playerprefs key, you save all your data in one playerPrefs key, as an xml string. and then you can do powerful searches among your data to build complex scoring systems, and it also allow for easier debugging of data all together.


 Bye,

 Jean