Jump to content
Rpg²S Forum
  • 0

Rumore dei passi


Squall_Leonheart
 Share

Question

Ragazzi qualcuno si ritrova lo script per il rumore dei passi? Ricordo che lo trovai ma ora non ne vedo traccia..

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

Recommended Posts

  • 0

Si ma avevi parlato di switch e allora avevo messo una switch XD

sostituisci lo script con questo:

 

VOLUME = 70 #volume passi


PITCH = true #cambia pitch a ogni passo
class Passi
 attr_accessor :suono
def initialize
 #Configurazione suono.... Modificare solo la variabile.
 #TERRAIN_TAG => AUDIO_SE
@suono = {
0=>"042-Knock03" ,
1=>"028-Door05",
}
end
end

class Interpreter
 def set_se(id_evento,se,t_tag)
$game_map.events[id_evento].change_se(se,t_tag)
 end
 def p_sound(scelta)
$game_system.p_player = scelta
 end
 def e_sound(scelta)
$game_system.p_event = scelta
 end
end

class Game_System
 attr_accessor :p_player
 attr_accessor :p_event
 alias pass_ini initialize
 def initialize
pass_ini
@p_player = false
@p_event = false
 end
end


class Game_Character
 alias passi_initialize initialize
 def initialize
@no_sound = false
@passi_se = Passi.new.suono
passi_initialize
 end
 
 def change_se(se,t_tag)
@passi_se[t_tag] = se
 end
 
 def make_sound
 if @pattern != 4 and @pattern != 8
  @no_sound = false
end
if moving? and not @no_sound
  if @pattern == 4 or @pattern == 8
  @no_sound=true
  pitch = 100
  if PITCH
	pitch = @pattern == 4 ? 100 : 80
  end
  if @passi_se[terrain_tag] != nil
  Audio.se_play("Audio/SE/"+@passi_se[terrain_tag],VOLUME,pitch)
  end
  end
end
 end
 
 
 def passi?
  for i in @list
if i.code != nil and i.code == 108 and i.parameters[0] == "passi"
  return true
  end
end
return false
 end
 
 
 alias passi_update update
 def update

if self.is_a?(Game_Player)
unless $game_system.p_player
 make_sound
end

else
 
 if self.is_a?(Game_Event) and passi? and not $game_system.p_event
make_sound
 end
 
 end
passi_update
 end
end

 

 

Usa i comandi via script:

 

p_sound(SCELTA) dove SCELTA è true o false, vale per il player

e_sound(SCELTA) dove SCELTA è true o false, vale per gli eventi

 

 

Tutto ok?

Link to comment
Share on other sites

  • 0
Il gioco si blocca e non vengono disattivati i suoni >.< (Quando premo inviio sull'evento col commento e_sound(false))

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0

Ah si... Il gioco si blocca perchè ho dimenticato una cosa... Comunque i comandi erano al contrario XD Cioe true se non si sentiva e viceversa, ora per sistemare l'ambiguita ho messo che se è true sono attivi i suoni e se è false sono disattivi.... Ora ho testato e sono sicuro che va XDXD Scusami per tutto il tempo che ci ho messo

 

 

VOLUME = 70 #volume passi


PITCH = true #cambia pitch a ogni passo
class Passi
 attr_accessor :suono
def initialize
 #Configurazione suono.... Modificare solo la variabile.
 #TERRAIN_TAG => AUDIO_SE
@suono = {
0=>"042-Knock03" ,
1=>"028-Door05",
}
end
end

class Interpreter
 def set_se(id_evento,se,t_tag)
$game_map.events[id_evento].change_se(se,t_tag)
 end
 def p_sound(scelta)
$game_system.p_player = scelta
return true
 end
 def e_sound(scelta)
$game_system.p_event = scelta
return true
 end
end

class Game_System
 attr_accessor :p_player
 attr_accessor :p_event
 alias pass_ini initialize
 def initialize
pass_ini
@p_player =true
@p_event = true
 end
end


class Game_Character
 alias passi_initialize initialize
 def initialize
@no_sound = false
@passi_se = Passi.new.suono
passi_initialize
 end
 
 def change_se(se,t_tag)
@passi_se[t_tag] = se
 end
 
 def make_sound
 if @pattern != 4 and @pattern != 8
  @no_sound = false
end
if moving? and not @no_sound
  if @pattern == 4 or @pattern == 8
  @no_sound=true
  pitch = 100
  if PITCH
	pitch = @pattern == 4 ? 100 : 80
  end
  if @passi_se[terrain_tag] != nil
  Audio.se_play("Audio/SE/"+@passi_se[terrain_tag],VOLUME,pitch)
  end
  end
end
 end
 
 
 def passi?
  for i in @list
if i.code != nil and i.code == 108 and i.parameters[0] == "passi"
  return true
  end
end
return false
 end
 
 
 alias passi_update update
 def update

if self.is_a?(Game_Player)
if $game_system.p_player
 make_sound
end

else
 
 if self.is_a?(Game_Event) and passi? and $game_system.p_event
make_sound
 end
 
 end
passi_update
 end
end

 

Link to comment
Share on other sites

  • 0
Si ora si >.< Grazie mille!

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0
Scusatemi per il Necropost,questo script mi interessa parecchio,solo che i suoni non mi piacciono..io ho 4 SE diversi per 4 superfici,che si chiamano "stepdirt,stepsnow,stepfloor,stepgrass e stepwood.Erano compresi in un vecchio script per VX cerato da un certo DeadlyDan...premetto che di scripting ci capisco poco,ma mi chiedevo se era possibile fare in modo che ad ogni tipo di terreno,corrisponde un SE diverso,insomma come lo script di Deadly solo che invece di essere per VX dovrebbe essere per XP... Edited by Noah

Prossimamente:

http://i.imgur.com/qknjqys.png

 

Link alla pagina del mio progetto

http://www.rpg2s.net/forum/index.php/topic/12962-antica-leggenda-la-lacrima-di-elbereth/page-3

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...