Silver Link Administrador
![Administrador Administrador](https://2img.net/h/stickman.com.br/forum/ranks/radmin.gif)
![Silver Link](https://2img.net/u/4011/55/25/33/avatars/1-17.png)
![Masculino Masculino](https://2img.net/i/fa/subsilver/icon_gender_male.gif) Número de Mensagens : 43 Idade : 29 Localização : Curitiba, PR Emprego/lazer : RPG Maker VX Humor : Muito Bom xD Alerta : Data de inscrição : 03/02/2008
![Diablo Waypoints Empty](https://2img.net/i/empty.gif) | Assunto: Diablo Waypoints 9/2/2008, 17:36 | |
| Sistema de Waypoints estilo Diablo. Criado por Arevulopapo (RMXP) e adaptado por mim para o RMVX. As instruções estão no script. - Código:
-
=begin
Diablo Waypoints criado por Arevulopapo (RMXP) e adaptado para o RMVX por Silver Link / Gold Link
Sistema de Waypoints ao estilo Diablo. ============================================================================== Para chamar o Waypoint use: $scene = Scene_Waypoint.new(parameter) No lugar de 'parameter' é o waypoint que você vai usar
Você pode usar o waypoint com "Ao tocar" Então use isso: $game_system.waypoints_active << index No lugar de 'index' é o lugar que você quer que seu waypoint acione quando você tocar ============================================================================== =end
class Game_System #-------------------------------------------------------------------------- attr_accessor :waypoints attr_accessor :waypoints_active attr_accessor :waypoint_sound #-------------------------------------------------------------------------- alias game_system_initialize initialize #-------------------------------------------------------------------------- def initialize #-------------------------------------------------------------------------- # Here you can change the sound played while teleporting #-------------------------------------------------------------------------- @waypoint_sound = "Audio/SE/Switch2" #-------------------------------------------------------------------------- @waypoints = [] #-------------------------------------------------------------------------- # Aqui são definidos os Waypoints. A estrutura é a seguinte: # ["Nome", id_do_mapa, jogador_x, jogador_y] #-------------------------------------------------------------------------- @waypoints << ["Mountanha", 1, 6, 4] # Esse é o primeiro Waypoint. Seu id é 0 (Zero). #-------------------------------------------------------------------------- @waypoints_active = [] game_system_initialize end #-------------------------------------------------------------------------- end #============================================================================== #============================================================================== class Window_Waypoint_Name < Window_Base #-------------------------------------------------------------------------- def initialize(waypoint_name) super(0,0,320,64) self.contents = Bitmap.new(288,32) self.back_opacity = 160 @waypoint_name = waypoint_name refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.draw_text(0,0,288,32,@waypoint_name.to_s,1) end #-------------------------------------------------------------------------- end #============================================================================== #============================================================================== class Window_Waypoint_List < Window_Selectable #-------------------------------------------------------------------------- def initialize super(0, 64, 320, 416) self.back_opacity = 160 refresh self.index = 0 end #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @item_max = $game_system.waypoints.size self.contents = Bitmap.new(288, @item_max * 32) for i in 0..@item_max - 1 draw_item(i) end end #-------------------------------------------------------------------------- def draw_item(index) x = 0 y = (index) * 32 if $game_system.waypoints_active.include?(index) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end self.contents.draw_text(x, y, 288, 32, $game_system.waypoints[index][0].to_s, 1) end #-------------------------------------------------------------------------- end #============================================================================== #============================================================================== class Scene_Waypoint #-------------------------------------------------------------------------- def initialize(waypoint) @waypoint = waypoint $game_system.waypoints_active << @waypoint unless $game_system.waypoints_active.include?(@waypoint) end #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @name_window = Window_Waypoint_Name.new($game_system.waypoints[@waypoint][0]) @list = Window_Waypoint_List.new if $game_player.screen_x < 320 @name_window.x = 110 @list.x = 110 end Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @name_window.dispose @list.dispose end #-------------------------------------------------------------------------- def update @list.update if Input.trigger?(Input::C) if $game_system.waypoints_active.include?(@list.index) Audio.se_play($game_system.waypoint_sound) $game_map.setup($game_system.waypoints[@list.index][1]) $game_player.moveto($game_system.waypoints[@list.index][2], $game_system.waypoints[@list.index][3]) $game_player.straighten $game_map.update $game_map.autoplay $scene = Scene_Map.new Graphics.transition(20) else $game_system.se_play($data_system.buzzer_se) end end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new end end #-------------------------------------------------------------------------- end Para mudar o SE de teleporte, procure a seguinte linha: - Código:
-
@waypoint_sound = "Audio/SE/Switch2" Para adicionar mais Waypoints, procure estas linhas: - Código:
-
# Aqui são definidos os Waypoints. A estrutura é a seguinte: # ["Nome", id_do_mapa, jogador_x, jogador_y] #-------------------------------------------------------------------------- @waypoints << ["Mountanha", 1, 6, 4] # Esse é o primeiro Waypoint. Seu id é 0 (Zero). Adicione abaixo dessas linhas os Waypoints. Mais explicações no script. Fui! | |
|