Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
12
First Language
English
Primarily Uses
RMMV
I'm having an issue after using the Yanfly animated sv battlers plugin where state icons are now appearing way above the enemy's head. What I'm wonder is if there's a way to adjust this.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,819
First Language
Czech
Primarily Uses
RMMV
Search for StateIcon inside YEP_AnimatedSVEnemies.
 

Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
12
First Language
English
Primarily Uses
RMMV
I did already. This is the function I tried to adjust:

Sprite_Enemy.prototype.updateSVStateSprite = function() {
if (!this._stateSprite) return;
this._stateSprite.visible = this._enemy.enemy().sideviewStateOverlay;
return;
var height = this._enemy.spriteHeight() * -1;
height -= Sprite_StateIcon._iconHeight;
this._stateIconSprite.y = height;
this._stateSprite.y = (this._enemy.spriteHeight() - 64) * -1;
};


I didn't know what exactly to expect so I just changed the values to see what would happen and it didn't affect anything. I'm not sure if this is even the part I should be adjusting though. It's just the part that caught my eye when I searched for StateIcon.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,183
Reaction score
10,819
First Language
Czech
Primarily Uses
RMMV
there is a function called updateStateIconHeight too. Both functions are used in somewhat different times. The things that interest you are this._stateIconSprite.y.
 

Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
12
First Language
English
Primarily Uses
RMMV
I've messed with all values contained in functions where "stateIcon" and "stateIconSprite" are used and the only things I've affected are the y scaling of the battler image itself, the state icon turn counter (but not the icon itself at that point), and the y scaling of the state icon (as opposed to the y positioning).
At this point I feel like one of the other Yanfly plugins I'm using must also be affecting this and that I probably already adjusted the right value but it's not showing because of that other plugin. I've looked in the Battle core js and the buffs and states core one so far with no luck. I'll look again though.


Edit: I'm also going to look at action sequences pack 2 since there's a couple places in the animated sv battlers js where that pack is mentioned with caveats attached.
 

Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
12
First Language
English
Primarily Uses
RMMV
Solved :D

So it turns out that action sequences pack 2 was the culprit after all.

I changed:

Sprite_Battler.prototype.updateStateSprites = function() {
if (this._stateIconSprite) {
var height = this._battler.spriteHeight() * -1;
height -= Sprite_StateIcon._iconHeight;
height /= this.scale.y;
this._stateIconSprite.y = height;
}
if (this._stateSprite) {
var height = (this._battler.spriteHeight() - 64 * this.scale.y) * -1;
this._stateSprite.y = height;
}


to:

Sprite_Battler.prototype.updateStateSprites = function() {
if (this._stateIconSprite) {
var height = this._battler.spriteHeight() * -0.8;
height -= Sprite_StateIcon._iconHeight;
height /= this.scale.y;
this._stateIconSprite.y = height;
}
if (this._stateSprite) {
var height = (this._battler.spriteHeight() - 64 * this.scale.y) * -1;
this._stateSprite.y = height;
}


This moved the state icon from about 100 pixels above my battler's head to just above it as needed. If I'm looking at this correctly it's adjusting the y position relative to your battler's height rather than their home anchor position in an effort to update them dynamically for different battlers. That's probably why certain seemingly small adjustments result in major changes. In instances where the icon disappears it's either because it's gone all the way off the screen (either up or down) or it's disappeared behind the battler.

I'll also mention that I did have the animated sv battlers js a couple rows beneath the three action sequence pack js files in my plugin list however moving animated sv battlers above the others didn't affect anything. This underpins a need to simply update the value in the action sequences pack 2 js since it's overriding other plugins with similar functions.

Thanks for the replies Poryg. I hope this helps others with similar issues! :D
 

Latest Threads

Latest Posts

Latest Profile Posts

ScreenShot_6_28_2022_3_2_40.png

There's 7 main areas in the game that are all connected. This train get's you from an underground lab to the center of someone's subconscious. inside the train you can talk to some of the passengers. but going to the top of it, there's battles.
Speedrunning all character portraits just so they all have the same quality. Not sure if this was a good idea, but now I'm almost done.
We now have a gameplay video!
DrBuni wrote on Akiritas's profile.
That is a cute Link picture, reminds me of the Samurai Jack artstyle.
I had an idea on how to get my encounters to leash after chasing the player for a little bit. After going down the Javascript rabbit hole, I realized I could do it in a regular movement route. Derp!

Forum statistics

Threads
123,145
Messages
1,154,371
Members
161,488
Latest member
rybaspi
Top