Changing Z level for certain animations in battle?

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
60
Reaction score
47
First Language
English
Primarily Uses
RMMV
Simply put, I'm looking for a way to display specific animations (such as magic circles) below battlers. I'm already using Galv's Map Animation Effects but as stated in the thread, it currently doesn't work for animations in battle. I've seen this feature implemented in this video, possibly through a different plugin that I couldn't find from my searches.

Whether it'd be a plugin edit to Galv's, a short plugin, or even a script call to alter the z values, anything would be appreciated
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
776
Reaction score
488
First Language
English
Primarily Uses
RMMV
Someone posted on the support forum a long time ago, and shared with me the following code, which allows you to set the z layer of an animation based on it's name in the database.
Code:
var animation_position = Sprite_Animation.prototype.updatePosition;
Sprite_Animation.prototype.updatePosition = function() {
    animation_position.call(this)
    if (this._animation.name.contains("TPZH")) {
        this.z = -1;
    } else {
        this.z = 8;
    }
};
This should do it for you. Just ad TPZH to the end of any animation name you want this to apply to.
 

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
60
Reaction score
47
First Language
English
Primarily Uses
RMMV
Someone posted on the support forum a long time ago, and shared with me the following code, which allows you to set the z layer of an animation based on it's name in the database.

This should do it for you. Just ad TPZH to the end of any animation name you want this to apply to.
Thank you very much, it works like a charm!
 

Random Panda

Veteran
Veteran
Joined
May 3, 2016
Messages
91
Reaction score
14
First Language
English
Primarily Uses
RMMV
This is super helpful. I was just wondering however, if there was a way to set it up so if you have a group of enemies that are relatively close together, the animation will play above the targeted enemy, but below an enemy that is positioned in front (ie. closer to the camera) of the targeted enemy.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Can someone tell me where I'm supposed to put this code? I made a script call within the battle but its still not working.
 

Attachments

Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
776
Reaction score
488
First Language
English
Primarily Uses
RMMV
Can someone tell me where I'm supposed to put this code? I made a script call within the battle but its still not working.
Open notepad and paste the text in there, then save as -> something.js

Import it into your plugin manager like any other plugin.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Hmm.....I did that and its not working. The animation in question is still appearing over the characters....hmmm....................................
 

Attachments

zaraku

Time Keeper
Veteran
Joined
Apr 19, 2018
Messages
60
Reaction score
47
First Language
English
Primarily Uses
RMMV
Hmm.....I did that and its not working. The animation in question is still appearing over the characters....hmmm....................................
You have to add TPZH to the animation names in the database, not the sprites themselves.
 

Mkingdom

Veteran
Veteran
Joined
Nov 1, 2019
Messages
180
Reaction score
13
First Language
English
Primarily Uses
RMMV
Ok done m'such a noob. But its still not working properly the animation appears below the actors but flickers in and out.......
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,881
Messages
1,017,227
Members
137,607
Latest member
Maddo
Top