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

Jewel Match Framework

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

  1. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi ... i just checked number 1... the "landslide Effect" was meant to cause pieces to landslide as though the current piece is a solid "like a wall panel" ... the behaviour works when "allow gravity" is disabled... I will need to fix the bug that will cause it to jump around under normal circumstances thx :)
     
    NeoUnity likes this.
  2. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    @NeoUnity

    please manual update the Board.cs script for this function... and then it will work as intended ! :)

    public bool causesLandslideEffect(){
    if((isFilled && pd.landslideEffect && panel.isFillable()
    && (isFalling || !panel.isStealable())
    ) || panel.isSolid() ){
    return true;
    }
    return false;
    }
     
    Last edited: Nov 20, 2014
    NeoUnity likes this.
  3. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    @kurayami88 I got it, Thank you for your quickly & helpful reply:)
     
  4. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    @NeoUnity

    i have again revised the function... it should work with empty panels well now...
    please let me know if it causes further bugs tq :)
     
  5. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    It works well tq :)
    Is it possible without revised scripts to add this rail(?) function of Candy Crush ?
    (existing portal panel + add new function for auto moving through rail+ ???)
     

    Attached Files:

  6. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    You will need to make a new panel with the rail ability. But as far as the engine goes, no I don't think you need to revise/modify it =)
     
  7. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    1) In JMFP, the portal panel has one space. Do you have a hint of one space has been seen two portals
    (portalA&B image is located on upper side of its space, Always one piece is located in portalB's space)
    2) How to make it come true that TreasureGoal has its image(down direction)?.
     

    Attached Files:

  8. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    1) you will need to make a new panel script or revise the current portal script for it to have the portal function but yet does not take up a space...

    2) you will need to add to WinningConditions script for the treasureGoal vector to instantiate a GUI at that board location. nothing too hard to do...
     
  9. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    If i have the 100 scenes, Then
    1) I add my custom piece to scene #50 2) Apply to the tk2dCamera prefab
    => All 100scenes have same BoardLayout like as scene #50's BoardLayout.

    Is it right?
    1. How to pass the "ready-made" BoardLayout(of each scene) over tk2dCamera prefab?
    2. Before start to make the scenes, How to pass BoardLayout over tk2dCamera prefab?
     
  10. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    all scene will copy the master prefab EXCEPT for modified changes. modified changes in the inspector will appear bolded once changed. you can revert back to follow the master by right clicking and select "revert value to prefab".

    anything not bolded will follow the master. so if the master added a new thing OR change a property, it will be passed on to the child copy as well (for those the child did not modify already).

    -----------
    p.s. > you can't see the bolded change in the boardLayout because it is a custom script... but as long as you have already touched the boardLayout script in the scene, it will no longer follow the master. (this should be the appropriate behaviour as well because you want the level edit to remain as you last left it anyway)
     
    NeoUnity likes this.
  11. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thanks a lot. I am studying the Prefab with your reply.
    How to access to suggestedPieces[0]'s arrayRef.
     
  12. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Are you still using v1.4.0 or have upgraded to v2.0.2?
     
  13. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I upgraded to v2.0.2
     
  14. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I'm not near my computer at the moment... But you can try accessing suggestedPieces[0] directly,... Then find the piece tracker script via suggestedPieces[0].getComponent<PieceTracker>().arrayRef... ArrayRef is of type int[]
     
    NeoUnity likes this.
  15. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thanks a lot. It works well.
     
    kurayami88 likes this.
  16. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    finally~! i had to make some sacrifices for my other asset to be released... i dropped the 2D Toolkit version and pushed the universal Unity2D version... but it's finally here~!
    introducing.. JSF~!!

    p.s.> if you use it but prefer the 2D Toolkit version, please contact me :)
    https://www.assetstore.unity3d.com/en/#!/content/23657

    the demo... :)
    http://goo.gl/dbym94

    the official forum for the new JSF asset
    http://goo.gl/Y9nZGC

    p.s.s.> unity 4.6 is officially out.... providing better 2D UI options....
     
    Last edited: Nov 27, 2014
  17. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    First off, I just wanted to say congratulations on your JSF release :)
    I don't have been liked the swipe games instead of match games. But, JSF is unexpedily funny~.


    It is fantastic that "Fully compatible with JMFP ( works together in the same project ! )" in JSF forum
    a=JMFP project file size, b=JSF project size. c=a+b. if ( works together in the same project ! ) then d is the actual file size.
    (c-d) value(about)?
     
    Last edited: Nov 27, 2014
  18. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Majority of the size comes from GUI elements... And since the GUI is roughly the same in both projects, you can actually merge the GUI elements. Therefore, c != a + b.... =)

    The main difference is in the scripts provided which shouldn't be more than even 1~2mb in size..

    I would assume once you replaced JMFP and JSF GUI with your own game GUI, you will find it not taking more than a few mb size difference.
     
    NeoUnity likes this.
  19. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,
    Looking for a little help to pause the game.

    using this code in the winning conditions script

    Code (CSharp):
    1. public bool pause = false;
    2.    
    3.     IEnumerator routineCheck(){
    4.  
    5.  
    6.  
    7.         while(!isGameOver) {// loop infinitely until game over
    8.  
    9.  
    10.             if (pause) {
    11.                
    12.  
    13.                 Time.timeScale = 0;
    14.                 Debug.Log("paused "+ pause);
    15.             } else {
    16.                
    17.                 Time.timeScale = 1;
    18.                 Debug.Log("!pause "+ pause);
    19.             }
    20.  
    Which pauses the game but I cannot get a response from the button then to unpause.

    Am I doing it in the right place.

    This is the code attached to the button I have tried.

    Code (CSharp):
    1. void OnMouseUpAsButton (){
    2.         //void OnMouseClick (){
    3.  
    4.  
    5.  
    6.         //JMFUtils.wc.pause = !JMFUtils.wc.pause;// TOGGLES onoff at each click
    7. //              
    8. //                if(paused){
    9. //                    Time.timeScale = 1;
    10.  
    11. //                }else {
    12. //                    Time.timeScale = 0;
    13. //            Debug.Log("paused = 0 "+paused);
    14. //                }
    15. //              
    16.             }
    17.  
    18.  
    19.  
    20.     void Update() {
    21.         if (Input.GetMouseButtonDown(0))
    22.             //JMFUtils.wc.pause = !JMFUtils.wc.pause;// TOGGLES onoff at each click
    23.             Debug.Log("Pressed left click.");
    24.        
    25.         if (Input.GetMouseButtonDown(1))
    26.             JMFUtils.wc.pause = !JMFUtils.wc.pause;// TOGGLES onoff at each click
    27.             Debug.Log("Pressed right click.");
    28.        
    29.         if (Input.GetMouseButtonDown(2))
    30.             JMFUtils.wc.pause = !JMFUtils.wc.pause;// TOGGLES onoff at each click
    31.             Debug.Log("Pressed middle click.");
    32.        
    33.     }
    34.  
    I have been searching online but not found a solution.

    Any hints would be great.
    Thanks

    John
     
  20. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    Hi, you only need the OnMouseUpAsButton() function... The Update() function is redundant and conflicting itself... Throw it away...

    Also, you only need to specify Time.timeScale = 1; Time.timeScale = 0;... No need to modify anything in game manager & winning conditions as the time scale will automatically pause all functions.
     
  21. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Kurayami,
    I was only trying the update function to test for different mouseclicks, It works as you said just in OnMouseUpAsButton.

    Thankyou.

    I also just tried one of the other scenes 2 x 4 Gems 5x5.unity, which is a collect type game and notice that their is no text showing for the amount of types just the sprite, I can see the variables showing in Heirarchy when the scene is running but nothing on the panel.

    Oh congratulations on getting JSF out in the Asset store, will have to wait on that one until I can figure out JMF though.
     
  22. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    check if you have accidentally un-referenced the "collectText" prefab on WinningCoditions.cs... this slot requires a prefab gameObject that has a "tk2dTextMesh" for 2DToolkit version or "TextMesh" for Unity2D version.
    the collectText prefab is located somewhere in the prefabs folder under the same name "collectText".
     
  23. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    No, the reference is there, strange if I open the first scene and change the game a type game the text shows, must be something I have added in winning script.

    Can I ask if you are going to be a changing the gui layout in JMF to the new UI in 4.6, the anchor system seems good for different resolutions.

    John
     
  24. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    i Thought about it... but i can't atm... that would mean that everybody using JMFP/JSF will be forced to update to Unity 4.6 whether they like it or not...

    I cannot implement something that is not supported by lower Unity versions else the compatibility will be broken. =/
     
  25. shoni-wheeler

    shoni-wheeler

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

    Can you tell me where I can find the reference to the sprites for Collect Text, I want to change each sprite when NumToGet = 0.

    Thanks

    John
     
  26. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    The reference for the sprites is not globally saved by default... If you wish to save it, you will need to make your own reference variable and set up the reference during the creation phase in the function "setUpTypes()"
     
  27. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    anybody interested? just a preview here... will upload to the asset store soon :)

    *p.s.> this link is a webplayer link... run your browser as administrator if needed :)
    http://goo.gl/CbVr7r
     
  28. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Kurayami,
    A couple of things, your latest update is that a small update to just one of the files.

    On the No more moves function, didn't it use to show a label, now it only seems to emit particles without informing the user why?.

    Can you tell me how to get the reference for the skin on a normal matched piece.

    Code (CSharp):
    1. public static void onPieceClick(int x, int y){
    2.         gm.board[x,y].pd.onPieceClicked(gm.board[x,y].piece); // call PieceDefinition's onPieceClick
    3.        
    4.         // the panel click is here because the panel will be next to be clicked after the piece
    5.         onPanelClick(x,y); // call PanelDefinition's onPanelClick
    6.  
    7.  
    8.         // -----------------------------------
    9.         // your own stuff here...
    10.         // x / y is the board position of which the piece located was clicked.
    11.         // e.g., JMFUtils.gm.board[x,y] ....
    12.         Debug.Log ("type clicked " + JMFUtils.gm.board[x,y].piece.slotNum);
    13.         Debug.Log ("skin " + JMFUtils.gm.board [x, y].pd.getSkin(1));
    14.  
    15.  
    16.  
    17.         // -----------------------------------
    18.     }


    Thanks
    John
     
    Last edited: Dec 8, 2014
  29. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    two files actually... *if you are talking about JMFP v2.0.3* ... as for JMFPv2.0.2, yes... only the PieceTracker.cs script

    sorry, the "NoMoreMoves" anim prefab is currently broken in the Unity2D Version. You can revise the prefab or change the NoMoreMoves prefab to suit your game. I will update this in the next release (v2.0.3; since it is not released yet)

    based on the function you quote, you can get it via:-
    gm.board[x,y].piece.slotNum; // the current skin number used...

    // now to get the actual skin prefab;

    gm.board[x,y].piece.pd.skin[ gm.board[x,y].piece.slotNum ];

    OR

    gm.pieceManager.getComponent<NormalPiece>().skin[ gm.board[x,y].piece.slotNum ];
    // replace "NormalPiece" with any pieceDefinition you want.
     
  30. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Kurayami,
    Thanks, that gives me the prefab and the type, I also need to get the same info from here if you would please assist me.

    Code (CSharp):
    1. public void doAnim(animType animType, int x, int y){
    2.         switch (animType){
    3.         case animType.GLOBALDESTROY :
    4.             if(PieceDestroyEffect){
    5.                 if(JMFUtils.isPooling){
    6.                     PoolManager.Pools[animPoolName].Spawn(PieceDestroyEffect.transform, gm.board[x,y].position, Quaternion.identity);
    7.                 } else {
    8.                     Instantiate(PieceDestroyEffect, gm.board[x,y].position, Quaternion.identity);
    9.                     Debug.Log ("destroyed skin " +  gm.board[x,y].piece.slotNum); // the current skin number used...NEED THE ACTUAL PREFAB
    10.                 }
    11.             }
    12.             break;
    I opened the NoMoreMoves prefab and saw it had a label attached, added font material and text mesh but could'nt get it to display, I suppose I could just add an animation to flow alongside the particle animation.

    I asked about the latest update because you already sent me a link and I was'nt sure whether to apply it because of alterations already made to current version, if you tell me which files are affected I will just overwrite those.
     
  31. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the same code applies... the function already give the x & y... just use back the suggested code.


    you can check the "manual update" folder located in the "JMFP release" folder. within it are changes from each version iteration. The changes are very minor so you can easily update it with little troubles :)
     
  32. shoni-wheeler

    shoni-wheeler

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

    Thanks, I am still confused regarding this animation code;
    Code (CSharp):
    1. case animType.GLOBALDESTROY :
    2.             if(PieceDestroyEffect){
    3.                 if(JMFUtils.isPooling){
    4.                     PoolManager.Pools[animPoolName].Spawn(PieceDestroyEffect.transform, gm.board[x,y].position, Quaternion.identity);
    5.                 } else {
    6.  
    7.                     Instantiate(PieceDestroyEffect, gm.board[x,y].position, Quaternion.identity);
    8.  
    9.                 }
    10.  
    11.                 Debug.Log ("destroyed skin type" +   gm.pieceManager.GetComponent<NormalPiece>().skin[ gm.board[x,y].piece.slotNum]); // the current skin number used...NEED THE ACTUAL PREFAB
    12.             }
    I want to change the animation on Destroy, the code instantiates PeiceDestroyEffect, I cannot find that prefab.
    The Sparks Particle seems to be the effect that is happening, can you explain what is happening here.

    I fixed to NoMoreMoves Prefab, by adding font material, a text Mesh and removing the mesh filter.

    Thanks

    John
     
  33. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    "PieceDestroyEffect" is the sparks particle. you can replace the sparks anim prefab with anything else you like by replacing the mentioned prefab in the inspector panel of "Custom Animations" of which the property is called "Piece Destroy Effect" ...
     
  34. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,
    This is beginning to drive me bananas, Need some advice anyone please.
    Made a new script, tried using JMFUtils.gm.Board[x,y] to get sprite type or name whatever, point is as soon as I Try to type JMFUtils.gm.Board[x I do not get intellisense for the x only Matrix4x. Now I am thinking out of scope but tried this inside winning conditions as well same problem even though it states:
    Code (csharp):
    1. ///<summary>
    2. ///
    3. ///Belowarepropertiesofinterest...
    4. ///
    5. ///gm.score<--- thecurrentscoreaccumulatedbytheplayer
    6. ///gm.moves<--- thetotalmovestheplayerhasmade
    7. ///gm.currentCombo<--- thecurrentcombocountofanygivenmove ( willresetto0eachmove )
    8. ///gm.maxCombo<--- themaxcombotheplayerhasachievedinthegaminground
    9. ///gm.isGameOver = true<--- stopsmostofallgameManageractivities
    10. ///gm.checkedPossibleMove<--- abooleanthatsignifiestheboardhasstabilizedfromthelastmove
    11. /// ( usethiswhenyouwanttheboardtostoponlyafterfinishcombo-ing )
    12. ///gm.canMove<--- abooleantoallowplayerstomovethepieces. true = canmove; false = cannotmove.
    13. ///gm.board[x,y] <--- usethistoreferencetheboardifyouneededmoreboardproperties
    14. ///gm.notifyBoardHasChanged() <--- totelltheboardtocontinuechecksafterithassettled
    15. ///gm.matchCount[x] <--- thecountofthetypethathasbeendestroyed.
    16. ///
    17. ///</summary>
    I just need to know what I am doing wrong please.
    Yes, still learning c# but the notes indicate I can access JMFUtils.gm.board from any script so why does it not work.

    John
     
    Last edited: Dec 12, 2014
  35. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    not sure exactly how you are typing it... but your own quote "JMFUtils.gm.Board[x" is wrong...

    try this... JMFUtils.gm.board[x
    --------
    also, please replace x and y with meaningful array numbers.... if you are using for loops, int x int y goes through an interation...

    else, direct access also works, e.g. JMFUtils.gm.board[1.4] *providing that 1 < boardWidth & 4 < boardHeight* else you will get a null pointer exception.

    please do not use JMFUtils.gm.board[x,y] directly without any reference as to what x and y is.
     
    Last edited: Dec 13, 2014
  36. shoni-wheeler

    shoni-wheeler

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

    Yes this is what I was overlooking:

    I was trying to change a normalpiece to a specialpiece

    Code (CSharp):
    1. gm.board[x,y].convertToSpecial( SpecialFive, 0 ) ; //to change the pieces
    but my PieceDefinition is also wrong.

    John
     
  37. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    *** pd (PieceDefinition) can be obtained via "JMFUtils.gm.pieceManager.getComponent<"desired-attached-custom-PieceDefinition">()"

    e.g.>
    JMFUtils.gm.pieceManager.getComponent<SpecialFive>()
     
  38. shoni-wheeler

    shoni-wheeler

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

    There is a problem with the Portals, if you have more than 1 pair the pieces drop through and land in them.


    John
     
  39. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the default portals does not support multi-entry / multi-exit points... please only use 1 pair at a time.... assign pairs by setting the panel strength number.
     
  40. shoni-wheeler

    shoni-wheeler

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

    I was not trying muliple entry or exit just in pairs as you stated in your video, it only happens if you have more than 1 pair.

    John
     
  41. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    doesn't seem to happen so far in my default settings... the sample scene provided in JMFP has up to 3 pairs... and they work as intended.

    could you screenshot your boardLayout so I can see how you have set up your board?
     
  42. shoni-wheeler

    shoni-wheeler

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


    There are no changes in any files except winning conditions, the sprites are all configured in prefabs same as the originals.
    John
     
  43. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    u will need to configure the pairs properly as i've mentioned...

    above the "A" and "B" panels, there is a number box... assign a number pair...
    e.g. > A - 0 & B - 0 ... A - 1 & B - 1 ... so forth... only 1 pair of A & B per number.... as in your case, all your portals currently have the number '0'
     
  44. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Kurayami,
    Stupid error, can see now the box above relates to the panel below, but still the same problem, I tried different sprites and positions with 1, 2 or three pairs.

    I just posted these and now see what the problem is, I stupidly ticked the has starting piece in Portal B in Panel Manager, so sorry for bothering you.





    John
     
    Last edited: Dec 14, 2014
  45. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    i've tried the exact same setup as you did... and encountered no errors...
    may i ask what version of JMFP are you using?
    *screenshot below*
     

    Attached Files:

    • test.png
      test.png
      File size:
      358.9 KB
      Views:
      744
  46. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    John
     
  47. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    np :)
     
  48. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thanks for JMFP v2.1.0 :)
     
  49. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    oh... tq for noticing... didn't expect it to be approved so fast to the asset store :D
     
  50. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Kurayami,
    Not working out on the changes to winningconditions.cs, far to much looping, never gets to a win or fail.

    John