CHARACTER SWITCH HELP (I'M A COMPLETE N00B)

Posts

Pages: 1
As said in the title I am an absolute newbie at this. I've done some stuff, messed around with a couple things but all in all I'm completely new.

For our final project at school my partner and I are making an RPG video game.
One of the key elements we need in the game is for the user to switch between two actors using the space bar.

I've made two common events, each one removes an actor from the party and adds the actor I wish to switch to.
After I did that I made those common events into the corresponding actors skills.
It switches between characters just fine but you have to go under the x button than go to skills then press on the skill for the character to change. I just want to make it to where all you have to do is press the space bar for the characters to change.

I hope I explained this all right.

(Side note: I know what scripts are I just have no clue how to use them if I were to have to use them in this scenario.
This can very easily be done with a script (not sure if you can do it without one though). First, what version of RPG Maker are you using?
If you are using 2K3 or 2K,do somewhat like people do with running. Also, you can't do Spacebar in 2k3 or 2k, so it must be something else. Make it so when a switch is turned on by pressing a key, the character switches, using the run with shift key idea, well, if you use 2k3 or 2k.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
No need for scripts. This can be done with one or two event commands.

First, make the common events both parallel processes. Then...

In RPG Maker 2003: Use the Key Input Processing to detect when the decision key is pressed and set a variable equal to the key being pressed. Then use a conditional branch to check if that variable is equal to 5.

In RPG Maker XP, VX, and VX Ace: Use a conditional branch to check if the C button is being pressed.

Whichever version you're using, you now have a conditional branch that checks if the player is hitting the space bar. Put your event commands that switch the character inside that conditional branch.
I'm using VX Ace (sorry I didn't include that with the information)
I'm trying to figure out this conditional branches magic that we have going on here.

In the mean time could anyone reference me to a script that could change a character by pressing a button such as C, V, or B (or the spacebar?)
You learn something new every day here... I never thought of using conditional branches like that. Anyway, I'll elaborate on how to do that.

Start by making a common event called "Character Switch" or something like that. Make the Trigger a parallel process. For the switch, use one that will only be on when character switching is available. If at any time you want to disable the char switching, simply turn off that switch.

Now, add a conditional branch. Select button on page 4 and then choose whatever key you want to use as the char switch button. Just for this example, I'll use "C" but you can choose whichever one you want. I don't think there's any way to use spacebar though, sorry. =(

What conditional branch does is it looks at whatever data you enter as its condition, and if that data is true then it does one thing. If it isn't true, it does another. So basically what we've done is made a common event where if C is being held down, it does one thing, and if C is NOT being held down then it will do another thing. Since we don't want anything to happen when C is not being held down, we're not going to edit the "Else" section of the conditional branch, only the first section which occurs when the data is true (in this case the C button being pressed).

Now we need to identify which character we're switching out. Add another conditional branch inside the one we just made. Go to page 4 in the conditional branch box and select "Script," then enter this and hit okay:

$game_party.leader.id == 1

The line of code we entered means that "actor 1 is the party leader." So, under the true section of the conditional branch, remove actor 1 and then add actor 2. This is optional, but if you still want to be able to see actor 1 in your party after switching them, simply add another line adding actor 1 again.

Now, the "Else" section here implies that actor 1 is NOT the party leader, meaning actor 2 is. Simply do the same thing as above, except reversed so that actor 1 ends up being the lead again.

Hope that helps. If you need any more help, just let us know. Here's an image of what your common event should look like when its finished:

http://gyazo.com/82c51fcd9c92632cd8394cf79ae8a6e6

Once you learn conditional branches, RPG Maker gets a lot easier to use.
This was extremely helpful, thank you very much!
And thank you tremendously for taking the time to write all that.
Pages: 1