Search Unity

Jewel Match Framework

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

  1. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,

    No, the weighted pieces seem fine as long as new piece mode is gravity not appear, the lack of appear not finding matches just causes chaos.

    Can I ask if 4 piece match is possible within the existing framework, that is 2 across, 2 down in a cube.

    I also noticed that a reset shuffles the pieces but also adds pieces if the board has empty panels which spoils the gameplay if you are trying to force the user with empty panels.

    slight mod on gamemanager seems to fix the issue.

    Code (CSharp):
    1. // resets the board due to no more moves
    2.     IEnumerator resetBoard() {
    3.         animScript.doAnim(animType.NOMOREMOVES,0,0);
    4.         JMFRelay.onNoMoreMoves();
    5.         yield return new WaitForSeconds(noMoreMoveResetTime);
    6.         // for the board width size
    7.         for( int x = 0; x < boardWidth; x++) {
    8.             // for the board height size
    9.             for( int y = 0; y < boardHeight; y++) {
    10.  
    11.                 // only reset where pieces are already
    12.                 if(board[x,y].isFilled && board[x,y].piece.pd is NormalPiece)
    13.                 //reset the pieces with a random type..
    14.                 board[x,y].reset(pieceTypes[0], ranType());
    15.             }
    16.         }
    17.         JMFRelay.onComboEnd();
    18.         JMFRelay.onBoardReset();
    19.         isCheckingPossibleMoves = false;
    20.     }
    John
     
  2. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I see what you mean... yea... appear mode was primarily made for JSF; not JMFP.... that's why it does not go well with a match-3 system....and yea... treasure game would require gravity else it cannot reach its goal.... i added the feature just because it was compatible :D... *not necessarily a good feature but it somewhat still works :p*

    to search for a "cube" would require you to modify the checkPattern() function of the PieceDefinition... just make a new custom pieceDefinition and override the mentioned function to check for cube shapes (and any other shapes if you want).... it is not limited to straight line matches :).... but it does require some good logic and minor coding skills :)

    ----------
    p.s. the reset filling empty space was by intent.... but if you want to turn it off; by all means :D
     
  3. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,
    weighted pieces only affected when New Piece Mode set to Appear.
    No Moves Reset also giving intermittent problems, upon reset no suggestions and some times no actual moves.
    Tested this using latest version, clean install, just set one of the levels to 5 x 5 board with 9 pieces to force No Moves and watch the behavior.

    John
     
    kurayami88 likes this.
  4. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Yes... it appears that the resetBoard function is faulty... try this fix and let me know if it still persist... i added an extra line highlighted below

    // resets the board due to no more moves
    IEnumerator resetBoard() {
    animScript.doAnim(animType.NOMOREMOVES,0,0);
    JMFRelay.onNoMoreMoves();
    yield return new WaitForSeconds(noMoreMoveResetTime);
    // for the board width size
    for( int x = 0; x < boardWidth; x++) {
    // for the board height size
    for( int y = 0; y < boardHeight; y++) {
    //reset the pieces with a random type..
    board[x,y].reset(pieceTypes[0], ranType());
    }
    }
    JMFRelay.onComboEnd();
    JMFRelay.onBoardReset();
    checkedPossibleMove = false;
    isCheckingPossibleMoves = false;
    }
     
  5. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,

    Yes, that seems to correct the issue.

    John
     
    kurayami88 likes this.
  6. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    For you may be, your logic tangled up here, you built it. List are difficult to debug?

    The NoMoves Reset is really annoying because it is so abrupt, tracking that down from resetBoard to board[x,y].reset then piece.resetMe , dressMe and destroyCall, now that appears to have a tween on the scale.

    John
     
  7. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the current checkPattern goes like this..
    horizontal list...
    recursively look right... if same color, add... if not same color, stop..
    recursively look left... if same color, add... if not same color, stop..
    vertical list...
    recursively look up... if same color, add... if not same color, stop..
    recursively look down... if same color, add... if not same color, stop..

    forward both list to matchConditions.... let matchConditions determine the further outcome...
    ------------
    what you need to do is modify the checkPattern to something like this...

    new cube list...
    look right... if same color, add... if not same color, stop..
    look down... if same color, add... if not same color, stop..
    look down+right... if same color, add... if not same color, stop..

    old vertical list leave empty...

    forward both list to matchConditions.... let matchConditions determine the further outcome... *becoz matchConditions require two list; but the list can be empty :)*

    then your cube match condition... using the modified checkPattern, if cubelist.count = 4 ... *has a cube* then destroy everything in cubeList... else do nothing (let other scripts do a checkPattern and perform the normal matches*
     
  8. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,

    Well something to look at, although how would you look down+right using foreach, the current pattern only looks in one direction each pass.???

    John
     
  9. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    you dont need a loop in this case... just use board[x+1,y+1] or similar....
     
  10. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,

    Are you still updating this asset, seems very quiet here.

    John
     
  11. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    i'm still here :)
    just release a bug update for some minor bugs.... but all in all the asset is quite complete as a standalone framework :)

    i'm still around to answer any queries though :D
     
  12. TaurusSilver

    TaurusSilver

    Joined:
    Sep 1, 2015
    Posts:
    10
    Hi,

    I am trying to make a special panel which infects pieces/gems around the special panel, if it's not destroyed yet. I want to change the infected pieces/gems into a panel which have to be destroyed first, before another gem or piece can be on that place.

    How should I check the pieces around my special panel and change only 1 piece after a succesful match (when succesfully swapping 2 gem spots)?

    Something like this:
    X X X X P X
    X Y X ->X Y X
    X X X X X X

    X would be a normal piece, Y would be the special panel and P would be the new panel with strength of 1(piece that is infected).
     
  13. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    you can try to use the "onPlayerMove()" function in your customPanel...
    but that would make it immediate response to player move... if you wish it to happen after the board stabilized, you can use "onBoardStabilize()" instead... if you need it to trigger only after every move, then you need a tracker variable for both onPlayerMove & onBoardStabilize to play together....

    ------------
    that is for the trigger... as on how to check... you can use the 'bp' variable in the functions stated above... the bp variable will give access to the current boardPanel and its associated board itself... so then if you want to check the neighbours... you can call "bp.master.allNeighbourBoard" to get a list of all the immediate neighbour boards surrounding your special panel... then you can set up your own validation checks and convert a neighbour to a piece/panel you would like :)
     
  14. estudio3D

    estudio3D

    Joined:
    Apr 2, 2014
    Posts:
    15
    kurayami88 likes this.
  15. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    I'm wondering, does this use Box2D physics? If not, how are you making the jewels fall down into the empty spaces?
    Thanks
     
    kurayami88 likes this.
  16. yohami

    yohami

    Joined:
    Apr 19, 2009
    Posts:
    124
    I believe it uses leantween
     
    kurayami88 likes this.
  17. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,

    It is all based on calculations and not using the physics engine. And as mentioned by yohami, tweened using LeanTween. :)

    Thanks~
     
    Kurius likes this.
  18. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    Just a heads up...
    Unity will be having a sale on this asset next month... details are below.

    March 1, 2016 3 pm CET to March 31 2016 3 pm CET

    Thanks~
     
  19. Deckon

    Deckon

    Joined:
    Mar 1, 2016
    Posts:
    1
    "Made Using JMF engine; **Currently for Android only** :- "
    Will this framework work for ios and other platforms or is it for android only?
    Does it work with unity 5.3 and do I still need 2d toolkit with it?
     
    Last edited: Mar 1, 2016
    kurayami88 likes this.
  20. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    Hi,

    Short answer :
    Yes it works for IOS as well as Android.
    No you do not need 2D Toolkit.

    Long answer :
    I'm not sure where you got this **Currently for Android only** quote from.... but JMFP / JSF system is portable to all Unity supported platform (which includes *but not limited to* PC, Android & IOS)

    There are two versions provided in the framework. You can either pick the Unity2d version which is the most versatile & compatible version to use and/or port to another GUI system of your choice.... or you can also use the 2D Toolkit version which has already been optimised for the 2D Toolkit GUI system :)

    The choice is yours :D
     
  21. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi i use to fiddle around with this asset ages ago but it don't seem to work now. I have found quite a few assets that were the same. I have pro and now it is not playable. Sorry if i sound annoyed but this has happened way too often to me now. I have the latest version of everything. It did say unity 5 ready. Look at pic i get these 2 errors.
     

    Attached Files:

  22. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    That error is telling that you do not have the pool manager asset...
    My advice would be to re-import the JMFP / JSF from the provided unitypackage again. Then make sure you do not delete the Pool Manager asset files.

    If it still has errors, try importing into a fresh new project and see if you still get the same error....
    Do let me know if you are still facing problems after trying the above.... Thanks~!

    **EDIT**

    ADDITIONAL NOTES :
    if you have the ORIGINAL pool manager asset, Please import the JMFP / JSF asset first... AND THEN import the original pool manager asset... this ensures that the original asset overwrites the dummy asset.

    Thanks~!
     
  23. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    But it was a completely clean project and i don't own pool manager though.
     
  24. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Sorry i worked it out i just had to make sure that i dont do leantween aswell cos i didn't read it when it says leantween is included. All works now.
     
    kurayami88 likes this.
  25. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi just wondering has anyone integrated mad level manager with this and if so can anyone do me a tutorial on how to. I am no coder i useally use playmaker thats why i am asking. I know i have to put code in the winning conditions and i did find where the stars are in that script. But the basic tutorials for mad level manager is different with the code. I am going to try to work it out myself but any help would be much appreciated. Pitty there isn't a integration file like it has for the 2d toolkit.
     
  26. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I have done it before for other clients... and yea you have do dive into the code (or atleast back when i did it)
    should u require GUI / Inspector drag n drop stuff, you would probably need to seek some help from a coder....

    but the code required isnt complicated... just follow MLM's call functions and provide the desired value and u should be good to go....

    u can study MLM's tutorials (if any, i dont remember seeing one back when i did it; i referred to their function calls and documentation)
     
  27. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Yep i have been reading up on mad level manager and it does seem a little easy maybe but after doing a few tutorials on mad level manager i will try it.
     
  28. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi i did my own sprites and am working with 2d toolkit and have noticed the Combotxt is not working. This actually happened after replacing the pieces aswell, because it was working before hand. The sound comes up when there is a combo.
     
  29. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    I just restarted the level again and now the combo works fine. I must have done something wrong the first time
     
  30. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi i was just wondering if a slider with 3 stars could be implemented/requested, just like in them match 3 games. I have been trying but of course i don't fully understand coding yet.
     

    Attached Files:

  31. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hopefully i get answered this time but i was wondering how does clear shaded works because when i just have 1 prefab there it doesn't seem to work.
     
  32. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Just wondering what is the treasure goals. I can't seem to find any documentation.

    Never mind i worked it out. But still wouldn't mind documentation though, its just lacking that.
     
    Last edited: Nov 26, 2016
  33. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    I won't get a answer again but with is get types is there away have the items across instead of down. Lack of answers lose stars on this product.
     
  34. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    I bought the booster script, its possible to put my own particles effects for the booster?
     
  35. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    On the script Special5Boost.cs

    I've disable this line:
    mgm.animScript.doAnim(animType.RAINBOW,x,y); // visual fx animation

    My question is how to put a sprite exploding for earch sprite select on booster Special5Boost?

    Its a simple question I think, I just need to know how to start.

    About the sprite exploding... I'm trying to do something like this:
    https://media.giphy.com/media/CKkGyQ91v5asE/giphy.gif

    Thanks in advance
     
  36. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    I believe you are talking about the destroy animation of the individual pieces that is being destroyed?
    but the main anim you disabled is only for the special five visual effect... u can change that seperately... however what you are looking for is example below...

    // Does the power merge colored. match 5 type power ( destroys specified param color )
    IEnumerator specialFiveColored(int[] arrayRef, Board thisBd, int slotNum, float delay, bool visuals){
    if(visuals){ // if play visual and sound effect
    gm.audioScript.matchFiveSoundFx.play(); // play this sound fx
    gm.animScript.doAnim(animType.RAINBOW,arrayRef); // visual fx animation
    }
    gm.destroyInTimeMarked(thisBd, delay, scorePerCube); // locks this piece & destroys after x seconds
    // thisBd.isFalling = true; // do not let it fall :)

    float delayPerPiece = 0.00f;
    yield return new WaitForSeconds(delay);

    foreach(Board board in gm.board){ // destroys the selected color in each board
    if(board.isFilled && !board.pd.isSpecial && board.piece.slotNum == slotNum){
    gm.destroyInTime(board, delayPerPiece, scorePerCube);
    gm.animScript.doAnim(animType.YOURNEWANIM,arrayRef); // visual fx animation
    }
    }
    }


    ===========================================
    for those codes highlighed in red

    1) check the delay... the default function call is set at 2 secs... leave this if the default is fine... else change it in the function call within the script...
    if(execute) StartCoroutine( specialMergeFive(posA,posB,thisGp,otherGp,2f) ); // do a power merge power

    2) add a new line as shown above with the code YOURNEWANIM....
    you will also need to modify the animScript and add a new anim called YOURNEWANIM.
    the anim script is named "CustomAnimations.cs".

    you can add a new gameobject & new switch-case call...
    e.g.

    case animType.YOURNEWANIM:
    if(YOURNEWANIMOBJECT){
    if(JMFUtils.isPooling){
    PoolManager.Pools[animPoolName].Spawn(YOURNEWANIMOBJECT.transform, gm.board[x,y].position, Quaternion.identity);
    } else {
    Instantiate(YOURNEWANIMOBJECT, gm.board[x,y].position, Quaternion.identity);
    }
    }
    break;
     
    miguelandrade likes this.
  37. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    so sorry @wendymorrison,
    I did not receive any notification on the forum thread and it went unnoticed...
    you can change the location of where the treasure needs to go by specifying the treasure goals properties in the BoardLayout script inspector. However, since the board is naturally gravity down, the bottom tile is the most obvious location... unless of course you change the gravity direction (also selectable on the GameManager script inspector).


    upload_2017-11-16_12-10-52.png


    upload_2017-11-16_12-13-20.png
     
  38. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    I will try here!!!

    Thank you very much!!!
     
  39. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    Hi

    I got success in changing the particle effect, I had to change the script as directed and switch GameManager Panel and change to the name of my "animation"

    if I want to put an animation for each sprite that is removed from the screen on Special5Boost(The first booster), is this possible?

    Can you help me with this?

    Thanks in advance!!!
     
  40. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493

    this is exactly the same method you use to put the explosion effect... just add another "anim object" which is your animation.

    tip :
    try combining your explosion and animation into a single object then set it so that it is called via the method mentioned above... having two seperate objects going off at the same time is resource comsuming.
     
  41. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    Thank you!!!
     
  42. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    Hi

    I'm trying to control the music backgrounds and sounds of the game.

    To mute the sound and using this line:

    ap.bgmPlayer.audio.volume = 0.0f;


    What is the name of the variable to control the music and soundfx?


    Can you help?

    Thanks
     
  43. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    I actually placed a very basic sound & music toggle in my framework... The control script is "FXToggle.cs" located at '\Scripts\area 51\GUI related'

    within it, you may check how I triggered the audio player... or you may even reuse/modify the script i made...
    NOTE: the "FXTracker.cs" is use in conjunction with the "FXToggle.cs" and controlled via drag and drop on the unity inspector.

    All the gameObject relevant to the sound/audio is located in my sample framework placed under the "Anchor Bottom Left".
    It contains the AudioSource for both the bgm/sfx as well as their trigger script

    ---------------
    however, the editable inspector settings for the audio is on the "AudioPlayer.cs" located alongside the GameManagerPanel and its scripts. The path is located at "\Scripts\customisables"

    AudioPlayer has already pre-assigned the AudioSource mentioned earlier.
     
    Last edited: Dec 28, 2017
  44. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22
    The script "FXToggle.cs" is perfect for what I'm looking for... Thank you very much!!!

    Other question, What is the variable to reduce of increase the sound volume/music?
     
  45. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    if within the FXToggle.cs script :
    ap.player.volume = x; // soundFX audio controller
    ap.bgmPlayer.volume = x; // bgm audio controller
    where x is the volume you want from range 0.0 ~ 1.0

    if within the audioPlayer.cs
    directly access the player / bgmplayer
    player.volume = x; // soundFX audio controller
    bgmPlayer.volume = x; // bgm audio controller
     
  46. miguelandrade

    miguelandrade

    Joined:
    Feb 28, 2015
    Posts:
    22

    I will try at home!

    Thank you very much!!!

    :)
     
  47. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Hi I decided to get back into this and see if it works with unity 2018 and it does. Of course had to re-learn this asset and noticed that you can have the jewels appear instead of the normal fall by gravity, but appear seems not to work with matches. When the jewels appear I might end up with the same kind in a row and they never gets a match. I liked this feature but can't use it which is a pity.
     
  48. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi, yes it does not work well with "appear" type because the feature was originally intended for the "swipe" framework instead.

    But you can actually call the board checker for matches manually ... I believe I disabled the routine checks to save on cpu usage, so the default behaviour only checks for matches when pieces are falling.


    if you are versed in diving into the code, there are two ways you can trigger matches for appear type,
    1) Put a routine to check for matches every "0.x" seconds... but consumes some CPU cycles
    2) put a match check after a piece appears (but after the appear animation fully completes).
     
  49. wendymorrison

    wendymorrison

    Joined:
    Jan 6, 2014
    Posts:
    246
    Thank you for answering but yeah I am still only learning to code. I have however learnt a lot by looking at your code by integrating Mad Level Manager.

    Just a quick question how would I turn your timer for isTimergame to a clock timer with only using minutes and seconds. I did get part of the way by looking at tutorials but it hasn't really worked the way I want it to.

    timer.JPG

    This image is how i want it to be like and starting with 1 minute and 20 seconds. Thanks in advance.
     
  50. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    that countdown is more towards visuals only... im not sure if there are any assets out there to convert secs to min:secs (there should be), but all coding logic should be in secs so its not the code you should go after, more of visualizing the code thats all.

    you can write a simple code by having two visuals... one visuals truncates the actual remaining time into x minutes (without the extra decimals)... something like Math.Floor(totaltime/60)
    and another truncates the remaining time into remaining secs via totaltime%60...

    then just paste the two side by side in a visual form like your asset above....