[XP] Terrain Step Sound

Started by G_G, April 26, 2011, 08:42:09 pm

Previous topic - Next topic

G_G

April 26, 2011, 08:42:09 pm Last Edit: September 08, 2019, 04:26:16 pm by KK20
Terrain Step Sound
Authors: game_guy
Version: 1.3
Type: Environment Add-on
Key Term: Environment Add-on

Introduction

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
  • Specific Sounds for Each Tileset
  • Specify Volume and Pitch
  • Specify an array of sounds to allow multiple sounds per terrain

Screenshots

N/A
Screenshots can't produce sound.

Demo

N/A
Links can't produce sound either.

Script

v1.2: ShowHide

#===============================================================================
# Terrain Step Sound
# Version 1.2
# Author game_guy
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
#===============================================================================
module TSS
  # In Frames Recommended 5-10
  Wait = 10
  # Ignore the next 2 lines
  Terrains = []
  Tilesets = []
  #===========================================================================
  # Enter in sounds for each terrain tag
  # Goes from 0-8. Set as nil to disable that terrain or delete the line.
  # Each terrain must now be an array. This allows you to define multiple
  # sound effects for each terrain.
  #===========================================================================
  Terrains[0] = ['001-System01', '002-System02', '003-System03']
  Terrains[1] = ['fs_wood_hard1']
  Terrains[2] = ['fs_grass03']
  Terrains[3] = ['fs_stone_hoof2']
  Terrains[4] = ['as_na_grassmove2']
  Terrains[5] = ['fs_water_hard1']
  Terrains[6] = ['fs_dirt_hard1']
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  Terrains[7] = [["sound", 80, 10], "sound2", ["sound3", 50, 0]]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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.
  #===========================================================================
  Tilesets[2] = []
  Tilesets[2][0] = ["Sound"]
  Tilesets[2][1] = [["sound", 75, 50]]
end
class Game_Map
 
  attr_accessor :rate
 
  alias gg_init_terrain_sounds_map_lat initialize
  def initialize
    @rate = TSS::Wait
    return gg_init_terrain_sounds_map_lat
  end
 
  def terrain_sound
    if TSS::Tilesets[@map.tileset_id] != nil
      sounds = TSS::Tilesets[@map.tileset_id][$game_player.terrain_tag]
    else
      sounds = TSS::Terrains[$game_player.terrain_tag]
    end
    return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
    sound = sounds[rand(sounds.size)]
    if sound.is_a?(Array)
      return [sound[0], sound[1], sound[2]]
    else
      return [sound, 100, 0]
    end
  end
 
end

class Game_Player < Game_Character
 
  def update_move
    @timer = $game_map.rate if @timer == nil
    @timer -= 1
    if @timer < 1
      terrain = $game_map.terrain_sound
      if terrain != nil
        vol = terrain[1]
        pit = terrain[2]
        son = terrain[0]
        Audio.se_play('Audio/SE/' + son, vol, pit)
      end
      @timer = $game_map.rate
    end
    super
  end
 
end


Zexion added a few more features: https://forum.chaos-project.com/index.php/topic,9460.msg192088.html#msg192088
v1.3: ShowHide

#===============================================================================
# Terrain Step Sound + Events
# Version 1.3
# Author game_guy
# New Features by Zexion
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
# Specify events that can play these sounds.
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Add the Name_Tag ("steps" by default) to the event page name (without quotes)
# to add dynamic footstep sounds to that event.
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
# Zex - For the Event & move_speed edit
# kk20 - for listening to zex's complaints
#===============================================================================
module TSS
  # Adjust this to your liking
  Wait = 20
  Name_Tag = "steps"
  # Ignore this
  Terrains, Tilesets = [], []
  #===========================================================================
  # Enter in sounds for each terrain tag
  # Goes from 0-8. Set as nil to disable that terrain or delete the line.
  # Each terrain must now be an array. This allows you to define multiple
  # sound effects for each terrain.
  #===========================================================================
  Terrains[0] = []
  Terrains[1] = [["FS - 03 - Wood", 40, 0],["FS - 04 - Wood", 40, 0]]
  Terrains[2] = ['FS - 05 - Metal']
  Terrains[3] = ['FS - 07 - Hollow Metal']
  Terrains[4] = [["FS - 09 - Concrete", 40, 0]]
  Terrains[5] = [["FS - 11 - Dirt", 40, 0],["FS - 11 - Dirt", 40, 0]]
  Terrains[6] = [["FS - 13 - Grass", 40, 0], ["FS - 14 - Grass", 40, 0]]
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  Terrains[7] = [["FS - 01 - Water", 50, 0],["FS - 02 - Water", 50, 0]]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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          # make public
end
#-------------------------------------------------------------------------------
# Game_Character
#-------------------------------------------------------------------------------
# Adds Gameus's terrain_sound method to game_character.
#-------------------------------------------------------------------------------
class Game_Character
  attr_accessor :move_speed  # make public
  #-----------------------------------------------------------------------------
  # Initialize ss_index
  #-----------------------------------------------------------------------------
  alias g_c_sfe_init initialize
  def initialize
    g_c_sfe_init
    @ss_index = 0
    @timer = 0
    @tss_speed = @move_speed
    set_tss_offset
  end
  #-----------------------------------------------------------------------------
  # Updates the timer when needed
  #-----------------------------------------------------------------------------
  alias g_c_sfe_update update
  def update
    g_c_sfe_update
    @timer -= 1 if @timer > 0
    if @tss_speed != self.move_speed
      set_tss_offset
    end
  end
  #-----------------------------------------------------------------------------
  # Sets the sound offset
  #-----------------------------------------------------------------------------
  def set_tss_offset   
    # Timer offset by movespeed
    case self.move_speed
    when 0..2
      @tss_offset = TSS::Wait + self.move_speed
    when 3
      @tss_offset = TSS::Wait
    else
      @tss_offset = TSS::Wait - self.move_speed * 2
    end
  end
  #-----------------------------------------------------------------------------
  # Returns the array to be used later
  #-----------------------------------------------------------------------------
  def terrain_sound
    if TSS::Tilesets[$game_map.map.tileset_id] != nil
      sounds = TSS::Tilesets[$game_map.map.tileset_id][self.terrain_tag]
    else
      sounds = TSS::Terrains[self.terrain_tag]
    end
    return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
    index_max = sounds.size - 1
    @ss_index = (@ss_index < index_max) ? (@ss_index + 1) : 0
    sound = sounds[@ss_index]
    if sound.is_a?(Array)
      return [sound[0], sound[1], sound[2]]
    else
      return [sound, 100, 0]
    end
  end
