Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Zexion on February 05, 2011, 12:38:18 am

Title: How do I check which actor is the leader?
Post by: Zexion on February 05, 2011, 12:38:18 am
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
Title: Re: How do I check which actor is the leader?
Post by: ForeverZer0 on February 05, 2011, 01:53:27 am
$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.
Title: Re: How do I check which actor is the leader?
Post by: Zexion on February 05, 2011, 11:42:36 pm
Thanks this is exactly what I needed. I haven't tested it, but I'm sure it's good :P
Leveled you :P