jueves, 26 de junio de 2008

Scripts RMXP

[Script] PMA

PERSONALIZACIÓN MUSICAL AVANZADA (PMA) , por Mondo Trasho

Descripción: ¿eres fanático de la música y siempre has querido personalizarla
al máximo en tus juegos? Esta es tu oportunidad. Este Script te permitirá
seleccionar la pista para ser reproducida en el mapa (no en batalla).
Podrás elegir entre 2 páginas con 10 temas musicales cada una. Para cambiar
de página utiliza las flechas derecha e izquierda de tu teclado. Para seleccionar
el tema que quieres que se reproduzca en el mapa pulsa la tecla C / Enter en el
tema que esté en curso.

Instrucciones: pegar en una nueva clase sobre Main. Luego utilizar el comando "llamar a script" y pegar el siguiente código: $scene = Scene_MusicMT.new
Para editar los temas que quieres que aparezcan simplemente debes buscar el módulo MONDO
(module MONDO) y editar el texto en comillas de cada tema.
Ejemplo MUSIC1 = "Pon tu tema musical aquí". El tema musical debe
estar guardado en la carpeta de BMG de tu proyecto.

Créditos: Mondo Trasho / El Adagio de la Bestia Producciones

VERSIÓN: 0.1 (primera versión)


Codigo
# --------------------------------------------------------------------------
# PERSONALIZACIÓN MUSICAL AVANZADA (PMA) , por Mondo Trasho
# --------------------------------------------------------------------------
# Descripción: ¿eres fanático de la música y siempre has querido personalizarla
# al máximo en tus juegos? Esta es tu oportunidad. Este Script te permitirá
# seleccionar la pista para ser reproducida en el mapa (no en batalla).
# Podrás elegir entre 2 páginas con 10 temas musicales cada una. Para cambiar
# de página utiliza las flechas derecha e izquierda de tu teclado. Para seleccionar
# el tema que quieres que se reproduzca en el mapa pulsa la tecla C / Enter en el
# tema que esté en curso.
# --------------------------------------------------------------------------
# Instrucciones: pegar en una nueva clase sobre Main. Para editar los temas
# que quieres que aparezcan simplemente # debes buscar el módulo MONDO
# (module MONDO) y editar el texto en comillas de cada tema.
# Ejemplo MUSIC1 = "Pon tu tema musical aquí". El tema musical debe
# estar guardado en la carpeta de BMG de tu proyecto.
# --------------------------------------------------------------------------
# Créditos: Mondo Trasho / El Adagio de la Bestia Producciones
# --------------------------------------------------------------------------
# VERSIÓN: 0.1 (primera versión)
#---------------------------------------------------------------------------

module MONDO
# Primera página
MUSIC1 = "029-Town07"
MUSIC2 = "010-LastBoss02"
MUSIC3 = "017-Theme06"
MUSIC4 = "031-Castle01"
MUSIC5 = "033-Ship01"
MUSIC6 = "040-Dungeon06"
MUSIC7 = "026-Town04"
MUSIC8 = "025-Town03"
MUSIC9 = "024-Town02"
MUSIC10 = "023-Town01"
# Segunda página
MUSIC11 = "016-Theme05"
MUSIC12 = "015-Theme04"
MUSIC13 = "014-Theme03"
MUSIC14 = "013-Theme02"
MUSIC15 = "012-Theme01"
MUSIC16 = "042-Dungeon08"
MUSIC17 = "041-Dungeon07"
MUSIC18 = "040-Dungeon06"
MUSIC19 = "039-Dungeon05"
MUSIC20 = "038-Dungeon04"
BGS = ""
end


