Get party member n°x's actor ID and store it in a variable

Newquaza 96

Veteran
Veteran
Joined
Sep 5, 2014
Messages
35
Reaction score
6
First Language
Italian
Primarily Uses
In my RPG Maker MV game, certain events require the player to choose one party member to interact with something.
For that reason, i have managed to make a multiple choice system that checks for the number of alive party members and gives a number of choices based on that. (if all 4 party members are alive, the game will display 4 choices, if 3 party members are alive, the game will display 3 choices, and so on)
For that purpose, i have made it so one variable is used to store the position in the party of the selected party member. However, i now find myself in need to translate the number of the position in the party of an actor to that actor's actual ID.
Basically, if i chose the actor who is in spot n°2 in the party, i need to make it so a variable is set to the actor ID of the actor who is in spot n°2.
With my limited knowledge of Javascript, i tried many different things and i also tried googling the answer, but i didn't get exactly what i was looking for.
This is what i was trying to work with up until now
$gameVariables.setValue(15, $gameParty.members($gameVariables.value(18)));
I thought this would make it so Variable 15 would be set to become the ID of the actor in the position relative to Variable 18, but it obviously doesn't work.
I tried using
$gameParty.members()[$gameVariables.value(18)].Id()
and other variations of that, since i have an extremely limited knowledge of Javascript and i can't find a list of all the terminology/syntax for RPG Maker MV anywhere. The thing is that i really don't know what to write in order to get the ID of the actor in spot n°x of the party (where x is the value of a variable).
Thank you very much in advance, and sorry if i was confusing. I hope i'm posting in the right section.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,541
Reaction score
6,874
First Language
German
Primarily Uses
RMMV
there is absolutely no need for scripts here - that is one of the most basic functions of the control variable command.

Just use the control variable command and switch the game data section from "map ID" to "Party member x's ID" (where you select which party members ID you want)
 

Newquaza 96

Veteran
Veteran
Joined
Sep 5, 2014
Messages
35
Reaction score
6
First Language
Italian
Primarily Uses
Oh my lord. I didn't even notice.
Thank you SO much. This helps out a ton.
I suppose this thread can be closed, then? Sorry for the super silly question.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

My sister is a saint. Specifically Saint Peter. Because shes my best friend until other ppl are around then shes all "nope, dont know him, dont like him."
Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:

Forum statistics

Threads
95,698
Messages
931,109
Members
126,043
Latest member
rpgteck
Top