edited March 2018 in ORK Scripting

I'm nearly done with custom UI/Hud(Grid Inventory/Equipment/Custom Skill Tree etc.) and I must say I'm very impressed with how much flexibility ORK gave me in this. I just have a few last loose ends to tie up and I had some questions about that.

1) How can I block ORK Raycasts with custom UI? For example UI to block movement, target selection etc. I found the options in ORK and I was able to block stuff with ORK's GUI boxes but I could not quite figure out how to do the same with Custom UI.

2) Can I somehow drop equipped equipment on the ground? I found Drop Functions on Items but not Equipment.

3) Is there a way for me to track the following player states in Turn Based Grid Battle. (I'm not using a battle menu of ORK)
a) Player is not currently engaged in either Target or Action Selection or Performing Action. (I want to force player into "Move" Command if player is not locked in any other action.
b) Player is Locked in Target Selection, So he selected action and now he is selecting target.
c) Player just canceled the Action. So he was in Target selection but pressed the cancel key.

I looked into different options in CombatantActions class, but maybe because I'm not using BattleMenu or I got these wrong. The IsChoosing/IsPreChoosing/IsWaiting/ActionState do not seem to correspond to b) situation.

4) Is it possible to get these two situations from Turn Based battle?
a) A new turn Started, meaning all the combatants had their turn and now they go for a new round.
b) A new "Local" turn started, meaning one combatant finished all his actions and new combatant was just selected.
c) Battle has ended
d) Combatant Died
e) Is there a way to track the point where the battle was triggered? I found the BattleStarted delegate but that triggers when actual combat starts, and before that there is Pre-battle stuff like character placement on grid etc.

Right now I edited source code with custom delegates for that, but wanted to check if there is a built in way to make upgrading ORK easier.

Post edited by hellwalker on
  • 1) Hm, the easiest way would probably be having a dummy GUI box added to ORK's GUI system while your custom UI is displayed with the bounds of the UI. This would feed into ORK's UI blocking system.

    2) Equipped equipment would first need to be unequipped, which returns it to the provided inventory (e.g. using combatant.Equipment.Unequip(equipShortcut, inventory)). You can drop it from there.

    3a) ORK's battle menu is still running in the background, you can e.g. check the current mode through the combatant.BattleMenu.Mode attribute.
    There are also different state attributes available in combatant.Actions and combatant.Battle (e.g. combatant.Actions.IsChoosing).

    3b) That'd be checking combatant.BattleMenu.Mode == BattleMenuMode.Target :)

    3c) You'd have to keep track of the last battle menu mode in your custom code and check it for changes.

    4) I guess you mean getting callbacks for these events? In that case no, there are no callbacks or handlers you could hook up to get that information. You'd have to add that in the battle system's source code.

    4e) How are your battles started? E.g. battle components or spawned combatants getting into battle start range of the player?
    Generally, the position where the battle was triggered is the player's position and can e.g. be stored into a variable at the start of the battle start event.
    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 March 2018
    1) That would be a bit hard to match as the UI moves around in animations. I guess I can add guibox component to my UI and feed it to ORK? There's probably a list of GuiBoxes and raycast is calculated based on that? I'll check in code.

    4e) Sorry my description was confusing. I meant the battle state or game state of PreBattle Actions. not the transform position of battle. Basically I want to hide some UI when the battle is triggered and show it when the actual battle starts.
    Post edited by hellwalker on
  • 1) Well, yeah .. but not based on the component (which is only used for the new UI), but an instance of GUIBox that's added to the GUI handler (ORK.GUI).
    I can add a function to allow you manually force a cursor over (resulting in ORK.GUI.IsCursorOver to be true, which all UI blocks are based on) in the next update.

    4e) Hm, well that would pretty much just be the duration between the start and end of the battle start event :)
    You should be able to do that with the event system, e.g. using a function node to call one of your functions to do that.
    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!
  • Cool thanks!
    For 1 Maybe something like this would be easier? https://docs.unity3d.com/ScriptReference/EventSystems.EventSystem.IsPointerOverGameObject.html like a toggle to optionally use check like this ? This function seems to work on UI and checks the ORK Canvas Group raycast block/enabling feature.
Sign In or Register to comment.