(SCRIPT REQUEST) COMBINING ACTOR WITH VARIABLE / SWITCH PARTY MEMBERS
Posts
Pages:
1
Hi everyone, I am working on a RPG maker VX ACE project in which you can choose to switch party members. You can change two party members.
For example:
Ella
Meredith
are not in the team, but Princess Plum and Mitzie are. Let's say the order of the party is like this: Player (You \P), Mitzie (\P) and then last Plum (\P).
Now when you want to switch party members, the game lets you choose between P (Mitzie) and P (Plum). And here is the problem: I made a script that has a conditional branch "Is actor in the party.", but I made one for each party member (see screenshot).
Which means if you want to remove Mitzie, but Plum's script is ahead in line, it will remove Plum, since the conditional branch is true (Plum is also in the party).
Is there a possibility to have a script like "is actor equal to party member (that you selected)" so you can avoid this? This is very important for my game... If I am not clear or if you need more screenshots, just ask! :)
Thanks a lot!
Myrthe
(I know nothing about Ruby.. so I messed a bit around and came up with this:
@actor_id==battle_members_id (If you selected party member 1 aka Mitzie in the example. I didn't work tho..)

For example:
Ella
Meredith
are not in the team, but Princess Plum and Mitzie are. Let's say the order of the party is like this: Player (You \P), Mitzie (\P) and then last Plum (\P).
Now when you want to switch party members, the game lets you choose between P (Mitzie) and P (Plum). And here is the problem: I made a script that has a conditional branch "Is actor in the party.", but I made one for each party member (see screenshot).
Which means if you want to remove Mitzie, but Plum's script is ahead in line, it will remove Plum, since the conditional branch is true (Plum is also in the party).
Is there a possibility to have a script like "is actor equal to party member (that you selected)" so you can avoid this? This is very important for my game... If I am not clear or if you need more screenshots, just ask! :)
Thanks a lot!
Myrthe
(I know nothing about Ruby.. so I messed a bit around and came up with this:
@actor_id==battle_members_id (If you selected party member 1 aka Mitzie in the example. I didn't work tho..)

This isn't scripting or ruby, this is eventing:
Make a common event that can be called when you want it to be.
Check if actor is in party =
If Yes
Fadeout screen
Remove that actor
Add actor
Transport player
Fadein screen
If No
Do the same except change to the actor that is not in the condition.
If you want this to teleport to anywhere and not a specific spot you need to keep track of each actor using variables. If only used in certain locations than its pretty easy to set up.
I did this in my game, somehow. Wait, I'll have screens up in a while...
Anyways, I had two characters whose positions will exchange when you press a button. Like who's in front will exchange with the one behind him/her (you know what I'm talking about, right?).
I used Add/Remove Party Member to change their positions, and bound the 'Position Change' to a self-switch-based conditional branch. So you bind the Actors to switches, or in your case variables.
e1> From what I understand, you only have to place the conditional branch beneath each respective choice. Then have a variable get the Actor ID of each member, and decide what the text in the choices will be.
Don't fret, I'll have screens soon enough :D
e2> Here you go!
This is Page One of the event that handles the party-switching function.
e3> Aaaaand here's the 'Add Actor' portion. It only looks complicated, but it's actually quite simple.

So basically: It just checks who isn't already in the party, and wasn't recently removed, and adds the said actor.
Since there are only four Actors, it can be easily determined by process of elimination. So at the start, I use variables to detect who are the current members of the party. The ID of the removed Actor was retrieved in Page 1 (see previous screenshot). Using these info, I nest multiple conditional branches to single out one out of the four actors, and then add that actor to the party.
Here, I'll assume that the removed Actor is Actor 1 (Eric). With that as a start, I check the Actor ID's of the remaining Actors (Possibly: Actor 2, Actor 3, or Actor 4). The Actor ID that is not equal to either of the Member ID's, is the Actor to be added.
That's all, I guess.
This is Page Two of the same event, with "Self-Switch A is ON" as its condition and set to "Autorun".
Hope I helped :)
Anyways, I had two characters whose positions will exchange when you press a button. Like who's in front will exchange with the one behind him/her (you know what I'm talking about, right?).
I used Add/Remove Party Member to change their positions, and bound the 'Position Change' to a self-switch-based conditional branch. So you bind the Actors to switches, or in your case variables.
e1> From what I understand, you only have to place the conditional branch beneath each respective choice. Then have a variable get the Actor ID of each member, and decide what the text in the choices will be.
Don't fret, I'll have screens soon enough :D
e2> Here you go!
In my example, you can only have three out of four actors in your party at a time.
These actors are: 1-Eric, 2-Natalie, 3-Terence, and 4-Ernest.

