• The Eevee Expo Game Jam #10 has concluded, congratulations to all participants! Now it's time for the judges to play through the games, and you can play along to vote who deserves the community choice spotlight.
    You can check out the submitted games here!
    Play through the games and provide some feedback to the devs while you're at it!
  • 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

Resource Pokemon Terrain Step Sounds 1

Enurta

Rookie
Member
Joined
Dec 30, 2020
Posts
2
Enurta submitted a new resource:

Pokemon Terrain Step Sounds - Sounds while walking on different terrain

Insert script above main
Ruby:
Expand Collapse Copy
#===============================================================================
# PE Terrain Step Sounds
# Version 1
# by Enurta
#-------------------------------------------------------------------------------
PluginManager.register({
  :name => "Terain Sounds",
  :version => "1.0",
  :credits => ["Enurta","gameguy"],
})
# Create nice aesthetics with terrain noise. As you walk across grass or sand,
# let it play a beautiful noise to add to the atmosphere...

Read more about this resource...
 

Leondrea

Trainer
Member
Joined
Jul 26, 2020
Posts
95
I tried this out, I wished it would work but it didn't :(
When I playtest an error appears as soon as I reach the bridge, even though I reassured the bridge has the terrain tag 15 in Debug Mode and the Script is the sound file and the sound files are in the folder, that I've added.
I'm using Essentials v.18.1 with this scripts:
  • Character Selection Screen by b04p5687 and TechSkylander
  • Name Windows from Mr. Gela
  • Item Find from Boonzeet
  • Evolution Customise from b04p5687
  • HGSS PokéGear from b04p5687 and Graphics from RichardPT
  • Options from Mr. Gela.
  • and last Script is yours "Terrain Step Sounds"
I've got this error:

NoMethodError:
Expand Collapse Copy
---------------------------
Pokemon Essentials
---------------------------
[Pokémon Essentials version 18.1.dev]

Exception: NoMethodError

Message: undefined method `[]' for nil:NilClass



Backtrace:

Terrain Step Sounds:79

Terrain Step Sounds:70:in `call'

Event_Handlers:51:in `trigger'

Event_Handlers:46:in `each'

Event_Handlers:46:in `trigger'

Game_Character:828:in `update_move'

Game_Character:769:in `update'

Game_Player:335:in `update'

Scene_Map:163:in `update'

Scene_Map:160:in `loop'



This exception was logged in

C:\Users\USERNAME\Saved Games\Pokemon Essentials\errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------


Here is your script that I've put above Main:

Code:
Expand Collapse Copy
#===============================================================================
# PE Terrain Step Sounds
# Version 1
# by Enurta
#-------------------------------------------------------------------------------
PluginManager.register({
  :name => "Terain Sounds",
  :version => "1.0",
  :credits => ["Enurta","gameguy"],
})
# Create nice aesthetics with terrain noise. As you walk across grass or sand,
# let it play a beautiful noise to add to the atmosphere and realism of the
# game.
#
# Features:
# Specific Sound for Each Terrain and Tileset
# Specify Volume and Pitch
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#===============================================================================   
module PETS
Tag = []
Tileset  = []
#===============================================================================
# Enter in sounds for each terrain tag
# Goes from 0-15 for Pokemon Essentials. Terrain Tag 1 won't be used as it is already coded within essentials.
# Each terrain type is in the array below.
#
# You can specify the sound file, the volume, and pitch of the file.
# Tag[2] = [["Filename",volume,pitch]
# Filename - Replace with the name of the file that you want to use
# Volume - 0-100; higher is louder
# Pitch - 50-150; lower is deeper
# If volume and pitch are not specified they will default to 100 for both.
#======================================================================================
Tag[0] = ["se_step_default",100,100] # Nothing
Tag[2] = ["se_step_grass",100,100] # Grass
Tag[3] = ["se_step_run_dirt",100,100] # Sand
Tag[4] = ["se_step_road",100,100] # Rock
Tag[5] = [] # Deep Water
Tag[6] = [] # Still Water
Tag[7] = [] # Water
Tag[8] = [] # Waterfall
Tag[9] = [] # Waterrfal Crest
Tag[10] = ["se_step_grass",100,100] # Tall Grass
Tag[11] = [] # Underwater Grass
Tag[12] = [] # Ice
Tag[13] = ["se_step_default",100,100] # Neutral
Tag[14] = ["se_step_grass",100,100] # Sootgrass
Tag[15] = ["se_step_default",100,100] # Bridge
# With tilesets, you can set specific sounds for each tileset so you don't
# have the same sounds. Add a new line and put
# Tilesets[tileset id] = []
# Then for each terrain put
# Tilesets[tileset id][terrain id] = "sound file"
# If a sound doesn't exist for a tileset, it will play a default sound,
# if a default doesn't exist, no sound at all.
end
#========================================================================================
# Game Map
#========================================================================================
class Game_Map
  attr_accessor :map
end
#=================================================================================
# Event that triggers the sound
#=================================================================================
Events.onStepTakenFieldMovement += proc { |_sender,e|
  event = e[0] # Get the event affected by field movement
  if $scene.is_a?(Scene_Map) && event==$game_player && !$PokemonGlobal.bicycle
    step_sound = PETS::Tag[pbGetTerrainTag(event)]
    if PETS::Tileset[$game_map.map.tileset_id] != nil # Prevents crashing
    unless PETS::Tileset[$game_map.map.tileset_id][pbGetTerrainTag(event)] == nil
      step_sound = PETS::Tileset[$game_map.map.tileset_id][pbGetTerrainTag(event)]
      end
    end
    sound = step_sound[0]
    volume = step_sound[1]
    pitch = step_sound[2]
    pbSEPlay(sound,volume,pitch)
  end
}
[/SPOILER]

