How do I check which actor is the leader?

Started by Zexion, February 05, 2011, 12:38:18 am

Previous topic - Next topic

Zexion

Im trying to make an evented HUD for the player's Hp, and I want it to have a picture of the lead character (A.K.A The player). The problem is, I will be letting the player shift through different characters. So, what can I call to make the character sprite change.

Ex:
If Script:....................Actor1........... 
@Show picture: Actor1_Hud

If Script:....................Actor2...........
@Show picture: Actor2_Hud

ForeverZer0

$game_party.actors[0]


This will always reference the party leader. From here you can get the name, ID, or whatever info you need.

If your checking if a particular actor is the party leader, in a conditional branch, using a script as a condition, use something like this:

$game_party.actors[0].id == ID_OF_ACTOR


This will result in a true/false if the actor ID you defined is the party leader.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Zexion

Thanks this is exactly what I needed. I haven't tested it, but I'm sure it's good :P
Leveled you :P