end
#-------------------------------------------------------------------------------
# Game_Player
#-------------------------------------------------------------------------------
Tss_Parent = $BlizzABS ? (Map_Actor) : (Game_Character)
class Game_Player < Tss_Parent
  #-----------------------------------------------------------------------------
  # Adds step sounds to the player
  #-----------------------------------------------------------------------------
  def update_move
    # Make sure this is the player
    if self != $game_event && @timer == 0
      # Play the sound effect
      terrain = self.terrain_sound
      if terrain != nil
        vol = terrain[1]
        pit = terrain[2]
        son = terrain[0]
        Audio.se_play('Audio/SE/' + son, vol, pit)
      end
      # Set timer
      @timer = @tss_offset
    end
    # Call original code
    super
  end
end
#-------------------------------------------------------------------------------
# Game_Event
#-------------------------------------------------------------------------------
class Game_Event < Game_Character
  #-----------------------------------------------------------------------------
  # Set the variable for checking if the event should make a sound
  #-----------------------------------------------------------------------------
  alias g_e_sfe_init initialize
  def initialize(map_id, event)
    g_e_sfe_init(map_id, event)
    @tss = self.name.include?(TSS::Name_Tag) ? true : false
  end
  #--------------------------------------------------------------------------
  # * Returns the event's name
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
  #-----------------------------------------------------------------------------
  # Returns the distance of this event from the player
  #-----------------------------------------------------------------------------
  def range?
    if $BlizzABS && BlizzABS::Config::PIXEL_MOVEMENT_RATE == 1
      player_x = $game_player.x / 2 # Adjusted for 1.0 pixel movement rate
      player_y = $game_player.y / 2 # Adjusted for 1.0 pixel movement rate
    else
      player_x = $game_player.x
      player_y = $game_player.y
    end
    radius = (Math.hypot((self.x - player_x), (self.y - player_y))).abs.floor
    return (radius)
  end
  #-----------------------------------------------------------------------------
  # Adds step sounds to the event with dynamic volume
  #-----------------------------------------------------------------------------
  def update_move
    # Check if the event should play a sound
    if @tss
      # Make sure it's an event
      if self != $game_player
        # Check if the event is anywhere near the player
        if range? <= 6 && @timer == 0
          # The amount to subtract from the normal volume
          sub_vol = 4 * range?
          # Play the sound effect
          terrain = self.terrain_sound
            if terrain != nil
              vol = terrain[1]
              pit = terrain[2]
              son = terrain[0]
              # Dynamic sound edit
              vol = vol - sub_vol
              vol = 0 if vol < 0
              Audio.se_play('Audio/SE/' + son, vol, pit)
            end
            # Set timer
            @timer = @tss_offset
          end
        end
      end
      # Call original code
      super
    end
end


Instructions

In script.

Compatibility

Not tested with SDK.

Credits and Thanks

  • game_guy ~ For creating it
  • Tuggernuts ~ For requesting it a long time ago
  • Sase ~ For also requeseting it

Author's Notes

Enjoy!

Cid

Is there a way to specify the volume and pitch of each sound effect?

G_G

*Updates*

Now at 1.1, you can now specify volume and pitch for each terrain.

Cid

Hmm, I get this error (upon moving the character) whenever I make use of the volume/pitch adjuster:

QuoteScript 'Terrain Sound' line 90: TypeError occured.
cannot convert nil into String


Have I missed something during set-up?

G_G

Fixed. Simple typo, sorry. >.<

Spaceman McConaughey

Glad I gave the OK on this being released. It's much better now. :D

*levels up*

Cid


Stray

Is there a way to make it with 4-8 sounds for each terrain?
Because always the same sound on a terrain is very annoying. As example: If there is a big area with the same terrain.

Annoying:
http://www.2shared.com/audio/OnpreM-G/Step_H1.html

Not so annoying:
http://www.2shared.com/audio/jAtsh7UX/Step_H2.html
I'm very grateful to you all for your great help.

G_G

Its possible. But it'd take a bit to do it. If I have the time after school today I'll try and do it.

Stray

Oh god, thank you so much for trying it!
I'm very grateful to you all for your great help.

Stray

I wanted to ask again...

also, is it able to make stepsounds for the npcs?
I'm very grateful to you all for your great help.

Vexus

Sorry for necropost but I'm having a small problem with this script.

I made a small event that makes your character move forward twice, play a sound effect and jump backwards and till there it works but when I move after the event the terrain no longer makes sounds when walking till I open/close menu or enter new map.

