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

KINGS - Card Swiping Decision Game Asset

Discussion in 'Assets and Asset Store' started by Maulwurfmann, Nov 26, 2017.

  1. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    I have now finished the update 1.41 and submitted to the Asset Store, it should be available soon. It includes some bugfixes in the Kings scene and also as promised a preview version of "The Mayor" demo scene ;)

    I used some free stock photos from Pexels and added an cartoon/comic effect. Also very few cards are in this demo, but it should be enough to show the function and get started with it.

    themayor.png

    You can try it here: WebGL

    Hope you like it! :D
     
    Lady_Lai and gabor17 like this.
  2. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Update 1.41 is now live in Asset Store!

    A few quick notes to the "The Mayor" demo scene:
    - i have reused the values from Kings, e.g. People, Army, Religion etc. to keep number of values low, if you should have issues while playing the demo, i suggest resetting playerprefs first
    - i did not use the CountryNameGenerator, instead i used the ValueDependentText script for the Mayor names, of course if you want to use the CountryNameGenerator, you can simply add it again to the scene
    - the mayor scene is currently not mentionend in the Documentation, since it's beside the design and the above points identical to the normal Kings scene, but if you should have any issues, or if something is unclear, just let me know!
     
  3. Lady_Lai

    Lady_Lai

    Joined:
    Jul 24, 2017
    Posts:
    16
    Hi! If I have some cards created in the 1.3 version, how can I implement a new card style system to them? Just adding Card Style (script) to the card doesn't work. The purpose is not to fill in event script from scratch again.
     
  4. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    In the Card Style script, you have to link in the existing images of the card you want to override and select a style, then it will work ;) Just take a look on one of the new cards how it is done there. If anything is still unclear, just let me know!
     
  5. Lady_Lai

    Lady_Lai

    Joined:
    Jul 24, 2017
    Posts:
    16
    Hmm, not so simple... Seems like I should also change an animation controller and set a card front image. But even after that, old fonts, line image, etc remain. So I decided to go another way: to use a new template and to copy an event script from the old card to it. It looks easier, but still there are two problems. 1) I can't change card's color and icon image. For example, I pick a new blue colour, but the card still keeps its original yellow. The same with icon image: I can't replace it with a new one. (When I try to change the original template, I face the same problem). 2) In game the card doesn't show my texts (title, question, answers) from the added event script, but just words from the template 'Title', 'question text', etc.
     
  6. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    Awesome asset! I have been using it for a few months and wanted to share what I've made so far. My game Alive 2 Survive was made with the Kings - Card Swiping Decision Game Asset and is currently in beta. Please download it and give it a try!

    Test Flight Link: https://testflight.apple.com/join/9tLu9GxQ
    Google Play Beta Link: https://play.google.com/store/apps/details?id=com.jamopolis.alive2survive

    Alive 2 Survive is a zombie apocalypse swipe to survive game. You'll see when you play the game that I extended some of the out of the box functionality. Let me know if you have any comments or questions.
     
    Kohlis and Maulwurfmann like this.
  7. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    Is it possible to disable the Ruler Select right after the game starts?
     
  8. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Yes, of course. You simply have to go to: GameCanvas -> Cards -> MainMenuCard and remove the "SelectKing" card from the "Follow Up Card" fields, then it will just use a random generated King or Queen.
     
  9. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366

    Looks awesome! Will definetely try it! :D
     
  10. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    1) If you use the new cards with the card styles, you will not edit the card directly, but you edit the CardStyles itself, then all changes of the CardStyle will automatically be applied to all card which have this CardStyle selected.
    2) The text will only be displayed when you are playing, in editor it will only display the text which is added in the text boxes.

    Example:
    Go to Kings -> Cards -> _Templates, there are all CardStyles located, choose e.g. CardStyle_t01, this CardStyle is selected on the card: "card_template01" now if you change the color and the icon of the card style, it will automatically applied to the "card_template01" and all other cards that use this card style.

    cardstyles.png

    I doubt that copying the EventScript component will work, since it should link then the textfields to the old cards. Please check this.

    You could try it with the Kings Import / Export script, this would allow you to atleast copy the text from the old cards to the new ones, you would only have to add the "Results" to the new cards.

    This is how i would do it:
    1. Duplicate one of the existing "card_template" cards and modify it to your likings, e.g font, animations, text positions etc.
    2. Duplicate one of the existing card styles, add it to your new created card template and add this card template in the Prefab field of the card style
    3. If you want to use different styles, create several card templates and card styles
    4. Add your new card styles to the "CardStyle List"
    4. Make sure all your old cards are currently in the CardStack script
    5. Export your cards with the Kings ImEx script
    6. In Excel replace the current card styles with the new cards styles
    7. Import the cards again with Kings ImEx script, make sure they are copied in a new folder, overwriting old cards will only replace the text of the EventScript.
    8. Add the conditions and results again (manually) to your new cards

    I hope i could explain it to you comprehensible, if something is unclear just let me know. But i understand converting from the old cards to the new ones is quite a bit of pain depending on how many cards you already have, but unfortunately this step could not be automated.

    In the next few days i will release a short tutorial video which explains the Kings ImEx script and the CardStyles, once you got used to it, it's really simple to use!
     
    Lady_Lai likes this.
  11. Lady_Lai

    Lady_Lai

    Joined:
    Jul 24, 2017
    Posts:
    16
    Maulwurfmann, thanks for the detailed answer! Yet I'm afraid the critical thing for me is to copy Results, cos I have a lot of values and dependencies :)) Happilly there are no too many cards - around 20. I'll do it by hand. The last important question: do I understand you correctly, that I can't change an icon for each separate card, all cards of one style should have the same icon?
     
  12. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Yes, exactly. If you look in the template folder you will see there is a card style for people, army, religion etc. so every category can have it's own icon, color etc.

    But of course you may not want to use the card style for specifc cards, which has many different icons, or like the marriage cards where the icon can change depending on which queen you marry, for this, you simply do not link in the Icon image of the card into the card style script that is attached to this card, this way you can have a specifc card icon independ from the card style, this also works of course for the card images too.
     
  13. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    Thank you! BTW for Alive 2 Survive I made the game in Unity 2018.3x so I could use the new nested prefabs feature for the cards. Nested prefabs work amazingly well with your asset, especially when you are dealing with 1000+ cards like I am!
     
  14. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    That's great to hear! Since i did not have much time yet to try 2018.3, i wonder how do you apply changes to the prefabs without overwriting the EventScript data?
     
    digifilm likes this.
  15. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    So I have a master card prefab that includes the EventScript on it with default data.
    NestedPrefabExample1.jpg
    Then each card in the game is a prefab variant of the master prefab. I change EventScript values on each of the variant cards (text, conditions, results, etc).
    NestedPrefabExample2.jpg
    When I update the master card prefab it updates each of the card variant prefabs, but doesn't change any data that has been manually changed like the text, conditions, etc. I can also add other scripts like GlobalEventMessageSender, AddAchievement, AddGamelog, etc to each of the variant prefabs and none of them are disturbed when updating the master prefab. I hope this helps!
     
    digifilm likes this.
  16. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Thank you very much! This is really awesome, didn't knew that it was this easy!
     
  17. Kohlis

    Kohlis

    Joined:
    Jul 30, 2018
    Posts:
    4
    Hi, after update 1.40 i have
    198x The referenced script on this Behaviour is missing!
    any way to solve that?
    thank you.
     
  18. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Did you update an existing project? If yes, could you try it to import it in a new project?
    Also a screenshot would be very helpful. Thanks!
     
  19. jjdomain

    jjdomain

    Joined:
    Sep 11, 2015
    Posts:
    93
    Hello,

    1. I noticed that when I select a a ruler and then restarts the game by selecting another ruler, the ruler icon and level in the stats panel still shows the ruler image from the first play. Am i doing something wrong? please see attached.
    2. Where is the selected ruler info (name/icon) stored and how can I retrieve it for use in the game? For example to display ruler info elsewhere.
    3. How to change the ruler info during the game? For example, based on certain stat conditions, the game will change ruler name/icon, etc.
     

    Attached Files:

  20. jjdomain

    jjdomain

    Joined:
    Sep 11, 2015
    Posts:
    93
    I also noticed a few other things using the latest version:
    1. the particle effects (that shows on first card, first play) shows up after level2, whenever I click the play button (to exit game) and then click on play again..in the editor.
    2. After reaching level 2, the level progress bar in stats panel stopped working (not progressing)..
     
  21. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    1. On game start all values are randomly generated, with the SelectKing card you manually set some values, e.g. name, surname, country.
    2. This are all stored in Values, and then in the appropriate subvalue, e.g. Name, Surname etc. To display it you can either use some of the UI fields of the value script, or use the "Value Display" script if you want to display it on a card.
    3. You can do this like i did on the "SelectKing" card, simply with the "SetValue" script

    I will also check your reported bugs and fix them with the next update.

    values.png
     
    Last edited: Feb 2, 2019
  22. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    1. there shouldn`t be any particle effects on the first start panel / card, could you please send me a screenshot?
    2. i could not reproduce this error, could you maybe try to reset your playerprefs and try it again?
     
    Last edited: Feb 2, 2019
  23. Lady_Lai

    Lady_Lai

    Joined:
    Jul 24, 2017
    Posts:
    16
    Maulwurfmann, can values be negative? Not from 0 to 100, but from -100 to 100, for example.
     
  24. jjdomain

    jjdomain

    Joined:
    Sep 11, 2015
    Posts:
    93
    Hello,

    I want to get your advice on the best way to implement banner ads for mobile app. Which template would be the best to use? I'm imagining banner either on top or bottom, but UI will need to auto adjust when banners are removed when user buys inapp purchase to remove ads.
     
  25. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Yes, just go to the value you want to change and in "Limits" change it from 0-100 to -100 to 100.
     
  26. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    I would take the normal Kings scene, and just move the card spawn point ("Cards" gameobject)a bit higher, then it should be enough space available to place it at the botton.

    Also regarding repositioning you could use an animator or dotween etc. you change the position of the card spawn point depending on ads enables/disabled, you could use a value for this and call an "value dependent event". But i am not sure if this is the best method to solve this.

    Hope this helps!
     
  27. jjdomain

    jjdomain

    Joined:
    Sep 11, 2015
    Posts:
    93
    Thanks for the quick reply!
    1. Would you happen to have a script handy to display banner ads? It would greatly help me since I'm not a programmer.
    2. Would you consider implementing inapp purchases in the asset? If would really be helpful to have from a monetization standpoint. If you have a script or something to share that would be awesome....looking through the unity iap integration docs gives me headaches :(
     
  28. Kohlis

    Kohlis

    Joined:
    Jul 30, 2018
    Posts:
    4
    I tried both error_02.png error_klings.png
     
  29. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    The scripts are not getting compiled since you have 2 (red) Error Messages, can you please send me a screenshot of these two. Thanks! Which version of unity are you using?
     
  30. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    We are currently working on support for Admob and Unity inApp Purchases, it will be available in one of the next updates, but i can not give you an exacte time.
     
  31. BBET

    BBET

    Joined:
    Dec 18, 2012
    Posts:
    40
    Hi Maulwurfmann,
    Really a great asset!
    I would like to use a 3D object on the cards - instead of the icons. The 3D Object uses blendshaps for e.g talking or smiling. Please could you give an example how to use 3D Objekts on a card and manipulate the blendshapes without further coding? Also different Animations of the 3D Objects beside the blendshapes should be supported.

    Perfect would be, if this work on the cards or also inbetween 2 cards depending on the decision.

    Thanks! Your are really providing outstanding support in this forum!
     
    Last edited: Feb 3, 2019
  32. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Thanks!
    Adding a 3d object to the card should be no problem. Simply drag it onto the card. You propably will have to adjust the scaling factor of the object (in my example i had to set it to 500) and add a Directional Light to the scene (for 2d you dont need it).

    Regarding blendshapes, i have not worked with them yet, can you control them with the Unity Animation System? Then it should be no problem. If the 3d object ist on the card, simply use the animations of the card to control it, similar like the marriage cards. If the gameobject is in the scene (if you want to show it inbetween 2 cards) go to the "Swipe" script in "Scripts" there are several UnityEvents which you can use to trigger the animations (e.g. swipe left preview / swipe right preview etc). And you could also use the GlobalMessages system to trigger these animations.

    Hope this helps! If anything is unclear, just let me know!

    3d.png
     
    BBET likes this.
  33. jjdomain

    jjdomain

    Joined:
    Sep 11, 2015
    Posts:
    93
    Ok great! Really looking forward to the admob support and inapp purchases...I'm sure this is on top of the list for everyone from mobile app perspective...keep up the great work and hopefully soon!
     
  34. Kohlis

    Kohlis

    Joined:
    Jul 30, 2018
    Posts:
    4
    my version : 2018.3.0f2
    upload_2019-2-4_17-35-5.png
     
  35. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    Hey Maulwurfmann, me again.
    Is it possible to add a videoplayer to a function like OnRightSwipe() to show a short video?
    Is it also possible to add an inventory with items that can be activated to push your stats?
     
  36. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    This is an issue with 2018.3. You have to disable project settings when importing the asset.

    Also you will have to manually add an Foreground and Background Layer, set the BackgroundCanvas to Background Layer and the ParticleEffects to Forground Layer. Or use Unity 2018.2.20 ;)

    We are currently working to upgrade the project to 2018.3, but i can't give you an exact date.

    import20183.png
     
    Last edited: Feb 5, 2019
    Kohlis likes this.
  37. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    What kind of videoplayer do you want to use?
    If you only want to use a few items you could do this as follow: create for every item a value and a button, use the value dependent enable script to activate the button when the value is 1, the button has a setvalue or advalue script which increase your stats when pressed, but also sets the value back to 0 so the button will be disabled again.
     
  38. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    ty for your fast answer!
    I wanted to show learning videos, only short clips that are triggered like the Ad cards. "You want to see a short video about xyz to get a reward"...
    After watching a video the player should get an item as reward in his inventory. I will try you idea with the buttons out asap :)
     
  39. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    In the asset store there are several video player assets (https://assetstore.unity.com/search?q=video&q=player&k=video player), it shouldn't be too difficult to find a suiting one. Regarding controlling/trigger the video player as long as it support UnityEvents it will be fine, you can then simply use the GlobalMessageSystem on the cards, similiar to playing an Ad.
     
    Last edited: Feb 6, 2019
  40. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    Ty Maulwurfmann, the video and the inventory is now working :)
    now i have another question: How can i find those dots which are shown when you have a change on your values? In the Project they are called StatChangePrevImage.
    I want to change the icons for it, and want to activate them via an item.

    i really love this asset btw! its very good structured and easy to work with it! Great Asset you made there! :)
    ty so far!
     
    digifilm likes this.
  41. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Glad you like it!

    The script to control the "Value Change Preview" is attached to the "Values" gameobject.
    The Images itself are attached to the value slider (e.g. Army, People, etc.) in the GameCanvas -> MainStatsPanel -> MainStats -> Army Slider. "StatChangePrevImage" and "StatChangePrevText"-
     
  42. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7

    I found the location of the images, but i want to visualize an increase and a decrease (green arrow up, red arrow down). i tried out the Value Change Preview script with my own sprites and it disabled the preview of the value changes completely.
    i the value change preview script attached to another gameobject? or how i have to use it?

    ty for your answer
     
  43. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    You need to replace the images in the "Value Change Preview" script. See screenshot:
    valuepreview.png
     
  44. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    Omg ty, i clicked through all the scripts and was just blind :D

    EDIT: but now it dont show me anything of those statchangethings :(

    EDIT: i get this message from console:

    IndexOutOfRangeException: Array index is out of range.
    ValueChangePreview.getPreviewSprite (Boolean changes, Single value, Boolean randomIndependant) (at Assets/Kings/scripts/ValueChangePreview.cs:80)
    ValueScript.actualizePreviewElements () (at Assets/Kings/scripts/ValueScript.cs:154)
    ValueScript.Update () (at Assets/Kings/scripts/ValueScript.cs:147)
     
    Last edited: Feb 7, 2019
  45. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366

    Please note: As you can see in the screenshot, there are 2 sets for these images (Element 0 + Element 1).
    Element 0 is meant to be the default view, which shows only an indication of how much the value changes and not in which direction, this does only Element 1, which in the demo scene will be selected when you get the "Witch-Card". This is been done by changing the Value "ShowResultValue". You can of course only use one set of icon and show the arrows on default.

    But if it doesn't show you anything it could be that you lost the connection to the UI elements? Please see screenshot below:

    valuepreview2.png
     
  46. k00ks

    k00ks

    Joined:
    Aug 3, 2018
    Posts:
    7
    nope, all my options are like in your screenshot

    EDIT: in Playmode i checked the StatChangePrevImage and recognized, that i wont change by swiping as it did befor i changed the sprites
     
    Last edited: Feb 7, 2019
  47. digifilm

    digifilm

    Joined:
    Dec 5, 2013
    Posts:
    13
     
  48. BBET

    BBET

    Joined:
    Dec 18, 2012
    Posts:
    40
    Hi Maulwurfmann,
    I have problems with the import of a csv-file. Everything looks fine on the import window (ImEx Window) - I see the content of the questions and the answers. Also „style ok“.
    When I start the import the cards are generated with the right groupname and cardname, but without content. Also Style is not change. So no questions or answeres are imported. I have also tried with the included „cardlist.csv“, but same problem. Any idea?
     
  49. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    This is very strange... Do you override existing cards or do you create new ones? Could you please send me a screenshot of the import/export window and one of a card (which shows the card style).

    Edit: If you are using Unity 2018.3 and you use the ImEx script in combination with nested prefabs/prefabs variants this is currently not working correctly. We release this week an update to support 2018.3 new prefab system.
     
    Last edited: Feb 11, 2019
  50. antemiles

    antemiles

    Joined:
    Oct 28, 2016
    Posts:
    1
    On importing the project, we left out the Project Settings as sugested. But, what do we do with the .json file inside packages? Do we have to import it too or not?