playMaker

Author Topic: Level unlock  (Read 68 times)

Ayman

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Level unlock
« on: October 21, 2018, 05:09:13 PM »
Hey . Im trying to make level unlock system but i see that when level 2 unlocked level 1 is locked . And when i unlock level 3 , level 2 locked again . means only 1 level is unlocked. But i know my method for that system is fully wrong so can you give any other solution for this or a very simple project to study it ( ihave 100 levels ) . Thanks for your time
« Last Edit: October 21, 2018, 07:18:22 PM by Ayman »

MattyWS

  • Junior Playmaker
  • **
  • Posts: 70
    • View Profile
Re: Level unlock
« Reply #1 on: Today at 01:22:32 AM »
It's depreciated now and thus not on the unity assets store but I've been using Mad Level Manager, which had playmaker actions. What you could do is contact the developer, who's quite a friendly guy, and see if he'd be willing to rectify the depreciation. There is nothing wrong with the code that I can see as I'm using nearly the latest version of Unity, it just gave an initial warning when I imported it to say it may not work because it's depreciated.

It works flawlessly, saving the level progress for the player and has pre-made themes (some of which I made).

https://assetstore.unity.com/publishers/2898

Athin

  • Playmaker Newbie
  • *
  • Posts: 34
    • View Profile
Re: Level unlock
« Reply #2 on: Today at 04:37:46 AM »
You can just have a simple Bool value on each level to state if its locked or not.  As one unlocked, you flip the previous level back.

Depending on the setup,  Arrays would be the best way to store the levels and manage them.  Using the Get Next action to grab the next level and unlock it while locking the previous one too.

Thore

  • Full Member
  • ***
  • Posts: 106
    • View Profile
Re: Level unlock
« Reply #3 on: Today at 10:25:41 AM »
If they are linear, you could use a simple int counter, e.g. “progress”. At an appropriate moment, it checks how far the player got, and all levels lower and equal the counter are considered open. If you complete a level, just add +1 to progress.

If it is not linear, I’d use a list of bools, or enum flags.

Ayman

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Re: Level unlock
« Reply #4 on: Today at 03:56:30 PM »
Thanks guys . I did it by bools i created 100 bools and when a level is done i use set bool value to true  and after that using bool test to test if its true  set button level interactable . But now the proleme is the unlocked levels donnt stay saved . Should i use player prefs , i think its little hard to do it too 100 booleans repeat it 100 times  .is there any trick for that