Anything I can do to fix it?

Also would be it too hard to have a script call that let's me change the wait for the sound so when your running the stepping sound goes faster and when your walking it goes back to what you write on the script?

Thanks
Current Project/s:

G_G

I'll look into it Vexux. Gimme about a week. xD My to-do list is getting pretty big.

Vexus

Sure np.

Thanks for adding it to the to-do list :)
Current Project/s:

toni112007

Hi all im new i have rpg maker xp and this does not work for me as i make this script and do what it says whenever i choose from 0-7 it says cannot find audio/se/fs "name of sound " when in game and game shuts down.

Landith

That means you need that file in your audio folder. So whatever 'name of sound' is put it in that folder 'GAME NAME/Audio/Se/Fs/' or whatever it specifies and you won't get that error anymore.

Blizzard

Just change them in the config.


  Terrains[0] = '001-System01'
 Terrains[1] = 'fs_wood_hard1'
 Terrains[2] = 'fs_grass03'
 Terrains[3] = 'fs_stone_hoof2'
 Terrains[4] = 'as_na_grassmove2'
 Terrains[5] = 'fs_water_hard1'
 Terrains[6] = 'fs_dirt_hard1'
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

toni112007

Do you know where are that sounds located? i cant find them anywhere :/
sorry im noob at rpg maker xp

G_G

In your project's folder. You place the sound effects in "Audio/SE/"

toni112007

I know that but i dont know where are these sound located
001-System01
fs_wood_hard1
fs_grass03
fs_stone_hoof2
as_na_grassmove2
fs_water_hard1
fs_dirt_hard1

I found only 001-system01,but i dont have others where can i get them?

G_G

They're not included. It was just an example of how to configure the script. You'll have to provide your own sound effects.

toni112007

ow so i can use my sounds and change name in script of these?

and one more thing sorry for offtop but i need to know how to make light effect
because im making dark horror game and i need light effect for lantern

G_G

Yes, you can use your own sounds. As for the light effect, you're going to have to post that in the Tutorials Request board.

toni112007

Hi again how can i set more sounds for one terrain? because with only one sound for fs it sounds like typewriter.
is there any way to make more sounds for one terrain.etc like i have 3 sounds for one terrain and sound change on each tile/footstep(more realistic) you know what i mean?

G_G

It's not possible with this version of the script, but I could add that possibility in there. I have to update the script anyways to fix the issue Vexus was having.

toni112007


Blizzard

Quick idea: You could use an array of strings (instead of just a string) as config. Then you simply pick a string randomly for the sound effect. This can be implemented in, like, 5 minutes.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

That's actually what I had planned. xD I have a job now so I don't just sit at my computer 24/7 like usual. I'll get to it this Saturday, I have it off.


ForeverZer0

Quote from: Blizzard on June 28, 2012, 04:47:22 pm
Quick idea: You could use an array of strings (instead of just a string) as config. Then you simply pick a string randomly for the sound effect. This can be implemented in, like, 5 minutes.


Thats how I did the "Ambient SFX" script I made a long time ago.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

toni112007

Could you make script that includes for when left leg moves plays one sound and when right leg moves plays other sound.that way it would be good footstep sound.thx

G_G

Updated to 1.2.

Play rate is now checked through Game_Player's "update_move" method so sounds should always work.
Every terrain must now be an array. Within the array, you can define sounds as a single "string" or as an array with volume and pitch options.
Terrain[0] = ["sound1", "sound2", ["sound3", 100, 0]]

If you only want one sound per terrain, you have the option to only put one sound in. If you don't want any sounds for the terrain, leave it empty.

You can also change the sound rate in game by using a script call.
$game_map.rate = X
X = value (the lower, the more frequent the sounds, 5-10 works weel)


Enjoy!

Vexus

Thanks for updating the script but now I get an error on Blizz Abs Part 2 on line 2219: NoMethodError occurred.

undefined method 'refresh' for #<Game_Player:0x8df1060>

Placing script over Blizz Abs scripts removes the error but no sound plays.
Current Project/s:

G_G

Go to line 99 and change this
class Game_Player < Game_Character

to
class Game_Player < Map_Actor

Vexus

Ok that fixed the first error now I'm getting another when I make a step on a terrain which has a sound.

line 115: TypeError occurred.

cannot convert fixnum into string.

Current Project/s:

G_G

Can you paste your configuration please?

Vexus

Sure:

#===============================================================================
# Terrain Step Sound
# Version 1.2
# Author game_guy
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
#===============================================================================
module TSS
  # In Frames Recommended 5-10
  Wait = 18
  # Ignore the next 2 lines
  Terrains = []
  Tilesets = []
  #===========================================================================
  # Enter in sounds for each terrain tag
  # Goes from 0-8. Set as nil to disable that terrain or delete the line.
  # Each terrain must now be an array. This allows you to define multiple
  # sound effects for each terrain.
  #===========================================================================
  #Terrains[0] = ['001-System01', '002-System02', '003-System03']
  Terrains[1] = 'Wood'
  Terrains[2] = 'Floor'
  Terrains[3] = ''
  Terrains[4] = ''
  Terrains[5] = ''
  Terrains[6] = ''
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  #Terrains[7] = [["sound", 80, 10], "sound2", ["sound3", 50, 0]]
  Terrains[2] = ["Floor", 70, 100]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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.
  #===========================================================================
  Tilesets[1] = []
  Tilesets[1][0] = "Floor"
  Tilesets[1][1] = ["Floor", 50, 100]
  #
  Tilesets[54] = []
  #Tilesets[54][1] = "Metal Step"
  Tilesets[54][1] = ["Metal Step", 80, 100]
