RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX/XP] How to swap actors around.

0 Members and 1 Guest are viewing this topic.

*
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Zero to Hero2014 Best IRC Quote2014 Most Missed Member2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Yo, I'm going to show you how to change the order of actors in the party whenever you feel like it. It's pretty dang easy.

You're going to want a common event if you want the player to be able to switch the order around whenever. Set it to parallel process, and set the trigger switch to anything you want, and activate it whenever you want them to be able to switch actors, and turn it off whenever you want it fixed.
Inside the event, place a conditional branch. This branch can be one of two things:
1. The (whatever) button is being pressed
2. Script: Input.trigger?(Input::Whatever)
Note that whatever must be Down, Left, Right, Up, A, B, C, X, Y, Z, L or R. Unless you're using a custom input script; if so just follow the instructions of that.
Inside the branch, use a script command. Have the command say this:
FOR VX
Code: [Select]
id = $game_party.members[0]
$game_party.remove_actor(id)
$game_party.add_actor(id)
FOR XP
Code: [Select]
id = $game_party.actors[0].id
$game_party.remove_actor(id)
$game_party.add_actor(id)
And the actor in the first position will now be in the last position, and all the others will have moved up one position. Why?
When you add an actor to the party, it automatically goes to the last position. When you remove an actor from the party, all others in positions further up than theirs go down. What we did was remove the actor in the first position from the party, then add it so it's at the last index. Why did we use 0 as the index? Because in Game_Party, the members/actors constant is an array, the indexes of which begin at 0.
After that script call, add, in the conditional branch, a wait command of 4-10 frames. This will keep the player from having to guess when to stop pressing the button, because common events run each frame and it's quite difficult to hold down a button for a sixtieth of a second.

It's all pretty dang simple. If anyone has a problem or wants screenshots, just ask.
it's like a metaphor or something i don't know