Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
24
Reaction score
9
First Language
Finnish
Primarily Uses
RMMV
Hi! I managed to make a walking-in-water sprite work for the player as well as the follower when crossing a river, but the problem with how I made it is when the player steps in the water and the follower is still on land, the follower also gets the water sprite when he's not yet in the water.

I have a common event checking location ID based on tile regions, and it changes the sprites when the player is in the river.

Is there a way to make the follower's sprite change only when he's actually in the water, instead of based on the player's location? :LZSproud:
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,428
Reaction score
15,223
First Language
English
Primarily Uses
RMMV
You would have to make your common event check the player and each follower position separately and update their sprites as necessary, rather than changing all sprites based on where the leader is.

The player and followers are all Game_Character objects, so all have the regionId() function.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
759
Reaction score
372
First Language
PT-BR
Primarily Uses
RM2k3
If you have any experience with Javascript, see this list of RMMV commands:
RPG MAKER MV / MZ Script Calls

Possibly someone will soon come up with a plugin or practice method, for now I am away from my personal computer where I could do the tests to be sure how to create.

Good luck
 

Neikoku

Villager
Member
Joined
Apr 17, 2021
Messages
24
Reaction score
9
First Language
Finnish
Primarily Uses
RMMV
You would have to make your common event check the player and each follower position separately and update their sprites as necessary, rather than changing all sprites based on where the leader is.

The player and followers are all Game_Character objects, so all have the regionId() function.
Ah yes I got it to work now, thank you!! Still a problem though, the follower's sprite changes only after taking another step outside/in the water. So when he steps on land, he still has the in-water sprite until he takes another step. Is there any way around this? :oops:

I tried the "change actor images" event command and then a script, both working the same. Here's the script:

1620998570772.png

@Dev_With_Coffee thanks for the list! I don't really know javascript (am able to figure it out if have to though) but I have felt a need for this at times.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
759
Reaction score
372
First Language
PT-BR
Primarily Uses
RM2k3
I will try to do this over the weekend.
 
Joined
May 24, 2021
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Yes, thank you, I've gotten it to work now!! However, there is still a problem: the follower's sprite only changes after taking another step outside/in the water. As a result, when he walks onto land, the in-water sprite remains with him till he makes another step. Is there a way to get out of this? :oops:

I tested both the "change actor images" event command and a script, and they both worked. The following is the script:
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
759
Reaction score
372
First Language
PT-BR
Primarily Uses
RM2k3
I did combining events with javascript, but it has the 4 member limit (default in Rpg Maker), if I create a plugin with this method I can do it for systems that may have more members or affect map events like NPCs.
Code:
◆If:Script:$gameParty.members().length > 0
  ◆Comment:=============================== LEADER =============================
  ◆If:Script:$gamePlayer.regionId() === 0
    ◆Script:$gamePlayer._characterName=$gamePlayer._characterName.split("_")[0]
    ◆
  :End
  ◆If:Script:$gamePlayer.regionId() === 1
    ◆Script:$gamePlayer._characterName=$gamePlayer._characterName.split("_")[0]+"_water"
    ◆
  :End
  ◆If:Script:$gamePlayer.regionId() === 2
    ◆Script:$gamePlayer._characterName=$gamePlayer._characterName.split("_")[0]+"_deep"
    ◆
  :End
  ◆Comment:=============================== Follower 1 =============================
  ◆If:Script:$gameParty.members().length > 1
    ◆If:Script:$gamePlayer._followers.follower(0).regionId() == 0
      ◆Script:$gamePlayer._followers.follower(0)._characterName=$gamePlayer._followers.follower(0)._characterName.split("_")[0]
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(0).regionId() == 1
      ◆Script:$gamePlayer._followers.follower(0)._characterName=$gamePlayer._followers.follower(0)._characterName.split("_")[0]+"_water"
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(0).regionId() == 2
      ◆Script:$gamePlayer._followers.follower(0)._characterName=$gamePlayer._followers.follower(0)._characterName.split("_")[0]+"_deep"
      ◆
    :End
    ◆
  :End
  ◆Comment:=============================== Follower 2 =============================
  ◆If:Script:$gameParty.members().length > 2
    ◆If:Script:$gamePlayer._followers.follower(1).regionId() == 0
      ◆Script:$gamePlayer._followers.follower(1)._characterName=$gamePlayer._followers.follower(1)._characterName.split("_")[0]
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(1).regionId() == 1
      ◆Script:$gamePlayer._followers.follower(1)._characterName=$gamePlayer._followers.follower(1)._characterName.split("_")[0]+"_water"
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(1).regionId() == 2
      ◆Script:$gamePlayer._followers.follower(1)._characterName=$gamePlayer._followers.follower(1)._characterName.split("_")[0]+"_deep"
      ◆
    :End
    ◆
  :End
  ◆Comment:=============================== Follower 3 =============================
  ◆If:Script:$gameParty.members().length > 3
    ◆If:Script:$gamePlayer._followers.follower(2).regionId() == 0
      ◆Script:$gamePlayer._followers.follower(2)._characterName=$gamePlayer._followers.follower(2)._characterName.split("_")[0]
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(2).regionId() == 1
      ◆Script:$gamePlayer._followers.follower(2)._characterName=$gamePlayer._followers.follower(2)._characterName.split("_")[0]+"_water"
      ◆
    :End
    ◆If:Script:$gamePlayer._followers.follower(2).regionId() == 2
      ◆Script:$gamePlayer._followers.follower(2)._characterName=$gamePlayer._followers.follower(2)._characterName.split("_")[0]+"_deep"
      ◆
    :End
    ◆
  :End
  ◆
:End
◆Wait:1 frame

Demo Video:
 

Latest Threads

Latest Posts

Latest Profile Posts

headshot_headshot.jpg
The theory has been proved. Based on an invisible image's data(the big red dot in the previous image), RM can identify different parts of an enemy and do something respectively. :kaojoy:
Ok.. coding what should be a simple "everyone is petrified and therefore dead, now go to game over screen" shouldn't involve needing to become Dr. J and dunking from the free throw line(my way of saying "jumping through hoops").
Hmmmm... how many xrays til I get super powers?
..of the major old school series that began in the 80s- early 90s, I still haven't beaten 'a' Zelda game. Mario 64 was the first Mario I've beaten. I don't know if I should give that honor to Link to the Past or A Link Between Worlds(I currently own both). Well technically I've haven't beaten a Sonic either (Game Genie doesn't count =P).
headshot_headinfo.jpg
Time to add the "headshot" concept into the game so that people may actually aim at the heads when shooting zombies and get massive damage and armor-pen bonus as rewards. :kaojoy:
(The red area is just for visually debug purposes right now. But, it's possible that I will add something that displays the weak spots of enemies in the future.)

Forum statistics

Threads
115,381
Messages
1,089,422
Members
150,096
Latest member
sanriosimp
Top