(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,571
Reaction score
3,774
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,571
Reaction score
3,774
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 Posts

Latest Profile Posts

so, ive been gone for too long when i log in and see that everything is where is shouldn't be. XD
Steam killing my eyes.. I forgot why I use it only when I have no other choice
Making a map, my brain went "Look, Mjölnir!" as I plotted out a sacrificial entrance.

Actually, it went, "Look, hammer. Wait, Thor's hammer!"
CG tile rendering, take 3: windows.
which section you guys think looks more accurate to the perspective? left or right?

for reference, this is what it looks like "at street level"
Okay, Animal Crossing is remarkably addictive and exceptionally calming. I've been playing it pretty exclusively... like... 6 hours a day. Been a while since I've been this engrossed.

Forum statistics

Threads
95,402
Messages
928,922
Members
125,622
Latest member
Komalis
Top