namespace GamingIsLove.ORKFramework.Schematics.Nodes
{
[EditorHelp("Set Combatant Battle Menu", "Changes the Battle Menu of a combatant.\n", "")]
[NodeInfo("Combatant/Combatant")]
public class SetBattleMenu : BaseSchematicNode
{
[EditorHelp("Battle Menu", "Define the Battle Menu that will be used.")]
public AssetSelection<BattleMenuAsset> newBattleMenu = new AssetSelection<BattleMenuAsset>();
//[EditorSeparator]
//[EditorTitleLabel("Combatant")]
public SchematicObjectSelection usedObject = new SchematicObjectSelection();
public SetBattleMenu()
{
}
public override void Execute(Schematic schematic)
{
Debug.Log("Execute is working");
Combatant combatant = this.usedObject.GetCombatant(schematic);
combatant.Setting.battleMenu.battleSystem[0].battleMenu = newBattleMenu;
schematic.NodeFinished(this.next);
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I can still manage to change the Battle Menu in game if I use "Own Default Menu", as here. However, in this case my script no longer works.
Maybe you can tell me how you're verifying it, so I can see if I can get it working somewhere on my end, and try to find any differences?
Thx
Edit : Looking through the changes in the code, I'm going to make a big guess!! In CombatantBattle.cs, public ActiveBattleMenu BattleMenu - there's a condition that's changed there. Previously it had if(this.battleMenu == null || this.battleMenu.Settings != this.GetBattleMenuSettings()) but this has now changed to only if(this.battleMenu == null) . Could this be causing the Battle Menu not to be updated in some situations where it was previously being updated in 3.2...?
In my own script I was able to fix it by simply adding in a combatant.Battle.ClearBattleMenu() to assign a null battleMenu and force that condition to succeed, leading to the Battle Menu being updated. But I still can't always override the Battle Menu on a combtant manually, as in the example above. I suspect you have a ClearBattleMenu() missing somewhere else!
(Playing around some more, I think that the issue shows when there is an override for a specific Battle System, and the game starts using a different System. When the System changes, I think it's at this point that the Battle Menu override fails to kick in - at least in my current project that's when I appear to see the issue still).
Next update will fix it.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!