Search Unity

Jewel Match Framework

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

  1. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    just add a text GUI to your portal Object... then in PortalA and PortalB scripts...
    onPanelCreate; set the text to be "durability+1"
     
  2. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thanks a lot
     
  3. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156

    I want to use the animated piece like as GingerBread Man of Cookie Jam.
     
  4. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    then use sprite animation from 2d toolkit...
     
  5. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I have the prefab(animation with animator) which will be used in JMFP. Is it possible?
     
  6. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    not sure where you get that prefab from... but anything that will animate/move your object/sprites will do... JMFP engine supports any sort of objects.
     
  7. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I want to know the suggestedPiece's board position(no transform.position)
     
  8. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    you can try...
    suggestedPiece.getComponent<PieceTracker>().boardPosition
     
  9. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thanks a lot
     
  10. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156

    I want to create the chest by 3 crates(which is not NormalPiece) like as VerticalPiece created by 4 NormalPieces match
     
  11. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    make a new pieceDefinition with a chance to create when 3-match... if failed by chance, create normal vertical/horizontal piece...
     
  12. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I'm sorry, i don't understand your explanation.
    MyCratePiece is created by CratePiece.chanceToSpawnThis like as TresurePiece <== I understand.
    MyChestPiece is created by CratePiece.matchConditions <== I don't know how make it.
     
  13. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    instead of like vertical piece whereby a match-4 is absolute... means if there is a match-4, 100% make vertical piece...
    have it like... 10% chance to make vertical piece... so a match-4 now does not always make a vertical piece
     
  14. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    According to my linked Video(Perhaps, you don't see the ending) , The game wins through 3-match Chest
    Crate is created by 3~5 match normal piece like as Treasure is created by 3-match Normal Piece (10% chance)
    not like as Vertical piece is created by 4-match Normal Piece (100%)
    I want to make Chest(my New PieceDefiniton) by 3-match Crate(my other New PieceDefiniton)
    I think that One myNew PieceDefiniton can't control Chest & Crate at the same time.
     
    Last edited: Sep 4, 2014
  15. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    possible... u already got the creating chest by chance...
    next you just have to modify the "checkPattern()" of the custom pieceDefinition script...
    call the override of the checkPattern and tell it to check for three chests instead of the default behaviour...
     
  16. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Thank you so much.
     
  17. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I want to know that the boss of "Curse You Ninja" has the image of 2X2 grid(quadruple the size of normal image)
    How to make it? One image is sliced by 2x2, then 4 images are created, Does it need 4 panels?
     
  18. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    I only used one big image... (but you can design it as 4 images as well).
    yes it needs 4 panels which works synchronously together...
     
  19. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I want to use only "one big image" with 4 panels. How it is used by JMFP?
    I don't know 2DTK mechanism. Only I know 1 panel has only one image.
     
  20. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    this was what i did... i put no skin for the panel... then instantiated my own gameObject (skin) during the creation phase... so that custom skin is an add-on to the panels and not part of the panel script itself
     
  21. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    I'm sorry that It is impossible to understand "custom skin is an add-on to the panels " for me.
    All 4 panels has same custom skin? Then, Why It is shown 1 image instead of 4?
    Before i see your comment, I guess that the one big image covers 4 panels. 4 panels are invisible because of big image....
    I'm sprry for bothering you again. But, It is very confused for me.:confused:
     
    Last edited: Sep 6, 2014
  22. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    panel1, panel2, panel3, panel4 = no skin (JMF built in skin)

    panel1 onCreate() = instantiate new gameObject (big skin; not built in skin)... covers a 4x4 area size
     
  23. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Okay, I understand it very well for your effort. Thanks a lot.
    I have been had a thought of " covers a 4x4 area size" on my walking around outisde.
     
  24. Derbyshire_

    Derbyshire_

    Joined:
    Aug 13, 2014
    Posts:
    3
    First I just want to say thank you for making such an excellent framework and being around to respond to users questions and such, very helpful reading through everything here and was a big reason I chose to purchase JMFPro, and since I'm new to the scripting side of game design your well commented scripts are extremely helpful.

    I do have a couple questions that are currently bugging me:
    1. When I set secondsPerSpecial and/or movesPerSpecial to 1 or 2 and the pieces are "specialed" at the end of the game it never goes to 0 but stops at 1, don't have this problem when its set to 3 or above, what can I do about this?

    2. Say I want to go about randomly animating pieces on the board, how would I call a random piece (clone) from the board to apply an animation to? I have animations for all of the pieces on the board and want to randomly apply one to the corresponding color piece.
     
  25. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    thanks for your interest in JMFP :)

    1) the text is most likely a visual bug of which the text no longer updates when the special call triggers. I can guarantee its just a visual bug and does not impair the game engine.
    if you would like to exercise your coding logic, you can give it a try yourself and debug the problem area. The place to look for it is in the WinningConditions.cs script.
    Hint: check the place whereby the text is being updated...
    If you can't find it / want me to fix it i will provide the fix soon :)

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

    2) you can randomly choose a board piece via "JMFUtils.gm.board[x,y].piece" whereby x < boardWidth and y < boardHeight....
    you can further get the color via accessing its property "slotNum" via "JMFUtils.gm.board[x,y].piece.slotNum".

    Note : you can get the GUI gameObject via "JMFUtils.gm.board[x,y].piece.thisPiece"

    p.s.> you may want to check if the piece is special or not first by calling the bool value "JMFUtils.gm.board[x,y].piece.isSpecial"... all special piece has a slotNum == 0 since most special piece only has 1 skin. (vertical and bomb pieces was not defined as a special piece thus isSpecial == false)

    p.s.s.> if you are randomly choosing a board, please make sure to check for NULL pieces before accessing the ".piece" variable (in the case of like rock/empty panels) . You can put a IF condition check of "JMFUtils.gm.board[x,y].isFilled" which returns true if there is a piece here and false if there isnt...

    Thanks~!
     
  26. Derbyshire_

    Derbyshire_

    Joined:
    Aug 13, 2014
    Posts:
    3
    I've Fixed the visual bug thanks to your hint so that's displaying correctly now, and it looks like you have given me enough to work from for my random piece animation script.

    Thanks Kurayami88.
     
  27. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    "when a piece ignore's gravity... it is blocking other pieces on top from falling"
    Is this used on "Curse you Ninja"? Because I have not seen the ending of this game.
    I guess... I have not seen it(piece ignore's gravity in JMFP) in any match-3 games.
    Would i suggest that the JMFP update list has modified piece's function (sliding effect like the RockPanel) because i have not full skill of programming for modifying JMFP & I have seen it in the newest many match-3 games
     
  28. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    yes... when a piece "ignore's gravity" it blocks other pieces from falling through it... and it does not cause the landslide effect....
    will KIV and see if i can easily fit it in...
     
  29. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    I try to put a image in the center of the screen when the level begins, but it game board always is showed above the image box that I put, like the image in this link:

    http://pasteboard.co/8hCu1yZ.png

    I just want to show an small text before each level begins, but because the game board is showed above the image that I want to show, it's not working.

    There's some way to hide the game board or put an image above the game board?
     
    Last edited: Sep 11, 2014
  30. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    check your z-order of your image... the GameManager uses a z-order range from about 10 till -10 or so... if you put your image at -30 or less it should be on top of the board...
     
  31. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    It worked for me, thanks
     
  32. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    How can i instantiate the prefab from static function in JMFRelay.cs?

    JMFRelay.onPreGameStart (){
    if (wc.isMyGame) {
    JMFUtils.gm.boardWidth = 9;
    JMFUtils.gm.boardHeight = 9;
    JMFUtils.gm.NumOfActiveType = 6;
    Instantiate(myPrefab, Vector3 (0, 0, 0), Quaternion.identity);
    ==> error CS0103: The name `Instantiate' does not exist in the current context
     
  33. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    you cannot instantiate something from a "non-monobehaviour" class ( AKA a class that does not inherit from monobehaviour or any of its related classes)

    you can however force it instantiate by referring to the required classes...
    e.g. GameObject.Instantiate(myPrefab, Vector3 (0, 0, 0), Quaternion.identity);
    if that does not work... you can always ask GameManager to do it via :-
    JMFUtils.gm.Instantiate(myPrefab, Vector3 (0, 0, 0), Quaternion.identity);
     
    NeoUnity likes this.
  34. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    GameObject.Instantiate(wc.myPrefab, new Vector3 (0, 0, 0), Quaternion.identity);
    It works good(delete : JMFUtils.gm.boardWidth = 9;JMFUtils.gm.boardHeight = 9;JMFUtils.gm.NumOfActiveType = 6)
    Thanks a lot.
     
  35. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    Hi,
    Love your framework I see you made an upgrade i believe i have version v1.3.2. What is the best way to upgrade.
     
  36. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    Prefab Evolution is on today's sale. - " you can nest your prefabs or models without breaking the connection"
    What's your opinion about it needs to be making many levels(=scenes) like as "Curse You Ninja"?
    Does "Curse You Ninja" have only one prefab of tk2dCamera?
     
  37. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    sorry I was not informed of any replies to the thread... you can always reach me via email as an alternative method :)

    To @UnityHB ,
    if you have not modified the main codes *e.g. GameManager etc* then you can overwrite the files easily... if you did... you can refer to the upgrade document provided in the main installer folder. It will be manual upgrading but i highlighted the changes to make it easier for you to replace the required code lines :)

    There are a few prefabs in JMFP ... but most of them are runtime instantiated.... the only prefab that is not runtime instantiated is the tk2dcamera (or the camera equivalent in Unity2D) ... but that is also for convenience only (to create a new scene) and not necessary during gameplay :)
    p.s.> thx for notifying me of replies in the thread ! :)
     
  38. StarwalkerUnity

    StarwalkerUnity

    Joined:
    Sep 19, 2014
    Posts:
    2
    When resetBoard() initiates any special on the board is destroyed, how can I prevent this?
     
  39. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    in the PieceManager inspector area... each individual "PieceDefinition" script has a property called "ignores reset"... it will ignore a board reset... use it on a special piece of your liking :)
     
  40. StarwalkerUnity

    StarwalkerUnity

    Joined:
    Sep 19, 2014
    Posts:
    2
    Perfect that worked thanks for getting back to me so quickly!

    Edit: Another question regarding the reset, sometimes it isn't able to find a match and can take 3-4 automatic resets before something is matchable, is there anyway to fix it so it can find matches within the first reset? Its been eating into time during a timed game while it resets multiple times.
     
    Last edited: Sep 24, 2014
  41. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the resets are randomized...this is the default behaviour
    it will reset the board, check the board's condition, resets again if no possible matches...
    a code to "intentionally" create a usable match is far too complicated (and too costly in terms of processing) to achieve. (especially on a dynamic board with near unlimited designs)

    what i may suggest is for you is to either :-
    a) reduce the maximum active piece type to about 3-4 for complicated board setups to ensure a match is easily made.
    OR
    b) to create a custom reset function that will do the initial reset (with the given reset delay time), and then sub-reset x-amount of times as necessary (which is near instantaneous) until a usable board is found which will seem like an instant to the player so he wont know that the board has actually been reset more than once.

    look into the GameManager.cs script "IEnumerator resetBoard() " & " void detectPossibleMoves()" function for a reference on how the board reset works and modify as necessary.
    If you are interested in custom modifications, i'm available for hire based on complexity of requirements :)
     
  42. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    Is It possible to put an outline border in the panel?
     
  43. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    Hi,
    If you want borders on the individual panels, all you have to do is change the looks of the panels and include the borders in the sprites.

    If you want a border as a container for the board ( like a background for the texts panels on the right in the default JMF kit) then you can mimic the background I've set... Just create a new sprite and set the Z-order to the back of the board...


    But if you want a nice border covering the empty panels as well as the sides and corners etc for a nice finished look, no there isn't a easy way... You will need to be a bit hard working and define each type of borders ( left only/top-left only/etc) and manually define it via choosing the correct skin for the panels in the board layout...
     
    fabiobh likes this.
  44. vastar

    vastar

    Joined:
    Apr 6, 2013
    Posts:
    25
    is there any way to save the board in a txt or xml file?
    I want to create a level editor for my players.
     
  45. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    with the current setup... no there isn't a default template/function to save the board into text....
    but you could create your own board layout text save file... all you have to do is technically save the board info into your own text file and programmatically re-assign the board setup during runtime.... it's entirely possible :)

    you would need the board's [x,y] position, and the current panel type as well as the panel's health... if you want to, you could also include the piece's info as well (color, piece type)..

    once the information is saved, you can code a script/function to digest the saved text and dynamically assign the board similar to what the current board layout is doing.

    if you want to know more about dynamically assigning the board, you can refer to this online document :)
    JMF Pro code references
    http://goo.gl/quVcTH

    p.s.> I believe it is best to set the default size of the board to 9x9 (or your max board size of your game) ... then make the board smaller via using "empty" panels.... because once the variable has been inited, the size of the board is fixed unless you re-declare the size variable which is more complicated than simply just assigning empty panels
    thanks~
     
  46. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    Hi,

    Where would i find script that controls the collect items text for the elements
     
  47. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    it's in the WinningConditions.cs script ... under the function called "getTypes()"
     
  48. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    Hi I checked the script still a bit difficult to identify the code the controls the font size for the collect items elements
     
  49. kurayami88

    kurayami88

    Joined:
    Aug 30, 2013
    Posts:
    493
    the text properties are control via prefab instead of script...
    in the prefab section, go to misc and look for "CollectText" prefab...
    >> JMF Pro/prefabs/Misc/CollectText

    :)
     
  50. UnityHB

    UnityHB

    Joined:
    May 24, 2014
    Posts:
    20
    Got it thanks