Search Unity

Jewel Match Framework

Discussion in 'Assets and Asset Store' started by kurayami88, Aug 30, 2013.

  1. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    You are really an alchemist :)
     
  2. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    This video includes how to change the background.

    I want to change the background with the script at runtime(=dynamically switch) like as Candy Crush.
    - example : level1~10 (background 1), next level 11~?? (background 2)
     
    Last edited: Jan 6, 2014
  3. ercu

    ercu

    Joined:
    Aug 29, 2013
    Posts:
    6
    sorry so empty panel means it can not be swiped there, i just thought it removes background. but when i change basic panel backgrounds (from both gamemanagerpanel and panelsmanager) it does not change. it always shows your gray one:/
     
  4. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    in the basic panel component,
    there are two attributes you can play with...

    Has No skin - default is 'enabled' <-- means basic panels has no predefined skin... uncheck this if you want to define your own skin in the skin section of the panels

    Has Default Panel - default is 'enabled' <-- means it will create the default skin-object which is defined in the GameManager section. If you define your own skin (via above mentioned just now) you may opt to disable this if you do not want it to overlap each other.

    -------------

    now if you wanted to change the default skin of THE ENTIRE ENGINE, then go to the gameManagerPanel, in the gameManager script, there will be a property that is labeled 'default back panel' ... change that 1 instead....
     
  5. ercu

    ercu

    Joined:
    Aug 29, 2013
    Posts:
    6
    wow there are lots of choices. i could not find "has no skin" and "has default panel" properties in panelsmanager, may be new update includes them. but "default back panel" works for me, thanks:)

    a problem for me is that, swiping sensitivity got worse in last versions, i have to pull to the end of the 2. gem to get it work, instead of center of it. is it just me? if not, and it's not a expected behaviour, i am sure you will fix it. (pro 1.1.2)
     
    Last edited: Jan 6, 2014
  6. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    i'm sorry perhaps i was mistaken what i had or had not changed yet in the revisions update...
    Unity is being slow in pushing out the official updates lately (again~)... being christmas as well as new years + weekends and all...

    I will pm you the latest version... pls do check your inbox thx :)
     
  7. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    $JMFP.png

    In Red Circle, Yellow piece is visible pass through empty panel. But On Candy Crush, It is not visible.
    Please give me a magic hint.
     
    Last edited: Jan 6, 2014
  8. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    can't view image... it's private...

    **EDIT**
    nvm... the quote showed the image...

    ** feedback **
    no idea... sorry... lolx...
    the best i can think of right now is giving empty panels a skin itself and putting it way in front (or, using the "is in front" option for panels) of the camera which will then make the object fall behind it thus making it "dissapear" ....
    but in no way will you see the background behind it...
     
    Last edited: Jan 6, 2014
  9. gamecreme

    gamecreme

    Joined:
    Jan 6, 2014
    Posts:
    2
    Having an error with the latest version.

    With LeanTween in Root Plugins folder
    NullReferenceException: Object reference not set to an instance of an object
    LeanTween.cancel (UnityEngine.GameObject gameObject, Int32 uniqueId) (at Assets/Plugins/LeanTween.cs:1624)
    Board.applyTweening (Single dropSpeed) (at Assets/JMF PRO/Scripts/area 51/Game Manager related/Board.cs:255)
    Board.spawnNew (.PieceDefinition pd, Vector3 pos, Single dropSpeed, Int32 skinNum) (at Assets/JMF PRO/Scripts/area 51/Game Manager related/Board.cs:246)
    GameManager+<spawnNew>c__IteratorC.MoveNext () (at Assets/JMF PRO/Scripts/area 51/Game Manager related/GameManager.cs:936)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <movePieces>c__IteratorA:MoveNext() (at Assets/JMF PRO/Scripts/area 51/Game Manager related/GameManager.cs:730)


    Here's another error log
    MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.get_gameObject ()
    LeanTween.cancel (UnityEngine.GameObject gameObject, Int32 uniqueId) (at Assets/Plugins/LeanTween.cs:1624)
    Board.applyTweening (Single dropSpeed) (at Assets/JMF PRO/Scripts/area 51/Game Manager related/Board.cs:255)
    Board.spawnNew (.PieceDefinition pd, Vector3 pos, Single dropSpeed, Int32 skinNum) (at Assets/JMF PRO/Scripts/area 51/Game Manager related/Board.cs:246)
    GameManager+<spawnNew>c__IteratorC.MoveNext () (at Assets/JMF PRO/Scripts/area 51/Game Manager related/GameManager.cs:936)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <movePieces>c__IteratorA:MoveNext() (at Assets/JMF PRO/Scripts/area 51/Game Manager related/GameManager.cs:730)

    After the script error, the gem stop dropping, everything just freeze
     
    Last edited: Jan 7, 2014
  10. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    Please be aware that the current LeanTween available in the asset store is bugged and does not work with JMF. Please get a different LeanTween version from either of the source below...

    http://goo.gl/FFBruq <-- leanTween v1.1822 if you need it
    Else,
    https://github.com/dentedpixel/LeanTween <-- latest LeanTween version available here

    Thanks
     
  11. gamecreme

    gamecreme

    Joined:
    Jan 6, 2014
    Posts:
    2
  12. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Panel Piece Selection In Editor Window (BoardSetup / Launch Window)
    Would you change mode which mouse right (display next panel,piece) mouse left(display previous panel,piece)
    Because the custom panels pieces will increase more and more.
     
  13. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    i previously had the idea of left click = panel; right click = pieces... but inspector buttons does not support left-right clicks as far as i know... so i can't... sorry =\

    **Edit**

    apparently it can be done... hmm... will add it when i'm free...
     
    Last edited: Jan 7, 2014
  14. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    http://goo.gl/H2aV0b
    WARNING** for JMFP ONLY**

    modified boardlayout script package... i want to wait for unity to release my long pending version before updating it...
    this replacement script should do the trick :)
     
    Last edited: Jan 7, 2014
  15. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Fantastic, It works good :)
    Next In JMFUltra (no JMFPro), I hope that the player directly make boardLayout
    and play it as like Bouncy Ball's "make your own level" mode :rolleyes:
     
    Last edited: Jan 7, 2014
  16. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    possible... but needs saving of data compared to the auto-save by unity....
    will not be making this...sorry... lolx
     
  17. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
  18. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    yes, candy crush obstacles can be done via JMFP ( though some not included in the default kit)
     
  19. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    * JMFPro *
    I understand aTemplate 1, 2 with TresurePiece PortalPanel's usage.
    onPlayerMove() onBoardStabilize() are not yet used.
    1. onPlayerMove() : Is needed by Candy Crush's chocolate?
    2. onBoardStabilize() : When is used on Candy Crush?
     
  20. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    those functions are there for anything you find u can use it for...not necessary it is part of candy crush ;)
     
  21. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    $JMFP(no bg).PNG

    This image is under no BackGround which i don't need.
    In red lines, the afterimage of piece arrow is not disappear under mobile PC whether using Pool Manager or not.
    By the way, Does JMFP's performance better than no using Pool Manager?
     
  22. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    in the tk2dCamera (the master of all objects in JMF), in the camera settings...there is an inspector property called "Clear Flags" which by default, is set to "depth only"... change this to "fill color" or perhaps sky-box if you want a skybox... that should solve your ghost image problem.

    --------

    in regards to your 2nd Question about pooling.... it SHOULD help performance by a lot especially during runtime in the long run as memory is re-used rather than being cleared re-assigned each time.
    I do not own Unity Pro to do the profiling for you sorry =( ...
     
    Last edited: Jan 8, 2014
  23. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I have some update on this...
    apparently there's a script called "tk2dUIMask" by 2d Toolkit which can mask (hide) any tk2dSprites within the specified zone buffer.
    in the "Add component" button, navigate to 2D Toolkit -> UI -> CORE -> tk2dUIMask

    --------
    good luck in implementing it :)
     
  24. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Wow, Amazing :)
    Then, What I do?
    Component>2D toolkit > UI > CORE : Okay,
    tk2dUIMask is written by grey color : No Selection
     
  25. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    just add the script to a new game object and make sure the collider that comes with it is sized appropriately to cover the area you want hidden...

    though, this script only works with 2d toolkit sprites as i doubt it will hide non-2d toolkit stuff... (e.g. 3d objects <- cannot hide)
     
  26. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    $mask.PNG
    In Private Message, It is impossible to upload the image from my PC.
    I arrange the depthMask in front of one empty panel. But, Nothing happens.
    What's the my mistake understanding?
     
  27. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the item you want to hide must be INSIDE the UIMask box.... just below the highlighted size you set , there's a property called "Depth" ... make it about "10" and position the box so that the box covers the grid from back to front...
     
  28. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    It works good :). Thanks a lot.
     
  29. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Afterwards, I want to have the rounding empty panel(=circular arc of the edge)
    What kind of script I study? BoardLayout.cs or BoardGuiSetUp.cs ... ?
     
    Last edited: Jan 10, 2014
  30. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    all grids / boards are square in shape...you can't change this...you have to change the skin of the panels instead... you can make the prefab you assign for the panel skin to appear rounded.
     
  31. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    $candy_merge.PNG

    I'm sorry for my poor graphic skill. As red lines of left image, there are many round shapes not same.
    As 9 sliced sprites in right image, I want to check pieces types which surrounding one empty(or basic) pieces before game start.
    What kind of script i check?
     
  32. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    in the new version of JMFP, *the version of which the changelog got say that i have made game manager independant of empty panel*
    well, in that version, empty panels are no longer using 'durability' as a check for allowGravity()... thus you can make use of the durability for skin associating...

    all you have to do is
    1) add all the different corners of "skin" you want to the skin of empty panel...
    2) uncheck the "has no skin" check box of the empty panel
    ** this will make empty panel create skins based on the durability assigned...
    3) go to board layout... for each empty panel you see, change the strength value (the numbers next to the panel button - which is also the durability of the panel)

    Note : to use skin[0], use strength 1... and so on...
     
  33. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Wow, That's a good idea.
    Okay, I understand.
     
  34. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    In spawn the TreasurePiece, I want that the spawn position is only board position is (5,9)
    instead of random position.
    Would you let me know to add some scripts?
     
  35. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    unfortunately it can't be done with the current JMFP... as the function "chanceToSpawnThis()" does not include the spawn board position...
    If you know how to modify the function to include the board then good luck...

    else,
    I will amend the function to include the board position so you can do additional checks... (when i'm free)
     
  36. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I really hope to solve this function with JMF"Pro" include one-line dropping swirls from candy jar(or pot?) when you are free.
     
  37. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Your support is very good. Thanks a lot :)
    I think that spawn pieces is random color, then it is to be influenced by golden chance when i play many match games.
    I hope to previse what kind of spawn piece color(minimum 9 pieces/FIFO), then I play my game with JMFP under the control of my foreseeability.
     
  38. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    no idea what you just said...
     
  39. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    If my new panel is only destoryed by the action of animation ARROW, Do i need to amend the many lines of scripts ?
     
  40. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    depends on how you approach it... if you want a generic "destroyInTime()" which saves who is calling the destroy, then you need to modify the destroyInTime() to include the it... then after that, make a check that if panelHit(), who is calling the it, if it's "arrow", then destroy, else, ignore...

    you will need to implement you own logic there...

    -------

    else, easiest way is to add-on specifically just for arrow ... so in the arrow script, instead of calling the generic "destroyInTime()", it calls another function called "Something()" that only this "something()" can destroy this panel....

    --------

    these are just ideas....you'll have to implement your own logic...
     
  41. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    You are a big help to me.
    If I have to check the animation of rainbow as well as arrow, I can not choice the easiest way as your comment.
    Then, What can i do implement with PieceDefinition.isSpecial? I hope to go easily at present.
     
  42. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    you can pass the identity of the calling script... in the custom pieces script (any of them), u can write something like this...

    destroyInTime(this);
    'this' will send over the calling script which is a type "PieceDefinition" ... so the recieving end will look something like this...

    void destroyInTime(PieceDefinition pd){
    if ( pd is xxx) {
    do something;
    } else {
    do something else;
    }

    }// end of destroyInTime()
     
  43. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Okay, I understand. Thanks a lot :)
     
  44. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    In JMFUtils.cs, "public static GameManager gm; // updated by GameManager -> Awake()"
    ------------------------------------------------------------------------------------------------------------------
    1:In PieceTraker.cs," public GameManager gm = JMFUtils.gm;"
    2:In PieceDefinition.Awake(), "gm=JMFUtils.gm;"
    3:In WinningConditions.Start(), "gm = GetComponent<GameManager>();"

    What's the difference 1 2 ? ( 2: Why use in Awake())
    What's the difference 2 3 ? (3: Why not use JMFUtils.gm?)
     
  45. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    1) pieceTracker isn't created until JMFUtils.gm is assigned so it's safe to assign direct...
    2) pieceDefinition is already in the scene, so there is a possibility of JMFUtils.gm = null when it is assigned thus creating error...
    JMFUtils.gm GetComponent<GameManager>() is the same thing... they both get "gm"... only difference is that winningConditions is already in the same gameObject as GameManager so it can get it direct without needing to waste resources finding the correct GameObject...

    JMFUtils.gm is a new thing i added in the latest version of which you can call if you need easy access to the gameManager without having to waste resources finding the gameObject via "GameObject.find()" ....
     
  46. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I'm happy to pull up level of programming with your help.
    Thanks a lot :)
     
    Last edited: Jan 14, 2014
  47. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    It's wonderful that JMF's piece can to move over 4 directions(optional gravity) different from many match 3 games.
    Would you think that PieceTracker is possible to drag through diagonal line with option as well as horizontal, vertical line?
     
    Last edited: Jan 15, 2014
  48. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    yes... u just have to modify the pieceTracker script on top of what is already there...
     
  49. AlphaGTR

    AlphaGTR

    Joined:
    Oct 26, 2013
    Posts:
    38
    Is there still issues with Unity 4.3.X for this asset?
     
  50. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    it seems to be fixed in Unity 4.3.2+ ... but JMF still support 4.2.2 if needed :)