State Icon Positions (solved)

Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
11
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,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Search for StateIcon inside YEP_AnimatedSVEnemies.
 

Sc0wly

Veteran
Veteran
Joined
Feb 13, 2017
Messages
46
Reaction score
11
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,125
Reaction score
10,639
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
11
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
11
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
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top