RMMV Make player party always go first in battle w/o Agility stat?

Cuprite

Previously Golden
Veteran
Joined
Feb 6, 2017
Messages
136
Reaction score
55
First Language
English
Primarily Uses
RMMV
I'm currently making a small prototype for a game idea I had and I want to make the party always go first (Technically. I plan on implementing a sort of initiative system, but that is irrelevant right now). The easy answer would be to just manipulate the Agility stat, but I'm using that stat for something else entirely (I don't have a dedicated Agility/Speed stat). Would there be any good way of doing this? I know there's a custom stat plugin and I tried using it with Yanfly's battle core, but it doesn't seem to work (I mean, the party goes first, but making the custom stat larger on the enemy changes nothing, so I worry about the game possibly just deciding at random that the enemy goes first for... some reason (Do I need to worry about this?)).
 

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
399
Reaction score
369
First Language
English
Primarily Uses
RMMZ
BattleManager determines the order of actions in battle by sorting the actions based on each action's speed and each action subject's agility.

That can be modified as you see fit with a plugin, but your post doesn't actually specify how you want to determine the action order, other than to say that actors should act before enemies.

(Technically. I plan on implementing a sort of initiative system, but that is irrelevant right now)

If you are planning on implementing a custom initiative system that isn't the default, then that is actually incredibly relevant—especially since you seem to be fishing for a plugin-based solution.

I'm not sure how you expect someone to either point you toward a plugin or help you customize the default functions if you think the details of how you actually want the action order to be determined are "irrelevant."
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
616
Reaction score
612
First Language
English
Primarily Uses
RMMZ
Like Kenen said, without knowing exactly *how* you want to change the turn order logic, we can't actually tell you how to implement the change. But the relevant code can be found in rpg_managers.js, and it's this function here:
JavaScript:
BattleManager.makeActionOrders = function() {
    var battlers = [];
    if (!this._surprise) {
        battlers = battlers.concat($gameParty.members());
    }
    if (!this._preemptive) {
        battlers = battlers.concat($gameTroop.members());
    }
    battlers.forEach(function(battler) {
        battler.makeSpeed();
    });
    battlers.sort(function(a, b) {
        return b.speed() - a.speed();
    });
    this._actionBattlers = battlers;
};
 

Cuprite

Previously Golden
Veteran
Joined
Feb 6, 2017
Messages
136
Reaction score
55
First Language
English
Primarily Uses
RMMV
BattleManager determines the order of actions in battle by sorting the actions based on each action's speed and each action subject's agility.

That can be modified as you see fit with a plugin, but your post doesn't actually specify how you want to determine the action order, other than to say that actors should act before enemies.



If you are planning on implementing a custom initiative system that isn't the default, then that is actually incredibly relevant—especially since you seem to be fishing for a plugin-based solution.

I'm not sure how you expect someone to either point you toward a plugin or help you customize the default functions if you think the details of how you actually want the action order to be determined are "irrelevant."
Oh, no, I just meant that I just need to figure out the turn order thing before doing anything with the initiative stuff. I already know how I'd do it: Roll 2 random variables and, if the party's is lower, give them a temporary status that would prevent them from moving until the next turn rolls around (I'd reskin the surprise system, but you can't exactly force it while already in the battle). That's why I specifically need to figure out how to make the party move first: If the party rolls higher, things go as normal, but their turn is delayed if they roll lower. I can do that part using Yanfly's Base Troop Events plugin. It's really just the forcing the party to go first part that's confusing me. Sorry for not elaborating.
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
616
Reaction score
612
First Language
English
Primarily Uses
RMMZ
Oh, no, I just meant that I just need to figure out the turn order thing before doing anything with the initiative stuff. I already know how I'd do it: Roll 2 random variables and, if the party's is lower, give them a temporary status that would prevent them from moving until the next turn rolls around (I'd reskin the surprise system, but you can't exactly force it while already in the battle). That's why I specifically need to figure out how to make the party move first: If the party rolls higher, things go as normal, but their turn is delayed if they roll lower. I can do that part using Yanfly's Base Troop Events plugin. It's really just the forcing the party to go first part that's confusing me. Sorry for not elaborating.
The thing is that everything that you just mentioned (including the initiative thing) all kind of hinge on that one function that I just posted. So it makes most since to deal with it all at the same time. So if you could give us detailed specifics, we could tell you how to implement it. For example, exactly what random numbers are you wanting to roll? Is it based on some game variables or something? Exactly how does it work? And what order do you want the members (within each party) to move? I mean I get that you want the player party to go first, but what order do you want the members of that party to move in? Just from member 1 to member X, in sequential order? Random? Still based on agility? Based on some other stat? And do you still want surprise attacks and preemptive attacks to be a thing? If you can lay out the exact logic that you're wanting to use, it'd be a simple matter to tell you how to implement it.

If you insist on implementing the initiative thing separately through some other plugin or something, that's fine, but we'd still need the rest of those questions answered before we can tell you how to do what you're asking.
 

Cuprite

Previously Golden
Veteran
Joined
Feb 6, 2017
Messages
136
Reaction score
55
First Language
English
Primarily Uses
RMMV
The thing is that everything that you just mentioned (including the initiative thing) all kind of hinge on that one function that I just posted. So it makes most since to deal with it all at the same time. So if you could give us detailed specifics, we could tell you how to implement it. For example, exactly what random numbers are you wanting to roll? Is it based on some game variables or something? Exactly how does it work? And what order do you want the members (within each party) to move? I mean I get that you want the player party to go first, but what order do you want the members of that party to move in? Just from member 1 to member X, in sequential order? Random? Still based on agility? Based on some other stat? And do you still want surprise attacks and preemptive attacks to be a thing? If you can lay out the exact logic that you're wanting to use, it'd be a simple matter to tell you how to implement it.

If you insist on implementing the initiative thing separately through some other plugin or something, that's fine, but we'd still need the rest of those questions answered before we can tell you how to do what you're asking.
Ok, I'll answer in order.

- I'm basing it kinda off of how most TTRPG's do it, so I'm planning on having 2 in-game variables randomly roll 1-20. If the variable representing the party is equal to or higher than the enemy party's, the fight would play as normal, but if its lower, everyone on the main party will be immobile for that first turn (Essentially delaying their movement).
- I kinda just plan on the turn order being in sequential Member A to Member Z order. Not using any of the existing RM stats (I've repurposed all 6 into completely different stats (Again, based on how most TTRPG's do it. I'm taking a lot of inspiration from them lately). There isn't an Agility stat or any equivalent of one). Only exceptions would be if a skill or whatever has priority.
- I'd like to keep surprise/pre-emptive attacks intact for scenarios like the party ambushing an enemy or being ambushed (With how this prototype is planned to function, all encounters would be triggered by an event, so I could just force them with one of Yanfly's plugins if the player is in the right conditions).