end
class Game_Map
 
  attr_accessor :rate
 
  alias gg_init_terrain_sounds_map_lat initialize
  def initialize
    @rate = TSS::Wait
    return gg_init_terrain_sounds_map_lat
  end
 
  def terrain_sound
    if TSS::Tilesets[@map.tileset_id] != nil
      sounds = TSS::Tilesets[@map.tileset_id][$game_player.terrain_tag]
    else
      sounds = TSS::Terrains[$game_player.terrain_tag]
    end
    return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
    sound = sounds[rand(sounds.size)]
    if sound.is_a?(Array)
      return [sound[0], sound[1], sound[2]]
    else
      return [sound, 100, 0]
    end
  end
 
end

class Game_Player < Map_Actor
 
  def update_move
    @timer = $game_map.rate if @timer == nil
    @timer -= 1
    if @timer < 1
      terrain = $game_map.terrain_sound
      if terrain != nil
        vol = terrain[1]
        pit = terrain[2]
        son = terrain[0]
        Audio.se_play('Audio/SE/' + son, vol, pit)
      end
      @timer = $game_map.rate
    end
    super
  end
 
end
Current Project/s:

G_G

This is your issue. Each sound or sound array, needs to be in an array itself.
Tilesets[54][1] = ["Metal Step", 80, 100]

To
Tilesets[54][1] = [["Metal Step", 80, 100]]


Along with these options as well.
Terrains[1] = 'Wood'
  Terrains[2] = 'Floor'
  Terrains[3] = ''
  Terrains[4] = ''
  Terrains[5] = ''
  Terrains[6] = ''
Terrains[2] = ["Floor", 70, 100]

Tilesets[1][0] = "Floor"
  Tilesets[1][1] = ["Floor", 50, 100]


All need to be wrapped in  [ ]

Vexus

July 16, 2012, 08:59:18 am #38 Last Edit: July 16, 2012, 09:10:22 am by Vexus
Ok that fixed it thanks :)

Now I'll try the feature you implemented for me to see if it's how I wanted it. (I'll update post if it gives me problems or whatever.)

[Edit]

Works perfectly, your awesome :)

+1
Current Project/s:

Vexus

August 06, 2012, 02:03:36 pm #39 Last Edit: August 06, 2012, 04:04:29 pm by Vexus
Anyway I can disable/enable this script?

In the beginning of my game your bare footed and I don't want to have the stepping sounds I have produced by shoes.

Thanks
Current Project/s:

ForeverZer0

Place this below G_G's script.

class Game_Map
 
 SOUND_SWITCH_ID = 1
 
 alias toggle_sound terrain_sound
 def terrain_sound
   if $game_switches[SOUND_SWITCH_ID]
     toggle_sound
   end
 end
end


Set the ID of the switch for controlling the script. When the switch is false, the script is "off".
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Vexus

Current Project/s:

Stray

February 12, 2013, 09:30:51 pm #42 Last Edit: March 07, 2013, 11:46:13 am by Stray
Thanks for giving this script. I think the ABS correcting from page 2 is important to mention it on the page 1, because many people want to use both I guess.

Is there a chance to have a second waiting time/rate between steps for Blizz-ABS-running?
I'm very grateful to you all for your great help.

Stray

I'm very grateful to you all for your great help.

Zexion

June 26, 2015, 04:30:58 pm #44 Last Edit: July 27, 2015, 02:33:25 am by Zexion
So I use this in my project and I needed to add a few things to get the effects i wanted. I figured I'd post this here. It works exactly as the original but with a few extra features.
Spoiler: ShowHide
#===============================================================================
# Terrain Step Sound + Events
# Version 1.3
# Author game_guy
# New Features by Zexion
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
# Specify events that can play these sounds.
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Add the Name_Tag ("steps" by default) to the event page name (without quotes)
# to add dynamic footstep sounds to that event.
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
# Zex - For the Event & move_speed edit
# kk20 - for listening to zex's complaints
#===============================================================================
module TSS
 # Adjust this to your liking
 Wait = 20
 Name_Tag = "steps"
 # Ignore this
 Terrains, Tilesets = [], []
 #===========================================================================
 # Enter in sounds for each terrain tag
 # Goes from 0-8. Set as nil to disable that terrain or delete the line.
 # Each terrain must now be an array. This allows you to define multiple
 # sound effects for each terrain.
 #===========================================================================
 Terrains[0] = []
 Terrains[1] = [["FS - 03 - Wood", 40, 0],["FS - 04 - Wood", 40, 0]]
 Terrains[2] = ['FS - 05 - Metal']
 Terrains[3] = ['FS - 07 - Hollow Metal']
 Terrains[4] = [["FS - 09 - Concrete", 40, 0]]
 Terrains[5] = [["FS - 11 - Dirt", 40, 0],["FS - 11 - Dirt", 40, 0]]
 Terrains[6] = [["FS - 13 - Grass", 40, 0], ["FS - 14 - Grass", 40, 0]]
 #===========================================================================
 # If you would like to specifiy a volume and pitch, simply set the
 # terrain as an array.
 # Terrains[7] = [["sound", volume, pitch]]
 # Just set it as a string if you would like the volume to be at 100 and
 # pitch at 0.
 # This also applies for tilesets below.
 # You can also define multiple sound effects with pitch and volume.
 #===========================================================================
 Terrains[7] = [["FS - 01 - Water", 50, 0],["FS - 02 - Water", 50, 0]]
 #===========================================================================
 # 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", "sound file2", etc...]
 # 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          # make public
