Search Unity

KINGS - Card Swiping Decision Game Asset

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

  1. KMDeclius

    KMDeclius

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

    the package is now deprecated. The default hint from Unity is:
    upload_2020-12-15_20-3-27.png
    To correct this: Support is still ongoing!

    Besides the Forum, the mail support@km-games.com is still active.
    The videos are still available here: https://www.youtube.com/user/KloppeMedia
    And the Documentation (at the moment, could change in the future) here: https://km-games.com/kings-card-swiping-decision-game-asset/
    The main documentation is within the asset itself, but I attached the Documentation and Tutorial also here.

    I hope this helps. Greetings.
     

    Attached Files:

    Lady_Lai likes this.
  2. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7
    Hello! I know the package is deprecated, but I'm gonna ask anyway...
    I was wondering how to change the music theme when a certain card is spawned: For example, when the game over card spawns, I'd like to play a certain ''game over song''
    Can somebody help, please?

    I'm trying as shown in the image attached: in the inspector of the card (in this case, the game over army card), i go on ''on card spawn'', i select the ''music player script'', but i can only select ''no function'' or ''monoscript.name''; I thought the function ''MusicPlayer.setSong'' would appear, but it's not happening.
    Thanks in advance :)
     

    Attached Files:

  3. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello,
    like I wrote, support is still active. The issue here is, the card is an prefab and not instantiated in the scene at this moment.
    Prefabs can't have references to the scene or scripts in the scene ( This is a default Unity behavior ). The second thing is, you would stop the actual song which is playing, therefore you have to access the one already in the scene. Seems tricky, but you can do it this way:
    1. Add the audioclip at the music player script:
    (Hierarchy)->Music->(Inspector)->MusicPlayer
    . Memorize the order of the clips, if you attach one as the 5th one, it has the index 4.
    2. Attach the script
    GlobalMessageEventSender
    to the prefab of your card. From an event of your Card call
    GlobalMessageEventSender.GlobalMessage(string)
    and add a message (you will need this message later. Similar like it is done on the card
    War_start
    .
    3. Specify another event receiver with your message at :
    (Hierarchy)->GlobalMessages->(Inspector)->GlobalMessageEvent
    . There you can have events which can call scripts in the scene. In the
    event
    for your message drag and drop the
    (Hierarchy)->Music->(Inspector)->MusicPlayer
    . As function call
    MusicPlayer.setSong(int index)
    and specify your index from Step 1.
    4. The
    MusicPlayer
    will save your selection, in case the game is interrupted and started later. To stop this song, you have to set a new index at a proper location. E.g. from another card or from the game manager when a new game starts.
    I hope this helps. Because I only have 32k Internet at the moment, I can't attach images. Sorry.
    Greetings
    KMDeclius
     
  4. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7

    Great! Thank You for the insanely fast and complete reply! I'm trying what you suggest ASAP.
    In the meanwhile, again, thank you for the support.
     
  5. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7
    Hello there! Thank You for the last reply, it worked just great.
    Anyway, I have another (and I hope last :)) quick question: I want to name the player due to the value ''Years'', example:
    Year 0 -15: ''the kid''
    Year 15 - 25: ''the youngster''
    Year 25 - 50 ''the man''
    Year 50 - 75 ''the old''
    PS: I don't need the name to be displayed on the game over log or the gameover timeline, since I'm not using them.
    I just need the name to be displayed on the top panel and the PlayerInfoPanel.
    Thank you in advance
     
  6. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi again,
    the script you are searching for is the script
    valueDependentTexts
    . You can add it to your text game object, define the source Kings-value, the steps and the texts. There's an extended version some pages earlier which allows even the use of an csv file for the texts. I also described the usage, if I remember correctly. I'm still on 32kbit internet at the moment, so I can't search for the link atm, sorry.

    I hope this helps.
    Greetings.
     
  7. Zefarec

    Zefarec

    Joined:
    May 4, 2021
    Posts:
    1
    Hello,
    Could you tell me how to translate the country names with I2 Localization? I just wondered how it works also documentation isn't detailed.
    Best regards.
     
  8. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello,
    because of the specific question to the country names, I am assuming you got I2 Localization running for the other texts. I dove into the code and it calls the translation routine as far as I see. According to the code, the country is also part of the base term output list, which can be used for I2 Localization. So far I see no issue here.

    If I2 Localization is enabled, you can test if a translation is generated, by uncomment the debug output in
    TranslationManager
    at around line 35. It will throw a warning, if it the localization returns an empty string and it this is replaced with the original.
    Code (CSharp):
    1.     public static string translateIfAvail(string term){
    2.         string retString;
    3.  
    4.         //Example of the use of I2 localization.
    5.         //To enable I2 localization, uncomment the line '#define USE_I2_LOCALIZATION'
    6.         //on the beginning of the script.
    7.         #if USE_I2_LOCALIZATION
    8.         retString = I2.Loc.LocalizationManager.GetTranslation(  term.TrimEnd()  );
    9.         if(string.IsNullOrEmpty(retString))
    10.         {
    11.         //Debug.LogWarning("Missing translation for term: '" + term +"' , using term as translation result." );//<-uncomments this
    12.         return term;
    13.         }else{
    14.         return retString;
    15.         }
    16.         #else
    17.         return term;
    18.         #endif
    19.     }
    Second option is, of course, check if the translations list feeded to I2L is correct or it didn't have a correct translation. This could happen if you use fantasy country names and there's no obvious translation for them. This also depends on the type of translation and my guessing here is only correct if theses lists exist.

    Last but not least, the
    Code (CSharp):
    1.     public static string translateIfAvail(string term)
    method mentioned can also be used to implement every other compatible translation tool. It get the
    term
    as input and shall output the translated version of the string. E. g. an pseudo example:

    Code (CSharp):
    1.     public static string translateIfAvail(string term){  
    2.         string translatedString = YourCustomTranslationTool.Translate(term);
    3.         return translatedString;
    4.     }
    Please correct me, if my guessing goes into the wrong direction. I hope this helps, greetings KMDeclius

    [Edits: the formatting was not correct]
     
  9. unity_kHV1XD18l8j7vQ

    unity_kHV1XD18l8j7vQ

    Joined:
    Dec 15, 2019
    Posts:
    1
    Hello, First at all, congratulation, your asset is perfect for my game.
    I'm a little bit stucked right now, and I need to ask you something, The second time you play de game, you have to choose the kings again , is there any possibility that these options being binded from the last game ? To leave it simple, if the second game the king is the son of the first one. Is there any simple way to do it ?

    Thanks in advance.
     
  10. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hello there,
    thanks for your question. You can alter the game flow of the game, especially the starting seqence, from the first card. The selection screen is a
    FollowUp
    -Card:
    upload_2021-7-21_23-29-3.png

    Some similar, but not exactly the same question about the starting seqence was on a previous page.

    Before you make changes, remember to make backups!

    What could be working?
    1. Create a new Kings-value, e.g.
    RulerSelected
    in
    ValueDefinition.cs
    and as GameObject (don't forget
    Keep Value
    so it's valid between games) and let the start number be 0:
    upload_2021-7-21_23-53-18.png
    Also set
    Keep Value
    of the Kings-values "Name","Surname".

    2. When Selection despawns, set the new Kings-value to something above 1:
    upload_2021-7-21_23-45-0.png

    3. Now you could use it as condition for the drawing of the selection card:
    upload_2021-7-21_23-56-57.png

    The sequence is now:
    (First Start)->Start Card (RulerSelected==0)->SelectionScreen->RulerSelected=100
    (Restart)->Start Card (RulerSelected==100)->Any Card

    This works for me except theres a bug resetting the Name-Value (not surename) to 0 at the end of the game. I have to investigate that.

    Regarding your second implicit question: you could modify the Name-Value at the game over card, so the ruling is inherited by the child.

    I hope this helps, I will investigate the bug further.
     
  11. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    And found one bug:
    The default item "MagicBean" was faulty:
    upload_2021-7-22_0-39-57.png
    You have to remove the name-Modifiers.
    Not save yet, found another bug...
     
  12. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    And found the (hopefully) last bug:
    Also set
    Keep Value

    of the Kings-values "Name","Surname","Gender-Playericon" AND "Country". Else the
    Country Name Generator
    will create a new possible combination. It works for me now.
     
  13. AxelCasauran

    AxelCasauran

    Joined:
    Dec 3, 2016
    Posts:
    5
    Hi, I'm curious why you removed this great assets at the store?
     
  14. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7
    Hello again!
    I'm almost done with my first game, I'm polishing it (I've attached a GIF so you can see a brief overall of the game).
    I wanted to thank you again, because without your great asset I could never do such a thing on my own, considering my lack of skills in programming and overall inexperience in game dev.

    20211005_185636.gif

    Unfortunately, there's still one thing I can't figure out by myself.
    I created a grid with all the characters in the game: I would like to insert a ''system'' similar to the Quest system: locked characters at first, and as the story progresses, once the character is ''unlocked'', the character is shown in the grid (I've attached another image which shows what I mean).
    photo1633454011.jpeg

    Do you have any suggestion on how to do it? I've tried with items and global messages (that's how i ''trigger'' the cutscenes and other things), but it doesn't work properly.
    I hope not to bother you too much with my posts, have a great day and thank you again for the great asset and great support on this forum.
     
  15. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi ChillArtGames,
    the concept looks good for me. It's a little bit late here, therefore I will only give some short suggestions at the moment. Perhaps I can more detailed explanations later this week.
    In principle, your character screen remindes me way more to some kind of inventory than it has similarity to the quest system. Let's say they are items, then the inventory system can spawn them as prefabs into a parent GameObject. To distinguish between other items, the inventory system has filters which item to spawn this way, if I remember correctly. I'm also not shure, if this feature is fully covered by the documentation.
    The grid view itself then is mainly a Unity thing, there are multible examples out there how to arrange this. Of course, the prefabs for them have to be adjusted.

    You would get some benefits, if you think of them as items:
    • the characters can be be added from Kings-Results (this includes e.g. also as rewards from quests)
    • the characters could be used in Kings-Conditions (e.g. the follow up card is depending on your 'connections')
    • the characters could be 'consumable' (e.g. played as trump card)
    To avoid issues, remember the items can be limited in count. So duplicate character items could avoided. On the other hand, multible disposable/usable characters could be possible. Depends on your intentioins.

    What's not covered this way:
    • the locked characters are not part of the grid (hmm.. let me think about this)
    • the order of the single items is not adjusted
    These two points would require a little amount of scripting, or tagging or something like this.

    I hope this helps for the moment, have a nice evening.
     
    ChillArtGames likes this.
  16. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7
    Thank you for the quick reply! I've tried like you suggested, and as you can see in the gif, it works.

    20211006_163242.gif

    Regarding the locked characters not in the grid and the adjusting of the position of the items, I thank you think I can do it on my own in the future.

    On the other hand, I'd like to have a ''counter'' of unlocked characters (characters unlocked / total characters) in between the grid and the title (as shown in the picture on the previous post).
    In order to create the counter should I do some code, or is it possible to show the number of items in some other way? I tried with value dependent text, but I'm not sure it's the correct way.
    Thank you again
     
  17. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi, I'm glad you got it working.

    There are different possibilities to achive an counter:
    • If you use no other items, you can use the different item count method, which is implemented in the inventor script in Hierarchy->(Gameobject)Inventory->(Inspector, attached script)Inventory:
      upload_2021-10-7_19-38-39.png
      You have to select a valid Kings-Value as output here. Then you could use the script "value dependent text".
    • Another approach would be simply counting the spawned objects (a small script) and output it to a text field.
      Code (CSharp):
      1. using System.Collections;
      2. using System.Collections.Generic;
      3. using UnityEngine;
      4. using UnityEngine.UI;
      5. public class GameobjectCountToText : MonoBehaviour
      6. {
      7.     public Text countTextField;
      8.     public string format = "{0}/100";
      9.  
      10.     void Update()
      11.     {
      12.         int cnt = transform.childCount;
      13.  
      14.         if (countTextField != null)
      15.         {
      16.             countTextField.text = string.Format(format, cnt);
      17.         }
      18.         else
      19.         {
      20.             Debug.LogWarning("(GameobjectCountToText): missing linked output text field.");
      21.         }
      22.     }
      23. }
      This creates following result:
      upload_2021-10-7_19-55-46.png
      You have to attach the script itself to the parent GameObject/Transform where the items are spawned and link a text field as output. The output string can be formatted with extra text, simply {0} is replaced by the object count itself. I also attached the finished script.
    I hope this helps.
     

    Attached Files:

  18. ChillArtGames

    ChillArtGames

    Joined:
    Apr 28, 2020
    Posts:
    7
    Amazing! Thank You very much, such an amazing support :)
     
  19. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi Folks,
    the support email doesn't work anymore.
    For direct support, please mail me directly:

    kmdeclius@web.de

    Greetings,

    KMDeclius
     
    Frogger_HH likes this.
  20. Frogger_HH

    Frogger_HH

    Joined:
    May 23, 2021
    Posts:
    1

    Hi, I have a problem. When I build the project on android, I see only brown BG in the build.
     
  21. KMDeclius

    KMDeclius

    Joined:
    Aug 12, 2019
    Posts:
    213
    Hi @Frogger_HH ,
    please provide more information. This isn't a known error of the Asset.

    Guessing from the fact thats your first post, I assume you are not familiar with the build workflow for unity.
    Correct me, if I'm wrong.

    Did you try it on another device (not only in the editor)? E.g. build for Windows/Mac etc.
    Did you select the correct scenes for the build? Be aware the build scene order is important, if you load the default Unity example scene or an emty scene first, it will not load further.

    Ref: https://docs.unity3d.com/Manual/BuildSettings.html - Header "Scenes in Build"

    I hope this helps.
     
  22. Elsanchezrey

    Elsanchezrey

    Joined:
    Feb 5, 2024
    Posts:
    1
    Hi everyone. I would like to download the file Kings_Tutorial.pdf, but the website is no longer be working and he redirect to a malicious website. Has anyone among downloaded it ? I'am curious to see how its working and I would like to create a small game similar to Reigns, and I believe Kings would be a good foundation
    While waiting for a return to the package store. Thanks in advance.
     
  23. Declius

    Declius

    Joined:
    Nov 17, 2016
    Posts:
    1
    The files are [edit] attached on my topmost post on page 20 of this forum.

    [another edit] The mail kmdeclius@web.de is also still working.

    I hope this helps.