MV Row Formation and Action Sequences...

So I'm having an issue with http://www.yanfly.moe/wiki/Row_Formation_(YEP) in combination with these... http://www.yanfly.moe/wiki/Category:Action_Sequences_(MV). The problem being that when I try to move people with an action sequence and back and forth a row, I get weird results...

Basically I have skills that let the user swap a row with the person in the front, or vice versa. I got this to work with a common event, but I was hoping to have the actual skill move everyone around since the common event is basically hiding everyone till it's done. With action sequences, the best I could do is this...


Spoiler: Image
Slide.gif


as you can see, It works fine for the user, but as soon as I use either an action effect (notetag moving) or eval for the target, they slide all over the place and then back to where they're supposed to be. I can't figure out how to have more control over the movement, so this kinda stuff keeps happening.

if anyone who uses both have a solution on how to better move actors/enemies, I'm all ears. I know I could just use notetags or evals normally to move people, but that never looked visually appealing to see someone in an idle stance just slide across the screen to a spot.

Edit... I think I've solved this actually. there's a line of code in the plugin
isNotChangeRowPosition and I added if someone has a state to apply this code. seemed to work. gonna test it a bit more before I close this.

EDIT 2: Now I've got a new problem lol... whenever I switch back or forth with the second person in a row, it resets the person who's now in the back row to the first spot of the back row instead of keeping them in the second spot of the row. I checked the rowIndex and yeah... it's considering them the "0" spot... which I find weird because someone's was already still in the row.

I wonder if it's intentional that the person who's already there doesn't become the first person slotted to a row. All I really need is for the new person in the back row to stay put when put back there instead of sliding to where the other person in the back is.

Wait... I'm onto something. it seems to be all based on the order they are coming into battle? like if actor 1 and 2 switch, it's fine if they're members()[0] and [1]... but if actors 1 and 3 switch, actor 1 ends up on top of actor 2 after switching for some reason. is there a way around this?
I figured out what's causing this I think, but I don't know how to fix it...
this._actor.index() seems to be what it's checking where to put people. I can't think of anything that would make it go off of row position instead though...
...can you show your code/action sequence, along with a specific description of the problem that you see after? I have no clue what's going on 🤣
eh yeah, I had a feeling I didn't explain this well at all unfortunately... here's the action sequence
Code:
<Select Conditions>
Row 2 Only
Not User
</Select Conditions>

<Skill 44 Cooldown: 1>
<Skill 45 Cooldown: 1>
<Skill 46 Cooldown: 1>
<Skill 80 Cooldown: 1>
<Skill 79 Cooldown: 1>
<Cooldown: 1>

<Instant>

<Custom Show Eval>
  if ($gameParty.rowSize(1) === 1) {
    visible = true;
  } else {
    visible = false;
  }
</Custom Show Eval>

<setup action>
change switch 19: off
clear battle log
display action
immortal: targets, true
wait: 30
hide battle hud

change switch 6: off
motion skill: user
motion skill: target
wait: 30

</setup action>

<target action>
camera focus: focus, center, 30
zoom: 135%, 30
wait for zoom
add state 43: existing actors
se: Jump3
jump user: 65%, 45
if (target.getY() === 456)
move user: point, 1260, 456, 45
else if (target.getY() === 396)
move user: point, 1080, 396, 45
else if (target.getY() === 516)
move user: point, 1260, 516, 45
end
end
motion escape: user
face user: forward
wait: 20
move target: point, 816, 456, 25
custom motion dash: target
animation 304: target, mirror
wait for movement
motion victory: target
motion skill: user
eval: user.setRow(2)
eval: target.setRow(1)

wait: 30

if (target === $gameActors.actor(1))
eval: $gameParty.setLeader($gameActors.actor(1))
else if (target === $gameActors.actor(2))
eval: $gameParty.setLeader($gameActors.actor(2))
else if (target === $gameActors.actor(3))
eval: $gameParty.setLeader($gameActors.actor(3))
end
end
</target action>


