Search Unity

Mad Level Manager - Level chooser and manager

Discussion in 'Assets and Asset Store' started by genail, Jul 13, 2013.

  1. Subleathal

    Subleathal

    Joined:
    Aug 10, 2012
    Posts:
    2
    is there any way to display the level number on the locked levels and is the profile data is well encrypted.
     
  2. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There!
    To count locked levels use a query:
    Code (CSharp):
    1. int locked = new MadLevelQuery().CountLocked();
    Profile data is not encrypted at all :) This feature will be introduced soon. If you need encryption, it's really easy to implement. You have to modify methods LoadProfileFromString() and SaveProfileToString() of MadLevelProfile class. You can do with the generated string whatever you want unless it is encrypted/decrypted correctly.

    Cheers!
    Piotr
     
  3. Subleathal

    Subleathal

    Joined:
    Aug 10, 2012
    Posts:
    2
    Thanks for the quick reply genail,
    My bad, I didn't post question correctly I guess!. I was referring to ui icon prefab, how to display the digits along with the locked sprite.
     
  4. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Ohh... No, my mistake, I'm sorry. I've read your question wrong.

    You can do this by modifying visibility settings for your icon. Like in the example, but you have to add level number for the Show when level is locked list and remove from the Show when level is unlocked list.

    Please write if you have any other questions!

    Cheers!
    Piotr
     
  5. san.daniele

    san.daniele

    Joined:
    Aug 16, 2013
    Posts:
    19
    Hi genail. Sorry for replying so late, had 2 crazy days.

    first of all: i realize it's pretty much impossible to diagnose this. My question is more: did you ever hear anything like that?
    Sorry for being so extremely vague above, I left out a lot of information.

    Here’s some ground info:
    - v2.1.3 (I noticed there's a new version out, going to try that one out later)
    - Grid Layout. Generate.
    - custom icon/font. Slightly changed grid size.
    - extension: a loading screen (same for all scenes)
    - no, my icon template is not in the scene

    doesn’t matter what grid/scene I use. Even if I created new ones, the problem remained. Deleting all levels from the configuration and rebuilding it: no change.
    Reseting the profile didn’t do the trick either.

    forgot to mention: if I chose "unlock all levels" or "complete all levels", #9 got unlocked. I just couldn’t unlock it through playing #8. Once again: it didn’t matter if I rearranged all levels. It was always #9.

    BUT: there's a simple way that resolved my issue: creating a new level configuration and adding everything the exact same way like in the old one. Activate and synchronize it. Problem solved. (not touching anything in the scene itself!)
    I discovered later that I can even change back to the old configuration and that one works again! I opened the backup files where the error occured … now all the sudden it works there as well!

    Are there some local files that get deleted when I change the configuration? I feel quite stupid now and realize that this pretty much looks like I just imagined the whole thing. All I have to prove my sanity is my iPad, that still has a testbuild where the error can be seen.
     
  6. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There!
    Good to hear that you've solved the problem!

    Do you have any local copy of your project in which this issue remains? I'd like to look into scene objects. If not that's OK. If this issue will be reported by someone else, I will request the scene for examination :)

    There are no local files or any cache, just scene objects, so something was wrong with the scene. I've recently found out that using some deprecated settings may conflict with new features, but I doubt it was the case here.

    Please write if you have more questions!

    Cheers!
    Piotr
     
  7. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    the waiting time is over, it's tim to buy this awesome TOP wish asset :D
    *i already bought your energy bar toolkit too in the past.

    but before i buy it, let me test your support please :)
    do you still have good support?

    i don't want to troubleshoot problem alone, it's so sad and depressing :'(
     
  8. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Keitaro,
    Yes, I'm here!

    The only issue that can arise today is that... I'm feeling really sick... I will try to give support as best as I can, but more difficult cases must wait until I'll get better. It's really to solve difficult problems when you're not feeling well :-(
     
  9. Keitaro3660

    Keitaro3660

    Joined:
    May 20, 2014
    Posts:
    86
    cool, that's okay :D
    i'm still in scene development, so i will keep this asset for the time being.

    i hope you got well soon! :)
     
  10. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Thank you! :)
    Please write if you will have any questions or issues!



    Edit: Just kidding, I'm here :)
     
    Last edited: Aug 22, 2014
  11. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Nalin,
    Thank you for writing!

    Currently there's no integration code with uGUI, but I will look at in within few days and I will decide what can I do with it. I'm guessing (and most probably I am right) that you can use both without any issues, so you will be able to set uGUI element above or below Mad Level Manager GUI elements.

    There should be no problems with TextMeshPro. MLM is also based on meshes :)

    About the uFrame... I honestly don't know. I'm looking at its tutorials and I'm trying to figure it out. I believe that there should be no issues, but if you will encounter any issues, I will be happy adapt my code for uFrame.

    Cheers!
    Piotr
     
  13. MPM_Qler

    MPM_Qler

    Joined:
    Aug 14, 2013
    Posts:
    3
  14. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks for the Reply

    I guess it will be nice if there is a way for uGUI to add / customise elements within MLM?

    cheers

    Nalin
     
  15. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Sure it will! :)
    Thank you for the suggestion!
     
  16. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks,

    I am just wondering how MLM deals with multiple devices/layouts resolution on mobile and how this might be compatible with uGUI?

    ...or does MLM assume a particular layout?

    cheers,

    Nalin
     
  17. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
  18. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Hello,

    Love the asset, thanks. I think it will work great with a few of the projects I have planned. I am running into 1 issue though. I want each level to have it's own score requirements for each star. Which script would I have to update for that and could you give me a quick example for one level please.
    Thanks for the help,
    Mura
     
  19. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There,
    Thank you for purchasing Mad Level Manager!

    You have a complete control over all collectibles, so in your level you can write method similar to this one:

    Code (CSharp):
    1. void FinalalizeLevel(int score) {
    2.     if (score < 100) {
    3.         // no stars :-(
    4.         return;
    5.     }
    6.  
    7.     if (score >= 100) {
    8.         EarnStar(1);
    9.     }
    10.  
    11.     if (score >= 500) {
    12.         EarnStar(2);
    13.     }
    14.  
    15.     if (score >= 1000) {
    16.         EarnStar(3);
    17.     }
    18. }
    19.  
    20. private void EarnStar(int num) {
    21.     MadLevelManager.SetLevelBoolean(MadLevel.currentLevelName, "star_" + num, true);
    22. }
    In this way you will earn first star when your score is at least 100, two starts when it is 500 or more and all three if 1000 points has been reached. This example is compatible with example scenes, but you can modify number of stars and property names as you wish :)

    Please write if you have any other questions!

    Cheers!
    Piotr
     
  20. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Ok awesome. Thanks. But is there already a script that I would put that code into or do I make a custom script. And if its a custom script do I need one for each level?

    Thanks again for the help
     
  21. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    You have to create your own script and call FinalizeLevel() method when your player finishes his level. You need only one script of this kind and it should work for all levels. The good idea would be making score thresholds as public variables, so you will be able to attach this script into a new game object and adjust it for each level.

    I couldn't create script that finishes level because finishing condition for each game will be totally different. For example if your game finishing condition is the end of time, your fields and Update() may look like this:

    Code (CSharp):
    1. public int timeLimit = 60;
    2. public int score; // increased during the game
    3. private bool finished = false;
    4.  
    5. void Update() {
    6.     if (!finished && Time.timeSinceLevelLoad > timeLimit) {
    7.         FinalizeLevel(score);
    8.         finished = true;
    9.     }
    10. }
    Cheers!
    Piotr
     
  22. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Awesome, thanks. I have my game set to reset the level right now. With that I should be good to go but will let you know if I hit any bumps. Thanks again
     
  23. g0tNoodles

    g0tNoodles

    Joined:
    Nov 28, 2010
    Posts:
    193
    EDIT: This was caused by the project still thinking I had completed level 1 from testing with the example scenes. I used the reset profile option to get it back to 0 stars.

    Hello,

    I have recently purchased this package and so far, it looks like it should do everything I require.

    However, I am a little confused by something. In the pictures below, you can see one image in play mode and one not. I have done nothing to say the first level is complete yet, nor anything else for that matter. I have just finished the initial set-up. I watched your video and when you press play, level one does not come up with any stars on it yet mine does (like it has already been completed).

    Am I missing something from the initial start up or has something changed since you posted your initial video?

    Thanks

    ShouldLookLike.png DoesLookLike.png
     
    Last edited: Aug 24, 2014
  24. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There!
    Thank you for purchasing Mad Level Manager!

    You've done everything just fine :) The issue that you're experiencing is because Unity editor is treated as single entity for game save system. It treats all the things that you're doing in there like it is a single game. In that matter you most probably have tried an example scene before and completed the first level. This state has been saved and now when you've created your own level select screen, it has been loaded :)

    Please use the Profile Tool to reset your editor's profile.

    Cheers!
    Piotr
     
  25. g0tNoodles

    g0tNoodles

    Joined:
    Nov 28, 2010
    Posts:
    193
    @genail Yeah, after I posted I had the thought that it may have been something along the lines of it already being saved from the run through I did earlier.

    Late night brain fart =]
     
  26. Shildrak

    Shildrak

    Joined:
    Jul 14, 2012
    Posts:
    5
    I'm looking for a way to control the unlock conditions, so the next level is not automatically unlocked upon a level being completed. In my case it's a combination of level completion plus a date (think christmas calender, where a level cannot be unlocked before a specific date, even though the previous level is completed). Do you have a good way to handle this?

    Thanks
     
  27. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Shildrak,
    Thank you for writing!

    By default next level is unlocked when previous is completed and this is in fact handled by level select screen script (yes, this is a little wired, but this is how it works). You would need to take control over unlocking levels, so you need to forbid level select screen to unlock any levels for you.

    Do you use grid layout? Please open MadLevelGridLayout.cs and around line 453 you will find:

    Code (CSharp):
    1.                     if (previousIcon != null) {
    2.                         if (createNewInstance) {
    3.                             previousIcon.unlockOnComplete.Add(levelIcon);
    4.                         }
    5.                     }
    Remove (or comment) it and rebuild your layout using "Rebuild" button.

    From now on you will need to complete levels like this, but it will give you more control:

    Code (CSharp):
    1. MadLevelProfile.SetCompleted(MadLevel.currentLevelName, true);
    2.  
    3. if (MadLevel.HasNext(MadLevel.Type.Level)) {
    4.     var nextName = MadLevel.GetNextLevelName(MadLevel.Type.Level);
    5.     MadLevelProfile.SetLocked(nextName, false);
    6. }
    In your case you can add additional statement to check if your next level is the level that you want to unlock only after specific date.

    Of course you don't want your special level to be unlocked only when the player completes any level, but on a specific date, so you'll need to add another script when your game will start.

    Please write if you have any other questions!

    Cheers!
    Piotr
     
  28. Shildrak

    Shildrak

    Joined:
    Jul 14, 2012
    Posts:
    5
    Thank you for the (very) quick help! Yes, I am using the grid and so far your suggestion seems to do the trick.

    I also had a need to revert the level numbers, so it displays as a countdown, eg from 12 - 1 instead of 1 - 12 as you progress. I did this by just changing MadLevelGridLayout.cs line 440, where it says
    Code (CSharp):
    1. levelIcon.levelNumber.text = < my special text here >
    If possible I wouldn't mind a couple of hooks in the API where you could control these kinds of things without modifying the original source (unlock conditions and display) down the road. On the other hand, I suppose the GridLayout is just an example of a layout and when there are special requirements like in my case, it's a small task to just create another one which can be more project specific.

    Thanks
     
  29. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Sure, I will add some hooks in future versions! Thank you for the suggestion :)

    Cheers!
    Piotr
     
  30. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
    Quick question: Is it possilbe to set maximum number of start per level? I want in first introduction/ tutorial levels give only one or two stars to earn in other levels 3 or 5 I didn't decided yet :) and I want to have different placement for one, two and 3/5 stars so it will look good, is it possible? :)
     
  31. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There!
    Thank you for asking!

    I think you could try to switch your layout generation method to manual (if you're using the free layout, then it's manual by default). Then you can edit your level icons individually by removing not used properties and adjusting star icons placement. Please try to do so :)

    Please write if you will have any other questions!

    Cheers!
    Piotr
     
  32. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hello,

    Is there a tutorial to create a level manager with the pic of our Facebook friends (like Candy Crush..) ?

    Thank you !
     
  33. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello There,
    Please look in here :)

    Cheers!
    Piotr
     
  34. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Thanks ! But there is not a complete tuto with Facebook for unity :(

    But it's cool !! Thanks !
     
  35. hepphep

    hepphep

    Joined:
    Feb 1, 2013
    Posts:
    24
    I purchased this asset and gave it a try, but ran to a little problem. I took a basic level selection scene into use and configured it to load my game levels. However, whenever I load my game levels I run into issues that my particle effects pooling does not get initialized. That initialization has worked nicely when using the usual scene loading that Unity provides, but for some reason through this path there is some issue. The pooling is also from one other asset package that I've bought so haven't yet looked it through in all the detail if it could be issue on its side, but on the other hand it works perfectly fine when loaded normally.

    Would you have any idea or good guess of what kind lead into such situation in this combination (if there is something specific in level loading mechanics that comes in mind)?
     
  36. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello hepphep,
    I'm sorry, but I haven't received notification about your message (and some other) for some reason!

    Mad Level Manager is using Application.LoadLevel() under the hood, so there's no rocket science here. What pooling solution are you using? I could ask this asset owner to share this package with me and I can take a look.

    I'm sorry again for the delay :-(

    Cheers!
    Piotr
     
  37. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello ababab5,

    I'm sorry for the delay. The reason is same as above... :-(
    I do not have complete facebook tutorial unfortunately, because there are several facebook plugins and I would need to integrate with them. This is the best that I could do. Please ask if you will have any issues or questions!

    Cheers!
    Piotr
     
  38. Banky

    Banky

    Joined:
    Sep 10, 2014
    Posts:
    24
    Hi genail,

    First of all, thanks for Mad Level Manager! It's saving me a huge amount of time and it's working great! I have a doubt, though (a newbie one, I think :)

    I am using a UI for configure game settings and when I access it from the level selector scene with the levels list, my UI appears over the free layout and it's working OK, capturing clicks and everything, but it seems Mad Level Manager is still capturing events (onclick, hover...). This is not happening to me with other scenes, just with Mad Level Manager. Is there any way to prevent this from happen? Or am I doing something wrong?

    Thanks in advance!
     
  39. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Banky,
    Thank you for writing!

    What UI system are you using?
     
  40. Banky

    Banky

    Joined:
    Sep 10, 2014
    Posts:
    24
    Hi, I'm using 2D toolkit UI

    Thanks!
     
  41. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I need to think about it and look into 2D Toolkit. I will give you the answer by tomorrow, is that OK? :)
     
  42. Banky

    Banky

    Joined:
    Sep 10, 2014
    Posts:
    24
    Of course! Tomorrow is great!!! :)

    Thanks again!
     
  43. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Banky,
    Please open file MadPanel.cs and find method UpdateInput(). Then edit the beginning of it to look like this:

    Code (CSharp):
    1. void UpdateInput() {
    2.         if (ignoreInput) {
    3.             return;
    4.         }
    5.        
    6.         // checking for 2D Toolkit input
    7.         if (tk2dUIManager.Instance.PressedUIItem != null) {
    8.             return;
    9.         }
    Please let me know if this is working for you!

    Cheers!
    Piotr
     
  44. Banky

    Banky

    Joined:
    Sep 10, 2014
    Posts:
    24
    Hi genail,

    No, it's not working, but I have it solved thanks to the code you posted, anyway :) ignoreInput is all that I needed to made it work. Now, I control the ignoreInput variable from my code and I enable or disable Mad Level Manager UI when I need.

    So it's working now.

    Thanks genail!
     
  45. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    The important thing is that the issue has been fixed! :)
    Please write if you will have any other questions or issues!

    Cheers!
    Piotr
     
  46. Databases

    Databases

    Joined:
    Mar 24, 2014
    Posts:
    22
    Hi genail

    i'm wonder about in game menu, i mean while i'm playing the game what about if i want to pause the game and i get a menu that gives me choices like either to resume or replay or go back to main menu?
    please help me because i got a headache while trying to make it, an i'm wasting my time instead of saving it!

    Thank you for your time and for this nice manager.
     
  47. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Databases,
    Your issue is not directly related to Mad Level Manager :)

    What UI toolkit are you using? I can recommend NGUI or uGUI. When pausing your game most probably you want to:
    - Set Time.timeScale to 0 so all the objects will freeze
    - Show GUI element that is in fact a pause menu
    - Connect to buttons un-pause action (hide, Time.timeScale to 1) and go to main menu action (MadLevel.LoadLevelByName()).

    Here's how I did it for my game: http://traincontrol.madpixelmachine.com/

    Please write if you will have any other questions!

    Cheers!
    Piotr
     
  48. Databases

    Databases

    Joined:
    Mar 24, 2014
    Posts:
    22
    Thanks a lot for the quick support, this is the illustration i needed

    I may ask for help later! :)
     
  49. IOZO

    IOZO

    Joined:
    Jun 26, 2010
    Posts:
    55
    Hello,

    I purchased MLM and find it almost perfect for my needs.
    I would like to use a single game level scene for all my game levels and inject a level configuration to change its behavior based on a level configuration, that we would set in the editor for each level.

    In the doc I've seen the level argument which should work but it looks like a single parameter instead of a list of various parameters with various types (bool, int, float, string, gameobject, ...)
    but I see no editor options to manage multiple parameters for each level.

    Did I miss something and if not can you consider such an extension to your attribute model ?
    It would be great to have another editor much like the extension editor to define a level setting templates and apply them to a level instead of the single argument. For each level we would then be able to adjust each parameter of the template.
     
  50. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello IOZO,

    I've decided to use only a string because it's the most universal solution. You can use it to pass a key or file name of your data file that should be loaded at level start. I will think about your suggestion though, seems interesting. Thank you, I will let you know when I will think this through :)

    Cheers!
    Piotr