• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Water current/ treadmills for Essentials v21.1

Tutorial Water current/ treadmills for Essentials v21.1 1.1

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
53
rafahbit submitted a new resource:

Water current for Essentials v21.1 - Water current

It is possible to find how to make water currents in version 20 and 20.1, but it does not work properly in version v21.1, I made the changes about a few months ago in the original post, but many may not have seen it.
So I bring here the updated tutorial.

this is the old tutorial:
Water current V20/20.1

changes are made to the game's base scripts, so make a backup beforehand to avoid losing your project.

STEP 1 : TerrainTag...

Read more about this resource...
 

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
Thanks for your help with this, I followed your steps (but made it a plugin) and it works fine. However, there's a bug if you try to surf directly over a current terrain, which is something that I need to work because how some parts of my game are made. Do you know how to fix this? I recorded a little clip for reference. If you enter the current while surfing everything works ok, but if you 'jump' over it glitches.
 

Attachments

  • watercurrent.mp4
    1.9 MB
  • watercurrentbug.mp4
    2.4 MB

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
53
Thanks for your help with this, I followed your steps (but made it a plugin) and it works fine. However, there's a bug if you try to surf directly over a current terrain, which is something that I need to work because how some parts of my game are made. Do you know how to fix this? I recorded a little clip for reference. If you enter the current while surfing everything works ok, but if you 'jump' over it glitches.
I need to check this in my game, but I believe it needs a line similar to staying good surfing after a battle. I'll check this later, and if I find a solution I'll come back here.
 

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
53
Thanks for your help with this, I followed your steps (but made it a plugin) and it works fine. However, there's a bug if you try to surf directly over a current terrain, which is something that I need to work because how some parts of my game are made. Do you know how to fix this? I recorded a little clip for reference. If you enter the current while surfing everything works ok, but if you 'jump' over it glitches.
I can't explain this bug, the current you placed was on top of a layer of water with the surf tag? Or was it placed as the first layer? the autotile is

Anyway, I tested all possibilities and the bug didn't happen, maybe it's the plugin.
unable to make a plugin that would work properly, perhaps some part is not working properly as a plugin.
If possible, try doing it without the plugin and see if the same bug occurs.

Another thing that I only realized now was that if you use the tags on the treadmill, you can also surf, so I'll have to rework that part, but it was the only bug I found.
 

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
I can't explain this bug, the current you placed was on top of a layer of water with the surf tag? Or was it placed as the first layer? the autotile is

Anyway, I tested all possibilities and the bug didn't happen, maybe it's the plugin.
unable to make a plugin that would work properly, perhaps some part is not working properly as a plugin.
If possible, try doing it without the plugin and see if the same bug occurs.

Another thing that I only realized now was that if you use the tags on the treadmill, you can also surf, so I'll have to rework that part, but it was the only bug I found.
I tried doing it without making it a plugin and have the same error. However, I found this on the original post which I hadn't read before:

future improvements:

There is a bug when using the default essentials graphics.
In this case, surf and dive have 2 separate graphics, the base and the palyer, if you use surf directly in a watercurrent, only the player moves and the surf base
does not, to avoid this, if it does not affect your game, combine the charts are surf base with the two palyer and leave the surf chart invisible. For now I don't have a plan on how to fix this.

I use default essentials graphics and this describes exactly what happens to me, so I guess this explains it 😅. I'll change the graphics as you say to make it work properly.
 

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
53
I tried doing it without making it a plugin and have the same error. However, I found this on the original post which I hadn't read before:

future improvements:

There is a bug when using the default essentials graphics.
In this case, surf and dive have 2 separate graphics, the base and the palyer, if you use surf directly in a watercurrent, only the player moves and the surf base
does not, to avoid this, if it does not affect your game, combine the charts are surf base with the two palyer and leave the surf chart invisible. For now I don't have a plan on how to fix this.

I use default essentials graphics and this describes exactly what happens to me, so I guess this explains it 😅. I'll change the graphics as you say to make it work properly.
My God, sorry, I swore I had replied to you again talking about how to fix the bug but only mentioning in the tutorial that this exists.
I'm sorry, I hope everything is ok now
 

Willix

Novice
Member
Joined
Feb 7, 2024
Posts
42
My God, sorry, I swore I had replied to you again talking about how to fix the bug but only mentioning in the tutorial that this exists.
I'm sorry, I hope everything is ok now
Don't worry, now it works nicely, thanks for your help! 😊
 

googud