<finish action>
zoom: 100%, 35
wait for zoom
change switch 6: on
show battle hud
reset camera
reset zoom
reset damage cap
tint screen: normal, 10
wait: 30
reset damage cap
immortal: targets, false
wait for new line
clear battle log
perform finish
wait for movement
wait for effect
show battle hud
change switch 19: on
</finish action>

the problem now is as follows... say the first party member and second switch with each other from front row to back (or vice versa), this works as intended. but if I say switch the first with the third, this happens...
Spoiler: image
ScreenShot_10_7_2023_6_56_30.png

the person who's been switched to the back basically wants to go to the top of the row instead of going to wherever the other person was. I THINK this is because I saw a line in row formations code that adjusts the party based on actor index. I think because I'm switching party member 1 with 3, it wants to put party member 1 in front of 2 in the back row because their index is first. at least that's what I'm gathering.

hopefully that makes sense. not sure how else to explain it.
It shouldn't hurt anything, but you have an extra "end" in your target action.

Actually two. Both times you do an if, you have two ends for some reason.

Your whole latter chunk can be way simpler, just one line:
Code:
eval: $gameParty.setLeader(target);

Incidentally, I think that bit is the problem. I don't think the row changing has anything to do with it, by itself. Where did that command even come from? It's not in the default engine nor in any of Yanfly's plugins.

But just changing the order of the actors in your $gameParty isn't going to have any visual effect on them in combat - I'm sure you notice that line of code doesn't move anyone on the screen. So yes, that's then going to screw up the positioning when something does reference the index.

I bet if you temporarily cut that part out, just the row changing would work fine.

If the changing order of actors is important, you're going to have to do that and then also manually move all affected battlers to the correct position.
ahh dunno why I was thinking I needed more than one end on either of those. as for the set leader stuff, I tried it without that and it still put the 1st person in the party on top of the 2nd.

the only reason I had the set leader thing is for whoever is in the front row is now the "leader". I was using this for that https://himeworks.com/2015/11/custom-party-leader/ so it wouldn't change the actual formation. or at least I don't think it's supposed to. but yeah, even getting rid of that still had the party member on top of the other.
Ah, so that's not at all related to what the leader is in the default engine. Okay.

That's weird...I've seen and used row movement commands in battle before and they worked correctly. So you're saying just having
Code:
user.setRow(2)
target.setRow(1)
results on one of them going on top of the other? Which? Is there any difference if you put a wait for movement in between?
I have 3 party members and say actor 1 is also party member 1. if I switch them with whoever party member 2 is. everything works with no issues. but if I switch them with party member 3, whenever actor 1 goes to the back row... instead of staying put where party member 3 was, after the skill is over, they move to where party member 2 is. in fact even though party member 2 didn't move at all, their rowIndex is now 1 instead of 0... it looks like this
Spoiler: Image
slide3.gif

but this only happens as described above. had I switched with the middle character, it'd have worked as intended. oh forgot to mention, this happens with a wait going on between them as well.
So...I think it must be something else.

I just slapped together a test project containing only the Battle Engine Core, Action Sequences 1, and Row Formation.

Gave a dummy skill to actor 1 that targets 1 ally and uses the exact two commands above in a target action.

No matter who I use it on, everyone shuffles around to logical spaces, there's no overlapping. I can't duplicate your bug.

Did you customize the plugin parameters for actor home positions?
yeah I did in order for people to not be bunch up on each other due to my screen resolution. I'm wondering if something else I have on is interfering. gonna try turning off everything and see if that helps.

Edit... just could not get this to work right so I decided to do this all a different way. I've got a plugin that tracks all home positions on screen and lets you move people and I've got another plugin that sticks them there no matter what lol. I'm gonna close this.

Original thread: https://forums.rpgmakerweb.com/threads/row-formation-and-action-sequences.161819/