(Solved) Recalculate Turn Order After Every Action

Status
Not open for further replies.

ginfubawuba

Villager
Member
Joined
Dec 1, 2017
Messages
12
Reaction score
3
First Language
English
Primarily Uses
RMMV
When an enemy is hit with a move that reduces their AGI, I want the remaining turn order to be recalculated to reflect that.

This is for the default turn based battle system.

What is the simplest way of doing this?
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,617
Reaction score
3,790
First Language
English
Primarily Uses
RMMV
The default battle engine calculates the turn order for a single round based on the AGI of each battlers at the start of that round if I'm not mistaken (it has been a long while since I used the default battle system). Therefore, you'll need a plugin to modify that logic.

I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.

 

ginfubawuba

Villager
Member
Joined
Dec 1, 2017
Messages
12
Reaction score
3
First Language
English
Primarily Uses
RMMV
The default battle engine calculates the turn order for a single round based on the AGI of each battlers at the start of that round if I'm not mistaken (it has been a long while since I used the default battle system). Therefore, you'll need a plugin to modify that logic.
[MOVE]JS Plugin Requests[/MOVE]
Ok Thank you
 

ginfubawuba

Villager
Member
Joined
Dec 1, 2017
Messages
12
Reaction score
3
First Language
English
Primarily Uses
RMMV
//This was edited by Ammon

BattleManager.getNextSubject = function() {

// this part re-sorts the actions by Speed incase anything changed
this._actionBattlers.forEach(function(battler) {
battler.makeSpeed();
});
this._actionBattlers.sort(function(a, b) {
return b.speed() - a.speed();
});
// Ammon edit stop

for ( ; ; ) {
var battler = this._actionBattlers.shift();
if (!battler) {
return null;
}
if (battler.isBattleMember() && battler.isAlive()) {
return battler;
}
}
};
 

Attachments

Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,617
Reaction score
3,790
First Language
English
Primarily Uses
RMMV
@ginfubawuba You can't delete posts, only moderators can do it. If you really want to delete a post, you can report your post and ask for a moderator to do it.

Also, please avoid double posting as it is against the forum rules. Double posting means posting when the latest post in a thread is your own. Instead, edit your latest post to add any missing information. No need to delete your latest post though, just keep that rule in mind for the future.

I'll close this thread since you've marked it as solved, but editing the title won't notify a moderator. In the future, if your thread has been solved you can report your thread (report button at the bottom of any of your posts, besides the "edit" button) and ask for it to be closed.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Making it a rule that I don't do any world building for my new game before the actual gameplay is concrete and working. I have 16 years of lore to work with anyway.
Cheesy power metal makes everything better. No matter what you do, you'll feel heroic doing it.
Starting to really like the first of my madness areas. I think the eyes looking at them really helps to sell the place. :LZSexcite:
Made idle animation for character. It first had only three frames but looked too different from walking animation and I had to draw five more.
MV and VX Ace both have good qualities.

Forum statistics

Threads
95,694
Messages
931,075
Members
126,032
Latest member
MadAtticGames
Top