Hey hey!

In my turn-based grid game, there are a few types of abilities, all linked to movement, that have been rather awkward to implement. For example:
- Applying a use-cost to a move action.
- Creating variant move actions (like a stealth action, with a different move rate and its own fx).
- Combing move actions with other abilities (for example, a charge ability that has an attack and a move in the same ability)

It feels like one way to be easily able to do all of those thing would be if the "Use Battle Action" node included "Grid Move" as an Action Type, so that a Grid Move could be embedded in a Schematic for another ability.

Is there anything in particular that makes that action difficult to integrate into that node? Any pointers on where I could start if I wanted to try to customise that node in that way myself?

Thanks!
  • You can use a grid move here via using battle AI.
    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!
  • Hmmm, I had a play around with this, but don't seem to be able to do what I want still. I want to launch the full path selection for the player, exactly like when they select a regular move action - is there a way to get that to execute?
  • No - even if the grid move would be a regular command to select here, none of these actions will bring up a target selection or anything like that. The Use Battle Action node is to fire an action with defined targets, not using regular target selections (or in your case, grid move selection).
    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!
  • Okay, thanks for the info. Guess I'll get to work writing my own custom node for that! ;)
  • Oh, doing what I was looking for seems to be actually way simpler than I was expecting it to be! Basically, just call StartGridMoveSelection on the player's battle menu in a custom node - a few little tweaks so that action cost is not applied twice, but so far seems to be working fine... :)
  • edited April 2022
    Hmmm... So maybe not that straightforward after all!

    This is the core of the script I'm using. The problem is that the schematic.NodeFinished executes straight away after the move selection starts, where it really needs to execute after the move selection is complete.

    Can you give any pointers on how I can stop the schematic continuing execution until after the move selection is complete?

    Thx

    Edit : Aha! Think I've worked it out... Just need a Runtime override of EndGridMoveSelection to contain schematic.NodeFinished, instead of having it directly in execute... :)


    using UnityEngine;
    using GamingIsLove.ORKFramework.Components;
    using System.Collections.Generic;
    using GamingIsLove.Makinom;
    using GamingIsLove.Makinom.Schematics;
    using GamingIsLove.Makinom.Schematics.Nodes;

    namespace GamingIsLove.ORKFramework.Schematics.Nodes
    {


    [EditorHelp("Launch Grid Move", "Launch Grid Move.\n", "")]
    [NodeInfo("Battle/Grid Path")]



    public class LaunchGridMove : BaseSchematicNode
    {

    public SchematicObjectSelection usedObject = new SchematicObjectSelection();

    public LaunchGridMove()
    {

    }

    public override void Execute(Schematic schematic)
    {

    Combatant combatant = this.usedObject.GetCombatant(schematic);

    combatant.Battle.BattleMenu.StartGridMoveSelection(null, true, ORK.Battle.System.canCancelAutoGridMove);

    schematic.NodeFinished(this.next);
    }

    }
    }

    Post edited by StevieJay on
  • So still struggling with this! Got it working globally pretty much how I wanted, but with a couple problems that I still can't resolve. I'm using the basic version exactly as above to test and debug, inside an ability that only triggers a schematic with that one node in it.

    1) Movement costs sometimes get applied, and sometimes not - so if the combatant moves multiple times in a turn, often they can use up more movement than should be available.

    2) Sometimes the battle menu doesn't re-open after a move is complete. Also sometimes after the turn end, and a move happened during the turn, then a new turn won't begin.

    I understand if you can't provide support on this, since it's going beyond what's expected for regular use, but if you are able to provide any pointers to how I could try to resolve those issues it'd be much appreciated! :)
  • Instead of calling this via the battle menu, I'd recommend directly starting the grid move selection via ORK.BattleGridSettings.moveCommand.Start function.
    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!
  • Hmmm, so I just tried using ORK.BattleGridSettings.moveCommand.Start as you suggested. The base script is included below.

    It still has exactly the same two problems though - 1) Movement costs are not consistently applied; 2) Sometimes battle menu doesn't reopen.

    Any other ideas?


    using UnityEngine;
    using GamingIsLove.ORKFramework;
    using GamingIsLove.ORKFramework.Components;
    using GamingIsLove.ORKFramework.UI;
    using System.Collections.Generic;
    using GamingIsLove.Makinom;
    using GamingIsLove.Makinom.Schematics;
    using GamingIsLove.Makinom.Schematics.Nodes;
    using GamingIsLove.Makinom.UI;

    namespace GamingIsLove.ORKFramework.Schematics.Nodes
    {

    [EditorHelp("Launch Grid Move", "Launch Grid Move.\n", "")]
    [NodeInfo("Battle/Grid Path")]

    public class LaunchGridMove : BaseSchematicNode
    {

    //[EditorSeparator]
    //[EditorTitleLabel("Combatant")]

    public SchematicObjectSelection usedObject = new SchematicObjectSelection();

    public LaunchGridMove()
    {
    }

    public override void Execute(Schematic schematic)
    {
    Combatant combatant = this.usedObject.GetCombatant(schematic);
    new Runtime(this, schematic, combatant);
    }
    }

    public class Runtime : SchematicRuntimeNode<LaunchGridMove>
    {
    public Runtime(LaunchGridMove settings, Schematic schematic, Combatant combatant) : base(settings, schematic)
    {
    ORK.BattleGridSettings.moveCommand.Start(combatant, null, true, RuntimeEndGridMoveSelection);
    }

    public void RuntimeEndGridMoveSelection(bool accepted)
    {
    schematic.NodeFinished(this.settings.next);
    }
    }
    }
  • Hm, well - I haven't tested it, but I guess firing another action during the action like that somewhat messes up the battle order.
    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 yep - checking the Battle Information on the player in-game I can see that as soon as the Grid Move Action is complete, the Turn, Turn Value and Turn State flip out. Turn State constantly flips between InTurn and BeforeTurn, and Turn and Turn Value both continue increasing constantly.

    I've tried looking inside the "Use Battle Action" node, to see how that handles firing an action within an action. As far as I can tell, it feels like I would need to use the Grid Move Selection to generate the Grid Move Action first. Then I add that Action as a SubAction, just like in Use Battle Action, instead of having it executed directly as it is at the moment.

    Does that make sense??
  • More or less, but that's currently not possible out of the box.
    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.