Status
Not open for further replies.

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
626
Reaction score
45
First Language
english
Primarily Uses
RMVXA
What do I do to tell where a specific character is in the party if I have an event that has the player choose who to ask a question and the members places might change depending on the party members places.
1651952570847.png
I have the part for the leader taken care of but am having trouble with the other members.
1651952642935.png
Thanks for the help.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,684
Reaction score
9,859
First Language
German
Primarily Uses
RMMV
control variable can give you the actor ID for any party position, it's in the game data section there.
basically use it to get back the actor ID of the actor in party position #2, #3, #4 and so on, then use those answers to work out your event.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
183
First Language
English
Primarily Uses
N/A
It's been a while since I worked in VX Ace.
$game_party.all_members will give you an array of actor data. I believe their position in the party is the same as their index.

$game_party.all_members[0].name would return the name of the first actor in the party.
$game_party.all_members[3].id would return the id number of the fourth actor in the party.

$game_party.all_members.index $game_actors[1]; will give you the index position of Actor1 in the Party. It'll return Nil if the Actor isn't in the party.

Unfortunately, the variable control script box has a character limit, and isn't big enough to type this.
So if you wanted to store the index position as a variable you'd have to use a more manual script call
$game_variables[1] = $game_party.all_members.index $game_actors[1]

or maybe do a conditional branch evaluation
$game_party.all_members.index $game_actors[1] == 0
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,684
Reaction score
9,859
First Language
German
Primarily Uses
RMMV
Unfortunately, the variable control script box has a character limit, and isn't big enough to type this.
that is why I mentioned the game data section.
there is absolutely no need to use any script, the game data section gives the same results without any script use.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
183
First Language
English
Primarily Uses
N/A
that is why I mentioned the game data section.
there is absolutely no need to use any script, the game data section gives the same results without any script use.
The game data doesn't tell you the specific position of a specific character. There's a lot of guess work involved. Is Eric in slot 1? if not; Slot 2? if not; Slot 3....

But with a script you get a straight answer. Eric is in slot 4.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
626
Reaction score
45
First Language
english
Primarily Uses
RMVXA
It's been a while since I worked in VX Ace.
$game_party.all_members will give you an array of actor data. I believe their position in the party is the same as their index.

$game_party.all_members[0].name would return the name of the first actor in the party.
$game_party.all_members[3].id would return the id number of the fourth actor in the party.

$game_party.all_members.index $game_actors[1]; will give you the index position of Actor1 in the Party. It'll return Nil if the Actor isn't in the party.

Unfortunately, the variable control script box has a character limit, and isn't big enough to type this.
So if you wanted to store the index position as a variable you'd have to use a more manual script call
$game_variables[1] = $game_party.all_members.index $game_actors[1]

or maybe do a conditional branch evaluation
$game_party.all_members.index $game_actors[1] == 0
So would it look like this:
person = $game_actors[$game_variables[16]].name
name = $game_actors[$game_variables[16]].face_name
index = $game_actors[$game_variables[16]].face_index
@params = [name, index, 0, 2]
command_101
$game_message.add("")
If not, how would it look? I have that in an event that shows for the leader. Sorry if this is confusing. Would it be easier to use the party.all instead and if so how would I set that up?
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
183
First Language
English
Primarily Uses
N/A
@slickdeath97
If all you care about is getting the portrait and name to match whoever is in \p[1,2,3,4...]
I think that'll work. Like, they're all going to say the same thing anyways?
That's useful so you only need 1 message in the event, rather than unique messages for each potential actor.

However, I kind of assumed that unique responses was the point.
Q: "What is your favorite food?"
Actor1: "Chicken"
Actor2: "Soup"
Actor3: "Chocolate"

Your original question "where a specific character is in the party"
Like, is Actor1 in p1, p2, p3....
Not, does p1 have Actor1, Actor2, Actor3...

So long as the Choices correspond to the Party Index, I think just store the choice number as a variable, then reference Party Index according to that number in a conditional branch.
You can go by .name or .id

$game_party.all_members[$game_variables[1]].name == "Noah"

8p1yTlj.png


So Noah's favorite food is "Chocolate"
Noah could be P1, P2, P3; or Choice1, Choice2, Choice3.
Position and Choice are the same thing.
The player is only going to make 1 choice.
So logically, "if" (condition) [that choice/ that position/ that actor/ that variable].name == "Noah";
*Show Noah's Message*
 
Last edited:

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
626
Reaction score
45
First Language
english
Primarily Uses
RMVXA
@slickdeath97
If all you care about is getting the portrait and name to match whoever is in \p[1,2,3,4...]
I think that'll work. Like, they're all going to say the same thing anyways?
That's useful so you only need 1 message in the event, rather than unique messages for each potential actor.

However, I kind of assumed that unique responses was the point.
Q: "What is your favorite food?"
Actor1: "Chicken"
Actor2: "Soup"
Actor3: "Chocolate"

Your original question "where a specific character is in the party"
Like, is Actor1 in p1, p2, p3....
Not, does p1 have Actor1, Actor2, Actor3...

So long as the Choices correspond to the Party Index, I think just store the choice number as a variable, then reference Party Index according to that number in a conditional branch.
You can go by .name or .id

$game_party.all_members[$game_variables[1]].name == "Noah"

