edited May 2023 in ORK Support
Hello, i am trying to work out abilities in menu screens.
I am not sure i understand correctly how it's supposed to work, hope i can get more clarity here.

To sum up the overall mechanic we're trying to reach : when in combat i have a group of combatants, the player choses a combatant, this combatant has abilities, the player can click on a ability which will take effect immediately (an attack for example).

First attempt : using shortcuts works fine, but we feel limited with the fact that the buttons on shortcut can't be prefabs (or did we miss this option?)

Second attempt : using a menu screen with a menu part "Ability" : the abilities are displaying, the buttons are now prefabs... but : these buttons refuse to be activated. When looking in the hierarchy we can see clearly the buttons are disabled and forever stay disabled so the abilities can't be used.

Question 1 :
Is it actually possible to obtain the same behavior with shortcuts and menu screens for abilities (on the mechanic aspect)?
If yes, what are we missing in the options that would allow the prefab buttons to activate therefore be usable?
(we have actually used those same prefabs for another screen menu but with inventory items so the behavior is a little different but works as expected)

Question 2 :
Should we go back to first attempt with shortcuts? Did we miss an option that would allow to replace the default buttons with a prefab for this type of display?

Thank you for any answer.
Post edited by AnneLaure on
  • Menu screens are only used for field-use, i.e. they only use abilities or items that are useable in the field and target allies (i.e. the menu user's group). So, for battle action selection, you should use the battle menu, or a shortcut HUD, control maps, etc.
    The shortcuts in battle menus can use a button prefab, though.

    1) Shortcut HUDs, no, shortcuts in battle menus, yes.
    In battle menus, they're just the same as having abilities or items listed, just coming from shortcut slots.

    2) Well, that's up to you - either using ability/item or shortcuts in battle menus is just a matter of what you want to have. Abilities/items just list the available stuff (based on the setup), shortcuts show the stuff that's assigned to the displayed shortcut slots.

    Also, for battle menu actions to be used immediately without target selection, you can use group/individual targets. I.e. have a 'marked' target and use actions on it without target selections. Group/individual targets are set up in Battle System > Target Settings and the battle menu needs to enable using them.
    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!
  • Thank you so much i guess i will have to look a little more into the battle menu!
  • Well I am confused, I made a battle menu, but I can't seem to be able to make it appear in game, how should I proceed? This menu should appear once in battle and the user is available to choose an action.
  • Your used battle system has settings regarding the battle menu. The default setup should open it automatically (Auto Call Menu enabled), otherwise you can call it with a defined input key.
    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!
  • Thank you I was finally able to show the menu !

    So now new problem : we were using "Player Auto Grid Move" set as "Always" (in the Phase Battles Settings) but it seems when this option is on, the menu won't show anymore.
    The intention was to allow the player to move freely without clicking an ability.
    Is there a workaround to be able to show the menu while keeping this feature ?
  • Well, yeah - that automatically calls the grid movement when the player can select an action, so same as using the grid move command from the battle menu.
    Canceling out of the grid move selection will show the battle menu.

    The only way to use both auto grid move and show actions is to use a shortcut HUD ...
    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 2023
    Thank you !

    I have new questions for you :)

    1 - Concerning the battle menu : is it possible to control the menu visibility "show / hide" or does it always have to be shown during a battle? If controllable how should we proceed?

    We are also considering another possibility : redo a menu via Unity with Unity buttons and call ORK functionalities via C#, a few questions popped-up:

    2 - What would be the best way to launch an ability via C# in the same way it does via an ORK ability button ?

    3 - In order to activate/deactivate a button when an ability is usable or not, is there an event that would allow to get the information when it's status changed ?

    4- There is a functionality we are using in Battle System > Battle Grid Highlights > Use Range > In Action Selection which allows to highlight the range in which an ability is usable on the grid on mouse over. Is there a way to call this behavior via C# ?
    Post edited by AnneLaure on
  • 1) Only if you don't use auto showing the battle menu (via your battle system's settings). In that case it can be opened/closed when a combatant can select actions.

    If you want to involve custom scripting, you can naturally also implement hiding the battle menu :)

    2) Best check ORK's source code for how it's done, but generally, you create an action for it (e.g. for an ability using AbilityAction class) and add it to the combatant, which takes care about stuff, e.g.:
    combatant.Actions.Add(new AbilityAction(combatant, abilityShortcut), newTurn);
    abilityShortcut is the AbilityShortcut instance of the combatant's ability, newTurn a bool indicating if a new turn is started or not.

    In case you just want to fire that action and it should be used when the combatant's next turn comes up, add is as the next action instead:
    combatant.Actions.AddNextAction(new AbilityAction(combatant, abilityShortcut));

    3) Not really, the battle menu just regularly checks it and updates the button's state ...

    4) Everything can be used via C#, since all functionality is exposed.
    It's generally pretty simple, the BattleGridHelper class has 2 Highlight and 2 StopHighlight functions to show/hide the highlights for individual cells or a list of cells. You'll need to get the cells you want to highlight first, though.
    Abilities/items have functions for that via their target settings.
    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!
Sign In or Register to comment.