Script call for checking which character is being selected?

Pearsona

Trash Goblin
Veteran
Joined
Nov 12, 2013
Messages
101
Reaction score
52
First Language
English
Primarily Uses
RMMV
Hiya! I'm currently making a new HUD for battles (and later menus as well) using SRD's supertools, and I need a way to check which actor is being selected for their turn so I can add an indicator so the player can tell who's turn it is.

My current idea is to have an arrow animation above every party slot and a 'condition' checking who is being selected and triggering the arrow to appear.

But, well, I can't figure out what script call to put in the 'conditions'. I think it might be "BattleManager.actor()", but I can't figure out how exactly to set that up or if that's even right. What script corresponds to checking whether it's a character's turn or not?

(Putting this here instead of plugin support because technically the part I'm confused about is part of the base MV engine, it's just that the context of the supertools may help you all understand the issue better)
 

Pearsona

Trash Goblin
Veteran
Joined
Nov 12, 2013
Messages
101
Reaction score
52
First Language
English
Primarily Uses
RMMV
Additional info since I found some solutions that don't quite work for me: My game will have a party that (aside from the main character) can be altered at the player's will. I found a solution but it only works for specific actor IDs, while I'd like to access characters currently in the active party based on their actor order.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,967
Reaction score
2,295
First Language
EN
Primarily Uses
RMMZ
Maybe something like:
  • BattleManager.actor().index() === 0
I.e. "is the index of the currently-inputting actor equal to 0?" The party leader is index 0, the next member is index 1, etc.

[Edit: see follow-up post.]
 
Last edited:

Pearsona

Trash Goblin
Veteran
Joined
Nov 12, 2013
Messages
101
Reaction score
52
First Language
English
Primarily Uses
RMMV
Maybe something like:
  • BattleManager.actor().index() === 0
I.e. "is the index of the currently-inputting actor equal to 0?" The party leader is index 0, the next member is index 1, etc.
Well... weirdly enough, despite the fact that it seems to work, I keep getting error messages like 'there's an error with "BattleManager.actor().index() === 0", press f8 to see more!' but then the battle continues as normal, functioning roughly how I want it to, but error messages pop up every time I start or end a turn.

Wait, I disabled Yanfly's Battle Engine Core and now the errors have stopped but... I need that plugin for other things D: Does anyone know how to sort out this compatibility issue?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,967
Reaction score
2,295
First Language
EN
Primarily Uses
RMMZ
Oh, whoops. :kaoswt2:

I'm guessing the error occurs when there is no actor inputting. Try this instead?
  • BattleManager.actor() ? BattleManager.actor().index() === 0 : false
I.e. "if there is an actor inputting, return true iff their index equals 0; else return false".
 

Pearsona

Trash Goblin
Veteran
Joined
Nov 12, 2013
Messages
101
Reaction score
52
First Language
English
Primarily Uses
RMMV
Oh, whoops. :kaoswt2:

I'm guessing the error occurs when there is no actor inputting. Try this instead?
  • BattleManager.actor() ? BattleManager.actor().index() === 0 : false
I.e. "if there is an actor inputting, return true iff their index equals 0; else return false".
IT WORKS!!! Thank you so much!!!

If you wouldn't mind, could I ask how to do this with the status menu? Just because I know I'm gonna need to know soon enough and I wouldn't want to bother the forums more than necessary ^^'
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,967
Reaction score
2,295
First Language
EN
Primarily Uses
RMMZ
Yay! :kaojoy:
If you wouldn't mind, could I ask how to do this with the status menu?
Without plugins, when selecting an actor as a target in battle, it shows a Window_BattleActor instance (looks like the battle status window, but behaves differently). I'm guessing that's the window you mean? If so, you could try a condition like this:
  • SceneManager._scene._actorWindow ? SceneManager._scene._actorWindow.index() === 0 : false
Looks like this might also work on the item scene (pause menu -> inventory) since the target window is given the same identifier there.
 

Latest Threads

Latest Posts

Latest Profile Posts

There are so many coding terms that are complete gibberish to me. Like what the heck is "Return" or "Array"??
Sometimes I forget how tiny and fun working in 16x16 is (or with 18x18 if ya counting the white outline LOL) and before you ask Yes. Yes this is an appropriate ratio of drinks to all the other stuff. :popcorn:
f37ac128dedc8a53af7deb2b12e8ea81becf6e46.png
Phew, sleep all day, awake all night. I don't know what to draw tonight!

Does that count as poetry? ..Is there a super fast way to test my creations in RPG Maker? Has anyone played the new Pokémon games? I'm itching to buy it but I don't think my husband will want me to after he finds out how much I spent on Christmas!
When can we get this?
RPG Maker MZ Saturn.png
Saturn port when?
I'm new to rpgmaker mv, link me some good stuff to learn.

Forum statistics

Threads
117,071
Messages
1,104,311
Members
153,052
Latest member
HaxDotCombo
Top