Announcement
Announcement
| Crystal Fantasy takes 1st as the 2013 2nd Quarter Contest Winner!!! See the Community Announcements section. |
New threads (complete scripts) here will go into a moderation queue. You will not see your thread appear when you create it. A moderator will decide if it will be approved or denied.
![]() ![]() |
Jan 31 2008, 02:29 AM
Post
#1
|
|
![]() Type: Coder |
Hey guys, another script release
The script has some minor problems which are explained in the script information, but overall it's pretty good. It features a different pitch for each step, and the footsteps are faster when you dash. You can download the footstep sound files i use here: http://www.megaupload.com/?d=O9VRGJ1Y Here is the script, hope you enjoy it CODE #==============================================================================
# ■ 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 -------------------- ![]() |
|
|
|
Jan 31 2008, 02:30 AM
Post
#2
|
|
![]() The forum Technician ![]() Type: Artist |
looks pretty cool.
-------------------- ![]() I take sig requestsNeed a Title screen or a Game over screen for your game? Go Here and post a request. I will try and make one. Do you have super smash bros brawl and a wifi connection? PM me and we can brawl together. |
|
|
|
Jan 31 2008, 05:52 AM
Post
#3
|
|
|
Keeping the dream alive! ![]() |
This would add favour to any game
-Tay -------------------- |
|
|
|
Jan 31 2008, 07:38 AM
Post
#4
|
|
![]() Sejourner ![]() Type: Undisclosed Alignment: Unaligned |
As always, GREAT addition!
-------------------- ![]() |
|
|
|
Jan 31 2008, 03:47 PM
Post
#5
|
|
![]() ![]() |
Nice script, DD. You know I like them all, thanks. Keep up the greaaat work!
-------------------- |
|
|
|
Jan 31 2008, 04:07 PM
Post
#6
|
|
![]() The forum Technician ![]() Type: Artist |
ur a pro man
-------------------- ![]() I take sig requestsNeed a Title screen or a Game over screen for your game? Go Here and post a request. I will try and make one. Do you have super smash bros brawl and a wifi connection? PM me and we can brawl together. |
|
|
|
Feb 1 2008, 07:18 AM
Post
#7
|
|
![]() ![]() Type: Coder |
lol, your making me feel lazy. Maybe I should make a couple scripts as well. This ones nice man!
-------------------- |
|
|
|
Feb 1 2008, 03:59 PM
Post
#8
|
|
![]() Type: Undisclosed |
Line 5 Error, Whi?
|
|
|
|
Feb 1 2008, 06:36 PM
Post
#9
|
|
![]() ![]() |
When I used this script it worked..maybe forgot to import the soundeffects?
-------------------- |
|
|
|
Feb 9 2008, 01:10 PM
Post
#10
|
|
![]() |
Awsome! You made my game more... Realistic! Thaks
|
|
|
|
Aug 7 2008, 01:10 PM
Post
#11
|
|
![]() |
Yeah great job man, makes the game more interesting!
|
|
|
|
Jan 4 2009, 07:12 PM
Post
#12
|
|
![]() Type: Undisclosed Alignment: Chaotic Good |
This is pretty cool. When I first read it I thought it would require a bunch of modifications i didn't understand but it worked with right away.
-------------------- A. Valerius Barbatus
Multum in parvo |
|
|
|
Mar 5 2009, 08:16 PM
Post
#13
|
|
![]() Type: Undisclosed |
I cant figure out how to find the tile number ID.
Can you explain? |
|
|
|
Jun 3 2009, 01:28 PM
Post
#14
|
|
![]() Type: Undisclosed |
Nice script... I use it on my project
|
|
|
|
Jul 8 2009, 10:25 AM
Post
#15
|
|
![]() ![]() Type: Designer Alignment: Lawful Good |
Nice script, but how do you enable footstep sound for NPCs (other events) ?
-------------------- ![]() |
|
|
|
Dec 14 2009, 10:27 PM
Post
#16
|
|
![]() Type: Undisclosed |
Yeah please explain how to find out the tile number
|
|
|
|
Feb 4 2010, 06:17 PM
Post
#17
|
|
![]() ![]() Type: Designer |
Amazing script but the step download doesnt work... i cant download please tell me where to download the step SE... thanks
-------------------- ![]() Spoiler: |
|
|
|
Feb 4 2010, 09:03 PM
Post
#18
|
|
|
Pump up the pie, yo! ![]() Type: Coder Alignment: Neutral Good |
Amazing script but the step download doesnt work... i cant download please tell me where to download the step SE... thanks http://www.megaupload.com/?d=O9VRGJ1Y |
|
|
|
Feb 5 2010, 07:07 AM
Post
#19
|
|
![]() ![]() Type: Designer |
Thank you dude This post has been edited by SweetyGirly: Feb 5 2010, 07:13 AM -------------------- ![]() Spoiler: |
|
|
|
Apr 14 2010, 03:01 AM
Post
#20
|
|
![]() ![]() Type: Designer |
Hello guys i just wana ask you about something to this script here... it works very good for me but i dont know how to check out the MAPtile IDs i got one tile which is the sound of snow but its not a snow tile
PS: sry for doublepost >.< i can not delete the message i wrote befor so >.< This post has been edited by SweetyGirly: Apr 15 2010, 01:55 PM -------------------- ![]() Spoiler: |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 20th June 2013 - 03:41 AM |
|
|