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

I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.

Forum statistics

Threads
117,002
Messages
1,103,717
Members
152,896
Latest member
LuanGarcia23
Top