MV looking for specific battle script calls as conditions for SRD HUD maker

figured id ask here since its very related to scripts themeselves.

ive been having trouble these past days trying to find the correct script calls to place in the condition box of SRD's HUD maker pluggin.

Been trying to have several pictures act as part of the UI of the battle screen depending on wich current option is being highlighted in the battle command window

aka, this one.
1678567747736.png

essentially what im trying to look for is the script call when the options Attack, Skills, Items, Guard or Run are being HIGHLIGHTED/hovered over.

ive already looked far and wide but nothing like this has been solved as far ive seen and also tried to mess with various script calls myself to see if they worked, including stuff like:

Window_ActorCommand
Yanfly.BEC.Scene_Battle_commandSkill
Scene_Battle.prototype.commandAttack.

with the only one that ive found to sorta work being this one in the excell spreadsheet of mv's and mz's script calls.
1678568243327.png

the only thing this does so far is just make the pictures disappear when the battle is being played out after choosing what actions to do, so it sorta works and i feel i may just be missing another bit of this to make it fully work.

if anyone knows the answer or can help in any way to find these id be really grateful, since its quite literally the only missing element to complete my battle HUD so i can move to work on other elements of the game.

thank you.
most command menu have "index" being top one is index 0.
if it has 5 indexes, it has 0, 1, 2, 3, 4 to use (some can modify this
to have more or less).

like actor 1 have 7 indexes where actor 2 only 4.
if each actor is equal in the indexes, it is a bit easier, specially if you have it
command based.

I believe MOGHunter has an images based on those battle commands,
but I cannot help you directly to look into it, but I might be later on.
most command menu have "index" being top one is index 0.
if it has 5 indexes, it has 0, 1, 2, 3, 4 to use (some can modify this
to have more or less).

like actor 1 have 7 indexes where actor 2 only 4.
if each actor is equal in the indexes, it is a bit easier, specially if you have it
command based.
yeah, luckly all of my actors will use the same 5 indexes, so hopefully it should easily apply to all of them, i tried including a number inside the script call but that hasnt worked out so far.

I believe MOGHunter has an images based on those battle commands,
but I cannot help you directly to look into it, but I might be later on.
ill look into it and see if i can find it, and if so ill put it in here, thanks.
you can also try to target the symbol of the command.
if you look into the menu command, it has "item", "equip" etc,
similair should be for the for battle command, but I got low time
to look into it for what could work or not, as I need to build it as well.

but for now, battle commands or the entire layout is on low priority.
otherwise, I already had the calls required.

I just got the mapHUD ready and polish it as well, but I think you
can figure out, maybe someone that knows the battle commands
can give you some more direct solution or a way to look into.
That's the actor command window, which can be fetched as:

SceneManager._scene._actorCommandWindow

To get the index of the selected command in that window:

SceneManager._scene._actorCommandWindow.index()
E.g. "is the first command (index 0) selected?"

SceneManager._scene._actorCommandWindow.index() === 0

To get the symbol of the selected command:

SceneManager._scene._actorCommandWindow.currentSymbol()
By default the actor command symbols are:
  • "attack"
  • "skill"
  • "guard"
  • "item"
So "is the Attack command selected right now" would be:

SceneManager._scene._actorCommandWindow.currentSymbol() === "attack"

For Skill commands, you can fetch the associated Skill Type ID like this:

SceneManager._scene._actorCommandWindow.currentExt()
E.g. is the command for Skill Type ID 3 selected?

SceneManager._scene._actorCommandWindow.currentSymbol() === "skill" && SceneManager._scene._actorCommandWindow.currentExt() === 3
That's the actor command window, which can be fetched as:

SceneManager._scene._actorCommandWindow


To get the index of the selected command in that window:

SceneManager._scene._actorCommandWindow.index()

E.g. "is the first command (index 0) selected?"

SceneManager._scene._actorCommandWindow.index() === 0


To get the symbol of the selected command:

SceneManager._scene._actorCommandWindow.currentSymbol()

By default the actor command symbols are:
  • "attack"
  • "skill"
  • "guard"
  • "item"
So "is the Attack command selected right now" would be:

SceneManager._scene._actorCommandWindow.currentSymbol() === "attack"


For Skill commands, you can fetch the associated Skill Type ID like this:

SceneManager._scene._actorCommandWindow.currentExt()

E.g. is the command for Skill Type ID 3 selected?

SceneManager._scene._actorCommandWindow.currentSymbol() === "skill" && SceneManager._scene._actorCommandWindow.currentExt() === 3

oh my god this worked, thank you so much!

i seriously cant even begin to thank you enough for this, been stumpt on it for quite long while, i really appreciate it, i can now begin workin on the other elements of the game.

YEAH.gif


not only that but the other code provided might help add some extra flair to some stuff.

seriously thank you.
That's the actor command window, which can be fetched as:

SceneManager._scene._actorCommandWindow


To get the index of the selected command in that window:

SceneManager._scene._actorCommandWindow.index()

E.g. "is the first command (index 0) selected?"

SceneManager._scene._actorCommandWindow.index() === 0


To get the symbol of the selected command:

SceneManager._scene._actorCommandWindow.currentSymbol()

By default the actor command symbols are:
  • "attack"
  • "skill"
  • "guard"
  • "item"
So "is the Attack command selected right now" would be:

SceneManager._scene._actorCommandWindow.currentSymbol() === "attack"


For Skill commands, you can fetch the associated Skill Type ID like this:

SceneManager._scene._actorCommandWindow.currentExt()

E.g. is the command for Skill Type ID 3 selected?

SceneManager._scene._actorCommandWindow.currentSymbol() === "skill" && SceneManager._scene._actorCommandWindow.currentExt() === 3


I'm having the exact same issue
how would you write the script as condition for this to work with RMMZ ?

Capture d’écran, le 2023-08-13 à 16.06.57.png


Thank you
I'm having the exact same issue
how would you write the script as condition for this to work with RMMZ ?
Did you try it? It's not different.
Did you try it? It's not different.

I did yeah

rmmz_managers.js:2036 TypeError: Cannot read property 'index' of undefined

:/
Please paste exactly what you put into your script box and tell us exactly what you're trying to do.

caethyril provided the code to do several things, so you saying "I'm having the exact same issue" doesn't tell us much.
Please paste exactly what you put into your script box and tell us exactly what you're trying to do.

caethyril provided the code to do several things, so you saying "I'm having the exact same issue" doesn't tell us much.

so I'm having the same issue in that I'm also looking for a script call to act as condition in HUD Maker when options in the Actor Commands window are HIGHLIGHTED/hovered over

specifically I fail to get the index of the selected command in that window to work in code check ;

Capture d’écran, le 2023-08-13 à 19.48.25.png


= TypeError : Cannot read property 'index' of undefined
It's probably crashing because you don't include any check for that window to even be on the screen, so the HUD is trying to check it as soon as you get into battle but it's not there.

Change it to:
Code:
return SceneManager._scene._actorCommandWindow?.index()==0;
It's probably crashing because you don't include any check for that window to even be on the screen, so the HUD is trying to check it as soon as you get into battle but it's not there.

Change it to:
Code:
return SceneManager._scene._actorCommandWindow?.index()==0;

That is exactly what I was looking for.

I truly appreciate the knowledge you guys are sharing here. Please forgive the poor phrasing of my original post and accept my gratitude.

Cheers.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-specific-battle-script-calls-as-conditions-for-srd-hud-maker.155719/