Search Unity

KINGS - Card Swiping Decision Game Asset

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

  1. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    thanks it works perfectly ! Indeed, everything was explained in the manual... I guess i got confused wtih " sending message" and "calling function". Have a nice day !
     
  2. Deleted User

    Deleted User

    Guest

    Hi, is there a way to simplify the game so that there are no stats and the cards are played out like a visual novel?
    e.g. there are two options on card A, option 1 leads to card B, option 2 leads to card C...

    just a simple interface without highscore, achievements, quests, and characters, but leave the settings there.
     
    Last edited by a moderator: Oct 2, 2019
  3. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello Yunythee,
    welcome to the forum.

    If you want the cards to be played in a specific order, depending on the previous choice, please look at the parameter "Follow Up Card". Each card has an EventScript attached where following cards can be defined, depening on answers, conditions or randomly from a defined pool.

    Following example is configured to draw "Religion_holywar" next, if the user swipes left. If the user swipes right "People_army" or "Religion_cathedral" will be the next card.
    FollowUp.PNG

    Please remember to add your following cards to the card stack and remove the check "Is Drawable", this will prevent them from beeing drawn randomly (I think it is also covered in the documentation).

    Regarding the simplification of the rest:
    I suggest to just move the according UI Canvas or Gameobjects out of the screen manually.
    Why am I so lazy ;) ?
    If you don't need the addional elements but want to add one or another later, it would be a relatively large effort to insert the elements again afterwards.
    Another reason, to be honest, atm I don't know what can be deleted without any problems (also for hidden bugs). :oops:

    Another suggestion: If you want to start with a simpler card (no selection, just one of your cards) please change the parameter "Spawned Card" of the card stack should do the trick. See documentation page 9.

    At least for the follow up, hopefully I could help you.
    Please post if you have more questions or need further advice for the current issue.
     
  4. Deleted User

    Deleted User

    Guest

    Thanks a lot! I deleted all values and game canvas except for cards. At first adding cards to gamecanvas didn't work out because they can't be swiped but it's fixed by adding the cards to 'follow up card". I think I can work from this.
     
    Last edited by a moderator: Oct 3, 2019
  5. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    ingame.PNG actual.PNG result.PNG

    Hello,

    On the right, the result i would like to get
    On the left, the ingame picture
    In the middle , the in editor picture

    As you see, i m struggling with the order of appareance of the pictures. And i didnt find the trick yet. Could you give me an hint ? Thanks !
     

    Attached Files:

  6. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61

    So, i found a work around : adding an image in the card object, and using the image component only to control the mask. Is there an another solution ?

    imageformask.PNG fond.PNG
     
  7. KMDeclius

    KMDeclius

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

    it's not clear to me what layering you want to achieve.
    Do you want a base card with a border where you can underlay different other images and icons?
    In this case I would suggest following order of the elements at the card prefab:

    • CardDesign - For this example this is drawn without an image. Children Objects are:
    1. Icon/Image (e. g. your AÏE Text)
    2. The Card Frame with transparency at the Icon/Image region. This should also be possible by using png files with transparency and setting the property "Texture Type" of the image to "Sprite (2D and UI)".
    3. Text 1
    4. ...

    It's important to know that Unity uses this order from top to buttom as the order it draws the Elements. In your second example the "Cardback" is at the end of the list, therefore it is drawn over your previous images. If it would be activated.

    I hope this helps.
     
  8. tieum67

    tieum67

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hello, yes it s exactely what i wanted to achieve... thanks fot the help !

     
    KMDeclius likes this.
  9. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    KMDeclius likes this.
  10. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi jamopolis,
    thank you. We had fun times playing your game in the beta state.
    We wish you much success with your game and hope for more such awesome usage of the Kings Asset like you did.
    It is hard to implement every possible feature in the asset without making it to overly complicated,
    therefore we are happy how you erniched the asset and adoptet it to your needs.
    Sincerly
     
  11. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    Thanks @KMDeclius !
     
  12. sonicatu

    sonicatu

    Joined:
    Oct 7, 2019
    Posts:
    1
    Hello! New guy here.

    I want to modify the game cards as to make them smaller and the questions to be displayed above the card instead of on it. However, whenever I do this, the question does display for the BackCard, but not on the front. Can I make the question text visible?
     

    Attached Files:

  13. jamopolis

    jamopolis

    Joined:
    Jan 20, 2015
    Posts:
    8
    My guess is you have a mask on one of the gameobjects that make up the card which is used for hiding the left and right answers. Try moving the question text gameobject outside of the mask gameobject.
     
  14. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,
    like jampolis said, it would be the best to move the text GameObject outside of the (animated part) of the card.
    If you don't know how to move the text,
    simply use the template card "NoMovingTextCard". It shows an example where the card is smaller and all texts are outside of the moving object by default. The image is still moving.
    noMovingText.PNG
    If you want your title text to move with the card, simply move the GameObject 'TitleText' from the parent 'CardText' to the parent 'CardImage'. You get this view, if you double-click on the prefab.

    I hope this helps.
     
  15. thenameismaster

    thenameismaster

    Joined:
    Mar 22, 2018
    Posts:
    1
    Could a refund be generated for my order. I am having issues with the asset and not being able to use it. I have emailed the seller just after an hour of purchasing and am not receiving any replies to it. Cannot work with the asset and the docs and tutorials are outdated. Please help with the refund
     
  16. KMDeclius

    KMDeclius

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

    I'm very sorry for the inconvenience. I will try to get access to the Emails and will give you the refund. I'm again very sorry, this could take a few days becaus I have only partial access to the support email at the moment.

    I will clarify this hopefully until the weekend.
    Edit: I sent you an Email.
     
    Last edited: Dec 4, 2019
  17. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Items overflow in the inventory. Even if it's only capable of having 5 items slot, I will have the 6th item. How to fix this? I tried adding a value in the value script called itemCount so that I can check if the items is already 5, then don't add more item. But I can't make it work.
     
  18. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    I have another issue. After I swipe a card, Idle Active becomes unchecked. This sets the animation to False. How to always set to it True?
     
  19. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello interpretasyo,
    the inventory is NOT limited to an specific amount of different items at the moment.

    I have several suggestions to solve the issue:
    1a. Just make more graphical slots (they are really just graphical). E.g. for the side Panel: moreSlots.PNG
    1b. Because each Item is spawned sepeartely in the inspector and you don't want to limit the different items, you could try to use a scroll list for this:
    https://docs.unity3d.com/Manual/script-ScrollRect.html
    Tutorials like
    are better for explaining this.
    The Items are spawned in a specif GameObject in the inspector, so this should work. If you want to do it this way, please move the Options button, else it would be part of the list.

    2. If you really want to limit the numer of diferent items I also could adjust the scrip to limit the number of adding items. But this would not prevent the cards, which give Items, from spawning.

    3. I could make a link to an value into the Inventory system where the number of different items is written to. This value then could be used to don't spawn cards which give items with the help of the condition system. This is also not the best solution because it could also block other cards which would just increase Items you already have.

    4. I could add an display filter the way only the first n elements are shown. This would be at the script "Inventory_UIItemList" which spawnes the Items into the UI. This way no Item would be lost.

    Pleas tell me which way would you prefer?
     
  20. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    For your second issue:
    If I understand you correctly, you want the animation to be ALWAYS active, even if you swipe?
    Or do you want the Idle Animation to come back after a specific time the user doesn't touch the screen?

    Could you please specify your wanted bahaviour?
     
  21. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    can you teach how to do the option 3? I wanted it so that if there are 5 different items already. i cannot have any more than that. and if there's item that will be added, it will be discarded. with this, the gamer would want to use immediately the items.
     
  22. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    sorry. i think i have explain it poorly. what's happening is that upon loading the game, the card will animate as usual (going from left to right). but when i swipe that card, the next card won't have any animation. if i stop the game, then play again, that same card that has no animation awhile ago will now have animation. but then again, if i swipe again, the animation will be gone on the next card

    just want to add. that i noticed that the touch count is not resetting to 0. if i manually changed it back to 0, idle active will have check, then it works fine. i dont know why suddenly there will be this changed as i didn't have any code changes.

    i created a new project. then load again the initial project. again, the same issue happens. something else is making the touch count unable to initialize back to 0.
     
    Last edited: Dec 14, 2019
  23. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    i have added a countItem variable, how would I store the value from Inventory items size. this will contain the unique number of items i currently have. so that i can check if my inventory is less that 5, that's the only time i will give the item.

    and i really appreciate your help. good day to you sir.
     
  24. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Soooo,

    i altered the Inventory script:
    InventoryExpansionDifferentItemValue.PNG

    This is a value dropdown, you can select your defined one from "valueDefinitions". Default is "name", therefore don't forget to adjust it to your value (Uh, I see user request coming like: My name changes all the time... :p , just a joke).

    The value can be used like every other one:
    diffItemsValue.PNG

    The script is attached. ATTENTION: Please backup yout project before overwriting the script. This is not well tested yet. Maulwurfmann used test things like that before he left the project.

    It hope for feedback if it works like you intended or if you encounter bugs.
     

    Attached Files:

  25. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Soooo... again,
    regarding the swipe/idle bahaviour:
    It was never intended to restart the idle for new cards.
    Therefore i added the option:
    idleAfterSwipe.PNG

    Behaviour: after an selection was done by the user/swiper, shorty before the next card, I set IdleActive to true if this option was selected. I'm not shure if this will run without issues on an touch-device.

    Like 47 minutes ago:
    The script is attached. ATTENTION: Please backup yout project before overwriting the script. This is not well tested yet.
    I hope for feedback if it works like you intended or if you encounter bugs.
     

    Attached Files:

    • Swipe.cs
      File size:
      15.4 KB
      Views:
      354
  26. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    wow, you're so great. and you did that in how many minutes. will give you the highest feedback rating for this.

    also, can help to elaborate more on the leaderboard part. let's say i want to have a leaderboard for who has the most items used. i can't make it work, and for me to test it take alot of time since i can only test it if i upload the game to google.
     
  27. KMDeclius

    KMDeclius

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

    I tried to make an example, yet not tested for the leaderboard part:

    I therefore created a new value called "itemsConsumed" in the valueDefinitions (and the according GameObject). Please enshure the check for keeping the value is set to false so it will get deleted for the next game. For my test I also added the script "MakeChanges" at the Inventory and set it to increase the value "itemsConsumed" by 1.
    The Inventory can fire an event for each Item which is consumed. With this I called exetueEffect on the added script,
    so it would increase the counter by one every time:
    countingConsumedItems.PNG

    For the Configuration of the Leaderboards I added one key which is exactly the same string as in the valueDefinitions. This way it should be able to load the value itself from the PlayerPrefs:

    valueLeaderboard.PNG

    The other values for the configuration of the leaderboard should be according to the documentation.

    One last step would be to link the value change to trigger an transmit to the leaderboard. I had to exend the value script to trigger an event AFTER it saved the change (see attachement). I called it AfterIncreased. Therefore for the after increase event of the value I'm calling the leaderboard to transmit the score. The value GameObject now looks like this:
    valueLeaderboard.PNG

    Thats it up to now:
    Every time an item is consumed an value is increased. After the value was saved it triggers the leaderboard to load the value and transmits it.

    Because I have no according device is this not tested!

    The script is attached. ATTENTION: Please backup yout project before overwriting the script. This is not well tested yet.
    I hope for feedback if it works like you intended or if you encounter bugs.

    Hope this helps.
     

    Attached Files:

    hippobob likes this.
  28. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    You’re really cool, you know.

    I saw the functionality to use excel to upload the cards. Is it easy to do the reverse? Where I can generate the excel based on the cards I have?
     
  29. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,

    The system (ImEx-ImportExport) works in both ways. But it's a litte bit more complicated to import from CSV because the system has to know which template to use and some things can fail for invalid csv files.

    It is advisable to first export to csv to give a correct base csv for the formatting. Please be aware that just some information is exported, mainly texts and categories. Exporting everything gives a overly complicated file.

    The UI for both is the same, more information in the documentation
    https://www.km-games.com/Kings_Documentation.pdf page 30.

    On page 11 of the forum there are some newer Informations for the use with special (e. g. chinese, korean etc.) characters and a newer version of the ImEx script with some minor bugfixes (mainly import with special charcters).

    Sincerly
     
  30. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Just want to clarify this. Every time the item increases, google play leaderboards pop-up. Before, google play leaderboards only pop-up when I clicked the button for leaderboards.
    I think the problem is because the button and the 'after increased' script are both calling "UI_call_transmitscoreAndLeaderboard".
    Apart from that, it works accordingly.
     
    Last edited: Dec 19, 2019
  31. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Should I copy the KingsImEx.cs found in page 11 of the forum? Even though I won't be having a special characters in my text. Although I'm not sure if a single quote is considered a special character in this case.
     
  32. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,

    regarding the leaderboard UI: you are right, calling the complete leaderboard every time is a little bit too much. There are alternative functions you can call like "std_call_transmitScore" - this shouldn't open the Leaderboad itself and only transmit the score. Depending on the settings it is possible for the login screen to pop up the first time it is transmitted.
    The available functions for transmitting are listed in the documentation pdf.

    Another alternative would be to don't actualize the highscore on each change. As an example it is possible to transmit it once when a speacial card appears by the use of global messages.

    Another possibility for transmitting it once with the UI would be linking the method "UI_call_transmitscoreAndLeaderboard" in the GameStateManger (within the inspector -> scripts) in the "OnGameOver" Event.

    Regarding the ImEx: For generating the csv the actual (1.55) Version is ok, no special need for the updated script.
    But for speacial characters case (a single quoute should be no issue) and some other minor bugfixes you could just replace it. I just remembered there was also a fix regarding the templates (if used) to be correctly set on new card on import.
    In the csv itself it should make no real difference.
     
  33. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    I try to explore about this scrolling. But can you help me as to why when I put elastic on the scrolling, it is limited only to the 6 items (i have removed the menu as you advised). Even though I have more than 6 items, it will still snap back to show only the initial 6 items.

    If I try to use the unrestricted scrolling, it will go on forever without anything to limit the scroll. I tried to look for some other tutorials but I cannot incorporate it with the game because if I tried, it messes other things. Please advise. Thanks!
     
  34. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,

    your Rect for the Items have to be bigger and should be able to hold all the elements. In the video above he was very fast going over this point. Else it will not scroll to lower elements.

    Event this issue is not directly Kings related, I played a litte bit with Unity and found a more suiting solution wich auto adjusts the size. For me following setup works (just a quick test for the vertical bar) :

    The ScrollArea is a new GameObject with :
    • ScrollRect script, for the content I linked the InventoryList GameObject and set Horizontal to false.
    • Mask and Image is needed to define the visible slot for the scrollbar (see my dummy configuration on the left side)

    ScrollInventory_ScrollArea.PNG

    The Inventory List was modified with:
    • On the left side of following Image is the increased size of the rect visible.
    • I increased the bottom padding in the Vertical Layout Groupt to give the last element a little bit more space.
    • An Content Size Fitter was added to automatically increase or decrease the size of the Rect. Vertical fit is set to Preferred size. For actiavation it should be enabled, I disabled it temporarily to show the manual increased size of the content rect. Even if it shows a warning, it works for me in Unity 2019.1.6f1.
    ScrollInventory_InventoryList.PNG

    With setup it works for me (ok, the white bar image sould be replaced with something nicer). Be aware this will not work with the horizontal bar directly, because moving the scroll view will also move the card.

    I hope this helps, as usual I am happy to receive feedback.
     
  35. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    It works like a charm. Imagine me having a whole day trying to figure out how to do that. In the tutorial, it requires me to have this Container which will hold the Inventory List, but it seems like that's keeps me from getting it right.
    For the issue when it's still swiping the card even though I just want to scroll the items (this will be an issue in both horizontal and vertical for 4 swipe card), I managed to use Event Trigger to add the in the scroll rect and turn off the swiping from there. I'm so happy. Although I'm not sure if this is efficient. Thanks a lot!
     
    Last edited: Dec 21, 2019
  36. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Thanks for the feedback,
    I'm glad it worked for your issue.
     
  37. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    I've been meaning to add something like an Easter egg where 1 picture (has button) when pressed will show a different card. What function should I use to show a card which is not on the stack?
     
  38. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,
    all cards have to be defined at the card stack. The index within the cardstack is used for save/load. If you have a card which is not within the stack and returning into the game would load the fallback card, which should be game over.
    If you want a card which only can occure by some easter egg or only follows a special previous card:
    Add the card to the card stack and set the configuration for this card to (CardPrefab->Eventscript)->"Is Drawable" to false. This will prevent your easter egg card from occuring randomly in your game.
     
  39. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Just want to drop to say kudos to you for helping us everytime. Hope you are having a good time wherever you are.
     
    KMDeclius likes this.
  40. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Thank you very much.
    I'm happy to help.

    For the holidays I wish everyone a peaceful time.
     
    interpretasyo likes this.
  41. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    What will happen if I upload using ImEx. Will it override the old cards if they have the same name? Will it just create a new cards?
     
  42. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi,
    you have to specify the folder where you import your cards.
    If there is no such card with this name, the according card prefab will be generated.
    If there is already a card with the specific name in this path, if I remember correctly, it will just update it with the setting from the csv. Setting on the prefab which are not modifiable by the import, like e.g. events and follow up cards, should stay the same.
    You could make a backup of your project and test it, if you are not shure.
     
  43. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Just want to inform that what you say is true. If ever someone might ask again.
     
    KMDeclius likes this.
  44. furkan1aktas

    furkan1aktas

    Joined:
    May 2, 2018
    Posts:
    33
    Hi,

    I am using Unity 2018 version 3.1f1. I want to add a Language selection tool to the First Start Panel in the game. Can you help me ? Frankly, I don't know much about coding. I'm a storyteller. Can you prepare a prefab for me? This would make me really happy. By the way, I bought what I needed for the extra language.
     
  45. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    Somehow, the start card is showing even if it's in the middle of the game.
    The condition to show the start card is if the year 0-1. (Number of years is 49 at this moment). It is drawable and high priority card. I tried to check if there's any duplicate in the cards but there isn't. Do you know what could be the reason why is this happening?
     
  46. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi furkan1aktas,
    I'm sorry I can't provide an prefab for the localization window. This would fail because I am not allowed to shar external paid resources of other assets in the forum and a prefab without correct links... too many uncertain error sources.
    If you installed the I2Localization they provide example scenes with buttons for changing the language, like they say in their documentation: http://inter-illusion.com/assets/I2LocalizationManual/ChangingthegameLanguage.html .
    I would like to suggest to yout to test their examples so you can decide which one is suiting for you. I don't know the dependencies of the examples, but coping the needed elements/buttons/dropdowns into your panel could work.
    If you want to add it to the FirstStartPanel, please also add it in some way to the options panel. Else the user will have no option to change it later in the game.

    TL;DR: I'm sorry, no prefab for this. But I2L provides examples.
     
  47. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi interpretasyo,
    this (of course) should not happen.
    When did this happen? Ingame after swiping another card or after loading the game?

    If this happens ingame after swiping a card there is only one reason I can think of at the moment:
    If the previous card has somewhere in the configuration (EventScript on the prefab) that the start card is a follup card, then all conditions and filters are ignored and the card is drawn next. Please be aware there are multible places on the card for defining the follow up card, dependent on swipe direction or as general following card.
    Could you please check this?
     
  48. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi,

    You are so great. It happens because we have a card that has a follow-up card but it is not properly set-up in the script. It was really weird for that first card to come but now it's working correctly. Thanks again.
     
    KMDeclius likes this.
  49. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello,
    in the support we fought an issue regarding newer Unity Versions and Unity Ads in Kings. We believe we hopefully found an solution if someone tries to use Kings e.g. with Unity 2019.2.8f1. We extended the "PlayUnityAd" script to initialize the Ads itself. The script is not really optimized and not tested on Devices yet, but test mode works in the editor.
    I attached it in case someone encounters the same issues.
    The configuration of the script looks like this:
    PlayUnityAd_Config.PNG

    It requires an update of the advertisement package, else it would throw some scripting errors.
    I tested it with version 3.4.1 in the editor:

    AdvertisementV3.4.1.PNG
     

    Attached Files:

    interpretasyo likes this.
  50. interpretasyo

    interpretasyo

    Joined:
    Jun 18, 2019
    Posts:
    33
    Hi, can you recommend a way to add a facebook share in the game? It's hard to incorporate it using the tutorial in the facebook developer itself.