8p1yTlj.png


So Noah's favorite food is "Chocolate"
Noah could be P1, P2, P3; or Choice1, Choice2, Choice3.
Position and Choice are the same thing.
The player is only going to make 1 choice.
So logically, "if" (condition) [that choice/ that position/ that actor/ that variable].name == "Noah";
*Show Noah's Message*
Ok. So I am trying to set it up, but am still a bit confused. What if the player changes where the characters are in the party?
1652098917694.png
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
183
First Language
English
Primarily Uses
N/A
In my example the only thing that choices do, is set Variable 1
to a simple number: 1, 2, 3...

The event process moves on to the conditional branches. It's only going to display the branch that's true. These are not nested inside the Show Choice branches, btw.

Putting the statement into plain words:
If "noah" is the name of Party Member #[Variable 1: Player's Choice]
Noah might not even be in the party. He could be the leader, he could be anywhere in the party index. We don't know what the Player's Choice will be. But when it is this, the event will process the commands of this branch.

Oh. When we're dealing with indexes the first Item is Index 0. Index 1 is the second...and so on.
So if it helps, you can rename the variable from "Choice" = 1; to something like "Party Index" = 1

If \p2; "Party Index" = 1
if \p3; "Party Index" = 2
if \p2; "Party Index" = 3

The leader \p1 would be Party Index 0.
I guess it's possible you might use some script that flags the "leader" as someone other than Party Index[0]. That would definitely throw a wrench in the works. :eswt:

The other thing to consider is that Game Variables have a default value of 0.
So you might want to end the event process if the player hits "Cancel".
If "Noah" was the party leader, the conditional branch statement: Party Member #[0] == "Noah"; would be true. The message with Noah's response would display, which maybe you don't want if the Player hit cancel and didn't make a selection.
 

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
626
Reaction score
45
First Language
english
Primarily Uses
RMVXA
In my example the only thing that choices do, is set Variable 1
to a simple number: 1, 2, 3...

The event process moves on to the conditional branches. It's only going to display the branch that's true. These are not nested inside the Show Choice branches, btw.

Putting the statement into plain words:
If "noah" is the name of Party Member #[Variable 1: Player's Choice]
Noah might not even be in the party. He could be the leader, he could be anywhere in the party index. We don't know what the Player's Choice will be. But when it is this, the event will process the commands of this branch.

Oh. When we're dealing with indexes the first Item is Index 0. Index 1 is the second...and so on.
So if it helps, you can rename the variable from "Choice" = 1; to something like "Party Index" = 1

If \p2; "Party Index" = 1
if \p3; "Party Index" = 2
if \p2; "Party Index" = 3

The leader \p1 would be Party Index 0.
I guess it's possible you might use some script that flags the "leader" as someone other than Party Index[0]. That would definitely throw a wrench in the works. :eswt:

The other thing to consider is that Game Variables have a default value of 0.
So you might want to end the event process if the player hits "Cancel".
If "Noah" was the party leader, the conditional branch statement: Party Member #[0] == "Noah"; would be true. The message with Noah's response would display, which maybe you don't want if the Player hit cancel and didn't make a selection.
Ok. So I am still confused, but I am trying it this way.
1652193161703.png
I have the variable part slightly set up, but am still confused about the rest of it.
 

coyotecraft

Mythographer
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
183
First Language
English
Primarily Uses
N/A
@slickdeath97
Maybe what you need is labels. You know, normally the event process moves down the list of event commands. But you can use labels (ideally in show choice) to tell the process to jump back to an early point in the event, or jump forward to the end of event list.


Code:
When [Yes]
    "Which Question?"
        [why?]
            set: <Party Choice var>
            Jump to Label: why
        [how?]
            set: <Party Choice var>
            Jump to Label: how
        [who?]
            set: <Party Choice var>
            Jump to Label: who
When [No]
        *End Event Process*
Jump to Label (end)    

    Label: why
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: how
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: who
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: end
 
Last edited:

slickdeath97

Veteran
Veteran
Joined
Feb 26, 2019
Messages
626
Reaction score
45
First Language
english
Primarily Uses
RMVXA
@slickdeath97
Maybe what you need is labels. You know, normally the event process moves down the list of event commands. But you can use labels (ideally in show choice) to tell the process to jump back to an early point in the event, or jump forward to the end of event list.


Code:
When [Yes]
    "Which Question?"
        [why?]
            set: <Party Choice var>
            Jump to Label: why
        [how?]
            set: <Party Choice var>
            Jump to Label: how
        [who?]
            set: <Party Choice var>
            Jump to Label: who
When [No]
        *End Event Process*
Jump to Label (end)   

    Label: why
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: how
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: who
        //Conditional Branch responses
            if <Party Choice var> == character
                "Answer"
            if <Party Choice var> == other character
                "Different Answer"
            Jump to Label (end)
    Label: end
Has been a minute. I tried this and it worked! Thanks for the help. This was the end result:
1652841014693.png
1652841035595.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,803
Reaction score
2,865
First Language
EN
Primarily Uses
RMMZ

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.
More words of wisdom: Trying to make everyone happy will just make you miserable.

Forum statistics

Threads
124,385
Messages
1,163,262
Members
163,186
Latest member
Khai2729
Top