Hi,
As the title says, I need help changing the position the actor faces when moving to the front of the enemy. I'm using Yanfly's Battle Engine Core, and all 3 of his Action Sequence Plugins. I did edit some of his scripts a little bit though because in my game I wanted actors on the left and enemies on the right. After I edited the scripts it was all fine at first. But then when it came to editing Yanfly's Action Sequence Pack 2 plugin I couldn't figure out how to change the direction the actor faced.
In the first spoiler, I put the code I edited in the Action Sequence Pack 2 plugin:
In this next spoiler is the code I think is what I need to edit to fix my problem. But I don't know what to change:
Also, I should probably point out that I flipped my actor's battler sprites using an image editor so it doesn't look reversed(I did this before my problem occurred).
In this last spoiler is my actor performing an attack with the note tags included:
<setup action>
display action
immortal: targets, true
</setup action>
<target action>
move user: targets, front, 20
zoom: 125%, 30
camera screen: target, front center, 30
camera focus: target, front center, 30
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
</target action>
If anybody knows what I should do, please let me know. Thank you for reading.
-SupeRPG
Update: I found out that the 'front' note tag does make my actor face forward, but it only works if my actor moves to the 'back' of the enemy.
For example, if I use these note tags...
move user: targets, back, 19
wait for movement
move user: targets, front, 1
wait for movement
...my actor moves to the back of the enemy facing towards it. Then, it moves quickly to the front of the enemy facing the right way, which is forward. I don't understand why my actor doesn't face forward when I use the 'front' tag first.
As the title says, I need help changing the position the actor faces when moving to the front of the enemy. I'm using Yanfly's Battle Engine Core, and all 3 of his Action Sequence Plugins. I did edit some of his scripts a little bit though because in my game I wanted actors on the left and enemies on the right. After I edited the scripts it was all fine at first. But then when it came to editing Yanfly's Action Sequence Pack 2 plugin I couldn't figure out how to change the direction the actor faced.
In the first spoiler, I put the code I edited in the Action Sequence Pack 2 plugin:
Code:
if (actors > 0 && enemies === 0) {
return (value === 'front') ? 'right' : 'left';
} else if (actors === 0 && enemies > 0) {
return (value === 'front') ? 'left' : 'right';
} else {
if (mover.isActor()) {
return (value === 'front') ? 'left' : 'right';
} else { // enemy
return (value === 'front') ? 'right' : 'left';
}
Code:
if (['BASE', 'FOOT', 'FEET'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'center');
var destY = this.actionMoveY(mover, targets, 'foot');
} else if (['CENTER', 'MIDDLE'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'center');
var destY = this.actionMoveY(mover, targets, 'center');
} else if (['HEAD', 'TOP'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'center');
var destY = this.actionMoveY(mover, targets, 'head');
} else if (['FRONT BASE', 'FRONT FOOT', 'FRONT FEET',
'FRONT'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'front');
var destY = this.actionMoveY(mover, targets, 'foot');
} else if (['BACK BASE', 'BACK FOOT', 'BACK FEET',
'BACK'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'back');
var destY = this.actionMoveY(mover, targets, 'foot');
} else if (['FRONT CENTER', 'FRONT MIDDLE'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'front');
var destY = this.actionMoveY(mover, targets, 'center');
} else if (['BACK CENTER', 'BACK MIDDLE',].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'back');
var destY = this.actionMoveY(mover, targets, 'center');
} else if (['FRONT HEAD', 'FRONT TOP'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'front');
var destY = this.actionMoveY(mover, targets, 'head');
} else if (['BACK HEAD', 'BACK TOP'].contains(type)) {
var destX = this.actionMoveX(mover, targets, 'back');
var destY = this.actionMoveY(mover, targets, 'head');
}
var offsetX = this.actionMoveOffsetX(actionArgs, mover, targets[0]);
var offsetY = this.actionMoveOffsetY(actionArgs, mover, targets[0]);
mover.battler().moveToPoint(destX + offsetX, destY + offsetY, frames);
mover.spriteFacePoint(destX, destY);
}
}
return true;
Also, I should probably point out that I flipped my actor's battler sprites using an image editor so it doesn't look reversed(I did this before my problem occurred).
In this last spoiler is my actor performing an attack with the note tags included:
<setup action>
display action
immortal: targets, true
</setup action>
<target action>
move user: targets, front, 20
zoom: 125%, 30
camera screen: target, front center, 30
camera focus: target, front center, 30
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
</target action>
If anybody knows what I should do, please let me know. Thank you for reading.
-SupeRPG
Update: I found out that the 'front' note tag does make my actor face forward, but it only works if my actor moves to the 'back' of the enemy.
For example, if I use these note tags...
move user: targets, back, 19
wait for movement
move user: targets, front, 1
wait for movement
...my actor moves to the back of the enemy facing towards it. Then, it moves quickly to the front of the enemy facing the right way, which is forward. I don't understand why my actor doesn't face forward when I use the 'front' tag first.