Is there a way via Schematic to check if the player is currently selecting targets for a specific ability? I tried using Select Battle Action but it seem to only account for when an ability has already started...
@ChimpLogik Hmm Is Battle Action node lets you specify an ability, but not sure if it will register at wherever you are calling the schematic from. Like are you using a schematic in Battles->Target Settings?
Tooltip says checks if the Schematic was started by the action so could be promising?
Thank you for the suggestion @GeneralK, unfortunately in this case the Schematic which is performing the checking is in Base/Control->Global Machine (started by a key).
No, there's no schematic node available for that. You'll have to add a custom node for that. You can get the currently active action for target selection via a combatant's battle menu: combatant.Battle.BattleMenu.TargetHighlight.Shortcut
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!
I used a Store Function Result node to store the result of your Custom Function in a local Selected Data (Key = player_action)
The result of that function is an IShortcut so in order to check that for a specific ability, I connected the Success Connection to a Check Shortcut node with Use Selected Data = true and Data Key = player_action but it doesn't work.
Store Function Result stores a value into a variable (as it's help text explains) - i.e. it'll only work for functions that return int, float, bool, string or Vector3 values. It has nothing to do with selected data ...
A workaround would be to just have the function store this into a global selected data, e.g.: Maki.Game.SelectedData.Change("key", shortcut, ListChangeType.Set);
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 Nicholas, I got the custom function to work. I apologize in advance if my question(s) sound redundant or flawed but I admit I have a lot of knowledge gaps on this topic ._.'
What is the Schematic node to compare the store global selected data against a specific ability?
I don't think there's currently a node for that. A workaround could be to use the Select Ability node to remove that ability from the global selected data and check if the global selected data is now empty/has less in it via Selected Data Count node. Most likely first store the global selected data into a separate one and operate on that to keep it available :)
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!
I tried to follow your advice but it doesn't seem to be detecting the desired ability (Chase and Hire in this case). This the way I set up the testing, not sure if I did something wrong:
Code in Call Function node:
public class ORKAbilities : MonoBehaviour { public IShortcut shortcut; public void StoreGlobalSelectedData_PlayerActiveAction(string key) { StoreGlobalSelectedDataActiveAction(GlobalFunctionsManager.GetPlayerCombatant(), key); } public void StoreGlobalSelectedDataActiveAction(Combatant combatant, string key) { shortcut = combatant.Battle.BattleMenu.TargetHighlight.Shortcut; Maki.Game.SelectedData.Change(key, shortcut, ListChangeType.Set); Debug.Log("(AutoMelee) StoreGlobalSelectedData_PlayerActiveAction called for key " + key); } }
Tooltip says checks if the Schematic was started by the action so could be promising?
You can get the currently active action for target selection via a combatant's battle menu:
combatant.Battle.BattleMenu.TargetHighlight.Shortcut
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The result of that function is an IShortcut so in order to check that for a specific ability, I connected the Success Connection to a Check Shortcut node with Use Selected Data = true and Data Key = player_action but it doesn't work.
Not sure how to make this work :(
It has nothing to do with selected data ...
A workaround would be to just have the function store this into a global selected data, e.g.:
Maki.Game.SelectedData.Change("key", shortcut, ListChangeType.Set);
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
What is the Schematic node to compare the store global selected data against a specific ability?
A workaround could be to use the Select Ability node to remove that ability from the global selected data and check if the global selected data is now empty/has less in it via Selected Data Count node. Most likely first store the global selected data into a separate one and operate on that to keep it available :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
This the way I set up the testing, not sure if I did something wrong:
Code in Call Function node: Call Function node
Select Ability node
Remove Data Count node