So I'm trying to recreate the Trick Room ability from Pokemon. What it does is reverses the turn order, causing actors with Less agi to attack first and higher agi to attack later.
After setting the AGI minimum to -9999, I used Target core to make sure I can apply a state to everyone on the field. Using commands from Yanfly Base parameters, I have:
<agi Rate: -100%>
My logic is that if everyone's agi is negative, those with lower agi would have a higher integer. (2 is greater than 1, but -1 is greater than -2). It technically works if I input (-agi) into Yanfly's Action Speed in his Battle Engine Core Plugin.
However, when the stat is applied the stats aren't affected, leading me to believe Yanfly's Base Parameter plugin can't change the base stats to a negative number. Is this the case? Can it be bypassed, or am I doing something wrong?
In summary, I want to make a state that multiplies Agility by -1. I hope I didn't make this too confusing.
Yanfly Base Parameters: Negative Stats? (Trick Room)
● ARCHIVED · READ-ONLY
-
-
If i'm not wrong the min is 0 or 1, the engine can't go lower than this by default.
-
If it's hard coded, then I guess it should be expected a simple plugin can't change that. Was hoping we moved past these scenarios with MV.
Ah well. Someone might have the answer I'm looking for so I'll keep this open, but I'll pursue alternative ways to get this ability to work. -
mmmmMMmm
Keep agi min at 0 dw. No need to go negative it'll create more problems for you
I'm not a expert coder by myself so I'm not sure if this will work
We can try to modify the agi "rules of turn" if you used your revolution move thing
1) have a game variable specifically for trick room. It's initially set to 0, and when you use it, it turns to 1 (use a common event). When you use it again it turns back to 0
2) unless someone already made a plugin to modify the way AGI's turn formula is calculated, you'll have to go deep in the "rpg_objects.js" file of your game, line 1433 :
SpoilerGame_Action.prototype.speed = function() {
var agi = this.subject().agi;
var speed = agi + Math.randomInt(Math.floor(5 + agi / 4));
if (this.item()) {
speed += this.item().speed;
}
if (this.isAttack()) {
speed += this.subject().attackSpeed();
}
return speed;
};
now replace the "var speed = agi + Math.randomInt(Math.floor(5 + agi / 4));" line by this entire block
Spoilervar speed = 0;
if ($gameVariables.value(666) === 1)
{ speed = 0 - (agi + Math.randomInt(Math.floor(5 + agi / 4))); }
else
{ speed = agi + Math.randomInt(Math.floor(5 + agi / 4)); }
noww uhhh replaces the 666 in that formula by the variable #id that you decided to use and you good :|:|
If this works, a little flaw is that the variable will stay to 1 after the battle ended (so trick room will stay active after the battle ended), sooo you have to turn it back to 0 at the end of a battle -
The formula works great! Thank You!
I attached the skill to a common event and a state. When the skill is used the common event changes the variable and applies the state to everyone in the party so the player knows the effect is active. I applied a State Removal Effect (From Yanfly Buff&State Core) to activate a script call to reset the variable back to 0, so I don't have to worry about manually resetting it. -
[closed]IgnoreMe[/closed]