Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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:
    200
    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:
    4
    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:
    200
    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:
    4

    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:
    4
    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:
    200
    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.
     
unityunity