collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: DeadlyDan_Footsteps - Version 1.00  (Gelesen 1848 mal)

Dainreth

  • Gast
DeadlyDan_Footsteps - Version 1.00
« am: Februar 01, 2008, 15:05:17 »
DeadlyDan_Footsteps - Version 1.00[/b][/size]
von DeadlyDan

Vorwort
Wie wäre es, wenn beim Laufen die Schritte eures Helden zu hören sind? Egal, ob durch den Schnee stampfend oder auf der Wiese spazierend, für alles gibt es die passenden Geräusche mit diesem Skript von DeadlyDan. Das Skript ist eigentlich selbsterklärend, Informationen zu bekannten Bugs oder Konfigurationsmöglichkeiten findet ihr im Skript (Englisch!). Einbauen tut ihr es ganz einfach: Fügt ein neues Skript über Main ein und kopiert den Code der Skript-Kategorie rein. Nun nutzt ihr noch die Soundeffekte, die DeadlyDan hinzugefügt hat (Download-Kategorie) und importiert diese in euer Projekt. Schon seid ihr fertig! Fragen könnt ihr hier, wie auch im original Thread stellen (unter Quelle findet ihr Links dazu).

Skript
Spoiler for Hiden:
#==============================================================================
# ¦ DeadlyDan_Footsteps by DeadlyDan
#------------------------------------------------------------------------------
#  Enables ability to "sound" footsteps when walking over specific tiles
#==============================================================================
# Usage:
=begin
  
  Simple, place the audio files in your SE directory, and try the game.
  
  There are some known bugs in this, if anyone has any fixes just let me know:)
  
  To add custom sounds for custom tiles you can do for example:
  
  FOOTSTEP_WOOD = [15] # The tilenumber ID that you get with debug_tileid function
  FOOTSTEP_WOOD_FILE = "Audio/SE/stepwood" # The filename for the sound
  
  then add underneath the # Insert custom sounds here line:
  
  footstep_check ( FOOTSTEP_WOOD, FOOTSTEP_WOOD_FILE, 0 )
  
  The last number in that function stands for the layer, since the wood tile i
  selected is on the ground layer, it's layer is 0.  
  
  (NOTE)
  There is a problem that when you go on carpet it makes dirt and snow sounds,
  i currently can't find a way to fix this, so, the best thing to do is to call
  the command $game_player.footsteps_enabled = false.
  
  To enable footsteps while stopping the carpet and tables from making the snow
  and dirt sounds, there's an uneasy solution of placing a touch event which
  calls $game_player.footsteps_enabled = false.
  
  Sorry about this inconvenience.

=end

class Game_Player < Game_Character
  
  FOOTSTEP_GRASS = [28, 29, 30]
  FOOTSTEP_GRASS_LONG = [29, 30]
  FOOTSTEP_GRASS_FILE = "Audio/SE/stepgrass"
  
  FOOTSTEP_DIRT = [32, 33, 34]
  FOOTSTEP_DIRT_LONG = [32 ,34]
  FOOTSTEP_DIRT_FILE = "Audio/SE/stepdirt"
  
  FOOTSTEP_SAND = [36, 37, 38]
  FOOTSTEP_SAND_LONG = [36, 38]
  FOOTSTEP_SAND_FILE = "Audio/SE/stepdirt"
  
  FOOTSTEP_SNOW = [39, 41]
  FOOTSTEP_SNOW_LONG = [40, 41]
  FOOTSTEP_SNOW_FILE = "Audio/SE/stepsnow"
  
  FOOTSTEP_WOOD = [15]
  FOOTSTEP_WOOD_FILE = "Audio/SE/stepwood"
  
  FOOTSTEP_PITCH = 100
  FOOTSTEP_PITCH2 = 90

  attr_accessor :last_foot
  attr_accessor :footsteps_enabled
  
  alias foot_initialize initialize
  def initialize
    foot_initialize
    @last_foot = 0
    @last_foot_pitch = FOOTSTEP_PITCH2
    @next_foot_pitch = FOOTSTEP_PITCH
    @footsteps_enabled = true
  end
  
  alias foot_move_left move_left
  def move_left ( turn_ok = true )
    foot_move_left ( turn_ok )
    if ( @move_failed == false )
      sound_foot
    end
  end
    
  alias foot_move_right move_right
  def move_right ( turn_ok = true )
    foot_move_right ( turn_ok )
    if ( @move_failed == false )
      sound_foot
    end
  end
  
  alias foot_move_up move_up
  def move_up ( turn_ok = true )
    foot_move_up ( turn_ok )
    if ( @move_failed == false and @footsteps_enabled )
      sound_foot
    end
  end
  
  alias foot_move_down move_down
  def move_down ( turn_ok = true )
    foot_move_down ( turn_ok )
    if ( @move_failed == false and @footsteps_enabled )
      sound_foot
    end
  end
  
  def no_layer_tile? ( layer )
    result = [false, false, false]
    for i in 0..2
      if ( @map_tile_id[i] == 0 )
        result[i] = true
      end
    end
    if ( layer == 0 )    
      if ( result[1] and result[2] )
        return true
      else
        return false
      end
    end
    else if ( layer == 1 )
      if ( result[2] )
        return true
      else
        return false
      end
    else
      return true
    end
  end
  
  def debug_tileid
    $game_message.texts[0] = @map_tile_tex[0]
    $game_message.texts[1] = @map_tile_tex[1]
    $game_message.texts[2] = @map_tile_tex[2]
  end
  
  def footstep_check ( footstep, file, layer )
    for i in 0..footstep.length
      if ( ( @map_tile_tex[layer] == footstep[i].to_s ) and ( no_layer_tile? ( layer ) ) )
        Audio.se_play ( file, 100, @next_foot_pitch )
        @last_foot = Graphics.frame_count
        return nil
      end
    end
  end
  
  def sound_foot
    if ( dash? )
      mul = 6
    else
      mul = 7
    end
    if ( Graphics.frame_count > ( @last_foot + mul ) )
      @map_tile_id = []
      @map_tile_tex = []
      for i in 0..2
        @map_tile_id.push ( $game_map.data[@x, @y, i] )
        @map_tile_tex.push ( @map_tile_id[i].to_s[0,2] )
      end
      
      # Use "debug_tileid" here to bring up the numbers of all the current tiles
      # to use with definitions of the tileids, walk over tiles ingame...
      
      if ( @last_foot_pitch == FOOTSTEP_PITCH )
        @next_foot_pitch = FOOTSTEP_PITCH2
        @last_foot_pitch = FOOTSTEP_PITCH2
      else
        @next_foot_pitch = FOOTSTEP_PITCH
        @last_foot_pitch = FOOTSTEP_PITCH
      end
      
      # Ground layer
      footstep_check ( FOOTSTEP_GRASS, FOOTSTEP_GRASS_FILE, 0 )
      footstep_check ( FOOTSTEP_DIRT, FOOTSTEP_DIRT_FILE, 0 )
      footstep_check ( FOOTSTEP_SAND, FOOTSTEP_SAND_FILE, 0 )
      footstep_check ( FOOTSTEP_SNOW, FOOTSTEP_SNOW_FILE, 0 )
      footstep_check ( FOOTSTEP_WOOD, FOOTSTEP_WOOD_FILE, 0 )
      
      # Layer 1
      footstep_check ( FOOTSTEP_GRASS_LONG, FOOTSTEP_GRASS_FILE, 1 )
      footstep_check ( FOOTSTEP_DIRT_LONG, FOOTSTEP_DIRT_FILE, 1 )
      footstep_check ( FOOTSTEP_SAND_LONG, FOOTSTEP_SAND_FILE, 1 )
      footstep_check ( FOOTSTEP_SNOW_LONG, FOOTSTEP_SNOW_FILE, 1 )
      
      # Insert custom sounds here
      
    end
  end
  
