MZ help with HUD Maker Ultra error "cannot read property 'active' of undefined"

i wish this plugin was still maintained
not sure whether i actually made a typo or is this a bug/compatibility issue with another plugin

Spoiler: The custom condition
Screenshot 2024-02-29 185018.png
what's happening is i'm trying to set a custom condition so a hud component appears when Actor command window is active. code is supposed to be correct, i've checked in the consoles. but whenever i would start a battle this error would pop up. also tried ending it with a "isOpenAndActive" also same error.

Spoiler
Screenshot 2024-02-29 185658.png
so does anyone know what could be happening here? or maybe an alternate way to check for when the actor command window is active

and another thing after testing, if i input the code and then reload hud maker while in battle, this error doesnt show up. it only ever shows up when i initiate a battle and not while im already in battle
first, your title wrote the most important part of the error message wrong. It is missing the 'of', and the important part of the error is 'of undefined'

It is not the 'active' that is undefined but the parent object of 'active'
which means '_actorCommandWindow' is undefined.

where did you get that label from?
first, your title wrote the most important part of the error message wrong. It is missing the 'of', and the important part of the error is 'of undefined'

It is not the 'active' that is undefined but the parent object of 'active'
which means '_actorCommandWindow' is undefined.

where did you get that label from?
it's straight from the console
Spoiler
Screenshot 2024-02-29 202030.png
whenever an actor command window is active/in use that will return true afaik
then you're using it in the wrong context.
not every variable is global, and not every object can be accessed from anywhere.

so it seems to be that the object is undefined at the context where you're trying to use it.

the console is not the code, so where in the code is that object defined and where in the code are you trying to use it?
then you're using it in the wrong context.
not every variable is global, and not every object can be accessed from anywhere.

so it seems to be that the object is undefined at the context where you're trying to use it.

the console is not the code, so where in the code is that object defined and where in the code are you trying to use it?
you can see in my first screenshot, it's just checking for a true or false, and i'm sure it's not in the wrong context. the error only happens when it's initiating battles. when in the battle itself the check works proper

here, i found a thread that is succesful using this same label. hence my confusion on why it's turning up an error
https://forums.rpgmakerweb.com/inde...rently-active-in-battle-srd-hud-maker.160361/
I imagine it is a plugin conflict. By default the battle scene does have an _actorCommandWindow, but perhaps another plugin has renamed it or removed/delayed its addition to the scene.

Maybe try this instead?
JavaScript:
return SceneManager._scene._actorCommandWindow?.isOpenAndActive();
This uses the optional chaining operator (?.) as an early-exit in case _actorCommandWindow is nullish (e.g. undefined).
I imagine it is a plugin conflict. By default the battle scene does have an _actorCommandWindow, but perhaps another plugin has renamed it or removed/delayed its addition to the scene.

Maybe try this instead?
JavaScript:
return SceneManager._scene._actorCommandWindow?.isOpenAndActive();
This uses the optional chaining operator (?.) as an early-exit in case _actorCommandWindow is nullish (e.g. undefined).
Yeap, this worked! something new to learn i suppose
thank you caethryl!

btw i love your plugins <3

Original thread: https://forums.rpgmakerweb.com/threads/help-with-hud-maker-ultra-error-cannot-read-property-active-of-undefined.166302/