class Window_Titulo < contents =" Bitmap.new(width" name =" $fontface" size =" 30" italic =" true" windowskin =" ()" contents =" Bitmap.new(width" name =" $fontface" size =" 20" italic =" true" windowskin =" ()" contents =" Bitmap.new(width" name =" $fontface" size =" 20" italic =" true" windowskin =" ()" contents =" Bitmap.new(width" name =" $fontface" size =" 20" italic =" true" menu_index =" 0)" menu_index =" menu_index" s1 =" MONDO::MUSIC1" s2 =" MONDO::MUSIC2" s3 =" MONDO::MUSIC3" s4 =" MONDO::MUSIC4" s5 =" MONDO::MUSIC5" s6 =" MONDO::MUSIC6" s7 =" MONDO::MUSIC7" s8 =" MONDO::MUSIC8" s9 =" MONDO::MUSIC9" s10 =" MONDO::MUSIC10" command_window =" Window_Command.new(260," index =" @menu_index" x =" 0" y =" 128" size ="="" window_titulo =" Window_Titulo.new" window_cduno =" Window_CDuno.new" x =" 0" y =" 70" window_cre =" Window_Creditos.new" x =" 360" y =" 400" scene =" Scene_MusicMT2.new" members =" 0" size ="="" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" menu_index =" 0)" menu_index =" menu_index" s1 =" MONDO::MUSIC11" s2 =" MONDO::MUSIC12" s3 =" MONDO::MUSIC13" s4 =" MONDO::MUSIC14" s5 =" MONDO::MUSIC15" s6 =" MONDO::MUSIC16" s7 =" MONDO::MUSIC17" s8 =" MONDO::MUSIC18" s9 =" MONDO::MUSIC19" s10 =" MONDO::MUSIC20" command_window =" Window_Command.new(260," index =" @menu_index" x =" 0" y =" 128" size ="="" window_titulo =" Window_Titulo.new" window_cddos =" Window_CDdos.new" x =" 0" y =" 70" window_cre =" Window_Creditos.new" x =" 360" y =" 400" scene =" Scene_MusicMT.new" members =" 0" size ="="" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new" scene =" Scene_Map.new">

SCREENSHOT


VERSIÓN 0.2 (SEGUNDA VERSIÓN)

NUEVO: ¡Ahora podrás agregarle descripción y los detalles para cada uno de
los 20 temas que hayas elegido!
# Para editar la cantidad de temas de la página 1 debes ir a la línea 1520
# y buscar: @command_window = Window_Command.new(260, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
# Cada "Sx" (x = un número) representa la cantidad de temas, sólo tienes que borrar
# las "S" hasta la cantidad de temas que quieres que aparezcan.
# Para la página 2 es la línea 2009.


DESCARGA AQUÍ (no entraba en Code :P)

SCREENSHOT DE LA VERSIÓN 0.2


[Script] AGPE (Agenda Personalizada)

¡NUEVA VERSIÓN V.02!!
¡¡AHORA PODRÁS AGREGAR UN FACE, UN NOMBRE Y UNA DESCRIPCIÓN!!

AGENDA PERSONALIZADA (AGPE) , por Mondo Trasho

Descripción: una agenda personalizada donde podrás guardar información sobre
los personajes mediante en el juego: se registrará un nombre, una descripción
y un determinado face para cada personaje
Permite hasta 20 personajes (dos páginas de 10 personajes cada una).
Para cambiar de página utiliza las flechas de dirección del teclado.
Hecho a pedido de Ningenin.

Instrucciones: pegar en una nueva clase sobre Main.
Luego utilizar el comando "llamar a script" y pegar el siguiente código:
$scene = Scene_Agenda.new
Para editar la descripción de los personajes que quieres que aparezcan simplemente ebes
buscar el módulo AMONDO # (module AMONDO) y editar el texto en comillas de cada tema.
Ejemplo Personaje1 = "Descripción aquí". Para que el nombre del personaje aparezca
en la agenda debes activar un interruptor determinado, está designado por defecto
desde el interruptor 1 hasta el 20 (uno por cada persoanje), puedes editarlo
buscando por ejemplo PERSONAJE1_ID = X (el número de interruptor que quieras
designarle.
Para editar el nombre busca en el módule AMONDO Ejemplo: NOMBREP1 = "Nombre 1"
Instrucciones para los faces: los faces deben estar en la carpeta "Pictures"
del proyecto con el mismo nombre que le asignes en el módulo AMONDO:
Ejemplo para el face 1º # Faces PIC_PERSONAJE1 = "Nombre del face".
El face debe tener como máximo 130 x 130 píxeles.

Créditos: Mondo Trasho / El Adagio de la Bestia Producciones

VERSIÓN: 0.2 (segunda versión)

Esta es la imagen de ejemplo del Face para que se guien las medidas:



SCREENSHOT

DESCARGAR LA VERSIÓN 0.2 (NUEVA!!)

NOTA AUTORAL:
Si que me llevo su tiempito hacer este Script, de hecho fue el que más me costó de los que hice hasta ahora.

Cualquier duda ya saben, tienen al creador aquí mismo para molestarlo, jeje.

Saludos y espero que les sirva.



-------------------------------------------------------------------------------------------
# AGENDA PERSONALIZADA (AGPE) , por Mondo Trasho
# --------------------------------------------------------------------------
# Descripción: una agenda personalizada donde podrás guardar información sobre
# los personajes mediante en el juego. Podrás borrar la información que no te guste.
# Permite hasta 20 personajes (dos páginas de 10 personajes cada una).
# Para cambiar de página utiliza las flechas de dirección del teclado.
# Hecho a pedido de Ningenin.
# --------------------------------------------------------------------------
# Instrucciones: pegar en una nueva clase sobre Main.
# Luego utilizar el comando "llamar a script" y pegar el siguiente código:
# $scene = Scene_Agenda.new
# Para editar el nombre de los personajes que quieres que aparezcan simplemente debes
# buscar el módulo AMONDO # (module AMONDO) y editar el texto en comillas de cada tema. # Ejemplo Personaje1 = "Descripción aquí". Para que el nombre del personaje aparezca
# en la agenda debes activar un interruptor determinado, está designado por defecto
# desde el interruptor 1 hasta el 20 (uno por cada persoanje), puedes editarlo
# buscando por ejemplo PERSONAJE1_ID = X (el número de interruptor que quieras
# designarle.
# --------------------------------------------------------------------------
# Créditos: Mondo Trasho / El Adagio de la Bestia Producciones
# --------------------------------------------------------------------------
# VERSIÓN: 0.1 (primera versión)
#---------------------------------------------------------------------------

Screenshot

DESCARGA AQUÍ


[Script] MONDO_TRASHO_FINALGAME

MONDO_TRASHO_FINALGAME (MTFG)

Autor: Mondo_Trasho

Script hecho a pedido de: Ningenin y Fangkids.

CARACTERÍSTICAS:
Este Script está preparado para ser usado al concluir el juego, dando las
características de:
- Llama a un nueva escena de Scene_Save, y no tienes otra opción que guardar
la partida, anulando el "Input::B" (o sea, la opción para cancelar).
- Reconfigura el Scene_Title (la escena de título agregando una nueva
opción que es editable, que te llevará a un nuevo mapa. Puedes agregar todas
las opciones que quieras.

INSTRUCCIONES:
- Crear una nueva clase encima de Main y pegar el siguiente código:
Codigo
# MONDO_TRASHO_FINALGAME (MTFG)
# -------------------------------------------------------------------
# Este Script está preparado para ser usado al concluir el juego, dando las
# características de:
# - Llama a un nueva escena de Scene_Save, y no tienes otra opción que guardar
# la partida, anulando el "Input::B" (o sea, la opción para cancelar).
# - Reconfigura el Scene_Title (la escena de título agregando una nueva
# opción que es editable, que te llevará a un nuevo mapa. Puedes agregar todas
# las opciones que quieras.
# -------------------------------------------------------------------
# INSTRUCCIONES:
# - Cuando termines el juego, debes llamar desde un evento y utilizar el comando
# "Llamar a Script", pegando el siguiente código: $scene = Scene_Save2.new
# Para editar la nueva opción que aparecerá en el Scene_Title debes:
# Ir a la línea 256 "s3 = "Nueva Opción" y editar el nombre por lo que quieras
# que aparezca. Luego, para editar el mapa que te llevará la nueva opción debes
# ir a la línea 298 y buscar esto "$game_map.setup(001)", cambiar el 001 por el
# ID del mapa donde quieres que te lleve la nueva opción.
#--------------------------------------------------------------------
# CRÉDITOS A: EL ADAGIO DE LA BESTIA PRODUCCIONES / MONDO_TRASHO
#------------------------------------------------------------------------------

class Scene_File2
#--------------------------------------------------------------------------
# * Object Initialization
# help_text : text string shown in the help window
#--------------------------------------------------------------------------
def initialize(help_text)
@help_text = help_text
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make help window
@help_window = Window_Help.new
@help_window.set_text(@help_text)
# Make save file window
@savefile_windows = []
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
# Select last file to be operated
@file_index = $game_temp.last_file_index
@savefile_windows[@file_index].selected = true
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
for i in @savefile_windows
i.dispose
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
for i in @savefile_windows
i.update
end
# If C button was pressed
if Input.trigger?(Input::C)
Title.new(1)
# Call method: on_decision (defined by the subclasses)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
# If the down directional button was pressed
if Input.repeat?(Input::DOWN)
# If the down directional button pressed down is not a repeat,
# or cursor position is more in front than 3
if Input.trigger?(Input::DOWN) or @file_index < 3
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Move cursor down
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 1) % 4
@savefile_windows[@file_index].selected = true
return
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If the up directional button pressed down is not a repeat、
# or cursor position is more in back than 0
if Input.trigger?(Input::UP) or @file_index > 0
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Move cursor up
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 3) % 4
@savefile_windows[@file_index].selected = true
return
end
end
end
#--------------------------------------------------------------------------
# * Make File Name
# file_index : save file index (0-3)
#--------------------------------------------------------------------------
def make_filename(file_index)
return "Save#{file_index + 1}.rxdata"
end
end

class Scene_Save2 < Scene_File2
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super("Which file would you like to save to?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# Play save SE
$game_system.se_play($data_system.save_se)
# Write save data
file = File.open(filename, "wb")
write_save_data(file)
file.close
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
def write_save_data(file)
# Make character data for drawing save file
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
# Write character data for drawing save file
Marshal.dump(characters, file)
# Wrire frame count for measuring play time
Marshal.dump(Graphics.frame_count, file)
# Increase save count by 1
$game_system.save_count += 1
# Save magic number
# (A random value will be written each time saving with editor)
$game_system.magic_number = $data_system.magic_number
# Write each type of game object
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end

class Title
def initialize(number)
@number = number
file = File.open("Title.data", "wb")
Marshal.dump(@number, file)
file.close
end
end


#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------

class Scene_Title
#--------------------------------------------------------------------------
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new

if FileTest.exist?("Title.data")
file = File.open("Title.data", "rb")
@title = Marshal.load(file)
file.close
end

@sprite = Sprite.new

if @title == nil
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Exit"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
else
case @title
when 0
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Exit"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
when 1
@sprite.bitmap = RPG::Cache.title("001-title01")
# Si haces cambios significativos aquí tendrás que modificar
# también el update
s1 = "Nuevo"
s2 = "Cargar"
s3 = "Nueva Opción"
s4 = "Salir"
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
end
end

@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# Nueva Opción a editar
#--------------------------------------------------------------------------
def command_nuevaopcion
command_new_game
$game_map.setup(001)
end
#--------------------------------------------------------------------------
def update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_nuevaopcion
when 3
command_shutdown
end
end
end
end




- Cuando termines el juego, debes llamar desde un evento y utilizar el comando
"Llamar a Script", pegando el siguiente código: $scene = Scene_Save2.new
Para editar la nueva opción que aparecerá en el Scene_Title debes:
Ir a la línea 256 "s3 = "Nueva Opción" y editar el nombre por lo que quieras
que aparezca. Luego, para editar el mapa que te llevará la nueva opción debes
ir a la línea 298 y buscar esto "$game_map.setup(001)", cambiar el 001 por el
ID del mapa donde quieres que te lleve la nueva opción.

CRÉDITOS A: EL ADAGIO DE LA BESTIA PRODUCCIONES / MONDO_TRASHO

-----------------

MONDO_TRASHO_FINALGAME (MTFG) V.02 ¡¡NUEVA!!

NUEVO: Podrás cambiar la música del nuevo Scene_Title.

Para cambiar la música del nuevo Scene_Title simplemente debes editar la línea
número 28 MUSIC1 = "" Y dentro de las comillas poner el nombre del tema que está guardado en la carpeta BMG.

Codigo
# MONDO_TRASHO_FINALGAME (MTFG) V.02 ¡¡NUEVA!!
# -------------------------------------------------------------------
# Este Script está preparado para ser usado al concluir el juego, dando las
# características de:
# - Llama a un nueva escena de Scene_Save, y no tienes otra opción que guardar
# la partida, anulando el "Input::B" (o sea, la opción para cancelar).
# - Reconfigura el Scene_Title (la escena de título agregando una nueva
# opción que es editable, que te llevará a un nuevo mapa. Puedes agregar todas
# las opciones que quieras.
#--------------------------------------------------------------------
# NUEVO: Podrás cambiar la música del nuevo Scene_Title.
# -------------------------------------------------------------------
# INSTRUCCIONES:
# - Cuando termines el juego, debes llamar desde un evento y utilizar el comando
# "Llamar a Script", pegando el siguiente código: $scene = Scene_Save2.new
# Para editar la nueva opción que aparecerá en el Scene_Title debes:
# Ir a la línea 256 "s3 = "Nueva Opción" y editar el nombre por lo que quieras
# que aparezca. Luego, para editar el mapa que te llevará la nueva opción debes
# ir a la línea 298 y buscar esto "$game_map.setup(001)", cambiar el 001 por el
# ID del mapa donde quieres que te lleve la nueva opción.
# Para cambiar la música del nuevo Scene_Title simplemente debes editar la línea
# número 28 MUSIC1 = "" Y dentro de las comillas poner el nombre del tema que está
# guardado en la carpeta BMG.
#--------------------------------------------------------------------
# CRÉDITOS A: EL ADAGIO DE LA BESTIA PRODUCCIONES / MONDO_TRASHO
#------------------------------------------------------------------------------
module MONDO
MUSIC1 = ""
BGS = ""
end

class Scene_File2
#--------------------------------------------------------------------------
# * Object Initialization
# help_text : text string shown in the help window
#--------------------------------------------------------------------------
def initialize(help_text)
@help_text = help_text
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make help window
@help_window = Window_Help.new
@help_window.set_text(@help_text)
# Make save file window
@savefile_windows = []
for i in 0..3
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
# Select last file to be operated
@file_index = $game_temp.last_file_index
@savefile_windows[@file_index].selected = true
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
for i in @savefile_windows
i.dispose
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
for i in @savefile_windows
i.update
end
# If C button was pressed
if Input.trigger?(Input::C)
Title.new(1)
# Call method: on_decision (defined by the subclasses)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
# If the down directional button was pressed
if Input.repeat?(Input::DOWN)
# If the down directional button pressed down is not a repeat,
# or cursor position is more in front than 3
if Input.trigger?(Input::DOWN) or @file_index < 3
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Move cursor down
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 1) % 4
@savefile_windows[@file_index].selected = true
return
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If the up directional button pressed down is not a repeat、
# or cursor position is more in back than 0
if Input.trigger?(Input::UP) or @file_index > 0
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# Move cursor up
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 3) % 4
@savefile_windows[@file_index].selected = true
return
end
end
end
#--------------------------------------------------------------------------
# * Make File Name
# file_index : save file index (0-3)
#--------------------------------------------------------------------------
def make_filename(file_index)
return "Save#{file_index + 1}.rxdata"
end
end

