Change sprite for following characters

So I am working on some swimming stuff on my maps, and it's all working well. All my characters have a walking and swimming sprite sheet and they are set to transition between the two as they enter the water region. The problem is that as soon as the leading character touches the water tile, all the characters switch to the swimming animation even though they are still "on land." I've fixed this by having them clump up on entrance and exit to water, but that's a little awkward. Is there a way to have the characters transition one by one as they enter the water region? Thanks!
I assume you are using region or terrain ID to define what is deep water, shallow water, etc... I made a similar system a few years ago, but I don't have it working as a plugin, so I'll give you the methods:

Complete Tutorial Event + Sample video:

Why did I use Javascript to change the follower graphics? Simple, to make the code dynamic and independent of the follower or the current sprite graphic it's using, so I wouldn't need to create dozens of Conditional Branches.

Player:
JavaScript:
$gamePlayer // Object
$gamePlayer.regionId() // Region ID
$gamePlayer._characterName // filename (String)

Check the number of members in the team, as attempting to modify objects that do not currently exist will cause errors in the game:
JavaScript:
$gameParty.members().length // Method with IF

Follower 1 (Party 2):
JavaScript:
$gamePlayer._followers.follower(0) // Object
$gamePlayer._followers.follower(0).regionId() // Region ID (Number)
$gamePlayer._followers.follower(0)._characterName // filename (String)

Follower 2 (Party 3):
JavaScript:
$gamePlayer._followers.follower(1) // Object
$gamePlayer._followers.follower(1).regionId() // Region ID (Number)
$gamePlayer._followers.follower(1)._characterName // filename (String)

Follower 3 (Party 4):
JavaScript:
$gamePlayer._followers.follower(2) // Object
$gamePlayer._followers.follower(2).regionId() // Region ID (Number)
$gamePlayer._followers.follower(2)._characterName // String
This looks really promising! To which js file should I add this code?
Please click on the link I sent you...
Complete Tutorial Event + Sample video:
I see! Apologies. I got this working to an extent, but now I'm running into a new complication. It may be that your code allows for this, but I'm not familiar enough with js to get it working. The game allows for actors to join in various orders, so any actor could theoretically occupy any follower position. Is there a way to read which actor is in the position and change the sprite sheet accordingly?
I took care of this using variables! I'm sure there is a more elegant way to do it, but after all this time the swimming is working as intended! Thanks for your help, I wouldn't have been able to figure this out without you.
Screenshot 2025-11-01 at 2.42.42 PM.png
There's no need for double posting in a short period of time if your message can be edited...

Yes, it's much simpler than everything I've shown before. You'll know the actor's ID, and this simple number will be the pointer to all the data of that particular actor:

Just analyze this using F8 or F12:
Code:
$gameParty // return Object ({})

List:
JavaScript:
$gameParty._actors // return Array like [1,4,2,3]

Example:
JavaScript:
$gameParty._actors[0] // return 1 (ID in database)

Return name:
JavaScript:
$gameActors._data[$gameParty._actors[0]]._name // return String "Harold" (In a new project, if the player keeps him as the leader...)

Read this:

Original thread: https://forums.rpgmakerweb.com/threads/change-sprite-for-following-characters.180801/