/P{n} displays the name of party member 'n'
With this, the names on the choices will change depending on who's on your party currently.
The variable checks the actor ID of member1/member2/member3, and is used to retrieve info on who is removed from the party.
The pattern is then repeated for the other choices.
If anything's unclear, ask away!
These actors are: 1-Eric, 2-Natalie, 3-Terence, and 4-Ernest.

/P{n} displays the name of party member 'n'
With this, the names on the choices will change depending on who's on your party currently.
The variable checks the actor ID of member1/member2/member3, and is used to retrieve info on who is removed from the party.
The pattern is then repeated for the other choices.
If anything's unclear, ask away!
This is Page One of the event that handles the party-switching function.
e3> Aaaaand here's the 'Add Actor' portion. It only looks complicated, but it's actually quite simple.

So basically: It just checks who isn't already in the party, and wasn't recently removed, and adds the said actor.
Since there are only four Actors, it can be easily determined by process of elimination. So at the start, I use variables to detect who are the current members of the party. The ID of the removed Actor was retrieved in Page 1 (see previous screenshot). Using these info, I nest multiple conditional branches to single out one out of the four actors, and then add that actor to the party.
Here, I'll assume that the removed Actor is Actor 1 (Eric). With that as a start, I check the Actor ID's of the remaining Actors (Possibly: Actor 2, Actor 3, or Actor 4). The Actor ID that is not equal to either of the Member ID's, is the Actor to be added.
That's all, I guess.
This is Page Two of the same event, with "Self-Switch A is ON" as its condition and set to "Autorun".
Hope I helped :)
Ah, thank you :D We meet again!
It helped a lot, thank you :D It looks complicated, but I'm sure I can use it!
Topic can be closed now :3
It helped a lot, thank you :D It looks complicated, but I'm sure I can use it!
Topic can be closed now :3
author=karins_soulkeeper
I did this in my game, somehow. Wait, I'll have screens up in a while...
Anyways, I had two characters whose positions will exchange when you press a button. Like who's in front will exchange with the one behind him/her (you know what I'm talking about, right?).
I used Add/Remove Party Member to change their positions, and bound the 'Position Change' to a self-switch-based conditional branch. So you bind the Actors to switches, or in your case variables.
e1> From what I understand, you only have to place the conditional branch beneath each respective choice. Then have a variable get the Actor ID of each member, and decide what the text in the choices will be.
Don't fret, I'll have screens soon enough :D
e2> Here you go!In my example, you can only have three out of four actors in your party at a time.
These actors are: 1-Eric, 2-Natalie, 3-Terence, and 4-Ernest.
/P{n} displays the name of party member 'n'
With this, the names on the choices will change depending on who's on your party currently.
The variable checks the actor ID of member1/member2/member3, and is used to retrieve info on who is removed from the party.
The pattern is then repeated for the other choices.
If anything's unclear, ask away!
This is Page One of the event that handles the party-switching function.
e3> Aaaaand here's the 'Add Actor' portion. It only looks complicated, but it's actually quite simple.
So basically: It just checks who isn't already in the party, and wasn't recently removed, and adds the said actor.
Since there are only four Actors, it can be easily determined by process of elimination. So at the start, I use variables to detect who are the current members of the party. The ID of the removed Actor was retrieved in Page 1 (see previous screenshot). Using these info, I nest multiple conditional branches to single out one out of the four actors, and then add that actor to the party.
Here, I'll assume that the removed Actor is Actor 1 (Eric). With that as a start, I check the Actor ID's of the remaining Actors (Possibly: Actor 2, Actor 3, or Actor 4). The Actor ID that is not equal to either of the Member ID's, is the Actor to be added.
That's all, I guess.
This is Page Two of the same event, with "Self-Switch A is ON" as its condition and set to "Autorun".
Hope I helped :)
Pages:
1