Hopefully that helps some? Sorry for not giving enough information to begin with.
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
616
Reaction score
612
First Language
English
Primarily Uses
RMMZ
(I'd reskin the surprise system, but you can't exactly force it while already in the battle).
Now that I think about it, you actually *can* do this, if you prefer that route. If you can run this script call after the previous turn ends, and before the next set of actions begin:
JavaScript:
BattleManager._surprise = true;
That would stop the player party from acting. And to stop the enemy party from acting, you could use:
JavaScript:
BattleManager._preemptive = true;
 

Cuprite

Previously Golden
Veteran
Joined
Feb 6, 2017
Messages
136
Reaction score
55
First Language
English
Primarily Uses
RMMV
Now that I think about it, you actually *can* do this, if you prefer that route. If you can run this script call after the previous turn ends, and before the next set of actions begin:
JavaScript:
BattleManager._surprise = true;
That would stop the player party from acting. And to stop the enemy party from acting, you could use:
JavaScript:
BattleManager._preemptive = true;
Oh wow, that works perfectly! I... genuinely didn't think setting the surprise/preemptive tag during battle would actually work. Idk, I just figured it'd only check for it when loading the encounter. Lol.

Thank you so much! :hhappy:
 

Arthran

Veteran
Veteran
Joined
Jun 25, 2021
Messages
616
Reaction score
612
First Language
English
Primarily Uses
RMMZ
No problem! Do you still want me to tell you how to re-work that function? Or do you already have a sufficient solution now?
 

Cuprite

Previously Golden
Veteran
Joined
Feb 6, 2017
Messages
136
Reaction score
55
First Language
English
Primarily Uses
RMMV
No problem! Do you still want me to tell you how to re-work that function? Or do you already have a sufficient solution now?
This seems sufficient. Since I can use the preemptive trigger, I made it so that if you have a 20 and the enemy doesn't, it triggers that. Otherwise, it's exactly as I'd envisioned it to be (And that one difference is a positive one imo). I'm really happy with this. ^-^
 

Latest Threads

Latest Profile Posts

I've been trying to get certain devs' and artists' permission to use their characters in a certain plugin demo I've been working on. I got permission for 3 characters thus far... I'm hoping I can get at least 5 by the end of next week.
By far, the weirdest flex I've ever seen on the internet is "I don't have the attention span to read what you wrote, but I REALLY want the world to know I don't have that attention span!".
Why... the FACK... do I work in customer service?!?!
Excuse me while I go question allllll my life choices.
DamageEvil_6.png added!
index.php

Forum statistics

Threads
125,778
Messages
1,173,427
Members
164,934
Latest member
_CnZ_
Top