The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Aurelia on May 08, 2011, 05:18:06 PM

Title: [SOLVED]A quick script call?
Post by: Aurelia on May 08, 2011, 05:18:06 PM
To store the database ID of the actor who is in slot 1 of the party?


For example, my party consists of B C D A in that order
The actor ID in database:
1. A
2. B
3. C
4. D


In this case, the actor in slot 1 of the party is B, whose corresponding ID is 2
So 2 will be stored into a variable.


Can anyone tell me how to do this? Thanks so much :3
Title: Re: A quick script call?
Post by: modern algebra on May 08, 2011, 05:31:41 PM

actor = $game_party.members[0]
$game_variables[1] = actor.id


Would store the ID of the first actor into variable 1. I split it in two like that since it would otherwise be too long for the script call. If there is no actor in that slot, however, it will return an error, so you may want to place it in a conditional branch which checks if:


$game_party.members.size > 0

Title: Re: A quick script call?
Post by: Aurelia on May 08, 2011, 05:50:19 PM
Totally worked :') This is wicked xD Thankiews ^-^