Hola. Aquí te dejo una lista de scripts para Rpg Maker XP. Son algunos que estaban por el blog y que sirven para añadir funcionalidades interesantes a tus juegos.
Para añadir los scripts a tu proyecto, debes copiar el código. A continuación vas a Editor de Scripts en el Rpg Maker y sobre Main (al final de la lista de scripts) das clic secundario y eliges INSERTAR. Así creas un script nuevo vacío donde tienes que pegar el código.
OJO: Asegúrate de que los scripts siempre queden sobre Main.
Seguimiento de party (compañeros de equipo) por el mapa
En este script su compañeros te siguen de cerca, pero no en fila, por lo que es más realista, incluso dispones de una serie de comandos para ellos:
Q - Cambiar líder hacia adelante.
W - Cambiar líder hacia atrás.
A - Actor seleccionado que no se mueva
S - Reunir actores
DESCARGAR: Aquí
Fuente
Hacer juegos del Zelda
Es un proyecto completo con scripts, engines y gráficos listos para crear tus propios juegos basados, en este caso, en el The Legend of Zelda.
Lo que contiene el Starter Kit:
- Ventana de título animado
- Estilo de guardado/cargar como Zelda (3 slots)
- Ventana Input de Nombre al estilo Zelda
- Créditos automáticos
- Sistema de Batalla del Zelda
- Sistema de corte con la espada
- Carga y giro con la espada
- Montar a caballo
- Guardía Hada (compañero)
- Movimiento por píxel
- Movimiento en 8 direcciones
- Saltar salientes
- Recoger cosas
- Barra detallada de salud
- Barra de magia extendible
- 4 estaciones disponibles en el mundo
- Ciclo de día y noche
- Sistema de nado
- Sistema de menus e inventario al estilo Zelda
- Equipamiento de items y armas
- Instalador de fuentes automáticamente
- Más de 8 fuentes para usar
- Memorizar reproducción de música
- Habitaciones oscuras y linterna
- Zoom en las puertas
- Tileset Swap Script (editar mapas mientras ejecutas el juego)
DESCARGAR
Linterna y efectos de iluminación
Te permite crear un efecto de linterna y de luces para mapas oscuros: Ver entrada
Manchas de sangre en el suelo
Este script consiste en que cuando utilicemos cierto comando aparecerán unas manchas de sangre en el suelo.: Ver entrada
Sensor de visión
Crea un rango de visión para los eventos. Cuando algo entre en el rango de visión puedes activar que ocurra algo: Ver entrada
Convertir mapa en imagen
Saca un mapa cualquiera y lo convierte en una imagen con el mismo tamaño del mapa: Ver entrada
Hacer una recopilación de libros para leer como Skyrim
Permite añadir libros a tu juego: Ver entrada
Mejorar sistema debug (depuración)
El sistema Debug del Rpg Maker XP nos permite utilizar ciertas opciones para testear nuestro juego. Entre ellas, si apretamos F9 entraremos a una ventana donde podemos modificar y ver los valores de todas las variables e interruptores.
DESCARGAR
Debugger System (añade más opciones al menú F9)
Debugger Battle (añade opciones de debug en batalla al pulsar X).
Detectar colisión de dos eventos
Este script detecta la colisión de 2 eventos.
- Se crea un evento en proceso paralelo.
- Se escribe la siguiente condición en el apartado script (cuarta pestaña): colisao(id_del_obstáculo,id_del_objeto,tipo)
- En el caso de que no se sepa la ID del evento obstáculo o del evento objeto, se puede utilizar el comando this_id para obtener el ID (también se puede utilizar en cualquier momento del juego para obtener la ID de un evento).
Dentro del paréntesis tenemos que:
- id_del_obstáculo: ID del evento que contendrá una condición.
- id_del_objeto: ID del evento que va a colisionar con el obstáculo.
- tipo: 0 para que la colisión sea sobre el evento, 1 para que sea al lado (como en una colisión normal).
=begin ####################################################### Sistema de Colisión de Eventos Este Script foi encontrado no Site www.mundorpgmaker.com E foi Desenvolvido por JoãoNeto - jneto@centershop.com.br ####################################################### colisao(id_do_obstáculo,id_do_objeto,tipo_de_verificação) Sendo que: *id_do_obstáculo - O ID do objeto que conterá a condição *id_do_objeto = O ID do objeto que colidirá com o obstáculo *tipo_de_verificação = Se for 0(zero) será de sobreposição ( um sobre o outro), se for 1 será de aproximação( um ao lado do outro). ####################################################### =end class Interpreter def this_id return @event_id.to_i end def colisao(obstaculo=@event_id,objeto=@event_id,tipo=0) obst = $game_map.events[obstaculo] objt = $game_map.events[objeto] case tipo when 0 # um emcima do outro if obst.x == objt.x and obst.y == objt.y return true else return false end when 1 # um do lado do outro, não importa o lado objt_direc = $game_map.events[objeto].direction obj_x = objt.x+(objt_direc==6?1:objt_direc==4?-1:0) obj_y = objt.y+(objt_direc==2?1:objt_direc==8?-1:0) if obst.x == obj_x and obst.y == obj_y return true else return false end end end end
Cambiar los controles del juego
Este script también sirve cuando en tu juego sucede un error extraño en el Rpg Maker XP y parece que un botón de dirección está siempre pulsado. Trae por defecto los controles del maker, pero puedes cambiarlos a partir de la parte CONFIGURACION DE CONTROLES.
Los comandos de los condicionales sobre las teclas van a quedar inservibles (tecla X pulsada?), debes usar condicional > script con lo siguiente:
Input.trigger?(Input::Key['tecla']): ¿la tecla 'tecla' fue pulsada?
Input.press?(Input::Key['tecla']): ¿la tecla 'tecla' está siendo presionada?
Se puede utilizar también la variable definida en CONFIGURACION DE CONTROLES, por ejemplo: Input.trigger?(Input::UP)
============================================================================== # module Input #============================================================================== module Input #---------------------------------------------------------------------------- # Simple ASCII table #---------------------------------------------------------------------------- Key = {'A' => 65, 'B' => 66, 'C' => 67, 'D' => 68, 'E' => 69, 'F' => 70, 'G' => 71, 'H' => 72, 'I' => 73, 'J' => 74, 'K' => 75, 'L' => 76, 'M' => 77, 'N' => 78, 'O' => 79, 'P' => 80, 'Q' => 81, 'R' => 82, 'S' => 83, 'T' => 84, 'U' => 85, 'V' => 86, 'W' => 87, 'X' => 88, 'Y' => 89, 'Z' => 90, '0' => 48, '1' => 49, '2' => 50, '3' => 51, '4' => 52, '5' => 53, '6' => 54, '7' => 55, '8' => 56, '9' => 57, 'NumberPad 0' => 45, 'NumberPad 1' => 35, 'NumberPad 2' => 40, 'NumberPad 3' => 34, 'NumberPad 4' => 37, 'NumberPad 5' => 12, 'NumberPad 6' => 39, 'NumberPad 7' => 36, 'NumberPad 8' => 38, 'NumberPad 9' => 33, 'F1' => 112, 'F2' => 113, 'F3' => 114, 'F4' => 115, 'F5' => 116, 'F6' => 117, 'F7' => 118, 'F8' => 119, 'F9' => 120, 'F10' => 121, 'F11' => 122, 'F12' => 123, ';' => 186, '=' => 187, ',' => 188, '-' => 189, '.' => 190, '/' => 220, '\\' => 191, '\'' => 222, '[' => 219, ']' => 221, '`' => 192, 'Backspace' => 8, 'Tab' => 9, 'Enter' => 13, 'Shift' => 16, 'Left Shift' => 160, 'Right Shift' => 161, 'Left Ctrl' => 162, 'Right Ctrl' => 163, 'Left Alt' => 164, 'Right Alt' => 165, 'Ctrl' => 17, 'Alt' => 18, 'Esc' => 27, 'Space' => 32, 'Page Up' => 33, 'Page Down' => 34, 'End' => 35, 'Home' => 36, 'Insert' => 45, 'Delete' => 46, 'Arrow Left' => 37, 'Arrow Up' => 38, 'Arrow Right' => 39, 'Arrow Down' => 40, 'Mouse Left' => 1, 'Mouse Right' => 2, 'Mouse Middle' => 4, 'Mouse 4' => 5, 'Mouse 5' => 6} #============================================================================== # CONFIGURACION DE BOTONES #============================================================================== UP = [Key['Arrow Up']] LEFT = [Key['Arrow Left']] DOWN = [Key['Arrow Down']] RIGHT = [Key['Arrow Right']] A = [Key['Shift']] B = [Key['Esc'], Key['NumberPad 0'], Key['X']] C = [Key['Space'], Key['Enter'], Key['C']] X = [Key['A']] Y = [Key['S']] Z = [Key['D']] L = [Key['Q'], Key['Page Down']] R = [Key['W'], Key['Page Up']] F5 = [Key['F5']] F6 = [Key['F6']] F7 = [Key['F7']] F8 = [Key['F8']] F9 = [Key['F9']] SHIFT = [Key['Shift']] CTRL = [Key['Ctrl']] ALT = [Key['Alt']] #============================================================================== # All keys ALL_KEYS = (0...256).to_a # Win32 API calls GetKeyboardState = Win32API.new('user32','GetKeyboardState', 'P', 'I') GetKeyboardLayout = Win32API.new('user32', 'GetKeyboardLayout','L', 'L') MapVirtualKeyEx = Win32API.new('user32', 'MapVirtualKeyEx', 'IIL', 'I') ToUnicodeEx = Win32API.new('user32', 'ToUnicodeEx', 'LLPPILL', 'L') # some other constants DOWN_STATE_MASK = 0x80 DEAD_KEY_MASK = 0x80000000 # data @state = "\0" * 256 @triggered = Array.new(256, false) @pressed = Array.new(256, false) @released = Array.new(256, false) @repeated = Array.new(256, 0) #---------------------------------------------------------------------------- # update # Updates input. #---------------------------------------------------------------------------- def self.update # get current language layout @language_layout = GetKeyboardLayout.call(0) # get new keyboard state GetKeyboardState.call(@state) # for each key ALL_KEYS.each {|key| # if pressed state if @state[key] & DOWN_STATE_MASK == DOWN_STATE_MASK # not released anymore @released[key] = false # if not pressed yet if !@pressed[key] # pressed and triggered @pressed[key] = true @triggered[key] = true else # not triggered anymore @triggered[key] = false end # update of repeat counter @repeated[key] < 17 ? @repeated[key] += 1 : @repeated[key] = 15 # not released yet elsif !@released[key] # if still pressed if @pressed[key] # not triggered, pressed or repeated, but released @triggered[key] = false @pressed[key] = false @repeated[key] = 0 @released[key] = true end else # not released anymore @released[key] = false end} end #---------------------------------------------------------------------------- # dir4 # 4 direction check. #---------------------------------------------------------------------------- def Input.dir4 return 2 if Input.press?(DOWN) return 4 if Input.press?(LEFT) return 6 if Input.press?(RIGHT) return 8 if Input.press?(UP) return 0 end #---------------------------------------------------------------------------- # dir8 # 8 direction check. #---------------------------------------------------------------------------- def Input.dir8 down = Input.press?(DOWN) left = Input.press?(LEFT) return 1 if down && left right = Input.press?(RIGHT) return 3 if down && right up = Input.press?(UP) return 7 if up && left return 9 if up && right return 2 if down return 4 if left return 6 if right return 8 if up return 0 end #---------------------------------------------------------------------------- # trigger? # Test if key was triggered once. #---------------------------------------------------------------------------- def Input.trigger?(keys) keys = [keys] unless keys.is_a?(Array) return keys.any? {|key| @triggered[key]} end #---------------------------------------------------------------------------- # press? # Test if key is being pressed. #---------------------------------------------------------------------------- def Input.press?(keys) keys = [keys] unless keys.is_a?(Array) return keys.any? {|key| @pressed[key]} end #---------------------------------------------------------------------------- # repeat? # Test if key is being pressed for repeating. #---------------------------------------------------------------------------- def Input.repeat?(keys) keys = [keys] unless keys.is_a?(Array) return keys.any? {|key| @repeated[key] == 1 || @repeated[key] == 16} end #---------------------------------------------------------------------------- # release? # Test if key was released. #---------------------------------------------------------------------------- def Input.release?(keys) keys = [keys] unless keys.is_a?(Array) return keys.any? {|key| @released[key]} end #---------------------------------------------------------------------------- # get_character # vk - virtual key # Gets the character from keyboard input using the input locale identifier # (formerly called keyboard layout handles). #---------------------------------------------------------------------------- def self.get_character(vk) # get corresponding character from virtual key c = MapVirtualKeyEx.call(vk, 2, @language_layout) # stop if character is non-printable and not a dead key return '' if c < 32 && (c & DEAD_KEY_MASK != DEAD_KEY_MASK) # get scan code vsc = MapVirtualKeyEx.call(vk, 0, @language_layout) # result string is never longer than 2 bytes (Unicode) result = "\0" * 2 # get input string from Win32 API length = ToUnicodeEx.call(vk, vsc, @state, result, 2, 0, @language_layout) return (length == 0 ? '' : result) end #---------------------------------------------------------------------------- # get_input_string # Gets the string that was entered using the keyboard over the input locale # identifier (formerly called keyboard layout handles). #---------------------------------------------------------------------------- def self.get_input_string result = '' # check every key ALL_KEYS.each {|key| # if repeated if self.repeat?(key) # get character from keyboard state c = self.get_character(key) # add character if there is a character result += c if c != '' end} # empty if result is empty return '' if result == '' # convert string from Unicode to UTF-8 return self.unicode_to_utf8(result) end #---------------------------------------------------------------------------- # get_input_string # string - string in Unicode format # Converts a string from Unicode format to UTF-8 format as RGSS does not # support Unicode. #---------------------------------------------------------------------------- def self.unicode_to_utf8(string) result = '' string.unpack('S*').each {|c| # characters under 0x80 are 1 byte characters if c < 0x0080 result += c.chr # other characters under 0x800 are 2 byte characters elsif c < 0x0800 result += (0xC0 | (c >> 6)).chr result += (0x80 | (c & 0x3F)).chr # the rest are 3 byte characters else result += (0xE0 | (c >> 12)).chr result += (0x80 | ((c >> 12) & 0x3F)).chr result += (0x80 | (c & 0x3F)).chr end} return result end end #============================================================================== # Numeric #------------------------------------------------------------------------------ # This class serves as superclass for all numbers. It was enhanced with a # utility method. #============================================================================== class Numeric #-------------------------------------------------------------------------- # sgn # Returns the sign of the number or 0 if the number is 0. #-------------------------------------------------------------------------- def sgn return (self == 0 ? 0 : self / self.abs) end end #============================================================================== # Array #------------------------------------------------------------------------------ # This class handles array data structures. It was modified to support the # utility operations sum and squares. #============================================================================== class Array #---------------------------------------------------------------------------- # sum # Sums up all the numeric values of the array. #---------------------------------------------------------------------------- def sum # initialize sum = 0 # add each element that's a number to sum self.each {|i| sum += i if i.is_a?(Numeric)} # return sum as float return sum end end #============================================================================== # Hash #------------------------------------------------------------------------------ # This class handles hash data structures. It was modified to support the # utility operations sum and squares. #============================================================================== class Hash #---------------------------------------------------------------------------- # sum # Sums up all the numeric values of the array. #---------------------------------------------------------------------------- def sum # initialize sum = 0 # add each element that's a number to sum self.each_value {|i| sum += i if i.is_a?(Numeric)} # return sum as float return sum end end
Sonido al caminar
Cada vez que el jugador dé un paso se escuchará el sonido del paso dependiendo del tipo de suelo que pise. Se puede configurar de la siguiente manera:
Terrains[0] = '001-System01' dentro del [] va el número del tag del terreno, que se puede cambiar en la Base de Datos del juego (y por defecto es 0) y luego el nombre del archivo de sonido que tiene que ir entre '' y se supone que debe de estar dentro de la carpeta SE.
También hay otra opción para indicar un sonido específico para cada Tileset y es de la siguiente forma:
Tilesets[tileset id][terrain id] = "sound file" tileset id es el ID del tileset en la Base de Datos, terrain id es el tag del terreno también en la base de datos y sound file es el archivo de sonido entre "".
En el script ya hay sonidos y configuraciones hechas, borra las que no te interesen.
#=========================================================================== # Terrain Step Sound # Version 1.1 # Autor game_guy #---------------------------------------------------- # Create nice aesthetics with terrain noise. As you walk across grass or sand, # let it play a beautiful noise to add to the atmosphere and realism of the # game. # # Features: # Specific Sound for Each Terrain # Specific Sounds for Each Tileset # Specify Volume and Pitch # # Instructions: # Setup the config below, its pretty self explanatory, more instructions # with config. # # Credits: # game_guy ~ For creating it # Tuggernuts ~ For requesting it a long time ago # Sase ~ For also requeseting it #========================================================================== module TSS # In Frames Recommended 5-10 Wait = 5 # Ignore the next 2 lines Terrains = [] Tilesets = [] #======================================================================== # Enter in sounds for each terrain tag # Goes from 0-8. Set as nil to disable that terrain or delete the line. #======================================================================== Terrains[0] = '001-System01' Terrains[1] = 'fs_wood_hard1' Terrains[2] = 'fs_grass03' Terrains[3] = 'fs_stone_hoof2' Terrains[4] = 'as_na_grassmove2' Terrains[5] = 'fs_water_hard1' Terrains[6] = 'fs_dirt_hard1' #======================================================================== # If you would like to specifiy a volume and pitch, simply set the # terrain as an array. # Terrains[7] = ["sound", volume, pitch] # Just set it as a string if you would like the volume to be at 100 and # pitch at 0. # This also applies for tilesets below. #======================================================================= Terrains[7] = ["sound", 80, 10] #======================================================================= # With tilesets, you can set specific sounds for each tileset so you don't # have the same sounds. Add a new line and put # Tilesets[tileset id] = [] # Then for each terrain put # Tilesets[tileset id][terrain id] = "sound file" # If a sound doesn't exist for a tileset, it will play a default sound, # if a default doesn't exist, no sound at all. #======================================================================= Tilesets[1] = [] Tilesets[1][0] = "Sound" Tilesets[1][1] = ["sound", 75, 50] end class Game_Map def terrain_sound if TSS::Tilesets[@map.tileset_id] != nil return TSS::Tilesets[@map.tileset_id][$game_player.terrain_tag] else return TSS::Terrains[$game_player.terrain_tag] end return nil end end class Scene_Map alias gg_init_terrain_sounds_lat initialize def initialize @tsswait = TSS::Wait gg_init_terrain_sounds_lat end alias gg_update_terrain_sounds_lat update def update if $game_player.moving? @tsswait -= 1 terrain = $game_map.terrain_sound if terrain != nil if @tsswait == 0 vol = terrain.is_a?(Array) ? terrain[1] : 100 pit = terrain.is_a?(Array) ? terrain[2] : 0 son = terrain.is_a?(Array) ? terrain[0] : terrain Audio.se_play('Audio/SE/' + son, vol, pit) @tsswait = TSS::Wait end end end gg_update_terrain_sounds_lat end end
Copiar un evento de otro mapa al mapa que quieras
Este script te permite llamar eventos de cualquier mapa y posicionarlos en el mapa que desees y en las coordenadas que especifiques.
#=============================================================# # Copy Event # #-------------------------------------------------------------# # Versão: 1.1 # # Data: 4 / 7 / 2010 # #-------------------------------------------------------------# # Autor: .:Fênix:. # # MSN: bmotamer@hotmail.com # #=============================================================# module Copy_Event # Ativar o script? (true / false) Activate = true end #=============================================================# # Permite copiar eventos de otros mapas al mapa actual # #-------------------------------------------------------------# # Para proceder a la copia, utilice este método: # #-------------------------------------------------------------# # > Script: copy_event(map_id, event_id, x, y) # #-------------------------------------------------------------# # map_id es el ID del mapa que quieres copiar, si es menor # # que 1, se refiere al mapa en donde se usa el comando # #-------------------------------------------------------------# # event_id es el ID del evento a copiar # #-------------------------------------------------------------# # x, y son las posiciones que va a tener el evento en el mapa # #-------------------------------------------------------------# # ESTE SCRIPT ES COMPATIBLE CON LOS RPG Makers XP y VX # #-------------------------------------------------------------# # NO TE OLVIDES DE ACREDITAR AL AUTOR DEL SCRIPT!!!!! # #=============================================================# if Copy_Event::Activate class Game_Event < Game_Character attr_accessor :id end class Game_Map def copy_event(map_id = 1, event_id = 1, x = 0, y = 0) id = @events.size + 1 event = load_data(sprintf("Data/Map%03d.r#{defined?(Graphics.wait) ? 'v' : 'x'}data", map_id < 1 ? @map_id : map_id)).events[event_id] event.id = id @events[id] = Game_Event.new(@map_id, event) @events[id].moveto(x, y) @events[id].id = id $scene.spriteset.character_sprites.insert($scene.spriteset.character_sprites.size - 2, Sprite_Character.new($scene.spriteset.viewport1, @events[id])) if !$scene.spriteset.nil? end end class Spriteset_Map attr_reader :viewport1, :character_sprites end class Scene_Map attr_reader :spriteset end def copy_event(map_id = 1, event_id = 1, x = 0, y = 0) $game_map.copy_event(map_id, event_id, x, y) end end
Comentarios
Publicar un comentario
ATENCIÓN: Tu comentario aparecerá cuando sea aceptado.