Battle sequence moving too fast. What does "slow down" mean in javascript

jjleroy

I love bananas
Veteran
Joined
Aug 5, 2017
Messages
184
Reaction score
34
First Language
German, English
Primarily Uses
RMMV
Good day dear RPGmakerfriends. I'm trying to make a cool RPG battle design namely the persona 5 battle design.
However, as you can see, things are moving way too fast.


I don't know about you but I think first of all, the enemy's HP Gauge should be visible longer. Unfortunately this can't be controlled by parameters in the plugin.

Second, the new turn starts too soon and the menu immediately pops up again even though the HP gauge is still going down.

Third, the "1 MORE!" animation is actually a common event activated by a switch, and does not stop the flow of the battle, but just runs parallel, which looks rushed and weird. Unfortunately it doesn't work if I set it to autoplay.

Now I tried to add

this._waitCount = 600;

into various places in the plugins, but nothing happened.
Now I wanted to ask. What would be the proper way to make the battle process slower?

EDIT: So what I tried now is to set a timeout before the HP gauge disappears.
But nothing happened. The HP gauge simply never disappeared...

Code:
//==============================
// * Update Fade
//==============================
HPGaugeSprite.prototype.updateFade = function() {
    if (this._slideA) {this._slideX += 2};
  
     setTimeout(function() {
         this.opacity = 0;
     }, 1000);
          
};
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,038
Reaction score
10,250
First Language
Czech
Primarily Uses
RMMV
I'm not going to answer the first one, sincr I don't even know any details whatsoever about how your action sequences are built. Nevertheless, the code you provided would be quite easy:
Code:
setTimeout(function() {
         this.opacity = 0;
     }, 1000);
will never do anything. setTimeout, setInterval and xhr.on events are context losing methods. Meaning that 'this' actually refers to the highest level, in other words Window, regardless of where you define it. You may have some luck with
"var self = this;" and then refer to self.opacity instead of this.opacity, although in all honesty, I doubt it would work and that you'd have to call the gauges by variable names.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Been parallax mapping nigh all night. :D
2nd character based on the same random inputs
the coffee shop i go to for open mic every friday only has 2 more open mics left and then they're done :'( i'm gonna die!
Everytime someone says Intel "kabylake" I hear either baby lake or ladycake.
Either I just had one of those dreams where you think you're awake, or I have time traveled. I woke up at 6:58am this morning, heard my father leaving for work, laid back down, now its 1:16am.

Forum statistics

Threads
93,383
Messages
911,872
Members
122,885
Latest member
Hayato7729
Top