end
#-------------------------------------------------------------------------------
# Game_Character
#-------------------------------------------------------------------------------
# Adds Gameus's terrain_sound method to game_character.
#-------------------------------------------------------------------------------
class Game_Character
 attr_accessor :move_speed   # make public
 #-----------------------------------------------------------------------------
 # Initialize ss_index
 #-----------------------------------------------------------------------------
 alias g_c_sfe_init initialize
 def initialize
   g_c_sfe_init
   @ss_index = 0
   @timer = 0
   @tss_speed = @move_speed
   set_tss_offset
 end
 #-----------------------------------------------------------------------------
 # Updates the timer when needed
 #-----------------------------------------------------------------------------
 alias g_c_sfe_update update
 def update
   g_c_sfe_update
   @timer -= 1 if @timer > 0
   if @tss_speed != self.move_speed
     set_tss_offset
   end
 end
 #-----------------------------------------------------------------------------
 # Sets the sound offset
 #-----------------------------------------------------------------------------
 def set_tss_offset    
   # Timer offset by movespeed
   case self.move_speed
   when 0..2
     @tss_offset = TSS::Wait + self.move_speed
   when 3
     @tss_offset = TSS::Wait
   else
     @tss_offset = TSS::Wait - self.move_speed * 2
   end
 end
 #-----------------------------------------------------------------------------
 # Returns the array to be used later
 #-----------------------------------------------------------------------------
 def terrain_sound
   if TSS::Tilesets[$game_map.map.tileset_id] != nil
     sounds = TSS::Tilesets[$game_map.map.tileset_id][self.terrain_tag]
   else
     sounds = TSS::Terrains[self.terrain_tag]
   end
   return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
   index_max = sounds.size - 1
   @ss_index = (@ss_index < index_max) ? (@ss_index + 1) : 0
   sound = sounds[@ss_index]
   if sound.is_a?(Array)
     return [sound[0], sound[1], sound[2]]
   else
     return [sound, 100, 0]
   end
 end
end
#-------------------------------------------------------------------------------
# Game_Player
#-------------------------------------------------------------------------------
Tss_Parent = $BlizzABS ? (Map_Actor) : (Game_Character)
class Game_Player < Tss_Parent
 #-----------------------------------------------------------------------------
 # Adds step sounds to the player
 #-----------------------------------------------------------------------------
 def update_move
   # Make sure this is the player
   if self != $game_event && @timer == 0
     # Play the sound effect
     terrain = self.terrain_sound
     if terrain != nil
       vol = terrain[1]
       pit = terrain[2]
       son = terrain[0]
       Audio.se_play('Audio/SE/' + son, vol, pit)
     end
     # Set timer
     @timer = @tss_offset
   end
   # Call original code
   super
 end
end
#-------------------------------------------------------------------------------
# Game_Event
#-------------------------------------------------------------------------------
class Game_Event < Game_Character
 #-----------------------------------------------------------------------------
 # Set the variable for checking if the event should make a sound
 #-----------------------------------------------------------------------------
 alias g_e_sfe_init initialize
 def initialize(map_id, event)
   g_e_sfe_init(map_id, event)
   @tss = self.name.include?(TSS::Name_Tag) ? true : false
 end
  #--------------------------------------------------------------------------
  # * Returns the event's name
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
 #-----------------------------------------------------------------------------
 # Returns the distance of this event from the player
 #-----------------------------------------------------------------------------
 def range?
   if $BlizzABS && BlizzABS::Config::PIXEL_MOVEMENT_RATE == 1
     player_x = $game_player.x / 2 # Adjusted for 1.0 pixel movement rate
     player_y = $game_player.y / 2 # Adjusted for 1.0 pixel movement rate
   else
     player_x = $game_player.x
     player_y = $game_player.y
   end
   radius = (Math.hypot((self.x - player_x), (self.y - player_y))).abs.floor
   return (radius)
 end
 #-----------------------------------------------------------------------------
 # Adds step sounds to the event with dynamic volume
 #-----------------------------------------------------------------------------
 def update_move
   # Check if the event should play a sound
   if @tss
     # Make sure it's an event
     if self != $game_player
       # Check if the event is anywhere near the player
       if range? <= 6 && @timer == 0
         # The amount to subtract from the normal volume
         sub_vol = 4 * range?
         # Play the sound effect
         terrain = self.terrain_sound
           if terrain != nil
             vol = terrain[1]
             pit = terrain[2]
             son = terrain[0]
             # Dynamic sound edit
             vol = vol - sub_vol
             vol = 0 if vol < 0
             Audio.se_play('Audio/SE/' + son, vol, pit)
           end
           # Set timer
           @timer = @tss_offset
         end
       end
     end
     # Call original code
     super
   end
end

New Features:

  • Rate between sounds is now tied with move_speed

  • Events can now have step sounds aswell. These are dynamic (get louder as they approach the player)


