Hi!

I'm trying to create a reward screen where the player gets to pick their reward amongst a choice of three, a bit similar to Slay the Spire (https://apptrigger.com/files/2019/01/Slay-the-Spire-Card-Rewards.jpg), but without the skip button. Possible rewards are randomly picked based on certain conditions, then the player clicks on the skill they want and a flashy animation follows.

I'm able to create schematic where skills are picked randomly based on different conditions. Basically, I randomly pick a number for 3 different variables, where each number represents a certain skill.

However, I don't know the best way to process the player's input with the visuals I want.

My first attempt today was to create a dialogue with choice, where each skill represented a choice based on condition (whether the skill was randomly selected as a reward or not). However, I don't know if I can visually present the choice as shown in the screenshot above or not. I've been able to present the choices with basic text in a dialogue box, but I've been unable to replace the skill names shown in text by big images placed next to each other. I don't know if it can be done...?

So my question is: what would be the best way to proceed to achieve what I want? Is it possible to have the player choose through a dialogue box like I tried? Maybe a create a custom shop? Or do I need to create a schematic spawning different game objects based on variables then have the player click on the game object to select the skill? (I really hope I won't have to go with option 3 :s)

Thanks!
  • edited June 21
    So when you did the dialog, is your schematic adding the skill to your combatant? If the only issue is displaying elements of the new ability or skill, I bet a UI shortcut is the way to go. Are you using cards like your example? I’d make a prefab variant of them (which I imagine you already must have for a game like this) - and make it strictly for rewards - then using a UI Key, tied to skill or ability to display it them. You’d have one Makinom UI canvas with three children (separate game objects) - and use shortcut ui - checkout the write up here:



    Not positive mind you as I too am constantly learning - but hope it helps out till @gamingislove or someone can help!
    Post edited by theProject on
  • Your general idea was correct, but needs to be done a bit differently.

    Using selected data, you can create abilities, show them in a choice dialogue and afterwards add them to a combatant:
    - Select Ability node can be used to create an ability and store it in selected data
    - Selected Data Choice node can show a choice dialogue to select something that's stored in selected data
    - Learn Ability node can also use an ability stored in selected data
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok, thank you for the input Gil, I'll try this tomorrow! I didn't know the Selected Data Choice node, I'll give it a shot!

    And thank you theProject for trying to help me! I guess Shortcut UI is certainly the way to go to make a card based game. However, I was only looking to create the reward screen, so I'm not certain this could be done through a Shortcut UI, which is more aimed to use skills quickly.
  • You can use shortcut UI in the Selected Data Choice to show information of the displayed content (and also use HUD templates).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks to your help Gil, I've been able to make the event work relatively quickly this morning! (Yay!)

    Now, there's only one thing I need to figure out to complete the visual aspect of my setup: is it possible with Ork to make the game know what skill reward is actually highlighted (before being selected)?

    For example, if you take the image of Slay the Spire I posted in the original post, there are three rewards shown left to right. If the player places their cursor over the left skill, I need a variable to let me know the left one is highlighted, etc.

    So my question is: with Ork, is it possible to change a variable based on what is currently highlighted (left option, middle option or right option)? Since I'm using the same prefab button for all three skill rewards (I'm using a HUD inside the button to show the content of the skill, the button itself is only the frame), the same button prefab will be present at three different spots.

    I could work with just knowing if it's the 1st, 2nd or 3rd option being highlighted (stored in an int variable), without knowing the exact ability it would reward by clicking on it.

    Thank you!


  • What do you want to do with that variable or information?

    If you want to display information on the selected reward, you can use the tooltip option of the Selected Data Choice node and use a tooltip HUD to display that information. E.g. using variable conditions to have some special tooltip HUD dispayed only for that reward screen by setting the variable before the dialogue and removing it afterwards.

    Otherwise, UI boxes can use schematics when an input was selected - the used ability should be available as local selected data via the key action in that schematic.
    Alternatively, you can also use pre-placed buttons, where each button's UI Button Input component uses a custom selection schematic to set a variable to different values.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited June 23
    Ok, I've spent my day on this but I got(ish) it thanks to your ideas.

    I've tried several things, but in the end, I've been able to get the result I wanted by spawning invisible game objects behind the UI with an interaction machine that triggers on mouse enter.

    I liked your ideas better, as they seemed simpler (not creating useless game objects and having trouble placing them correctly would have been good), but I haven't been able to make them work.
    Alternatively, you can also use pre-placed buttons, where each button's UI Button Input component uses a custom selection schematic to set a variable to different values.
    I spent quite a bit of time on this, but couldn't make it work. I added preplaced buttons in the UI Box underneath the real buttons, but I couldn't trigger their own custom input schematics. I even tested to place them away from the real buttons (to be sure the input wasn't being eaten by the real button), but no, I haven't been able to make the schematic trigger.
    What do you want to do with that variable or information?
    I need to send that information to other game objects/HUD to change their appearance based on what ability is selected, and where it is visually. It's cosmetic, but it's the only think I'm missing to complete my setup.

    I had already been able to show the skill's information using tooltip HUDs, like you suggested.

    Thanks for your time :)

    Post edited by max_power on
  • Placed buttons also need to be added to the UI Box component at the root of your UI box prefab. The Input Settings have the Add Placed Input button to add them and select the button that's used.
    When the UI box is used in-game, the placed inputs will be used instead of creating new ones from the prefabs.

    When using tooltips, you can also access the tooltip content via scripting in case you need it for custom scripts:
    Maki.UI.Tooltip.TooltipContent
    Generally, this is something implementing the IContent interface, which gives you access to basic content information (e.g. name, description, icon, etc.) - for anything more, you'd need to check if it is what you need and cast it to that class.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah yes, this is what was lacking from my previous attempt!

    Everything works now! Thank you so much :)

    And I'll keep the tooltip script in mind, it might come in handy.

    Thanks for your time!
Sign In or Register to comment.