(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,635
Reaction score
3,794
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,635
Reaction score
3,794
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

The new intro Logo for my videos.

I speed it up, the one I use to use was to long.
The workweek is now over. Now I can work on my GamZzzzzZzzzzZzzzZzzZz....
Just watched Onward with the family. One of the best movies I've ever seen. <3
2 hours & 20 minutes remaining. :D
...trying to hurry finish up all commissions before I never put the controller down again ;)

Forum statistics

Threads
95,822
Messages
932,194
Members
126,256
Latest member
tehgreatestsam
Top