An Error With Theo's Footstep sound script

So I'am using Theo's footstep script and it works just fine! But there's
a strange problem with the script, when you use the jump command
from the move route list or if you jump at all it plays the footstep sound.
Code:
# =============================================================================
# TheoAllen - Footstep Sound
# Version : 1.2
# =============================================================================
($imported ||= {})[:Theo_FootSound] = true
# =============================================================================
# Change Logs:
# -----------------------------------------------------------------------------
# 2018.03.02 - Change how the sound is handled (2)
# 2014.02.01 - Change how the sound is handled
# 2013.11.16 - Finished script
# =============================================================================
=begin

  Intro :
  Because walking with no sound is soooo boring ....
 
  How to use :
  Put the script below material and above main.
 
  > If you want an event to use footstep sound as well, put <footstep> tag by
    using comment.
  > If you want to change the footstep sound, use script call
    footstep[id] = RPG::SE.new("name", vol, pitch)
 
  Further instruction on setting.

  Terms of use :
  Credit me, TheoAllen. Feel free to use and edit as much as you want. Just dont
  claim it's yours. Gimme free copy for commercial use.
 
=end
#==============================================================================
# Configs :
#==============================================================================
module Theo
  module FSound
  #---------------------------------------------------------------------------
    RegionMode = false
  #---------------------------------------------------------------------------
  # Want to use region? If no (false) then it will use terrain tag
  #---------------------------------------------------------------------------
 
  # --------------------------------------------------------------------------
    List = {  # <-- No, dont touch this
  # --------------------------------------------------------------------------
  # Define the sound effect here with this following format
  #
  # ID => RPG::SE.new("Name",vol,pitch),
  #
  # - ID      >> ID for the region / terrain tag
  # - "Name"  >> SE name from Audio/SE
  # - vol     >> Volume SE (0 - 100)
  # - pitch   >> Pitch (50 - 150)
  # --------------------------------------------------------------------------
 
      0 => RPG::SE.new("Step",120,100),
      
    # Add more here
    # Don't forget comma!
      
  # --------------------------------------------------------------------------
    } # <-- No, dont touch this
  # --------------------------------------------------------------------------
 
  # --------------------------------------------------------------------------
    SoundDelay = [10,6] # [normal, dash]
  # --------------------------------------------------------------------------
  # A frame delay before playing next footstep sound
  # One for walking, later one for dashing
  # --------------------------------------------------------------------------
 
  end
end
#==============================================================================
# End of config
#==============================================================================
class Game_Interpreter
 
  def footstep
    $game_system.fsound
  end
 
end

class Game_System
  attr_reader :fsound
 
  alias theo_fsound_init initialize
  def initialize
    theo_fsound_init
    @fsound = Theo::FSound::List
  end
 
end

class Game_Event
 
  alias theo_fsound_init initialize
  def initialize(map_id, event)
    theo_fsound_init(map_id, event)
    @sound_delay = 0
  end

  def fsound_tile_data_id
    Theo::FSound::RegionMode ? region_id : terrain_tag
  end
 
  def footstep_sound
    $game_system.fsound[fsound_tile_data_id]
  end
 
  alias theo_fsound_update update
  def update
    theo_fsound_update
    update_footstep_sound if play_footstep?
  end
 
  def update_footstep_sound
    @sound_delay -= 1
    if @sound_delay <= 0 && moving?
      sound = footstep_sound
      sound.play if sound
      if dash?
        @sound_delay = Theo::FSound::SoundDelay[1]
      else
        @sound_delay = Theo::FSound::SoundDelay[0]
      end
    end
  end
 
  alias theo_fsound_page_setting setup_page_settings
  def setup_page_settings
    theo_fsound_page_setting
    setup_fsound
    @sound_delay = 0
  end 
 
  def setup_fsound
    @play_footstep = false
    @list.each do |command|
      next unless command.code == 108 || command.code == 408
      if command.parameters[0][/<footstep>/i]
        @play_footstep = true
      end
    end
  end
 
  def play_footstep?
    @play_footstep
  end
 
end

class Game_Player
 
  alias theo_fsound_init initialize
  def initialize
    theo_fsound_init
    @sound_delay = 0
  end

  def fsound_tile_data_id
    Theo::FSound::RegionMode ? region_id : terrain_tag
  end
 
  def footstep_sound
    $game_system.fsound[fsound_tile_data_id]
  end
 
  alias theo_fsound_update update
  def update
    theo_fsound_update
    update_footstep_sound
  end
 
  def update_footstep_sound
    @sound_delay -= 1
    if @sound_delay <= 0 && moving?
      sound = footstep_sound
      sound.play if sound
      if dash?
        @sound_delay = Theo::FSound::SoundDelay[1]
      else
        @sound_delay = Theo::FSound::SoundDelay[0]
      end
    end
  end
 
end
Can some one make an edit so that I can either cut off this script with a switch or make so that it dosn't play the footstep sound when we jump.
@TheoAllen would probably be able to answer your question.
Not using this myself so lol I didn't test it that much, probably you could try to change these line (line 149 ~ 151) from the script you posted.
Code:
  def play_footstep?
    @play_footstep
  end
To this
Code:
  def play_footstep?
    @play_footstep && !jumping?
  end
See if it works.
Not using this myself so lol I didn't test it that much, probably you could try to change these line (line 149 ~ 151) from the script you posted.
Code:
  def play_footstep?
    @play_footstep
  end
To this
Code:
  def play_footstep?
    @play_footstep && !jumping?
  end
See if it works.
That didn't work...
because it's in Game_Event.

Add this:

Code:
class Game_Player < Game_Character
  def play_footstep?
    @play_footstep && !jumping?
  end
end

I would have put it into Game_Character or Game_CharacterBase, but the other requirements were all defined at a higher level, so it would have required reworking more of the script.

I've moved this thread to RGSSx Support. Thank you.

because it's in Game_Event.

Add this:

Code:
class Game_Player < Game_Character
  def play_footstep?
    @play_footstep && !jumping?
  end
end

I would have put it into Game_Character or Game_CharacterBase, but the other requirements were all defined at a higher level, so it would have required reworking more of the script.
Were do I put this? I get an error when I try to put it in game.
In between the two lines that theo told me to put it in.
You're right @Shaz, that was horrible me when just started coding lol.
Try the reworked version https://github.com/theoallen/RGSS3/blob/master/Footstep Sound.rb
because it's in Game_Event.

Add this:

Code:
class Game_Player < Game_Character
  def play_footstep?
    @play_footstep && !jumping?
  end
end

I would have put it into Game_Character or Game_CharacterBase, but the other requirements were all defined at a higher level, so it would have required reworking more of the script.
You're right @Shaz, that was horrible me when just started coding lol.
Try the reworked version https://github.com/theoallen/RGSS3/blob/master/Footstep Sound.rb
Thanks this works like a charm!
Were do I put this? I get an error when I try to put it in game.
In between the two lines that theo told me to put it in.

I'm sorry - yes, you can put in in that script, right at the end, or in a completely new script slot.

Original thread: https://forums.rpgmakerweb.com/threads/an-error-with-theos-footstep-sound-script.104743/