To make an event have step sounds add "steps" to the event page name.
The whole system is now compatible with blizz-abs, but only with a pixel move rate of 0 or 1. (Couldn't figure out the player coords at the higher values)

danleon950410

Quote from: Zexion on June 26, 2015, 04:30:58 pm
So I use this in my project and I needed to add a few things to get the effects i wanted. I figured I'd post this here. It works exactly as the original but with a few extra features.
Spoiler: ShowHide
#===============================================================================
# Terrain Step Sound + Events
# Version 1.3
# Author game_guy
# New Features by Zexion
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
# Specify events that can play these sounds.
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Add the Name_Tag ("steps" by default) to the event page name (without quotes)
# to add dynamic footstep sounds to that event.
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
# Zex - For the Event & move_speed edit
# kk20 - for listening to zex's complaints
#===============================================================================
module TSS
  # Adjust this to your liking
  Wait = 20
  Name_Tag = "steps"
  # Ignore this
  Terrains, Tilesets = [], []
  #===========================================================================
  # Enter in sounds for each terrain tag
  # Goes from 0-8. Set as nil to disable that terrain or delete the line.
  # Each terrain must now be an array. This allows you to define multiple
  # sound effects for each terrain.
  #===========================================================================
  Terrains[0] = []
  Terrains[1] = [["FS - 03 - Wood", 40, 0],["FS - 04 - Wood", 40, 0]]
  Terrains[2] = ['FS - 05 - Metal']
  Terrains[3] = ['FS - 07 - Hollow Metal']
  Terrains[4] = [["FS - 09 - Concrete", 40, 0]]
  Terrains[5] = [["FS - 11 - Dirt", 40, 0],["FS - 11 - Dirt", 40, 0]]
  Terrains[6] = [["FS - 13 - Grass", 40, 0], ["FS - 14 - Grass", 40, 0]]
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  Terrains[7] = [["FS - 01 - Water", 50, 0],["FS - 02 - Water", 50, 0]]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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          # make public
end
#-------------------------------------------------------------------------------
# Game_Character
#-------------------------------------------------------------------------------
# Adds Gameus's terrain_sound method to game_character.
#-------------------------------------------------------------------------------
class Game_Character
  attr_accessor :move_speed   # make public
  #-----------------------------------------------------------------------------
  # Initialize ss_index
  #-----------------------------------------------------------------------------
  alias g_c_sfe_init initialize
  def initialize
    g_c_sfe_init
    @ss_index = 0
    @timer = 0
    @tss_speed = @move_speed
    set_tss_offset
  end
  #-----------------------------------------------------------------------------
  # Updates the timer when needed
  #-----------------------------------------------------------------------------
  alias g_c_sfe_update update
  def update
    g_c_sfe_update
    @timer -= 1 if @timer > 0
    if @tss_speed != self.move_speed
      set_tss_offset
    end
  end
  #-----------------------------------------------------------------------------
  # Sets the sound offset
  #-----------------------------------------------------------------------------
  def set_tss_offset   
    # Timer offset by movespeed
    case self.move_speed
    when 0..2
      @tss_offset = TSS::Wait + self.move_speed
    when 3
      @tss_offset = TSS::Wait
    else
      @tss_offset = TSS::Wait - self.move_speed * 2
    end
  end
  #-----------------------------------------------------------------------------
  # Returns the array to be used later
  #-----------------------------------------------------------------------------
  def terrain_sound
    if TSS::Tilesets[$game_map.map.tileset_id] != nil
      sounds = TSS::Tilesets[$game_map.map.tileset_id][self.terrain_tag]
    else
      sounds = TSS::Terrains[self.terrain_tag]
    end
    return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
    index_max = sounds.size - 1
    @ss_index = (@ss_index < index_max) ? (@ss_index + 1) : 0
    sound = sounds[@ss_index]
    if sound.is_a?(Array)
      return [sound[0], sound[1], sound[2]]
    else
      return [sound, 100, 0]
    end
  end
end
#-------------------------------------------------------------------------------
# Game_Player
#-------------------------------------------------------------------------------
Tss_Parent = $BlizzABS ? (Map_Actor) : (Game_Character)
class Game_Player < Tss_Parent
  #-----------------------------------------------------------------------------
  # Adds step sounds to the player
  #-----------------------------------------------------------------------------
  def update_move
    # Make sure this is the player
    if self != $game_event && @timer == 0
      # Play the sound effect
      terrain = self.terrain_sound
      if terrain != nil
        vol = terrain[1]
        pit = terrain[2]
        son = terrain[0]
        Audio.se_play('Audio/SE/' + son, vol, pit)
      end
      # Set timer
      @timer = @tss_offset
    end
    # Call original code
    super
  end
end
#-------------------------------------------------------------------------------
# Game_Event
#-------------------------------------------------------------------------------
class Game_Event < Game_Character
  #-----------------------------------------------------------------------------
  # Set the variable for checking if the event should make a sound
  #-----------------------------------------------------------------------------
  alias g_e_sfe_init initialize
  def initialize(map_id, event)
    g_e_sfe_init(map_id, event)
    @tss = self.name.include?(TSS::Name_Tag) ? true : false
  end
  #--------------------------------------------------------------------------
  # * Returns the event's name
  #--------------------------------------------------------------------------
  def name
    return @event.name
  end
  #-----------------------------------------------------------------------------
  # Returns the distance of this event from the player
  #-----------------------------------------------------------------------------
  def range?
    if $BlizzABS && BlizzABS::Config::PIXEL_MOVEMENT_RATE == 1
      player_x = $game_player.x / 2 # Adjusted for 1.0 pixel movement rate
      player_y = $game_player.y / 2 # Adjusted for 1.0 pixel movement rate
    else
      player_x = $game_player.x
      player_y = $game_player.y
    end
    radius = (Math.hypot((self.x - player_x), (self.y - player_y))).abs.floor
    return (radius)
  end
  #-----------------------------------------------------------------------------
  # Adds step sounds to the event with dynamic volume
  #-----------------------------------------------------------------------------
  def update_move
    # Check if the event should play a sound
    if @tss
      # Make sure it's an event
      if self != $game_player
        # Check if the event is anywhere near the player
        if range? <= 6 && @timer == 0
          # The amount to subtract from the normal volume
          sub_vol = 4 * range?
          # Play the sound effect
          terrain = self.terrain_sound
            if terrain != nil
              vol = terrain[1]
              pit = terrain[2]
              son = terrain[0]
              # Dynamic sound edit
              vol = vol - sub_vol
              vol = 0 if vol < 0
              Audio.se_play('Audio/SE/' + son, vol, pit)
            end
            # Set timer
            @timer = @tss_offset
          end
        end
      end
      # Call original code
      super
    end
end

New Features:

  • Rate between sounds is now tied with move_speed

  • Events can now have step sounds aswell. These are dynamic (get louder as they approach the player)


To make an event have step sounds add "steps" to the event page name.
The whole system is now compatible with blizz-abs, but only with a pixel move rate of 0 or 1. (Couldn't figure out the player coords at the higher values)


Thank you so much, Zexion! It's an amazing modification to an amazing script and it sure brings ambientation to a deeper level!
Only flaw i've seen so far is that after using the running and sneaking functions of the Blizz ABS System the rate between sounds gets stuck and won't return to walking/normal speed rate. Sure it changes between the running and sneaking rates flawlessly, but when you release the key to just walk at normal speed there's no change, you're stuck in the previous rate.
I've been trying to solve it for a week but i can't seem to figure it out.

KK20

Find this part in the script and replace it:

  #-----------------------------------------------------------------------------
  # Updates the timer when needed
  #-----------------------------------------------------------------------------
  alias g_c_sfe_update update
  def update
    g_c_sfe_update
    @timer -= 1 if @timer > 0
    if @tss_speed != self.move_speed
      @tss_speed = self.move_speed
      set_tss_offset
    end
  end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

danleon950410

Quote from: KK20 on August 27, 2016, 08:32:51 pm
Find this part in the script and replace it:

  #-----------------------------------------------------------------------------
  # Updates the timer when needed
  #-----------------------------------------------------------------------------
  alias g_c_sfe_update update
  def update
    g_c_sfe_update
    @timer -= 1 if @timer > 0
    if @tss_speed != self.move_speed
      @tss_speed = self.move_speed
      set_tss_offset
    end
  end


I can't thank you enough, it works flawlessly!!! You saved my life!
Thank you, thank you very much! This makes me extremely happy!
You have my infinite gratitude

AmareusRedink

I have a problem with the Tileset part, always makes me the error undefined method, ¿What happen?

KK20

Can you provide the full message of the error? And your configuration

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AmareusRedink

September 08, 2019, 01:13:59 am #50 Last Edit: September 08, 2019, 02:06:26 am by KK20 Reason: Added code tag and removed double post
#===============================================================================
# Terrain Step Sound
# Version 1.2
# Author game_guy
#-------------------------------------------------------------------------------
# Intro:
# 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
# Specific Sounds for Each Tileset
# Specify Volume and Pitch
# Specify an array of sounds for each terrain, allowing random sounds for each step
#
# Instructions:
# Setup the config below, its pretty self explanatory, more instructions
# with config.
#
# You can now change the sound rate in game using a script call.
# $game_map.rate = X
# X = sound rate (the lower the value, the more frequent the sounds)
#
# Credits:
# game_guy ~ For creating it
# Tuggernuts ~ For requesting it a long time ago
# Sase ~ For also requeseting it
#===============================================================================
module TSS
  # In Frames Recommended 5-10
  Wait = 10
  # Ignore the next 2 lines
  Terrains = []
  Tilesets = []
  #===========================================================================
  # Enter in sounds for each terrain tag
  # Goes from 0-8. Set as nil to disable that terrain or delete the line.
  # Each terrain must now be an array. This allows you to define multiple
  # sound effects for each terrain.
  #===========================================================================
  Terrains
[li]= ['001-System01', '002-System02', '003-System03'][/li]
  Terrains[1] = ['TalkAngryBirds']
  Terrains[2] = ['fs_grass03']
  Terrains[3] = ['fs_stone_hoof2']
  Terrains[4] = ['as_na_grassmove2']
  Terrains[5] = ['fs_water_hard1']
  Terrains[6] = ['fs_dirt_hard1']
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  Terrains[1] = ["TalkAngryBirds", 100, 0]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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.
  #===========================================================================
  Tilesets[1] = []
  Tilesets[1]
[li]= "Floor"[/li]
  Tilesets[1][1] = ["Floor", 50, 100]
  #
  Tilesets[1]
[li]= "TalkAngryBirds"[/li]
  Tilesets[52][1] = ["TalkAngryBirds", 100, 0]
end
class Game_Map
 
  attr_accessor :rate
 
  alias gg_init_terrain_sounds_map_lat initialize
  def initialize
    @rate = TSS::Wait
    return gg_init_terrain_sounds_map_lat
  end
 
  def terrain_sound
    if TSS::Tilesets[@map.tileset_id] != nil
      sounds = TSS::Tilesets[@map.tileset_id][$game_player.terrain_tag]
    else
      sounds = TSS::Terrains[$game_player.terrain_tag]
    end
    return nil if sounds == nil || !sounds.is_a?(Array) || sounds.size < 1
    sound = sounds[rand(sounds.size)]
    if sound.is_a?(Array)
      return [sound
[li], sound[1], sound[2]][/li]
    else
      return [sound, 100, 0]
    end
  end
 
end

class Game_Player < Game_Character
 
  def update_move
    @timer = $game_map.rate if @timer == nil
    @timer -= 1
    if @timer < 1
      terrain = $game_map.terrain_sound
      if terrain != nil
        vol = terrain[1]
        pit = terrain[2]
        son = terrain        Audio.se_play('Audio/SE/' + son, vol, pit)
      end
      @timer = $game_map.rate
    end
    super
  end
 
end
And the error says: Script "floorstepsxd" line 73:NoMethodError ocurred.

                   undefined method '[]=' for nil:NilClass

KK20

Your configuration is wrong clearly. Pointing out this in particular:
  Tilesets[1] = []
  Tilesets[1][0] = "Floor"
  Tilesets[1][1] = ["Floor", 50, 100]
  #
  Tilesets[1][0] = "TalkAngryBirds"
  Tilesets[52][1] = ["TalkAngryBirds", 100, 0]
So the first set is almost correct: You just need to put "Floor" in an array like the example showed.
Tilesets[1][0] = ["Floor"]

The "TalkAngryBirds" section is completely wrong. First off, you're overwriting the value stored in Tilesets[1][0], which originally contained "Floor", to "TalkAngryBirds". Not to mention, you need to put it in an array too.

Secondly, you forgot to initialize Tilesets[52] to an empty array like the first set did.
Tilesets[52] = []
That is the reason why you are getting the error.

From the looks of things, I believe you don't really know what you're doing. Please explain and I can point you to the right direction in configuring it properly.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AmareusRedink

September 08, 2019, 12:45:59 pm #52 Last Edit: September 08, 2019, 12:50:22 pm by AmareusRedink
In fact, I don't even know what I do, I even say that I lasted almost all day on this. ejem, I already "fix" and I reorganized it, and the game has already started, but it happens that the sound that is supposed to be heard should not be heard, ¿I missed something?

Tilesets[52] = []
  Tilesets[52][0] = ["TalkAngryBirds"]
  Tilesets[52][1] = ["TalkAngryBirds", 100, 0]

KK20

I also forgot to mention in the previous post that if you specify a volume and pitch, you need to wrap those around an array too. Otherwise you'll get some Fixnum conversion error.
Tilesets[1][1] = [["Floor", 50, 100]]

Tilesets[52][1] = [["TalkAngryBirds", 100, 0]]

So you're saying that you have made an entry in your Tileset Database with an ID of 52, changed the Terrain Tag for some of those tiles to either 0 or 1, and there is a sound effect in your Audio/SE folder named 'TalkAngryBirds'?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AmareusRedink

The 1 and 0 that I put is just a test, they are not the same sound to see which one works, I regret my ignorance, ¿but is it necessary to put the "Floor" or is a example?

KK20

I thought "Floor" was your doing :O.o: . In the original script, it's "Sound":
  Tilesets[2] = []
  Tilesets[2][0] = ["Sound"]
  Tilesets[2][1] = [["sound", 75, 50]]
If you're not using "Floor" then remove it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AmareusRedink

 sorry for doing this hard with this subject, but this is how I have the configuration now:

 Terrains[0] = ['001-System01', '002-System02', '003-System03']
  Terrains[1] = ['TalkAngryBirds']
  Terrains[2] = ['fs_grass03']
  Terrains[3] = ['fs_stone_hoof2']
  Terrains[4] = ['as_na_grassmove2']
  Terrains[5] = ['fs_water_hard1']
  Terrains[6] = ['fs_dirt_hard1']
  #===========================================================================
  # If you would like to specifiy a volume and pitch, simply set the
  # terrain as an array.
  # Terrains[7] = [["sound", volume, pitch]]
  # Just set it as a string if you would like the volume to be at 100 and
  # pitch at 0.
  # This also applies for tilesets below.
  # You can also define multiple sound effects with pitch and volume.
  #===========================================================================
  Terrains[1] = [['TalkAngryBirds', 50, 100]]
  #===========================================================================
  # 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", "sound file2", etc...]
  # 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.
  #===========================================================================
  #
  Tilesets[52] = []
  Tilesets[52][1] = [["TalkAngryBirds", 50, 100]]
  #
the problem that does not start has been resolved, thanks, but it happens that the test sound I try to make is not heard sorry, but this is the first time I handle this type of scripts (I am a Beginner) :wacko:

KK20

Please use code tags when pasting large blocks of code. [ code ] and [ /code ] without the spaces

At this point I'd need you to upload a demo of your project. This doesn't problem does not appear to be script related.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

AmareusRedink

September 08, 2019, 06:09:53 pm #58 Last Edit: September 08, 2019, 07:36:46 pm by AmareusRedink

AmareusRedink

and the end the problem was one of the scripts I used, Bruh.

AmareusRedink

Does anyone know how to make events such as people walking heard with this script?

KK20

Did you look at https://forum.chaos-project.com/index.php/topic,9460.msg192088.html#msg192088

Sounds like all you need to do is open the event you want to play sounds, and at the top left where you can name your event, just put steps somewhere in it.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Pelip

It's possible to make this script compatible with Cogwheel's Pixel Movement script?

KK20

No.

The user before you (AmareusRedink) reported the same issue for the same pixel movement script.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

whitespirits

is this avail for vx ace? its the easiest and simplest I can find but I need vx ace

KK20

Did you try Victor's step sound? It's the first thing that pops up in a google search.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

whitespirits

Hi man, it requires his module which is a little annoying

KK20

Annoying how? This is pretty much your only option if google doesn't list any other results.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

whitespirits

I will try it with his module, just wanted something simple without extras