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,978
Reaction score
2,300
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,978
Reaction score
2,300
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,978
Reaction score
2,300
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

20 festive cards can now be unlocked in BiteMe!

The cards are permanent, but can only be unlocked in December!
Once the year is over, you won't be able to unlock the cards, or to upgrade it.
https://johndoenews.itch.io/biteme-storymodeCard141-160-Ad.png
Finally showing some updates again
I think it's ready - Chapter Selection:
unknown.png
On another more gaming topic, I paid 20 bucks for a visual novel to emotionally destroy me. I may write an entry about that.
1638611395177.png
Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.

Forum statistics

Threads
117,176
Messages
1,105,177
Members
153,293
Latest member
uwaphua
Top