Solved - Pokémon like - battle (with suggestion)

Castagna

Member
Member
Joined
Sep 22, 2015
Messages
21
Reaction score
3
First Language
Italian
Primarily Uses
I would like to have a battle system like pokémon, where the first actor goes in battle and, when he dies, the next alive one goes in battle, while the first one is moved from the first position of the party to the last one. Can someone help me? 


(I don't know much about MV libraries... this is all I can do for the moment)


*NOT WORKING EXAMPLE*

Code:
//There will be only one member in battle (the first one)
Game_Party.prototype.maxBattleMembers = function() {
    return 1;
};

//when the first member dies, it doesn't mean it's gameover
Game_Unit.prototype.isAllDead = function() {
    var temp=$gameParty.allMembers();
	var i=;
	//if the first member is dead, i have to...
	if ($gameParty.allMembers()[].isDead())
	{
	//...check if someone is alive
	while ($gameParty.allMembers()[i].isDead())
	{
	i++;
	//if all members are dead, it's gameover
	if (i>=$gameParty.allMembers().length) 
	{
	return true;
	}
	}
	//member i is alive
	//I need to set him as first member to show him as a battler
	var j;
	//remove all party members
	for (j=;j<$gameParty.allMembers().length;j++)
	{
	$gameParty.removeActor(temp[j]);
	}
	//add the alive member as first
	$gameParty.addActor(temp[i]);
	//add all the other members...
	for (j=;j<$gameParty.allMembers().length;j++)
	{
	//...except the one already added
	if (j!=i) $gameParty.addActor(temp[j]);
	}
	}
	$gameParty.battleMembers()[]=temp[i];
	return false;
};
 
Last edited by a moderator:

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
822
First Language
English
Primarily Uses
I'm working on this currently. I'll update you when it's finished or close to.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:
I'm having a fun time working with the MZ RTP. The waterfall hasn't changed, though, so I'm wondering if they didn't make a new one or if they forgot to put it in...

good progress on the typescript Definitions files almost done all the Manager and yet I still have to do the Battle Manager...who is seriously so much data lol
Are the export options for MZ known yet?
I thought they were supposed to be my friends T_T

Forum statistics

Threads
100,646
Messages
978,068
Members
132,259
Latest member
RegularManGuy
Top