edited May 2022 in ORK Scripting
Hey hey!

I just updated to version 3.3, and one of my scripts appears no longer to be working. I use the custom node below to change a combatant's battle menu during a battle, but it no longer functions - no errors, just the menu doesn't change. I'm guessing it's linked to the updates to Battle Menu Call?

Can you see anything in the update that would cause this script to no longer work?

Thx! :)

Edit : It appears I'm unable to get Battle Menu overrides to work at all. Even if I go to a combatant, and manually change their Battle Menu through an override on Battle Settings -> Override Settings, I can still only ever see the default Battle Menu.

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);
}
}
}
Post edited by StevieJay on
  • There've been no changes related to this and a combatant's battle menu override works fine on my end.
    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 May 2022
    Hmmm, weird... To give a little more detail, I'm changing the battle menu using "Own Battle Menu", and then "Add Battle Menu" to add a different Turn Based Battle Menu, as shown in this screen shot. This was working fine before I upgraded to 3.3.

    image

    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.

    image

    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).
    Post edited by StevieJay on
  • Yeah, seems like there's an issue with battle system type specific replacements. Though this should also have been an issue in previous versions.

    Next update will fix it.
    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.