class Scene_Save2 < Scene_File2
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super("Which file would you like to save to?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# Play save SE
$game_system.se_play($data_system.save_se)
# Write save data
file = File.open(filename, "wb")
write_save_data(file)
file.close
# If called from event
if $game_temp.save_calling
# Clear save call flag
$game_temp.save_calling = false
# Switch to map screen
$scene = Scene_Map.new
return
end
# Switch to menu screen
$scene = Scene_Title.new
end
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
def write_save_data(file)
# Make character data for drawing save file
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
# Write character data for drawing save file
Marshal.dump(characters, file)
# Wrire frame count for measuring play time
Marshal.dump(Graphics.frame_count, file)
# Increase save count by 1
$game_system.save_count += 1
# Save magic number
# (A random value will be written each time saving with editor)
$game_system.magic_number = $data_system.magic_number
# Write each type of game object
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
end
end

class Title
def initialize(number)
@number = number
file = File.open("Title.data", "wb")
Marshal.dump(@number, file)
file.close
end
end


#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------

class Scene_Title
#--------------------------------------------------------------------------
def main
if $BTEST
battle_test
return
end
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new

if FileTest.exist?("Title.data")
file = File.open("Title.data", "rb")
@title = Marshal.load(file)
file.close
end

@sprite = Sprite.new

if @title == nil
$game_system.bgm_play($data_system.title_bgm)
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Exit"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
else
case @title
when 0
$game_system.bgm_play($data_system.title_bgm)
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
s1 = "New Game"
s2 = "Continue"
s3 = "Exit"
@command_window = Window_Command.new(192, [s1, s2, s3])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
when 1
Audio.bgm_play("Audio/BGM/" + MONDO::MUSIC1, 100, 100)
@sprite.bitmap = RPG::Cache.title("001-title01")
s1 = "Nuevo"
s2 = "Cargar"
s3 = "Nueva Opción"
s4 = "Salir"
@command_window = Window_Command.new(192, [s1, s2, s3, s4])
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
end
end

@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@command_window.dispose
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# Nueva Opción a editar
#--------------------------------------------------------------------------
def command_nuevaopcion
command_new_game
$game_map.setup(001)
end
#--------------------------------------------------------------------------
def update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_nuevaopcion
when 3
command_shutdown
end
end
end
end



Scene_Reset

Este realmente es un Script muy simple, pero como lo hice para mí pensé que quizás a alguien más podría servirle.

Scene_Reset

- Script hecho por Mondo_Trasho

- Descripción: permite reiniciar la partida desde el mapa. Vendría a reemplazar al comando "New Game", y te ahorraría ir al Scene_Title para comenzar una nueva partida.

- Instrucciones: pegar encima de Main. Para hacerlo funcionar: utilizar el comando llamar a Script y poner:

Codigo
$scene = Scene_Reset.new

Créditos: Mondo Trasho / El Adagio de la Bestia Producciones

Codigo
#==============================================================================
# ** Scene_Reset
#------------------------------------------------------------------------------
# Script hecho por Mondo_Trasho
#------------------------------------------------------------------------------
# Permite reiniciar la partida desde el mapa.
#------------------------------------------------------------------------------
# Para hacerlo funcionar: utilizar el comando llamar a Script y poner:
# $scene = Scene_Reset.new
#------------------------------------------------------------------------------
# Créditos: Mondo Trasho / El Adagio de la Bestia Producciones
#==============================================================================

class Scene_Reset
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
command_new_game
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_new_game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Stop BGM
Audio.bgm_stop
# Reset frame count for measuring play time
Graphics.frame_count = 0
# Make each type of game object
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# Set up initial party
$game_party.setup_starting_members
# Set up initial map position
$game_map.setup($data_system.start_map_id)
# Move player to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refresh player
$game_player.refresh
# Run automatic change for BGM and BGS set with map
$game_map.autoplay
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
end

Se me ocurrió también agregarlo en el Menú como la opción New Game, pero primero quería saber si a alguien le interesaba.

Saludos y espero que le sirva a alguien (a mi me sirvió xD)


Es mi primer Script y realmente es muy simple, pero mientras lo hacía para un proyecto pensé que quizás a alguien le serviría.

InfoMT

# Creado por Mondo Trasho

# Descripción: crea una ventana de tiempo y otra de oro en el mapa.

# Instrucciones: Sustituye el Scene_Map por este Script o bien pégalo encima
de Main (las dos opciones son válidas).

SCREEN:



Espero que a alguien le sirva.

¡Saludos, y suerte!


Script:

Codigo
#--------------------------------------------------------------------------
# * InfoMT
# Creado por Mondo Trasho
#--------------------------------------------------------------------------
# Descripción: crea una ventana de tiempo y otra de oro en el mapa.
#--------------------------------------------------------------------------
# Instrucciones: Sustituye el Scene_Map por este Script o bien pégalo encima
# de Main.
#--------------------------------------------------------------------------

class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
@Window_GoldMT = Window_GoldMT.new
@Window_PlayTimeMT = Window_PlayTimeMT.new
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
@Window_GoldMT.dispose
@Window_PlayTimeMT.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update


# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
@Window_GoldMT.update
@Window_PlayTimeMT.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end


class Window_GoldMT < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(470, 210, 160, 64)
self.contents = Bitmap.new(width - 10, height - 10)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end


class Window_PlayTimeMT < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(470, 280, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end

No hay comentarios: