Pokemon like Battle system

So, I'm currently working on a Pokemon styled game. I have reached the process of making the first trainer battle (no random encounters yet). I am setting it so that Pokemon are party members, and I cannot get the main character (Mack, your trainer) to leave battles, so only the Pokemon fight, is this possible?
I have an image attached that shows the party in battle, (Butterfree being the enemy) any ideas? Capture.PNG
Depending on how you are doing it, it is very easy. Since it is a training session you are calling the battle. All you need to do is change party members. It's a command in the event.
Depending on how you are doing it, it is very easy. Since it is a training session you are calling the battle. All you need to do is change party members. It's a command in the event.
I tried removing Mack at the begining of a battle and adding him back at the end, but he's added as member 2, so the pokemon leads the party. If you could say how to fix this it would help.
Add Mack at the end of the battle. Then do the following in a script call:

Code:
$game_party.actors.unshift($game_party.actors.pop)
$game_player.refresh
$game_map.need_refresh = true

to move him from the last member to the first member. I haven't tested this, so let us know if you have any issues with it.

To do this, you might need to add this as a new script above Main:

Code:
class Game_Party < Game_Unit
  attr_accessor :actors
end

There are more elegant ways to do it, where you don't open up the class's internal properties to any risk by providing outside access to it.
Add Mack at the end of the battle. Then do the following in a script call:

Code:
$game_party.actors.unshift($game_party.actors.pop)
$game_player.reresh
$game_map.need_refresh = true

to move him from the last member to the first member. I haven't tested this, so let us know if you have any issues with it.

To do this, you might need to add this as a new script above Main:

Code:
class Game_Party < Game_Unit
  attr_accessor :actors
end

There are more elegant ways to do it, where you don't open up the class's internal properties to any risk by providing outside access to it.
Ok thanks. I'll take a look tomorrow (past midnight for me) and if this doesnt work a new idea just came to me, remove the pokemon from the party and the add Mack and then 're add the Pokemon, but I would rather use the script as it would be quicker...
Code:
$game_party.actors.unshift($game_party.actors.pop)
$game_player.reresh
$game_map.need_refresh = true
You mean
Code:
$game_player.refresh
😛
remove the pokemon from the party and the add Mack and then 're add the Pokemon

I would have suggested that, but I didn't know if you'd only have one Pokemon or several. As long as you're only ever going to have two party members, that'd probably be the better way to do it. But the moment you have more than two, or two but you're not certain who the other one is (if you could choose one from several choices), the script solution is better.


You mean
Code:
$game_player.refresh
😛

Fixed.

I'm glad one of us knows what I'm talking about! 😛
I would have suggested that, but I didn't know if you'd only have one Pokemon or several. As long as you're only ever going to have two party members, that'd probably be the better way to do it. But the moment you have more than two, or two but you're not certain who the other one is (if you could choose one from several choices), the script solution is better.




Fixed.

I'm glad one of us knows what I'm talking about! 😛
Well with the matter of more than 1 pokemon, its a bit of a joke game so I will only ever have Magikarp as the game has a bit of a... I can't explain it. You have to play it. When it is done I'll post a link to the Game jolt page 😉

Original thread: https://forums.rpgmakerweb.com/threads/pokemon-like-battle-system.103299/