Search Unity

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 am not sure what kind of game you exactly want to do, but i suggest to try to keep it as simple as possible.
    E.g. if you want the player to go back to the same card from the previous chapter card, then i would make only one card per chapter (cardstack group) that has the option to switch between between chapters, and simply put the other "switch chapter" cards from the other chapters as follow up cards, e.g. switchcard from chapter1 has followup cards linked in to chapter 2, 3, 4.

    Hope this helps.
     
  2. Davlin

    Davlin

    Joined:
    Feb 19, 2013
    Posts:
    55
    Hello

    Could you please tell how to automatically resize the canvas to other than 16:9 aspect ratio?
     
  3. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    As i posted previously, this will work automatically in the next update which will be released later this week ;)
     
  4. Davlin

    Davlin

    Joined:
    Feb 19, 2013
    Posts:
    55
    Thank you!
     
  5. Davlin

    Davlin

    Joined:
    Feb 19, 2013
    Posts:
    55
    Hello

    I downloaded the updated asset, but the issue with resizing the UI still exists.
     
  6. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    The Update is not online yet :oops:
    I also wanted to add the UI changes to "the Mayor" scene, but it took a bit longer than expected, but i am as good as finished, hopefully i will submit the update to the Asset Store in the next 1-2 days...
     
  7. Davlin

    Davlin

    Joined:
    Feb 19, 2013
    Posts:
    55
    Oh, got it :)
     
  8. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Update 1.55 is now finished and submitted to the Asset Store :)
    It should be available in the next few days!

    Update 1.55:
    - Complete UI rework to allow Landscape and Portrait mode with one scene and adjusting to all Screen sizes/ratios.
    - UI adjustment to Notch/Camera Punch-hole thanks to Safe Area Helper (by Crystal Pug)
    - minor fixes and improvements

    The Mayor Demo scene is also updated to work with both Landscape and Portrait, you can try it here.

    Screenshot_20190614-122935_Kings.jpg Screenshot_20190614-122949_Kings.jpg
     
    jamopolis likes this.
  9. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    Update 1.55 is now available in the Asset Store :)
     
    jamopolis likes this.
  10. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    Strange Unity says 1.55 is launched, but the version I can download still seems to be 1.52
     
  11. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    This and all future updates are only for Unity 2019 version, if you want to use Unity 2018 and use some of the new features/scripts, you can install Unity 2019, download the package/or scripts from it and import it in Unity 2018.
     
  12. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    Good to know - thanks!
     
  13. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Is there a video tutorial how to make a game like the mayor demo???
     
  14. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    No, a video tutorial is not available for the Mayor demo. I think this is not really neccessary, since all functions are the same as in the Kings demo scene, only the layout / design of the cards has been changed.

    Do you have any problems with editing the Mayor demo? Or is anything unclear with it?
     
  15. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    FYI. I am on vacation for the next two weeks, so replies may be a bit delayed from my side. Thanks for your understanding.
     
  16. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    No I just asking pre-purchase since documentationa nd get started documentation are based on the kings example. Both looks quite different so I was wondering :) Will purchase today.
     
    Maulwurfmann likes this.
  17. yazidane

    yazidane

    Joined:
    Oct 6, 2015
    Posts:
    29
    how to integrate the admob ads like rewarded ads, interstitial into the mayor scene?
     
  18. hippobob

    hippobob

    Joined:
    Feb 26, 2017
    Posts:
    33
    Hi, I was wondering what Redraw Block Cnt means.
     
  19. kuyeo

    kuyeo

    Joined:
    Jul 23, 2019
    Posts:
    1
    Hello, I am Chinese. I am using excel (CSV) to export/import CARDS, but I cannot import Chinese strings. Is there any solution?thank you
     
    hippobob likes this.
  20. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hello, i was wondering how to initialise a dictionary. For what i understood, i can only setup a dictionnary entry with a value using a card/extra/dictionary. So at the same time i create an entry and set a value.
    But if i want to set several things of the dictionary at the begining of the game ? I guess i should do it in the first card. Is there a another way ? Is the dictionary stored in a script where i could put the values and keys manually ? thanks !
     
  21. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    As you may suggest from the missing answers, Maulwurfmann no longer works for km games.
    We apologize for your inconvenience.
    Until we decide the further steps, I would like to try to answer your questions.
     
  22. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    If one card was drawn it can not be drawn again for "Redraw Block Cnt" - draws. From the Dokumentation: "Redraw Block Cnt gives you the optionto block a card for x draws after it has been drawn"
     
    hippobob likes this.
  23. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    I have to take a look into this. It should be the same as for normal cards, since the cards from the Mayor scene are similar to the usual cards, except the button/visual layout.
     
  24. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    This is a known behaviour from Unity and there is a solution to this. Most of the time, the csv file is not correctly encoded in UTF-8 (Reencoding to UTF-8 can be done with a software like Notepad++). At some cases there are mismatching delimiters in the file. If you could send me the file I would like to make a PDF Report on how to format the csv file for ImEx for you.
     
  25. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hello, i do have an issue with setting a value at the beginning of the game. I would like to set the value at 50, so i did random min =50 and random max =50. But this value is always set to 1... What s strange is that is works fine with two other values. I tried to solve it by deleting and copy/paste the other values game objects, deleting and writing back the value in the script, with no result. valueDef.JPG value.JPG
     
  26. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    I will show you one possibility to do this. This solution needs no attachement to the first card and can set more than the dictionary, you could also add Items or set values.
    For this solution I added a new GameObject at the scripts. There i Attached two scripts:
    1. DelayedEvent and
    2. MakeChanges

    DelayedEvent is configured to "Start On Start" and calls MakeChanges.ExecuteEffect with a Delay of 0 seconds.

    MakeChanges is configured to execute Conditional. The condition here is that the key "DictSet" equals "initialized". This is false for the first startup, because there is no such key set yet. Therefore the Branch "Modifiers False" is executed.

    For the changes in this branch I set the dictionary Key "DictSet" to "initialized". Therefore for the next start of the game it will not be executed again. Additional I set all the initial keys like in the example "Name" to the value "Hanseline".
    You could make additional changes here which only take effekt on the first start of the game. I also tested it with adding an item.

    Initialize_Dictionary.PNG

    Edit: Sorry I forgot to answer one of your questions: The Dictionary is stored with Json as serialized List in the PlayerPrefs for each user. Additional it is possible it is stored in an encrypted format. Therefore a direct modification in a file is not possible.
     
  27. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
     
  28. hippobob

    hippobob

    Joined:
    Feb 26, 2017
    Posts:
    33
    Thank you very much for your reply! But I've read this function in the source code. English is not good to do unit project is really difficult! XD
    In addition, I hope this project will continue. I hope the departure of the team members will not affect you! Thank you for your persistence. I thought something happened to him on vacation!
     
  29. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Thank you for adding the screenshot of the valueDefinition file.

    The first enumeration values in this definition file (up to and including "years") are used e. g. in the character selector. The character selection panel at the beginning of the game uses the 3. entry for memorizing the gender (0 or 1) and therefore overwrites your configuration.
    Unfortunately the enumeration is stored by the index number and not by the name you give it, therefore also adding new values in between could break your configuration. We discussed this behaviour but didn't change it, because changing it now would break all other builds.

    Solution: valueDefinitions.PNG
    Leave the first values as they are. Add your values after the "years".
    Please go through your existing valueScripts and other, which use this and select your desired value from the extended dropdown menu.

    I hope this solves your problem.
     
  30. furkan1aktas

    furkan1aktas

    Joined:
    May 2, 2018
    Posts:
    33
    Hello again after a long time,

    You know Google Play has switched to 64 bits since August 1st. I have a game with Unity 2017.4.3f1. Online on Google Play. How can I make it suitable for 64-bit?
     
  31. yazidane

    yazidane

    Joined:
    Oct 6, 2015
    Posts:
    29
    Others by the demo in google play. Anyone have successfully publish any game using this template?...like to see other example

    Also i really need to know to how to add the admob ads working to the mayor scene. Any tutorial will be helpful.
     
    Last edited: Aug 21, 2019
  32. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Because there are some Unity issues regarding csv files without the correct UTF8 Encoding, I prepared a report how to convert it correctly. Some adional issues, which could lead to a errors and the according solutions for Kings ImEx are also described.
    I hope this helps solving your issue with complex characters :).
     

    Attached Files:

  33. wagamama

    wagamama

    Joined:
    Feb 10, 2013
    Posts:
    8

    Hello I want to ask why the Card's color and Icon Can't Change????
    I change it that but it not change
     
  34. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi wagamam,
    this is a feature and not a bug :p.
    There are several ways to do this.

    The behaviour is from the card styles (attached to the card itself)
    Cardstyle1.PNG
    If you want to change the style (some colors and images) for all cards with this style, you can edit the style itself.
    You can do so by double click the card style and adjust your images/colors:
    Cardstyle2.PNG

    It should update your settings instantly.

    If you want to add a new style you can right-click and select "Create->Kings Card Style"
    or easier: select an existing style in the Project Tab and press "Strg+d" to duplicate it.
    => Adjust the style and its name for your needs.

    I create a style cs_healthRed for example:
    Cardstyle3.PNG

    Notes:
    1. Please do not delete the script "Card Style" form the Card,
    this would generate error messages in Unity because this is a required component for cards.

    2. To get the card styles work with the import and export feature (Kings ImEx),
    please dont't forget to add your new style to the style list:
    Cardstyle4.PNG

    I hope i could help you.
     
  35. furkan1aktas

    furkan1aktas

    Joined:
    May 2, 2018
    Posts:
    33
    I didn't get an answer for my question?
     
  36. nartay

    nartay

    Joined:
    Apr 11, 2018
    Posts:
    3
    Hello, I'm making a would you rather game using the asset. I have some questions and any advice/suggestion would be appreciated.

    I want to add animation for each card. For example when swiped left there will be smiling goat image and when right sad goat.
    de.jpg
    In another card there is a question asking which button to press. When card is being swiped left a hand would go to button A at the same time and vice versa.
    0.jpg 0.jpg

    So basically we have simple animations for each card and animations change with respect to swiping direction. I'm kind of a newbie and if you guys can push me in the right direction that would be great
     

    Attached Files:

  37. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    I'm very sorry for the late answer.

    I think I can't help you directly with this request, because it shouldn't make difference for the Kings asset.
    The asset was released without dlls therefore a change in the bitwidth would be no problem. As far as I saw the release settings have to be changed to 64 bit and a new apk with 64 bit has to be uploaded. I have to admit, because of the lack of an according device I can't test following solution.

    A quick search on Google reveals:
    https://stackoverflow.com/questions/55974331/unity-export-android-64-bit
    There are some pitfalls mentioned but it seems to work.

    I would be glad to help, if there are more concrete issues because of KINGS which are causing an issue for compiling.

    Please inform me, if the mentioned solution works or you discovered other issues.
     
  38. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi nartay,

    from your description I assume you want the Image or animation depending on each card. Therefore it would be the best solution to tie the animation/images directly to the card itself.
    I will show you one possible and easy solution to your first question.
    I attached two images to a card, as an example the card "NoMovingTextCard" is used because it has elements which are static. I attached two images which are disabled by default:
    KINGS_ImageActivation.PNG

    The "Event Script" of the card has two events which are handy for your wanted behaviour:
    • On Swipe Left
    • On Swipe Right
    For the left swipe event I activated the left image and vice versa:
    KINGS_ImagesOnSwipeEvent.PNG

    Thats it for the images. Result ( without a goat image :) ):
    KINGS_ActivateImagesOnSwipe.gif

    This solution has a drawback, the Image is only shown as long as the card is alive. If the next card is drawn the image vanishes also.

    For your second question:
    It is not clear to me what you want to achieve, because you can use buttons on cards which the user can press directly. The example card "Merchant" does exactly this.

    If you want to play an animation based on the events you can do it similar to the Images. There are a few changes:
    1. Instead of only activating the images you have to add an animator, which moves the image on activation to the button. Alternatively you could let the image active and use the swipe events to trigger the animator to start the animation. Regarding the animation and triggers I have to point to the vast amount of unity tutorials covering this.
    2. If you want to move something with the card, make the animated canvas element the parent. Parenting for Unity Gameobjects is defined in the hierarchy and also covered by tutorials.

    If you want to play an animation synchron to the card movement, you have to make a new animator based on the original and modify the Blend Tree to move your pointer regarding to the variable "CardPos". This value is sent directly to the animator of the card and represent the swipe amount:

    CardPos_BlendTree.PNG

    Unfortunatly I'm not an expert regarding animators and can't provide a modified animator at the moment.

    I hope I could help, please share if you could achieve your goals or if you need further assistance.
     
  39. BBET

    BBET

    Joined:
    Dec 18, 2012
    Posts:
    40
    Hi,
    Is it possible to use the card styles and import / export of csv also with the mayor scene? Which card styles would I need to use? I found in themayor/cards only the __basecard to copy for new cards.

    Is it possible to use the inventory in the mayor scene?
     
  40. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello,
    by principle it should be possible. In fact, the kings cards and the Major cards are roughly the same. They can also be used at the same time, like following screenshot shows (even if it looks a little bit strange):

    major_within_kings_ingame.PNG

    It should also be possible to export the Kings-Cards and reimport them using a "Major"-Template.

    The Major-Template is a litte bit older and the cards are missing some elements for the templates. I will check the dependencies and, if possible, write a migration guide for enabling the Major cards for ImEx.

    I hope I can provide the guid in a few days.
     
    BBET likes this.
  41. BBET

    BBET

    Joined:
    Dec 18, 2012
    Posts:
    40
    Thanks a lot, an Update of the major cards for import/export would be perfect!

    By the way, is there any experience in combining the Kings asset with Adventure Creator?
    I evaluate to use Adventure Creator for Intro and animated sequences/dialogs between blocks of decisions in Kings and the variable manipulation in Kings. I want also to exchange the inventory between Kings and Adventure Creator and also some other variables. I will need further evaluations how I can combine the UIs and how I will exchange variables between both assets. If there is any experience in combining those asset I would appreciate some hints, but it is clear for me that this is a very specific setup, that might not be relevant for others.
     
  42. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi CCM,
    i made a step by step guide for using ImEx with the Major Scene Cards in the attachement.
    Within this process I detected an bug in the ImEx script which caused an incorrect set of the cardstyle for the attached CardStyle Script. While fixing this error i also limited the Warning Spam for illegal characters to 5 (regarding another request from a different user).
    A new version of the script is also attached.

    Regarding the Inventory:
    You could try to copy the Inventory GameObject to your Major scene. Please be aware to also copy all the Inventory UI Panels also and set the correct links between them:
    Inventory_Major.PNG

    Regarding Adventure Creator:
    I have no experience with Adventure Creator. I think it will be tricky to combine the different Inventories and, if possible, needs some scripts to transfer the items between them.
    Nevertheless you could perhaps use the script "Make Changes" if the Kings scene is loaded (in the background?) to directly add specific items. But I would suggest to not try to combine the different inventories.

    I hope I could help, please post if this could help you or there are remaining question.
     

    Attached Files:

    BBET likes this.
  43. BBET

    BBET

    Joined:
    Dec 18, 2012
    Posts:
    40
    Thanks a lot, I will need a few more days to test this. I come back if I have challanges. Thanks!
     
  44. yazidane

    yazidane

    Joined:
    Oct 6, 2015
    Posts:
    29
    sir, i really need to integrate admob to the mayor scene...really need a tutorial or video for this. hope you can help me
     
  45. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello yazidane,

    I would like to help you with implementing AdMob to the Mayor scene. I don't know what you already tried to implement it, therefore I have a bunch of questions and suggestions.

    Does AdMob work for you in the card scene? (Configuration of IDs, Video is shown, Rewards are given after the video? )
    If you don't know where to find it in the card scene: There is a GameObject in the Hierachy of the scene called "AdmobAds", the configuration of the attached script "PlayAdMob" is mentioned in the Documentation.

    If it works for you in the Card scene you can transfer it to the Mayor Scene:
    Copy the GameObject "AdmobAds" to your Mayor Scene.

    Make your configuration how you want it to work.
    For example I will now explain how it is configured in the card scene. The following process is used and further explained:
    AdMob_Process.jpg

    The GameObject "AdmobAds" has three scripts:
    • PlayAdMob
    • (A) ChangeValue which modifies the value "AdmobVideo"
    • (B) ChangeValue which modifies values for rewarding (e.g. increase the value Money).
    The script PlayAdMob has many events, for this example the RewardBasedVideos are used. When the video loading is finished we want to get informed the advertisement is ready. Therefore using the event in the inspector:
    AdmobAds -> EventsRewardbasedVideo -> HandleRewardBasedVideoLoaded
    to call the (A) ChangeValue script. By setting the value "AdmobVideo" to 1 we can now give the according Card/Mayor Panel from the Card stack. This is done by using the conditions of the card/panel.

    Following image shows the configuration of the EventScript to show the request-card/panel only if the video ad was loaded:
    AdMob_EventScript_Config.PNG
    In this example "IsHighPriorityCard" is set to true, therefore the card is drawn as fast as possible. On the other hand the configuration "RedrawBlockCnt" ist set to 15, therfore there are at least ~15 Cards/Panels between two Advertisement Cards. You have to make your own panel for the Mayor scene, where you ask the user if the advertisement should be shown. Don't forget to add the card/panel to the CardStack.

    So, where are we now: If everything works and the ad was loaded a card/panel is shown to the user.
    Next step is to play the ad, if the user wants to see the ad.
    This is done via the "GlobalMessageEventSender". From the example event "OnSwipeLeft" the Message "playAdmob" is sent to the GameObject "GlobalMessages" where the Event for playing the Video is triggered:
    playVideoEvent.PNG
    After the video was shown correctly, (B) ChangeValue is executed to reward the player. This could also be replaced by the script "MakeChanges" were also rewards like Inventory Items can be added. But please be aware, the Mayor Scene is not configured for using the Inventory yet.

    I hope this helps to implement Admob to the Mayor scene, I hope I didn't forgot a step.
    If you have further questions, please let me know.
     
  46. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hello, it looks like i can't change the background. For example, if i want to do it on a card spawn, i cannot access to background.cs (as seen in your example in the forum) ( so that i could access to PersistantImages.SetSpriteIndex) . Maybe i'm wrong and i sould put another object in the list , but which one ?
     
  47. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    it works fine , thanks !

     
  48. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello tieum67,
    what works fine? The issue with the years value and/or the one regarding the background.
     
  49. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    the issue with the years value is solved , thanks to you

    but i'm still strugglinf with the change f background

     
  50. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Accessing something in the scene from a spawned element is always a little bit tricky.
    Like you mentioned, setting it by PersistantImages.SetSpriteIndex doesn't work directly.
    For the example the Global message System was used.

    • To change the background via the Global Message System add the script "GlobalMessageEventSender" to your card.
    • Define a message which is sent on e.g. see the example card "War_start":
      SendEvent.PNG
    • At the GameObject "GlobalMessages" you can now define actions when receiving your Message:
      BackgroundChange.PNG
    • Because the images are persistent don't forget to add a card which sends a message to reset the background image.

      I hope this helps.