Search Unity

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 @Charlie_T, here you have a quick solution for this: LINK !

    Have a nice day,
    Dorin
     
  2. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    I following in this tutorial but I couldn't call star when level completed

    http://madlevelmanager.madpixelmachine.com/doc/2.2.8/basics/madleveltester_scene_explained.html
    And some script in this tutorial add try to add but where I must to add this script to get star when level completed.

    And another question.

    When I try to made button get back to menu. When I click button I cannot get back to main menu. I
    the level grid

    http://redmine.madpixelmachine.com/boards/14/topics/134
    http://redmine.madpixelmachine.com/boards/12/topics/422

    Only one scene menu not working but another level example level 2, 3... it work.
     
  3. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Charlie,
    Can you show me your code?

    Cheers!
    Piotr
     
  4. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    using UnityEngine;
    using System.Collections;
    using MadLevelManager;

    public class GoToMainMenu : MonoBehaviour {

    public string LevelName;

    void Start(){
    var sprite = GetComponent<MadSprite> ();
    sprite.onTap += (s) => MadLevel.LoadLevelByName("menu");
    }
    }


    This one.

    Thanks
     
  5. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I think you should also add onClick event:

    Code (CSharp):
    1. sprite.onClick += (s) => MadLevel.LoadLevelByName("menu");
    Please also have the Console window open. If there will be errors, you will see there what's wrong :)

    Cheers!
    Piotr
     
  6. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    I add but not working.
     
  7. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Are you sure that your code is executing? Try adding Debug.Log("something") inside.
    Are you receiving any errors in your console window?
     
  8. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    Mad Level Manager: Cannot find scene menu in the configuration. Is the level configuration broken or wrong configuration is active?
    UnityEngine.Debug:LogError(Object)
    MadLevelManager.MadLevel:FindCurrentSceneLevel() (at Assets/Mad Level Manager/Scripts/Base/MadLevel.cs:168)
    MadLevelManager.MadLevel:get_currentLevelName() (at Assets/Mad Level Manager/Scripts/Base/MadLevel.cs:103)
    MadLevelManager.Level:Load() (at Assets/Mad Level Manager/Scripts/Base/MadLevelConfiguration.cs:687)
    MadLevelManager.MadLevel:LoadLevel(Level) (at Assets/Mad Level Manager/Scripts/Base/MadLevel.cs:1381)
    MadLevelManager.MadLevel:LoadLevelByName(String) (at Assets/Mad Level Manager/Scripts/Base/MadLevel.cs:225)
    LoadSelectLevel:OnClick() (at Assets/Scripts/LoadSelectLevel.cs:16)
    UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:918)
    UICamera:processTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1598)
    UICamera:processMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1226)
    UICamera:processTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1296)
    UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1060)

    Note: all sences I add to build setting already.
     
  9. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    You should add your scenes into Level Configuration. Please also see this tutorial.
     
  10. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    You mean, I must add Main menu sence to Level configuration?
     
  11. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    After I add main menu to level config. I got error:

    Level Main Menu is of wrong type. Won't look at it.
    UnityEngine.Debug:LogWarning(Object)
    MadLevelManager.MadLevelAbstractLayout:LookAtLevel(String) (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:251)
    MadLevelManager.MadLevelAbstractLayout:LookAtLastPlayedLevel() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:282)
    MadLevelManager.MadLevelAbstractLayout:Start() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:359)
    MadLevelManager.MadLevelGridLayout:Start() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelGridLayout.cs:162)
     
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Yep! Simply you have to add all your levels (even not playable) to the level configuration.
    Please read these three simple rules :)

    This is because Mad Level Manager needs to track where you currently are. In this way the features like MadLevel.LoadNext(), extensions and traverse animations (in the future) are working.

    Remember that your first scene should be added at the top of level configuration!

    Will be the best if you will completely stop using Build Settings for adding levels, and use it just for building things :) It's good for simple cases, but it's not extensible.
     
  13. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Because it should be set to Type = Other. Please see the tutorial :)
     
  14. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    I set to type = Other already but not work. When I change to extra it worked.
     
  15. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Strange... You can leave it that way, but if you'll try to switch back to Other it should be working too.
     
  16. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
  17. genail

    genail

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

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    this one
     

    Attached Files:

  19. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    and game view
     

    Attached Files:

  20. Charlie_T

    Charlie_T

    Joined:
    Feb 13, 2015
    Posts:
    58
    How can I fix this:

    Level Select Level is of wrong type. Won't look at it.
    UnityEngine.Debug:LogWarning(Object)
    MadLevelManager.MadLevelAbstractLayout:LookAtLevel(String) (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:251)
    MadLevelManager.MadLevelAbstractLayout:LookAtLastPlayedLevel() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:282)
    MadLevelManager.MadLevelAbstractLayout:Start() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelAbstractLayout.cs:359)
    MadLevelManager.MadLevelGridLayout:Start() (at Assets/Mad Level Manager/Scripts/Base/Layouts/MadLevelGridLayout.cs:162)


    many thanks
     
  21. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Charlie,
    I've sent you the solution yesterday as a private conversation.

    Please see it or please write to me on support@madpixelmachine.com.
     
  22. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045

    Long anticipated Mad Level Manager version 2.3.0 has been released today! The hottest features are integration packages with Easy Save 2 and Anti-Cheat Toolkit, but there’s even more!

    Integration with Easy Save 2 and Anti-Cheat Toolkit

    OK, so what this is all about? If you own Easy Save 2 or Anti-Cheat Toolkit, now you can use Mad Level Manager as its storage backend! This simply means that all the game data saved by Mad Level Manager Save & Load subsystem can now be managed and secured by these 3rd party tools! C’mon, how cool is that?!

    New swipe directions and paging for the Grid Layout

    Now you’re not limited to swipe only from right to left, but you can do it in any direction! What’s more, you can fine-tune your paging method to achieve something like this (included in the package):



    iOS-like drag effect on edges



    And more!

    NEW FEATURES

    • Layouts can be configured to currently active Level Configuration instead of fixed one
    • API to connect your own save & load backend
    • Grid Layout: iOS-like drag effect on edges
    • Grid Layout: Paging offset by percent
    • New easier testing scene (MadLevelTester2)
    IMPROVEMENTS
    • Improved dragging on large areas
    BUG FIXES
    • Unity 5: Shader fixes
    • Level Configuration: Fixed disappearing level when dragged & dropped
    • Fixed issue with pressing the swipe icon or next page icon during swiping
    • Fixed running of the game from level with extension
    • Some objects were painted multiple times
    • Fixed rebuilding when depth-based rendering is turned on
    What’s next?
    At this point we’re focusing on version 2.5.0. Wait, where’s 2.4.0?! There will be no 2.4.0! That’s because we want to point out the big jump we’re doing between this releases. Why not 3.0.0? Because 3.0.0 is a completely different story.

    For 2.5.0 we’re planning to implement features such as advanced unlocking conditions and better group select screens. Yes, you could do a group select screen in previous Mad Level Manager versions, but the implementation was kinda hacky.

    For 3.0.0 we’re planning to completely switch to uGUI. The current rendering engine is good, but it’s difficult to integrate with anything else, and you need to learn it (a little but still) in order to use it. uGUI implementation will put you in the already familiar environment and all you’ll need to do is to connect things together in order for your level select screen to be working.
     
    Charlie_T, RoyalCoder and Mayureshete like this.
  23. cg_destro

    cg_destro

    Joined:
    Aug 13, 2013
    Posts:
    142
  24. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Thank you for your suggestion! I'm adding this to my TODO list :)
     
  25. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Any ETA on uGUI integration?
     
  26. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi!
    Unfortunately I still cannot tell when it will be released.
    Yet you can use MLM with uGUI at one scene. But you need to setMadPanel.ignoreInput bool field to true if you want the icons to ignore all click/touches and dragging.

    Cheers!
    Piotr
     
  27. kocabuza

    kocabuza

    Joined:
    Mar 10, 2015
    Posts:
    3
    Hi
    Is it possible to disable the animation at the beginning of the Level Select Scene. Level Icons floating from the bottom of the screen.

    Thanks
     
  28. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi!
    Yes, just remove Animator and Anim components from level icon prefab :)

    Cheers!
    Piotr
     
  29. kocabuza

    kocabuza

    Joined:
    Mar 10, 2015
    Posts:
    3
    Thanks a lot.
     
  30. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    98
    Hi Piotr,

    I wanted to add a custom sprite that will be like a background box on which all my levels are shown (here is a sketch https://yadi.sk/i/tJVbeTzafTXxi). What is the best way to do it so it scales just like levels?

    Best regards,
    Vladyslav M.
     
  31. genail

    genail

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

    There's currently a way to do that by switching to the Manual mode, but I recently have developed a better way :) Please write to me to support@madpixelmachine.com with your invoice no. and I will send you the newest version that is not in AS yet, but allows to pin these kind of sprites and backgrounds on each level select screen page.

    P.S. Most probably I will send it to you tomorrow, because I am going away in a moment.

    Cheers!
    Piotr
     
  32. Edd2000uk

    Edd2000uk

    Joined:
    Jan 2, 2014
    Posts:
    14
    Hi Piotr,

    Thanks again for your great asset. Please could you give me some pointers on saving the game progress to Google Play instead of on the device. Specificially I am using the Android Native asset from the asset store, are you familer with this?

    Regards,
    Ed
     
  33. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi Ed!
    From the current version Mad Level Manager allows you to create storage backends. You will have to implement IMadLevelProfileBackend. It's really easy and you can learn how to do it here. :)

    If you will have any issues or questions, please let me know!

    Cheers!
    Piotr
     
  34. Edd2000uk

    Edd2000uk

    Joined:
    Jan 2, 2014
    Posts:
    14
    Hi Piotr,

    Thanks for your reply, I'll give it a try.

    Regards,
    Ed
     
  35. Edd2000uk

    Edd2000uk

    Joined:
    Jan 2, 2014
    Posts:
    14
    Hi Piotr,

    I'm not sure if I'm missing the obvious but I can't figure out what / where I am saving from. So if I want to create a backend that saves the level progress to Google data for example, where do I get this information to save? For example is it an array, is there a list of data somewhere?

    Regards,
    Ed
     
  36. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    The data is passed as string as parameter called value in SaveProfile() method. You just have to store it. In LoadProfile() you have to read stored string and just return it from the method. That's all! :)
     
  37. Edd2000uk

    Edd2000uk

    Joined:
    Jan 2, 2014
    Posts:
    14
    Hi Piotr,

    Thanks for your help.

    Regards,
    Ed
     
  38. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    No problem! :)
    I think I will have to write my own implementation sooner or later.
     
    NeoUnity likes this.
  39. kaloskagatos

    kaloskagatos

    Joined:
    Aug 26, 2014
    Posts:
    10
    Hi all,

    Is it possible to generate level configuration by code ? I mean, I might have a infinite number of levels as I generate them randomly, I have one only game scene which is populated according to the parameter I pass to it... which the scene number.

    I saw some code that would do the trick but I wonder if there is a good way to do it.


    edit:

    It seems it's not possible, the level.sceneObject cannot be created outside of the Unity Editor...
     
    Last edited: Apr 1, 2015
  40. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hoi
    Maybe someone can give me a quick pointer, how to roll your own selection scene but have the level management (locking, stars etc.). Basically i need a MadLevelIcon working on GameObjects instead of Sprites, since my Buttons are custom placed 3D objects.

    Cheers :)
     
  41. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi kaloskagatos!
    I think the only way to do that would be by modifying MLM code since it was not designed to work that way.

    I think if maybe making a copy of current level will work? Still it needs a change in the code, but copying an existing level is much simpler to do than changing the level storage logic. It should be done by copy constructor I think... Then the source level can be marked as "other" to make it invisible in level select scene and after copying it change its type.

    If you will have any troubles with that, please let me know!

    Cheers!
    Piotr
     
  42. genail

    genail

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

    I think you can achieve that by creating MadLevelIcon (which is a sprite) and setting transparent sprite texture. Then attach your game object as this sprite child and adjust sprite size to match your game object size (the colliders are generated based on MadLevelIcon size. You will see the bounds.)

    By doing this the icon will receive touch event but player will see only your 3D object.

    (I think I will make this simpler in the future).

    Please let me know about the results!

    Cheers!
    Piotr
     
  43. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,
    I need some advice, I have added two gameobjects to my Level Select Scene, a Facebook connect button and a Store button.
    The problem is I while the facebook button is selectable I need the level icons to be inactive, I tried setting Time.timescale = 0 and also adding a gameobject grid to cover the icons but that just stops the icons animating and they still receive touch input, is there a way to make them totally inactive whilst this scene is open and the buttons are being used.

    Thanks

    John
     
  44. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi Josn!
    Yes, there is! :)

    Instead of setting Time.timeScale to 0 try doing this:
    Code (CSharp):
    1. MadPanel.FirstOrNull().ignoreInput = true;
    And when you want MLM to regain its ability to react on input do the oposite:
    Code (CSharp):
    1. MadPanel.FirstOrNull().ignoreInput = false;
    Please let me know if you will have any issues!

    Cheers!
    Piotr
     
  45. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi, Thanks for the reply,

    Yes, it gives this error : error CS1501: No overload for method `FirstOrNull' takes `0' arguments

    John
     
  46. kaloskagatos

    kaloskagatos

    Joined:
    Aug 26, 2014
    Posts:
    10


    Hi Piotr,

    Thank you for your answer. I made a try but it looks like I can't do it without rewritting many things in MadLevelConfiguration.cs. But I'm not a C# programmer, I'm discovering it with Unity (but I'm a programmer!), and maybe I'm doing it wrong. But for the moment it doesn't matter, I have a lot of thing to do in priority. I'll make a new try when my game will be in a better state. Thanks by the way.
     
  47. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    Hi, that basically works well with the visible bool in the Sprite settings. But i ran into many other obstacles, just for instance z-positioning. So i'd like to try a different way by keeping all of the 2D overlay, but control the visibility of the level buttons ( which would be all in the same place then) by look direction. Simplified, when the player looks up, lvl one gets visible, if he looks right level two etc.

    For that, i think, i need a reference to all the level GameObjects generated below Dragable so i can enable/disable them accordingly. How do i get those? Another way would be to set the focus Manually and have non focused icons to become invisible (and collides disabled) via a custom animation. But that needs a reference as well i guess.
     
  48. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Ouch...
    I'm sorry. You can pass there current transform or null :) Passing a transform will speed-up the search process if you're executing in on a object that is located somewhere under MadPanel in the hierarchy. If you will pass the null then it will look for first MadPanel anywhere on the scene:

    Code (CSharp):
    1. MadPanel.FirstOrNull(transform).ignoreInput = true;
     
  49. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    That's why I wanted you to let me know :)
    How's about if I prepare a modified version for you that will allow copying levels like I suggested? Today I might not be able to do it but I think I will have something on Monday or Tuesday.
     
  50. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hmm... there are other ways, but I have to ask you some more questions before I can answer to it. I will send my Skype ID to you as PM, can you contact me there?