Search Unity

Trading Card Game Maker

Discussion in 'Assets and Asset Store' started by Melang, Mar 30, 2014.

?

What would you like to see in this kit:

  1. lots of pre-coded spell and creature effects (ex. copy creature, double strike)

    224 vote(s)
    54.5%
  2. cool 3d effects, possibly a 3d background (ex. Hearthstone, MtG:DP)

    147 vote(s)
    35.8%
  3. optimization for mobiles

    182 vote(s)
    44.3%
  4. multiplayer

    260 vote(s)
    63.3%
  5. card art that you are free to use in your games

    106 vote(s)
    25.8%
  6. sound effects and voices

    92 vote(s)
    22.4%
Multiple votes are allowed.
  1. Mario-White

    Mario-White

    Joined:
    Sep 16, 2014
    Posts:
    3
    Can someone help me with a code to modify win/lose conditions to end the game in (player.cs)

    if ((Life <= 0 || (MainMenu.TCGMaker.core.OptionGameLostIfHeroDead && HeroIsDead)) && !GameEnded) //the player has just lost!
    {

    //Debug.Log("player lost because of life<=0");
    GameLost();

    }
    else if ((Enemy.Life <= 0 || (MainMenu.TCGMaker.core.OptionGameLostIfHeroDead && Enemy.HeroIsDead)) && !GameEnded) //the enemy has just lost!
    {
    // Debug.Log("enemy lost because of life<=0");
    GameWon();


    if there's 3 of one type (undead) creature in play. I want a win condition. I'm not sure how to create the code to search for 3 of multiply types.
    Thx
     
  2. SpectralRook

    SpectralRook

    Joined:
    Feb 9, 2014
    Posts:
    112
    There may be a better way to do this but one option is compare the subtype of each creature in play to the subtype for "undead". The default is 0 but unless you know that for sure you may want to check it against the list of subtypes.

    Code (CSharp):
    1.     private bool MatchSubtype(string subtypeName, int subtypeIndex )
    2.     {
    3.         bool subtypeMatch = false;
    4.         for (int i=0; i < MainMenu.TCGMaker.stats.CardTypes.Count; i++)
    5.         {
    6.             if (MainMenu.TCGMaker.stats.CardTypes[i].name == subtypeName && i == subtypeIndex)
    7.                 subtypeMatch = true;
    8.         }      
    9.         return subtypeMatch;
    10.     }
    You could execute that in the update with something like the following. Note if you are only ever going to look for undead then I wouldn't bother with using MatchSubtype. Just grab the subtype for undead once and compare it to the foundcard.Subtype. The example adds more work than is necessary for a simple comparison.

    Code (CSharp):
    1.  
    2.     player_undead_in_play_count = 0;
    3.      foreach (card foundcard in Player.player_creatures)
    4.      {
    5.        if (MatchSubtype("undead", foundcard.Subtype)) // if (0 == foundcard.Subtype)
    6.        {        
    7.          player_undead_in_play_count++;
    8.          
    9.          if (player_undead_in_play_count >= 3)
    10.          {
    11.            Debug.Log("Player won; 3 Undead in play");
    12.            GameWon();
    13.          }
    14.        }
    15.      }
    16.        
    17.     enemy_undead_in_play_count = 0;
    18.      foreach (card foundcard in Enemy.player_creatures
    19.      {
    20.        if (MatchSubtype("undead", foundcard.Subtype) // if (0 == foundcard.Subtype)
    21.        {        
    22.          enemy_undead_in_play_count++;
    23.          
    24.          if (enemy_undead_in_play_count >= 3)
    25.          {
    26.            Debug.Log("Enemy won; 3 Undead in play");
    27.            GameLost();
    28.          }
    29.        }
    30.      }
    31.  
    The enemy_undead_in_play_count and player_undead_in_play_count would go up at the top of the Player class like
    Code (CSharp):
    1.  
    2.    public static int player_undead_in_play_count;
    3.    public static int enemy_undead_in_play_count;
    4.  
     
  3. Mario-White

    Mario-White

    Joined:
    Sep 16, 2014
    Posts:
    3
    Its looks good to me, But some how it's throwing an error

    Assets/TCG/Scripts/Player.cs(437,26): error CS1525: Unexpected symbol `{'

    &

    Assets/TCG/Scripts/Player.cs(450,9): error CS8025: Parsing error

    I added,

    Code (CSharp):
    1. public static int player_undead_in_play_count;
    2. public static int enemy_undead_in_play_count;

    at the top and added the win condition

    Code (CSharp):
    1. void Update () {
    2.  
    3.         TurnPopUpTimer += Time.deltaTime;
    4.  
    5.  
    6.         if(Input.GetMouseButtonDown(1))        // right-click
    7.             {
    8.                 if (Player.NeedTarget>0)
    9.                     {
    10.                         ActionCancelled = true;
    11.                         Debug.Log ("cancelled");
    12.                         Player.NeedTarget = 0;  //cancel the spell
    13.                     }
    14.                 else if (Player.DisplayingCreatureMenu)
    15.                     {
    16.                         Player.DisplayingCreatureMenu = false;
    17.                        
    18.                         foreach (card foundcreature in Player.player_creatures)
    19.                             foundcreature.abilities.DisplayMenu = false;
    20.                     }
    21.             }
    22.  
    23.         if (CreatureStatsNeedUpdating) {
    24.        
    25.             foreach (card foundcard in Player.player_creatures)
    26.                 {
    27.                     foundcard.UpdateCreatureAtkDefLabels();
    28.                 }
    29.             foreach (card foundcard in Enemy.enemy_creatures)
    30.                 {
    31.                     foundcard.UpdateCreatureAtkDefLabels();
    32.                 }
    33.             CreatureStatsNeedUpdating = false;
    34.  
    35.         }
    36.  
    37.         if ((Life <= 0 || (MainMenu.TCGMaker.core.OptionGameLostIfHeroDead && HeroIsDead)) && !GameEnded) //the player has just lost!
    38.                     {
    39.        
    40.             //Debug.Log("player lost because of life<=0");          
    41.             GameLost();
    42.                        
    43.                     }
    44.         else if ((Enemy.Life <= 0 || (MainMenu.TCGMaker.core.OptionGameLostIfHeroDead && Enemy.HeroIsDead)) && !GameEnded) //the enemy has just lost!
    45.                     {
    46.         //    Debug.Log("enemy lost because of life<=0");          
    47.                         GameWon();
    48.                        
    49.                     }
    50.  
    51.         player_undead_in_play_count = 0;
    52.         foreach (card foundcard in Player.player_creatures)
    53.         {
    54.             if (MatchSubtype("undead", foundcard.Subtype)) // if (0 == foundcard.Subtype)
    55.             {      
    56.                 player_undead_in_play_count++;
    57.                
    58.                 if (player_undead_in_play_count >= 3)
    59.                 {
    60.                     Debug.Log("Player won; 3 Undead in play");
    61.                     GameWon();
    62.                 }
    63.             }
    64.         }
    65.        
    66.         enemy_undead_in_play_count = 0;
    67.         foreach (card foundcard in Enemy.player_creatures
    68.                  {
    69.             if (MatchSubtype("undead", foundcard.Subtype) // if (0 == foundcard.Subtype)
    70.                 {      
    71.                 enemy_undead_in_play_count++;
    72.                
    73.                 if (enemy_undead_in_play_count >= 3)
    74.                 {
    75.                     Debug.Log("Enemy won; 3 Undead in play");
    76.                     GameLost();
    77.                 }
    78.             }
    79.             }
    80.  
    81.     }
     

    Attached Files:

  4. SpectralRook

    SpectralRook

    Joined:
    Feb 9, 2014
    Posts:
    112
    Oops. Typo in the enemy check.

    Code (CSharp):
    1. if (MatchSubtype("undead", foundcard.Subtype) // if (0 == foundcard.Subtype)
    should be
    Code (CSharp):
    1. if (MatchSubtype("undead", foundcard.Subtype)) // if (0 == foundcard.Subtype)
    Don't forget forget to add the MatchSubtype somewhere in player.cs if you are going to use it.

    Here is the full list of changes to apply the check after a full turn:
    Define Counters in Player.cs for undead in play and undead played this turn.
    Code (CSharp):
    1.  
    2.   public static int player_undead_in_play_count = 0;
    3.   public static int enemy_undead_in_play_count = 0;  
    4.   public static int EnemyUndeadPlayedThisTurn = 0;
    5.   public static int PlayerUndeadPlayedThisTurn = 0;
    6.  
    Reset the counters to 0 at the Start of a game in Player.cs StartGame().
    Code (CSharp):
    1.  
    2.   PlayerUndeadPlayedThisTurn = 0;
    3.   EnemyUndeadPlayedThisTurn = 0;
    4.   player_undead_in_play_count = 0;
    5.   enemy_undead_in_play_count = 0;
    6.  
    Assign the player_undead_in_play_count to PlayerUndeadPlayedThisTurn in Player.cs NewTurn().
    I'm thinking it should be after Player.HandZone.DrawCard();
    Code (CSharp):
    1.  
    2.   Player.PlayerUndeadPlayedThisTurn = Player.player_undead_in_play_count;
    3.  
    We need to do the same for the enemy_undead_in_play > EnemyUndeadPlayedThisTurn in Enemy.cs NewTurn()
    Code (CSharp):
    1.  
    2.   Player.EnemyUndeadPlayedThisTurn = Player.enemy_undead_in_play_count;
    3.  
    Check in Player.cs Update() if undead in play now and previous turn are greater than 3 to determine win/lose
    Code (CSharp):
    1.  
    2.   player_undead_in_play_count = 0;
    3.   foreach (card foundcard in Player.player_creatures)
    4.   {
    5.   if (MatchSubtype("undead", foundcard.Subtype)) // if (0 == foundcard.Subtype)
    6.   {  
    7.   player_undead_in_play_count++;
    8.    
    9.   if (Player.PlayerUndeadPlayedThisTurn >= 3 && player_undead_in_play_count >= 3)
    10.   {
    11.   Debug.Log("Player won; 3 Undead in play");
    12.   GameWon();
    13.   }
    14.   }
    15.   }
    16.    
    17.   enemy_undead_in_play_count = 0;
    18.   foreach (card foundcard in Enemy.enemy_creatures)
    19.   {
    20.   if (MatchSubtype("undead", foundcard.Subtype)) // if (0 == foundcard.Subtype)
    21.   {  
    22.   enemy_undead_in_play_count++;
    23.    
    24.   if (Player.EnemyUndeadPlayedThisTurn >= 3 && enemy_undead_in_play_count >= 3)
    25.   {
    26.   Debug.Log("Enemy won; 3 Undead in play");
    27.   GameLost();
    28.   }
    29.   }
    30.   }
    31.  
    Use this to Match Subtype Index to a Subtype Name.
    Code (CSharp):
    1.  
    2.   private bool MatchSubtype(string subtypeName, int subtypeIndex )
    3.    {
    4.      bool subtypeMatch = false;
    5.      
    6.      for (int i=0; i < MainMenu.TCGMaker.stats.CardTypes.Count; i++)
    7.      {
    8.        if (MainMenu.TCGMaker.stats.CardTypes[i].name == subtypeName && i == subtypeIndex)
    9.          subtypeMatch = true;
    10.      }
    11.      
    12.      return subtypeMatch;
    13.    }
    14.  
     
    Last edited: Jan 24, 2015
  5. Trevinburgh

    Trevinburgh

    Joined:
    Jan 26, 2015
    Posts:
    29
    Just discovered this, it looks extremely interesting. Is there a manual I can read so I don't have to ask FAQs? If not then here are a few questions:

    - Is it possible to get rid of the 'tap land' mechanic and use something else (mana incrementing each turn, playing/sacrificing cards, etc)? Tapping just feels *too* much like MtG for me. Is there a demo which doesn't look like a MtG clone?

    - What's involved in coding the AI for a single player game? I'm assuming it's roll-your-own since every game will be different, but is there any framework support or is it down and dirty coding?

    - How easy would it be to implement a single player campaign mode with branches depedning on whether the player wins or loses?

    Thanks.
     
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Still no news on the update?
     
  7. Power777

    Power777

    Joined:
    Aug 24, 2013
    Posts:
    10
    I hate to say it, i was about to buy the system but the huge lag time for updates is not good. Not sure what is up with the author but the update is taking much too long. I have tried to chat him on skype and no replies yet. Melang, are you ok? What is the reason for the long wait now? If there is a problem, please inform us. Thank you,
    P777
     
  8. Quadskilla

    Quadskilla

    Joined:
    Jan 28, 2015
    Posts:
    1
    Hey there!
    I gotta ask, If I buy the Kit now, Would I be able to make a online game already?
    Right now I have unity 4.6, so would that mean I would have to downgrade my unity so I can use it?
    Thanks in advance, and I hope everything is Ok with the OP.
    I added you at skype as well!
     
  9. Rom-

    Rom-

    Joined:
    Nov 26, 2008
    Posts:
    90
    Assuming this asset is dead? Shame, was going to purchase it...
     
  10. Akarui

    Akarui

    Joined:
    Feb 4, 2015
    Posts:
    3
    I just got an answer from Melang today.
    He's very busy right now, no ETA for the update.

    No, this asset is not dead, we just have to be patient right now.
     
  11. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Sorry but a brand new account with its first post beeing this doesnt reassure me at all. For an asset that cost as much as NGUI and more than playmaker, rtp, ... i expect the same kind of support. Leaving your asset without a promised update for almost 6 months and not even appearing on the forum for some kind of explanation or progress report is unacceptable imho.
     
  12. Akarui

    Akarui

    Joined:
    Feb 4, 2015
    Posts:
    3
    I actually made this account in may last year, but I guess it counts from the day that I log in for the first time...Whatever.
    Looking at my post, I should have expected this kind of reaction but I just wanted to let everybody know if they didn't get an answer from him yet.

    About the lack of information, I have to agree...
    Even if there are no real news, at least knowing that it's still being worked on is better than nothing, imo.
     
  13. thiagomelo

    thiagomelo

    Joined:
    Feb 10, 2015
    Posts:
    8
    1. I need to add card effects how to select a card from the grave and put on the hand or deck.

    2. View all cards in the grave.

    3. Search in the deck

    How can I do this?
     
  14. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    any canvas version :)=
     
  15. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Hey guys as Melang hasn't been on these forums for ages and getting hold of him is next to impossible I thought I would share this brief convo I had with him to put everyone on the same level as me, for those who do not know I worked on some of the art for this kit it's why I was able to get in to contact with him here is our very very short skype convo

    (The day before by me) Hey anything happening with the card game kit I dont mind if its just "its on hold" just wondering if anything IS happening or not
    [16-Feb-15 11:23:17 AM] Melang: Hi. I might go back to it in the summer. It's already in a solid and satisfactory state right now anyway.
    [16-Feb-15 2:07:22 PM] JK: Right but you already promised updates to people and people on the forums are not very happy, also there are quite a few bugs and its not updated to use unity 4.6s UI which is quite important so id disagree
    [16-Feb-15 2:07:50 PM] JK: For the price you are charging its not satisfactory

    He has been offline since then so he never got back to me about this comment.

    Note: I edited the names to cover anyones skype IDs just in case. I can show screenshots of this convo to prove its not me just spouting rubbish.
    I wouldn't normally share personal skype convos but I have been massaging this person for months for updates and being completely ignored as have most people on these forums it seems so I think it's only fair I share this so everyone is aware of the state of the kit.

    To answer, yes the kit works as advertised nothing on the asset store page is a lie, BUT anything promised in these forums for future updates MIGHT be missing, and anything you would like to be added will likely have to be done by you or someone else, I am also unsure of how support is now as Melang hasn't been responding to me at all on skype.
     
  16. Trevinburgh

    Trevinburgh

    Joined:
    Jan 26, 2015
    Posts:
    29
    Thanks @JessieK. Looks like I'll give this one a miss, shame.
     
  17. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Thanks for the info @JessieK .Its very discouraging that the developer didnt even have the "courage" to come here and post that all this talk about the ui update and the new features was just bulls**t and that he is postponing the development.
     
  18. Deleted User

    Deleted User

    Guest

    I just bought this toolkit a few days ago and I love it. I'm new to digital game development, but I wanted to make my own TCG type game, but I figured Unity wouldn't be the right game engine for it, but I guess I was wrong.
    This toolkit makes it very simple to change rules and make your own unique game with.

    How do you get a "Shop Scene" into the game to buy cards at? and, Did booster packs ever make it into the game?
     
  19. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I'm about to lose hope also, as no official update from the Author, nice kit but 4.6UI is a big thing I wish for.
     
  20. Nerdzul

    Nerdzul

    Joined:
    Sep 3, 2014
    Posts:
    15
    I guess that's the risk of buying stuff with a single developper or small team behind, something happens to that person and the project ends\gets on hold forever. Well lesson learned for me, a 90 dollar lesson nonetheless.

    Still it was a pretty interesting asset and I'll check here from time to time, just in case something new cames out.

    For Zero Dark Fire there is no shop scene or booster yet, but I guess that it won't be the hardest part to code, assuming some experience with Unity, but since I have very little I can't help you with that.
     
  21. Deleted User

    Deleted User

    Guest

    Thanks anyway! Hopefully this kit keeps getting updated, but I can make due with what is in it for now
     
  22. Deleted User

    Deleted User

    Guest

    I'm having an issue with making new cards and adding them to the game. I don't have the ability to save a new database of cards, it only lets me load from a file. Without being able to save/make a new database I can't add cards to the deck or collection scene. Anyone have an ideas on how to solve this?
     
  23. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Click 'Save Game Settings' at the bottom.
     
  24. Deleted User

    Deleted User

    Guest

    That doesn't create a database file for me to edit though. It saves the cards, but I don't know where they are being saved to so I wouldn't know the number id for the cards.

    I'm already using a work around by re-editing existing cards, but thanks for the help.
     
  25. Nerdzul

    Nerdzul

    Joined:
    Sep 3, 2014
    Posts:
    15
    to add cards to the collection\deck in single player there are two txt files (I can't remember the exact location at the moment). They are just lists with the index number of the cards (starting from 0 with the uppermost card) in the collection, add the ones you are interested to the txt, the number of times you wish them to appear and they will show in the collection.
     
    Exeneva likes this.
  26. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Sorry if my advice isn't helpful. It's actually been some time since I've worked with this kit.

    The Zems project (mentioned somewhere earlier in this thread) is now using its own custom system instead of this kit, mostly because we want server-side authorization instead of everything client-side.
     
  27. Samlin

    Samlin

    Joined:
    Nov 16, 2013
    Posts:
    9
    It would appear Melang realized there is a conflict of interest with his own Zems online game and decided to drop this kit.

    Good thing I waited before buying but it's still quite unfortunate for those who did. I thought perhaps he's waiting for Unity 5 to be released but now I think an update is unlikely to happen.
     
  28. Nerdzul

    Nerdzul

    Joined:
    Sep 3, 2014
    Posts:
    15
    Btw Exeneva how is Zems doing? I have been lurking on the forum there, but it doesn't look like there is a lot going on these days
     
  29. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    The forum is not being used at the moment. The entire website is due for an overhaul near the end of this month.

    For following the project, I recommend our Facebook or Twitter :)
     
  30. Nerdzul

    Nerdzul

    Joined:
    Sep 3, 2014
    Posts:
    15
    Thanks the new interface pictures looks quite promising. Sorry for being off-topic again, but I was wondering is the signup for the alpha still open btw?
     
  31. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Sure, shoot our Facebook a message :)
     
  32. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Is the kit compatible with unity 5?
     
  33. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Exeneva care to release your own system as a kit for purchase later when you launched your game? I smell a huge market here :)
     
  34. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    Is the a .sql file with this kit
     
  35. JessieK

    JessieK

    Joined:
    Feb 4, 2014
    Posts:
    148
    Hey I have been using this kit and my own art work to start making a game for a couple months now, but I was wondering if anyone who is skilled in programming could help me modify this kit a bit, basically all I need is the ability to buy packs of cards with the in game money system and some sort of rarity system

    I am willing to pay so please contact me via personal message if this interests anyone.
     
  36. SUMFX

    SUMFX

    Joined:
    Jan 28, 2015
    Posts:
    45
  37. leogre

    leogre

    Joined:
    Mar 2, 2015
    Posts:
    4
    Can anibody tell me how I can change the background please?
     
  38. D2012

    D2012

    Joined:
    Apr 22, 2015
    Posts:
    1
    can anybody help me fix this error in this asset
    Assets/TCG/Scripts/EditDeckScripts.cs(67,67): error CS0039: Cannot convert type `card' to `UnityEngine.GameObject' via a built-in conversion
     
  39. Zeronine

    Zeronine

    Joined:
    May 22, 2011
    Posts:
    24
    JessieK: your PM appears not to be accepting conversations ( PM ). Please check or PM me back.
    Thanks
     
  40. nogard230

    nogard230

    Joined:
    Jul 21, 2014
    Posts:
    8
    Hi, how convert this Photon unity in unity network for lan? thanks
     
  41. Banelight

    Banelight

    Joined:
    Jul 6, 2015
    Posts:
    1
    Hi All,

    I bought this asset ages ago, and got caught up with real life...but was also waiting on updates. I see there are many...so well done Melang! This kit is looking awesome....as a active Hearthstone player I'm looking forward to how this develops.

    I actually have a specific TCG I would like to build, and it requires that I be able to make separate hero's with their own powers (like in HS) will this be on the books at all Melang?

    Also last time we chatted you were going to add "Taunt" type skills....has this happened as yet? Sorry I popped in here as an afterthought and quickly looked through the MANY pages...didin't see anything concrete, so apologies if I missed it.

    Kind Regards
     
  42. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Sorry, @Banelight , but you most likely won't be seeing updates to this asset for some time. The author has moved on to other stuff.
     
  43. chriscj477

    chriscj477

    Joined:
    Feb 7, 2014
    Posts:
    4
    Hi

    I am thinking of buying this, will it work for Android and iOS?
     
  44. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    197
    Its not supported anymore i won't recommend you to buy it thanks!
     
    chriscj477 likes this.
  45. Sprush

    Sprush

    Joined:
    Sep 28, 2014
    Posts:
    5
    Did you figure this out? I am having same issue
     
  46. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Not supported, outdated assets should be removed from the assetstore!
     
  47. MrBeros

    MrBeros

    Joined:
    Aug 27, 2015
    Posts:
    27
    It`s supported via Skype.

    I have the issue too:
    Assets/TCG/Scripts/EditDeckScripts.cs(67,67): error CS0039: Cannot convert type `card' to `UnityEngine.GameObject' via a built-in conversion

    Thanks the support i fix it.
    For all with the same error, just follow the steps in the first post and the code must look

    clone = Instantiate(card_to_move.GameObject) as GameObject; <----- this works

    NOT

    clone = Instantiate(card_to_move) as GameObject; <----- this works NOT
     
  48. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    There should be a update for Unity 5?
     
  49. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    There isn't even an update for unity 4.6 UI :D
     
    MrEsquire likes this.
  50. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    again, DO NOT PURCHASE THIS UPDATED STUFF. NO SUPPORT, NOT WORKING
     
    moure likes this.