Rookie
Member
Joined
Jun 19, 2024
Posts
2
Thanks for your help with this, I followed your steps (but made it a plugin) and it works fine. However, there's a bug if you try to surf directly over a current terrain, which is something that I need to work because how some parts of my game are made. Do you know how to fix this? I recorded a little clip for reference. If you enter the current while surfing everything works ok, but if you 'jump' over it glitches.
I fix this bug by add one line.
at
def pbWaterCurrent

if !$DEBUG || !Input.press?(Input::CTRL)
return if !$game_player.pbTerrainTag.water_current
$game_temp.surf_base_coords = nil # I added here #manual remove surf base
$game_temp.followers.update

Bug1.png


and one more bug for anyone who stuck at rock near current

change
break if !$game_player.pbTerrainTag.water_current
to
break if ![imath]game_player.pbTerrainTag.water_current || ![/imath]game_player.can_move_in_direction?($game_player.direction) # I added here

Bug2.png


I trying to fix:
Expand Collapse Copy
def pbWaterCurrent
  if !$DEBUG || !Input.press?(Input::CTRL)
    return if !$game_player.pbTerrainTag.water_current
    $game_temp.surf_base_coords = nil # I added here #manual remove surf base
    $game_temp.followers.update
    $PokemonGlobal.sliding = true
    in_water_current = true
    direction = $game_player.direction
    oldwalkanime = $game_player.walk_anime
    first_loop = true

    loop do
      if in_water_current
        case $game_player.pbTerrainTag.id
        when :currentNorth
          direction = 8
        when :currentEast
          direction = 6
        when :currentSouth
          direction = 2
        when :currentWest
          direction = 4
        end
      end
      
      break if !$game_player.pbTerrainTag.water_current || !$game_player.can_move_in_direction?($game_player.direction) # I added here

      if direction == $game_player.direction
        $game_player.move_forward
      else
        in_water_current = false
        case direction
        when 8
          $game_player.move_up
        when 6
          $game_player.move_right
        when 2
          $game_player.move_down
        when 4
          $game_player.move_left
        end
      end

      $game_temp.followers.move_followers if first_loop

      while $game_player.moving?
        pbUpdateSceneMap
        Graphics.update
        Input.update
      end
      first_loop = false

      while $game_player.moving?
        Graphics.update
        Input.update
        pbUpdateSceneMap
      end

      $game_player.center($game_player.x, $game_player.y)
      $game_player.straighten
      $game_player.walk_anime = oldwalkanime
      $PokemonGlobal.sliding = false
    end
  end
end
 

googud

Rookie
Member
Joined
Jun 19, 2024
Posts
2
I using 2 layer Rock on Sea
layer 1 : sea
layer 2 : rock
Avoid it or more bug 🤣



edit
I found that it's not about 2 layer rock.
Player still surf through 1layer rock.

fixed
I found that something make $game_player.through = true
so at pbStartSurfing I add this one line. this problem solve.
Bug3.png


almost good script

a few more bug as you can see in video
sometime it is not smooth water current.
 
Last edited:

rafahbit

Trainer
Member
Joined
Oct 21, 2020
Posts
53
I using 2 layer Rock on Sea
layer 1 : sea
layer 2 : rock
Avoid it or more bug 🤣



edit
I found that it's not about 2 layer rock.
Player still surf through 1layer rock.

fixed
I found that something make $game_player.through = true
so at pbStartSurfing I add this one line. this problem solve.
Bug3.png


almost good script

a few more bug as you can see in video
sometime it is not smooth water current.

I was going to make a plugin where I wouldn't need to make so many changes to the original scripts to make it easier to find and fix bugs like these, I just made an adaptation for 21.1. I didn't touch Pokémon Essentials these months due to a chronic illness, I'm going back now, I'll see if I can improve this adaptation to correct these errors. What I imagined would happen was that the game would slightly freeze when moving from a current on one map to another, I didn't get to test this hypothesis but I believe that this will happen. As soon as I can adapt it better and make a decent plugin, I'll update it here, but I believe it shouldn't take long.

Thanks for the feedback and showing the bug and a solution,
 

StormGallade

Rookie
Member
Joined
Sep 1, 2024
Posts
2
Hey! I've implemented this plugin within my project but I am noticing an issue that is bugging me - The camera following the player desyncs while they are moving through the currents. I understand that there is a center function after the player is done moving through all of the currents they are moving through but I am wondering if there is any possible way to make it so the camera doesn't stray from the player being centered at all. Thanks!
 
Back
Top