I can't figure out why this error appears. I tried to think of NoMethodError but I can't see any "nil's" in the script itself.
And I will use NO HMS and is there a way to take off those tags 5-12? I will use key items to remove the HMs
 
I tried this out, I wished it would work but it didn't :(
When I playtest an error appears as soon as I reach the bridge, even though I reassured the bridge has the terrain tag 15 in Debug Mode and the Script is the sound file and the sound files are in the folder, that I've added.
I tried putting your script in a copy of Essentials, and I never got this error, even without having the sound effect file in the folder. I did manage to get an identical error when I stepped without a sound effect option- for example, I commented out "Tag[0] = ["se_step_default",100,100]" and stepped on a tile with no terrain tag, and that gave me the error. So I'd suggest double-checking to make sure that you didn't accidentally set the bridge to something besides 15 on accident.

And I will use NO HMS and is there a way to take off those tags 5-12? I will use key items to remove the HMs
You'll still use those terrain tags, won't you? For example, even if you use a Surfboard instead of Surf, you'd still need to have the tag marking that as water.
 

Leondrea

Trainer
Member
Joined
Jul 26, 2020
Posts
95
I tried putting your script in a copy of Essentials, and I never got this error, even without having the sound effect file in the folder. I did manage to get an identical error when I stepped without a sound effect option- for example, I commented out "Tag[0] = ["se_step_default",100,100]" and stepped on a tile with no terrain tag, and that gave me the error. So I'd suggest double-checking to make sure that you didn't accidentally set the bridge to something besides 15 on accident.
I double-checked and the game set the terrain tag of the bridge to 42, even though I changed it back to 15...
maybe I didn't save properly? Now I went back and I put every 42 tags to 15 and made sure to save it, then I closed RMXP
and opened it again. I went back to the terrain tags editor and now it says 15 again.

Now I playtested it again, and when I go through the bridge the same error pops up.
Do I need to change the terrain tag of the tile in layer 2 and layer 1 to 15 too?
Thank you for your help, I appreciate it.

You'll still use those terrain tags, won't you? For example, even if you use a Surfboard instead of Surf, you'd still need to have the tag marking that as water.
I thought that when I use no HMS I wouldn't need those tags, but when you say they are for the movement in-game then I better let them be there.
Just wondering how I do that with the badges, but I'll be watching Thundaga's tutorials and I may be using Marin's script for that.
 
Last edited:
Now I playtested it again, and when I go through the bridge the same error pops up.
Do I need to change the terrain tag of the tile in layer 2 and layer 1 to 15 too?
Hm... I'd definitely suggest doing that, at least, but it sounds like your editor is having problems saving the terrain tag for some reason...
I thought that when I use no HMS I wouldn't need those tags, but when you say they are for the movement in-game then I better let them be there.
Yeah, terrain tags do a lot more than just handle HMs. The water tag, for example, doesn't just ask the player to surf, it also calls the Water encounter types, and lets the the player fish there.
 

BIGFriv

Mr. Bigglesworth
Member
Joined
Mar 31, 2017
Posts
58
Has anyone made this script work for v19.1? I really want to use it, but I'm not very good at updating scripts myself.
 

Golisopod User

Elite Trainer
Member
Joined
May 11, 2020
Posts
319
Has anyone made this script work for v19.1? I really want to use it, but I'm not very good at updating scripts myself.
Had a quick glance at the script and looks like all that needs to be changed is that pbGetTerrainTag(event) becomes $game_map.terrain_tag(event.x,event.y). I'm not a 100% sure though.
 

SethLikesCombusken

Novice
Member
Joined
Apr 12, 2021
Posts
15
Yes, I know. Ence why I asked what I could do to port it to v19.1
the way 19 handles terrain tags has it define a lot of shit differently unfortunately. ive been trying to make a version of this script for 19.1 but no luck :/
 

SethLikesCombusken

Novice
Member
Joined
Apr 12, 2021
Posts
15
Yes, I know. Ence why I asked what I could do to port it to v19.1
ok so i actually figured it out
just put this in its own script above main (there are two variations):

Ruby:
Expand Collapse Copy
Events.onStepTakenFieldMovement += proc { |_sender, e|
  event = e[0]
  if $scene.is_a?(Scene_Map)
    event.each_occupied_tile do |x, y|
     #you can actually put as many of these modules as u need, one for each tag
     if $MapFactory.getTerrainTag(event.map.map_id, x, y, true).id_number == 2 #<-- Tag # for grass, you can put whichever
       pbSEPlay("[INSERT YOUR FILE NAME HERE]")
     end
     #
     if $MapFactory.getTerrainTag(event.map.map_id, x, y, true).id_number == 4 #<-- Tag # for rock, you can put whichever
       pbSEPlay("[INSERT YOUR FILE NAME HERE]")
     end
     #
    end
  end
}

that one's for if you want a single sound to play... but i did this with my game:

Ruby:
Expand Collapse Copy
Events.onStepTakenFieldMovement += proc { |_sender, e|
  event = e[0]
  if $scene.is_a?(Scene_Map)
    event.each_occupied_tile do |x, y|
     if $MapFactory.getTerrainTag(event.map.map_id, x, y, true).id_number == 4 #<-- Tag # for rock
       i = rand(6)+1
       i = "rocksound(1)" if i == 1
       i = "rocksound(2)" if i == 2
       i = "rocksound(3)" if i == 3
       i = "rocksound(4)" if i == 4
       i = "rocksound(5)" if i == 5
       i = "rocksound(6)" if i == 6
       pbSEPlay(i)
     end
    end
  end
}

what this does is it will play any of the songs above based on a random number so your footsteps feel more authentic :)
 
Back
Top