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!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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);
}
}
}
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! :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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);
}
}
}
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
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??
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!