end

Downloads
Schrittgeräusche, die DeadlyDan benutzt. (Download über File-Upload)

Quellen
Link zum Thread auf rmvx.net
Link zum Thread auf RPG RPG Revolution

Schlusswort
Wieder ein großes Danke an DeadlyDan für diesen netten Zusatz, den er geskriptet hat. Auch ein Danke dafür, dass er erlaubt hat, seine Skripts hier zu veröffentlichen. Ich hoffe der ein oder andere findet Spaß und Nutzen an diesem Skript. Wenn ihr möchtet könnt ihr euch bei DeadlyDan bedanken, nutzt hierfür einfach die Kategorie Quelle. Viel Spaß damit!
« Letzte Änderung: Februar 01, 2008, 19:52:25 von Dainreth »

DeadlyDan_Footsteps - Version 1.00

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
DeadlyDan_Footsteps - Version 1.00
« Antwort #1 am: Februar 04, 2008, 19:40:30 »
Hi Dainreth,

hast du das Script mal getestet. Wie funktioniert es so?

MFG Markus

DeadlyDan_Footsteps - Version 1.00

Offline Seph

  • bLUbb?
  • Mr. MACK-Tile
  • ***
  • Beiträge: 224
DeadlyDan_Footsteps - Version 1.00
« Antwort #2 am: Februar 04, 2008, 20:29:10 »
@goldenboss
Also ich habs getestet und find es nicht so gut. Naja man sollte vielleicht mal die ses austauchschen dann isses bestimmt besser. aber benutzn werd ich snicht

DeadlyDan_Footsteps - Version 1.00

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
DeadlyDan_Footsteps - Version 1.00
« Antwort #3 am: Februar 04, 2008, 21:03:31 »
Ok, danke für die Antwort, Seph. ;)

DeadlyDan_Footsteps - Version 1.00

Offline Seph

  • bLUbb?
  • Mr. MACK-Tile
  • ***
  • Beiträge: 224
DeadlyDan_Footsteps - Version 1.00
« Antwort #4 am: Februar 04, 2008, 21:26:32 »
Soll dich jetz aber net davon abhalten des Script net zu nutzen ;)

DeadlyDan_Footsteps - Version 1.00

Dainreth

  • Gast
DeadlyDan_Footsteps - Version 1.00
« Antwort #5 am: Februar 05, 2008, 11:39:17 »
Es funktioniert, wie Seph sagte. Jedermanns Geschmack ist es sicher nicht, hat ja auch noch ein paar kleine Bugs wie zum Beispiel, wenn man auf Teppichen geht. Also ich finde, es ist ein Feature, dass nicht jedes Spiel braucht, aber für Horrorspiele oder ähnliches kann man es sicher gut nutzen, wenn man die passenden SE dazu nutzt.

 


 Bild des Monats

rooftop party

Views: 3148
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal