Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Elizeusz on July 22, 2012, 11:31:13 AM
-
Hi. I have done one scene where i have my menu ( texture buttons ) each one is coresponding with one level. Every level is the other scene. Only one button in menu is enable other are disable. I want to unlock each of them after finishing level. I do not now how to do this. I have bool variable wich i call win and i do not know what i can do with this. I never play with save and load then maybe some of You can help me ?
-
Hi,
Study this thread very carefully, it is a the very same problem only dealing with showing and hiding cubes. So in your case, once you grasp the logic behind managing the radio buttons, you can then apply it to your own case.
http://hutonggames.com/playmakerforum/index.php?topic=997.msg4102#msg4102 (http://hutonggames.com/playmakerforum/index.php?topic=997.msg4102#msg4102)
dont hesitate to come back if you need more infos.
bye,
Jean
-
Thank You for Your help :) I have one scene where i have my menu ( created by NGUI) i can enable disable buttuns by set property which is working fine for me. I have other scenes ( puzzle) when i finish and win i get bool variable ( i have fsm bool test which check if this one is 0 or 1 when is one then i load another level) . Now i want to send unlock event to first scene wher i have my NGUI menu and remeber this . Then if i finisch 2 level for example and i will come back to the game i can chose between them ( they will be unlock) not sure if this is good explanation....
-
Hi,
ok, and where do you have an issue? sending that event to unlock the ngui button?
bye,
Jean
-
Yes. And how to do that when i exit game and then enter again those changese will be there..
-
from 2.40 min i want to to something like this.. :)
-
Hi,
Ok, I get it.
Basically, one way that I would investigate is the following:
Instead of a boolean variable you maintain an integer ( let's call it "Current Level Access", which represent the current level, so 4 would that the user has unlock the first four levels, so anything level id above 4 would be locked.
so , are you able to create a prefab that does three things:
1: implements a int variable called "My level id" ( that you tick "show in inspector") that will tell that FSM which elvel it represents
2: have a global event "CHECK LEVELS ACCESS" that when fired compares "Current Level Access" and "My level id". If "My level id" is below "Current Level Access" then you enable the button, if not , you disable it.
Try this, if you are struggle, I'll make a working example.
bye,
Jean
-
If You have time please make some simple example.
-
Hi,
ok, import that package attached to this post. It's a fully working sample with three level buttons,
use the level manager and its inspector interface to unlock levels, lock them alls. Click on the unlocked levels to callback the level manager with the name of the level to load, locked level will not callback the level manager,
so, pay attention as to how the prefab is made of for the level buttons, and how it all communicates. Note also that I do not make use of global variables, just to show that it's possible to get away with having to use too many global variables when it's not necessarly needed.
if you have questions, don't hesitate. If everything is clear, I'll put it on the user wiki, I think it's a good sample.
EDIT: now with player prefs to save level.
bye,
Jean,
-
Thank You very much i will study this example :)
-
Hi Jean...
I used this example and it's excellent - many thanks for adding this to the forum.
If you have time, could I just ask how to get it to store the results to the player preferences so that the same levels appear unlocked when the game is switched back on.
Also, how would a trigger event unlock the next level?
Thanks,
Harry
-
Hi,
I am really sorry, I am currently in sprint mode, as the project I am working on is going to release on the app store next week, so I am really unable to allocate time on this at the moment. Can you bump this end of february if noe one stepped in before?
meanwhile, you will find a lot of examples of how to use the playerprefs on this forum and on the playmaker Sample. have you tried them?
bye,
Jean
-
Hi Jean...
Yes of course - I'll search the forum for any references. I understand you are a very busy person. Thank you so much for taking the time to answer, and for all the time you spend helping people in the forum.
Good luck with your with the release of your App.
Thanks,
Harry
-
Hi,
ok, I edited the scene so that it nows saves and retrieves the currently accessible level from the player pref. so you can unlock a level, close the app, restart and it will go back to that unlocked level.
as for triggering an unlock, this is simply a matter of firing the event "UNLOCK NEXT LEVEL", so you can use any kind of system to eventually fire that event.
bye,
Jean