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,957
Reaction score
2,292
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,957
Reaction score
2,292
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,957
Reaction score
2,292
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

spillycup wrote on Finnuval's profile.
i love u so much! i’m so happy you’re in my life right now :kaocry:
To my horror, I found out I got zero Jack Vance books in my bookshelf! :kaoback: Where do y'all go in the internet to buy used books? Like, not Amazon?
Marquise* wrote on Mrs_Allykat's profile.
Your new logo is sooooo attractive! Feels like those sour liquid candy mixed with the wrapping of the popping candy rocks ones. ^^ It gives flavor and taste to our eyes. ^^
Sorry I couldn't comment before, I relogged here for someone's B-Day yesterday. ((Yeah yeah... been scared got on the throne and all as usual. Being social seems harder than walking now. So sorry to everyone and especially you.))
How goes the game make?

Forum statistics

Threads
116,991
Messages
1,103,613
Members
152,873
Latest member
Applegreed
Top