Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mad Level Manager - Level chooser and manager

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

  1. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi Piotr,

    I tried your suggestion to create a font for Mad Font, doesn't work :( ...
    The font that I 'm trying to create: FONT

    Thanks!
     
  2. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
  3. souldroid

    souldroid

    Joined:
    Feb 27, 2015
    Posts:
    5
    Hi there,

    I need to have all levels from different groups in the same scene using a Free Layout. It's about having a path with all levels from all groups and some condition (like total star number) blocking the access between the groups.



    Is there any workaround to get this?

    Thanks!
     
  4. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi!

    I think that using groups functionality here won't do any good. I will tell you how I would do it :)

    1. First I would move all levels to a single group
    2. Then I would not use MadLevelProfile.SetCompleted() on any level. Setting the completed flag will automatically unlock the next level. You don't want to do that, at least not always.
    3. I would write my own unlocking code. Levels may have naming convention to tell me what group it belongs to (like gr1_level1).
    4. I would unlock next level only if it is of the same group. If next level is of different group, nothing will happen (at the moment).
    5. When back in the level select screen it should recalculate all starts for group levels. You will need to manually iterate through level list (MadLevel.currentConfiguration.levels). And sum up all the stars for different groups.
    6. Store group unlock state somewhere (like MadLevelProfile.SetProfileBoolean("gr1_locked", true); Then based on this value decide to unlock first level of next group (MadLevelProfile.SetLocked("gr2_level1", false);
    7. Display needed stars information based on previous calculations
    API links:
    I know that this may be a lot, I hope you're familiar with scripting. Your case is very specific, yet I tried to make Mad Level Manager as flexible as possible.

    Tip: to sum up all level stars, create an array of levels name for a group and use a query. It can look like this:
    string[] levelNames = {....}; // use MadLevel.currentConfiguration.level list to get level names
    int collectedStars = new MadLevelQuery().ForLevel(levelNames).SelectProperty("star_1", "star_2", "star_3").CountEnabled();

    Please write if you have more questions!

    Cheers!
    Piotr
     
  5. souldroid

    souldroid

    Joined:
    Feb 27, 2015
    Posts:
    5
    Wow, that was a really useful and super fast answer!!. Thanks a lot, it's more than enough :)

    And yes, I think you made a very flexible plugin, I'm loving it.
     
    genail likes this.
  6. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    You welcome!
    I'm very happy to hear that you like it :)
     
  7. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi Piotr,

    Can you send me the prefab of the font you made, please !

    Thanks in advance
     
  8. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Sure! Here's the unitypackage :)
     

    Attached Files:

    RoyalCoder likes this.
  9. souldroid

    souldroid

    Joined:
    Feb 27, 2015
    Posts:
    5
    Hi Piotr,

    I followed your advices but I have encountered a problem.

    As you said, now I never use SetComplete and instead, I manually unlock the levels with SetLocked


    While playing the game, the levels get unlocked correctly, but when I stop and play the game again (in the editor), the levels appear locked (except level 1 which is always unlocked by default).

    I've checked if SetLocked is sending the data, and it looks right, as you can see in the sent string:



    But when I stop and play the game again, the icons are locked, as I checked debugging:



    I thought the problem was that SetCompleted does something else that is needed for the profile to be saved, so I tried to use SetCompleted again but setting the UnlockOnComplete parameter empty as this:



    But this didn't work either. It seems that the only way for keeping the profile saved correctly is using SetCompleted function but leaving UnlockOnComplete parameters with the next level icon set.

    Do you have any idea about why the profile is not being saved when I avoid SetCompleted?

    Thanks!
     
    Last edited: Oct 10, 2015
  10. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Very odd. Are you sure you're not locking on reseting the profile anywhere? Please put a breakpoint on MadLevelProfile.Reset() and MadLevelProfile.SetLocked(). Please let me know if you will find out something.

    I will be going now, I will get back to you tomorrow morning :)

    Cheers!
    Piotr
     
  11. souldroid

    souldroid

    Joined:
    Feb 27, 2015
    Posts:
    5
    I've just realized that I wasn't using the last version of MLM so I updated to 2.3.4 and it's working now!

    Thanks so much for your attention :)
     
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Oh... It could be the cause of course :) I'm glad that it is working now!

    Cheers!
    Piotr
     
  13. chaseholton

    chaseholton

    Joined:
    Dec 17, 2012
    Posts:
    78
    With 2.3.4 I'm getting three errors and I am not sure how to bypass them! Any help would be much appreciated.

    Assets/Mad Level Manager/Examples/Stuff/Scripts/MadLevelTesterController.cs(80,23): error CS0266: Cannot implicitly convert type `MadLevelManager.MadSprite.EventFlags' to `MadLevelManager.MadSprite.EventFlags'. An explicit conversion exists (are you missing a cast?)

    Assets/Mad Level Manager/Examples/Stuff/Scripts/MadLevelTesterController.cs(81,23): error CS0266: Cannot implicitly convert type `MadLevelManager.MadSprite.EventFlags' to `MadLevelManager.MadSprite.EventFlags'. An explicit conversion exists (are you missing a cast?)

    Assets/Mad Level Manager/Examples/Stuff/Scripts/MadLevelTesterController.cs(82,20): error CS0266: Cannot implicitly convert type `MadLevelManager.MadSprite.EventFlags' to `MadLevelManager.MadSprite.EventFlags'. An explicit conversion exists (are you missing a cast?)

    All three are on these lines in the code:

    ...
    public void PlayFinishAnimation (MadSprite chosenSprite, bool completed) {
    levelNameText.eventFlags = MadSprite.EventFlags.None;
    argumentsText.eventFlags = MadSprite.EventFlags.None;
    backToMenu.eventFlags = MadSprite.EventFlags.None;
    ...

    Any clues?? Am I that much of a noob that something is just simple and I'm overlooking it?!

    Much appreciated guys!

    Great product regardless. It's been a dream to use, until this minor hiccup :p

    Chase
    WLG
     
  14. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello @chaseholton

    I see that you wrote to me also by email. Since I'm checking my emails first, please check yours :) I will post the solution here when we will find out what was wrong.

    Cheers!
    Piotr
     
  15. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    I'm thinking of buying this asset , I love all the functionalities, one question though. Can I speciefy the win condition using this asset , for example a brick breaker after all bricks are destroyed load next level?
     
  16. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello @ezaz12121
    I believe that I've just replied to you by email :)

    Mad Level Manager will not help you to define win conditions, you have to write these yourself. What Mad Level Manager will help you do is to manage your levels state and saved data (like locked, unlocked, completed, collected points, stars, etc.). All the game logic is up to you. Please see this example to get to know what I am talking about:

    http://madlevelmanager.madpixelmach...er_scene_explained.html#option-initialization

    Cheers!
    Piotr
     
  17. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    I got how it works now lol, I already have my game logic finished , my bricks get destroyed when hit, I have my bounce etc.. So this asset will most definitely help making more levels , this does include display life system right ?
     
  18. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    You shouldn't use MLM GUI system because it is to simple for usual games :) Please use Unity UI or any other advanced UI system to display the stats, and use MadLevelProfile methods to save and load the player state :)

    http://madlevelmanager.madpixelmachine.com/doc/latest/basics/save_load_api.html

    Cheers!
    Piotr
     
  19. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    Ok, I can make all the ui in unity seperate, and still use mlm to manage the levels right ?
     
  20. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Yep, that's right :)
    If you will have any issues with doing that, please write to me anytime on support@madpixelmachine.com!
     
  21. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hey @genail ,

    I have a quick question for you, I'm displaying the levels in my project on 10 pages, every page is a different chapter...what I want to know if it's possible to read (access) the page index to display the chapter name for every page ? Thanks !
     
  22. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello @D0R1N ,
    Yes, you can! :)

    Get the MadLevelGridLayout component from Grid Layout object and then do something like this:
    int pageIndex = gridLayout.pageCurrentIndex;

    Cheers!
    Piotr
     
    RoyalCoder likes this.
  23. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Thanks worked ;)

    P.S In my GridLayout Settings I selected to load the last completed level, but I get all the time to levels >30 , in the debug I get the page index "1" , any ideas ;) ? Thx
     
  24. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Do you mean the "Look at last completed level" option? Please make sure that you're marking your levels as 'completed' using MadLevelProfile.SetCompleted() method.
     
  25. MalcolmWashington

    MalcolmWashington

    Joined:
    Jul 16, 2015
    Posts:
    12
    hi mad level manager admin

    how can i reset only one group.

    for example:

    if i use resetprofile() , that resets whole levels which are in different groups

    my groups name : step1, step2....
    each group has 10 levels.
    i just want to reset the "step1" group's levels.

    if possible , can you give me example in playmaker.
     
  26. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi @MalcolmWashington ,
    Currently this is not possible but shouldn't be too difficult to implement :)

    Please write to support@madpixelmachine.com with your invoice no. and I will send you the updated package as soon as it will be ready :)

    Cheers!
    Piotr
     
  27. chiquitae126

    chiquitae126

    Joined:
    Oct 21, 2012
    Posts:
    8
    Hello I'm having a really big issue, trying to create my own level icons... I followed the instructions... I was able to get mad level manager to recognize my prefab but when I play the game it gives me a white screen I'll post screen shots.
     

    Attached Files:

  28. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    Hello , I created two groups, each of them have there own level select scene , I also have a scene for the world select scene. How do I add the two groups in that scene.
     
  29. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi!

    Is the Mad Level Manager UI the only thing that is on the scene? Maybe something is rendering on top of it? Please try putting a bundled example icon prefab instead of yours just for test.

    Also do you see any errors in the Console window?

    P.S. http://www.wikihow.com/Take-a-Screenshot-in-Microsoft-Windows :)

    Cheers!
    Piotr
     
  30. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello @ezaz12121 !

    Most probably you need to create "launcher" levels in your default group (where your group select screen is). There launcher levels should load the specific group level select screen. Just like here:

    http://madlevelmanager.madpixelmachine.com/demos/groups.html

    It's just at the beginning of The Setup section :)
    If you will have any issues with that, please let me know!

    Cheers!
    Piotr
     
  31. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    Oh wow right in front of me , thanks
     
  32. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    i decided to use one scene = one level path i think its easier for me right now, i do have a question, i can change the icon size right? they are too big on the game window.
     
  33. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Yes :) Just use the Icon Template -> Scale.
     
  34. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    This are starting to make sense alittle now , I was looking at ur examples and decided to test the queries txt you for showing completed levels , I copied it and pasted in my scene hierarchy, any particular reason its not showing a anything when I press play?
     
  35. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    I tires the icon template scale , I up the scale but it doesn't change the size ??
     
  36. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    What exactly have you copied and where? Can you show me some screenshots?

    Are we talking about the same option? https://gyazo.com/7423f4165fc9f58f2ab6762ee0ef9c25

    Cheers!
    Piotr
     
  37. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    Ops, I was changing the scale in the transform .
    I will get the screenshots.
     
  38. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    The query example text.
     
  39. ezaz12121

    ezaz12121

    Joined:
    Oct 7, 2015
    Posts:
    22
    BTW , I want to say thank you again for replying to my emails and here , I know I ask stupid questions , but I'm just not good at scripting or reading docs , still learning on how to read documentions.
    And it's an awesome asset , I couldn't have figured the level management out alone :)
     
  40. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    @ezaz12121 About this query example text I would like to see your screenshots. Please send these to support@madpixelmachine.com :)

    Don't worry about asking questions. I will answer all of them the best as I can :)

    Cheers!
    Piotr
     
  41. RoyalCoder

    RoyalCoder

    Joined:
    Oct 4, 2013
    Posts:
    301
    Hi Piotr,

    I put my levels in groups for some reasons , but now in my Level Selection Screen I see only one group selected from GridLayout , the problem is that I have 9 groups but can select only one ...is there a possibility to show them all ? Thanks !
     
  42. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi!
    Not in the current version. I will PM you in a moment.
     
  43. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,

    Is it possible to get paging using the free layout, so that page 1 has say 30 levels, then page two 30 levels and so on, with the ability to have different backgrounds for each page and use a star count maybe to gain entry to next page.
    Is this do able.
    I can get quite a few levels on one layout but it would be a lot better split into pages or groups.

    John
     
  44. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello John,
    Unfortunately free layout has no pagination support. It is meant to be continuous. If you want multiple pages, you have to use Grid Layout. You can switch Grid Layout to manual mode (Grid Layout inspector option) to be able to change your icons positions. Please try it :)

    Cheers!
    Piotr
     
  45. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Piotr,
    No, that does not work well, still the same background just paging the icons.
    I need different maps just like most match 3 games, the free layout is better but only up to a certain amount of levels, still not what I require.

    John
     
  46. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    There's an example bundled within Mad Level Manager. It's called "Multiple Backgrounds". Please look into Examples directory. It shows how to create grid layout with pagging and multiple background. Have you seen it?

    Piotr
     
  47. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Piotr,

    Thats looks OK, how do I change the template to the space theme?

    John
     
  48. isacan

    isacan

    Joined:
    Jul 18, 2013
    Posts:
    37
    Hello,

    i have an extension for before_level. how can access level name from extension before_level scenes?
     
  49. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    You can do this by assigning icon template from space theme and copying background object (yes, object copied from one scene can be pasted into another :) )

    @isacan Just the same as always :) Just use MadLevel.currentLevelName.

    Cheers!
    Piotr
     
  50. isacan

    isacan

    Joined:
    Jul 18, 2013
    Posts:
    37
    i'm getting from MadLevel.currentLevelName "New Scene"