Hello.
I wonder if it's possible a plugin that'd allow me to shift the animation played on a battler by X and Y offset. Ideally, I could specify this in the actor/enemy notetag in the database.
Thanks :)
Battler Animation Shift
● ARCHIVED · READ-ONLY
-
-
Although it may not answer your question directly... but?
$gameActors.actor(actorId).startAnimation(animId)
Event/Code
By looking at the Skill "Show Battle animation"
if that doesn't answer your question maybe this?
https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/animated-battle/
You might need his core, I hope it helped. -
Take a look: https://forums.rpgmakerweb.com/inde...s-the-animation-position-of-a-battler.100415/
@Yethwhinger Is it possible to adjust the position of a specific animation with a script like this:
<offsetAniX[1]:number1>
<offsetAniY[1]:number2>
<offsetAniX[2]:number3>
<offsetAniY[2]:number4>
where [1] and [2] would be the animation number in the database -
Thank you! That'll save me some time :)
-
I have updated the AdjustAniPos plugin to allow specifying adjustments for each battler for each animation. All the individual animation adjustments need to go into the same note in the actor's or enemy's note field. The format is
<offsetAniXSp:id1 numberX1,id2 numberX2,...,idN numberXN> and <offsetAniYSp:id1 numberY1,id2 numberY2,...,idN numberXN>. For example, to have animation 5 move 50 pixels right and animation 24 move 100 pixels left, the note would be <offsetAniXSp:5 50,24 -100>. This adjustment is in addition to whatever was specified for all animations with the <offsetAniX:number1> and <offsetAniY:number2> notes.
Code:// AdjustAniPos.js // Created on 9/24/2018 // Last modified on 11/13/2018 by Yethwhinger var objYeth = objYeth || {}; /*: * @plugindesc This plugin is meant to adjust the position * of animations on battlers. * @author Yethwhinger * * @help This plugin adjusts the position of animations * over a battler by moving it using <offsetAniX:number1> * and <offsetAniY:number2> entries in the note fields of the Enemies * and Actors sections of the database. number1 and number2 * represent pixel adjustments in the x and y directions. * * Specific animations can be adjusted for a battler by using * the note format <offsetAniXSp:id1 numberX1,id2 numberX2,...> and * <offsetAniYSp:id1 numberY1,id2 numberY2,...>. For example, * animation 3 could be moved 20 pixels down for a specific * actor by adding <offsetAniYSp:3 20>. All such special * adjustments should go into the same note. For example, if * adjusting the position for animation 7 down by 10 pixels on * the same actor, the previous note would be modified to look * like <offsetAniYSp:3 20,7 10>. * * If using this plugin with YEP_X_ActSeqPack2, place this * plugin just above that one in the plugin list. */ //---------------------------- // Changes to Game_Enemy //---------------------------- objYeth.Game_Enemy_setup_OffsetAni = Game_Enemy.prototype.setup; Game_Enemy.prototype.setup = function (enemyId, x, y) { var osAniX = $dataEnemies[enemyId].meta.offsetAniX; var osAniY = $dataEnemies[enemyId].meta.offsetAniY; var osAniXSp = $dataEnemies[enemyId].meta.offsetAniXSp; var osAniYSp = $dataEnemies[enemyId].meta.offsetAniYSp; var noteFormat = /(\d+)\s+(-?\d+),?/g; var tempMatch; objYeth.Game_Enemy_setup_OffsetAni.call(this, enemyId, x, y); this._offsetAniX = 0; this._offsetAniY = 0; this._offsetAniXSp = []; this._offsetAniYSp = []; if (osAniX) { this._offsetAniX = Number(osAniX); } if (osAniY) { this._offsetAniY = Number(osAniY); } if (osAniXSp) { tempMatch = noteFormat.exec(osAniXSp); while (tempMatch) { this._offsetAniXSp[tempMatch[1]] = Number(tempMatch[2]); tempMatch = noteFormat.exec(osAniXSp); } noteFormat.lastIndex = 0; } if (osAniYSp) { tempMatch = noteFormat.exec(osAniYSp); while (tempMatch) { this._offsetAniYSp[tempMatch[1]] = Number(tempMatch[2]); tempMatch = noteFormat.exec(osAniYSp); } noteFormat.lastIndex = 0; } }; //---------------------------- // Changes to Game_Actor //---------------------------- objYeth.Game_Actor_setup_OffsetAni = Game_Actor.prototype.setup; Game_Actor.prototype.setup = function (actorId) { var osAniX = $dataActors[actorId].meta.offsetAniX; var osAniY = $dataActors[actorId].meta.offsetAniY; var osAniXSp = $dataActors[actorId].meta.offsetAniXSp; var osAniYSp = $dataActors[actorId].meta.offsetAniYSp; var noteFormat = /(\d+)\s+(-?\d+),?/g; var tempMatch; objYeth.Game_Actor_setup_OffsetAni.call(this, actorId); this._offsetAniX = 0; this._offsetAniY = 0; this._offsetAniXSp = []; this._offsetAniYSp = []; if (osAniX) { this._offsetAniX = Number(osAniX); } if (osAniY) { this._offsetAniY = Number(osAniY); } if (osAniXSp) { tempMatch = noteFormat.exec(osAniXSp); while (tempMatch) { this._offsetAniXSp[tempMatch[1]] = Number(tempMatch[2]); tempMatch = noteFormat.exec(osAniXSp); } noteFormat.lastIndex = 0; } if (osAniYSp) { tempMatch = noteFormat.exec(osAniYSp); while (tempMatch) { this._offsetAniYSp[tempMatch[1]] = Number(tempMatch[2]); tempMatch = noteFormat.exec(osAniYSp); } noteFormat.lastIndex = 0; } }; //---------------------------- // Changes to Sprite_Animation //---------------------------- Sprite_Animation.prototype.updatePosition = function () { if (this._animation.position === 3) { this.x = this.parent.width / 2; this.y = this.parent.height / 2; } else { var parent = this._target.parent; var grandparent = parent ? parent.parent : null; this.x = this._target.x; this.y = this._target.y; if (this.parent === grandparent) { this.x += parent.x; this.y += parent.y; } if (this._animation.position === 0) { this.y -= this._target.height; } else if (this._animation.position === 1) { this.y -= this._target.height / 2; } var battler = this._target._battler; if (!battler) { battler = this._target.parent._battler; } if (battler) { var xSp = battler._offsetAniXSp[this._animation.id] || 0; var ySp = battler._offsetAniYSp[this._animation.id] || 0; this.x += battler._offsetAniX + xSp; this.y += battler._offsetAniY + ySp; } } }; -
@Yethwhinger thank you so much! is it okay if I use this plugin in commercial project? :c
-
You may use this plugin in a commercial project.
-
You're my savior <3 Thanks <3!
This plugin is just what I asked so the topic is resolved :) -
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.