• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Resource icon

v20.1 Water current for Essentials v20/20.1 1.0

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖
Hi everyone! In this tutorial, I'm gonna show you how to add water currents to your game.
Before starting, be aware that this is for Essentials v20/20.1, and I'm not planning to make any compatibility with older versions of Essentials. This also isn't compatible with PSDK.

STEP 1 : TerrainTag section

In your script editor, go in the TerrainTag section and look for attr_reader :ignore_passability.
Add attr_reader :water_current on the next line.

Then, look for @ignore_passability in the same section, and add @water_current = hash[:water_current] || false on the next line.

This should look like this :
water_current_1.png

Now, at the end of the section, add these four terrain tag registrations after the :NoEffect one. If you already have scripts that add new terrain tags, change the id numbers (18, 19, 20 and 21) so they don't clash with other id's.

This should look like this :
water_current_2.png

STEP 2 : Overworld section
Now go in the Overworld section and look for Auto-move the player over waterfalls and ice.
Add these two lines between pbSlideOnIce and end :
water_current_3.png

Now look for def pbSlideOnIce, and add this after the last end :
water_current_4.png

To show you how it should look, here is a bit of code from def pbSlideOnIce and def pbWaterCurrent :
Ruby:
$game_player.center($game_player.x, $game_player.y)
  $game_player.straighten
  $game_player.walk_anime = oldwalkanime
  $PokemonGlobal.sliding = false
end

def pbWaterCurrent
  return if !$game_player.pbTerrainTag.water_current
  $game_temp.followers.update
  $PokemonGlobal.sliding = true
  direction    = $game_player.direction

STEP 3 : Overworld_WildEncounters section
Finally, go in the Overworld_WildEncounters section, and look for def encounter_possible_here?
Add this line before the last return false :
water_current_5.png

STEP 4 : Assign the terrain tags
You can now assign the terrain tags to water current tiles. These should already exist within the Autotile folder from base Essentials.

Enjoy this new feature, and let me know if something went wrong.

Also, a big thank you to Vendily and TechSkylander1518 who helped me fix a bug!
Credits
Credit if used:
ChromusSama => main script
Vendily and Techskylander1518 => helping fixing a bug
Author
ChromusSama
Views
1,792
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from ChromusSama

Back
Top