Lunatic Mode & YEP ATB

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
172
Reaction score
30
First Language
English
Primarily Uses
RMMV
Here is what I am trying to do:
In my game, I am attempting to create a Haste stat, a mechanic that would effectively increase spell casting speed (shortening the time required for a spell to go off after selecting it).
Here is the battle system I use: http://www.yanfly.moe/wiki/Battle_System_-_ATB_(YEP)

The way I made this new Haste stat is by using variables, placed in 4 different variables, each utilized for each of my game's characters. The problem I am running into is trying to differentiate who is attacking (or using a skill/item), I have successfully gotten it use a single variable, the problem is that when it does that, that 1 variable is applied globally, to both enemies as well as all actors. That isn't what I want, Haste is supposed to be a stat just like any other, where each character's Haste stat is unique.

So, here are the methods I attempted so far:
Within the Plugin Parameters, you will see a spot called Charge Gauge, and it says that "this is a formula processed as an eval". I can't figure out how to create an if statement for this, to check which battler is about to take action. If I simply try to write an if statement, it just fails, crashing with an error, something about if statements or something.
This is what I have so far that I have been testing: var a = BattleManager.actor.id; if(a === 2){1500 - ($gameVariables.value(84) * 9);} else {1500;}
My testing character, actor 2, uses a Haste stat stored at variable 84. For testing, I am multiplying the Haste stat by 9, which should result in a skill going off instantly. Furthermore, if the battler is not determined to be actor 2, it should default to the normal charge amount of 1500. However, what is happening instead, is everything is being ignored, simply using the 1500 charge amount for everyone.

The second thing I tried was trying to use the "Attack Speed" trait, hoping it might work during the Charge time, but unfortunately, it does not.

The third thing I tried was using the JS stuff provided on the page I linked earlier, but none of them do what I want. I did have an alternative idea of trying to make Haste instead cause your next turn to start quicker, but that doesn't work either.

I am fairly new to this stuff, but for the most part, I have figured out quite a bit on my own. Every idea I have had so far, I have figured out how to create it and make it work correctly. But this has had me stuck for over a week now, and I just can't figure it out. Anyone have any new ideas, or input that could help?
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
663
Reaction score
373
First Language
English
Primarily Uses
RMMV
Your if statement doesn't work because it is undefined. BattleManager.actor is a function. To get the actorId from the function you'd need to use BattleManager.actor().actorId().

I'm not sure that this would work either though, this function appears to only provide the actor that is currently acting, so I'm not sure how that works in the ATB plugin.

So, with that being said, and without testing this myself, why not use a check for a specific state on the actor instead? You're using a super complicated method to determine if an actor has a haste state on them, when you can check if the the actor has a haste state on them right from the formula, no variables required:
(BattleManager.actor() && BattleManager.actor().isStateAffected(x)) ? 0 : 1500
This should make the actor have zero charge time if they are affected by state X, or 1500 if not. I also added a check to make sure the BattleManager has an actor object, so it shouldn't crash.

edit:
I just tested this and it doesn't seem to work, after all. It always gives the second number. I suspect it has something to do with the fact that BattleManager.actor() is null unless someone is currently being given orders. I expect it becomes null after the orders are given as well.

It doesn't seem like the default note tags allow you to change the user's ATB values with a skill, only the target, so you'd need to use the lunatic eval codes to set the user's atbCharge value to maximum. I'm not sure how to go about doing this, but this is a good jumping off point for anyone else to try to assist you.
 
Last edited:

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
172
Reaction score
30
First Language
English
Primarily Uses
RMMV
Your if statement doesn't work because it is undefined. BattleManager.actor is a function. To get the actorId from the function you'd need to use BattleManager.actor().actorId().

I'm not sure that this would work either though, this function appears to only provide the actor that is currently acting, so I'm not sure how that works in the ATB plugin.

So, with that being said, and without testing this myself, why not use a check for a specific state on the actor instead? You're using a super complicated method to determine if an actor has a haste state on them, when you can check if the the actor has a haste state on them right from the formula, no variables required:
(BattleManager.actor() && BattleManager.actor().isStateAffected(x)) ? 0 : 1500
This should make the actor have zero charge time if they are affected by state X, or 1500 if not. I also added a check to make sure the BattleManager has an actor object, so it shouldn't crash.

edit:
I just tested this and it doesn't seem to work, after all. It always gives the second number. I suspect it has something to do with the fact that BattleManager.actor() is null unless someone is currently being given orders. I expect it becomes null after the orders are given as well.

It doesn't seem like the default note tags allow you to change the user's ATB values with a skill, only the target, so you'd need to use the lunatic eval codes to set the user's atbCharge value to maximum. I'm not sure how to go about doing this, but this is a good jumping off point for anyone else to try to assist you.
Right. I already knew that because I already tried that. but thank you for offering your input. hopefully we can get more people thinking about this and get it figured out!
 

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

Latest Threads

Latest Profile Posts

Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Jumping and gravitation 0.1 build - RPG Maker MV
It's ironic, but one of the many hilarious things done with Shia's Just Do It speech was to make a hype song, and....I know what it is.....but I still get inspired by it! I'm like..."Yes I can!!"

Forum statistics

Threads
97,975
Messages
948,251
Members
129,228
Latest member
T-Rylo
Top