Últimos temas
» Script de menupor maxi Jue 04 Dic 2014, 1:44 pm
» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm
» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am
» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am
» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm
» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm
» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am
» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am
» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am
» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am
» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am
» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm
» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am
» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am
» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm
¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado Ninguno
El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm
Scripit Save Game - By LordLucius
+5
Veldar
cloud221
crisshinto
Toy
SoyCanek
9 participantes
RPG maker VX :: Scripts ::
Página 1 de 1.
Scripit Save Game - By LordLucius
hola, como les va de vuelta?
bueno aqui les traigo un sript que cuando uno guarda la partida le deja una imagen de donde quedo.es una especie de harry potter ( y el pricionero de azcaban), si alguno lo jugo save de que hablo. Se ve asi
[Tienes que estar registrado y conectado para ver esa imagen]
bueno, el sripit es este:
bueno aqui les traigo un sript que cuando uno guarda la partida le deja una imagen de donde quedo.es una especie de harry potter ( y el pricionero de azcaban), si alguno lo jugo save de que hablo. Se ve asi
[Tienes que estar registrado y conectado para ver esa imagen]
bueno, el sripit es este:
- Spoiler:
- Código:
#-------------------------------------------------------
# Advanced Save/Load 1.0
#-------------------------------------------------------
=begin
Criado por LordLucius - http://rpgmakervx.forosactivos.net/
Esse script Modifica Totalmente o Sistema de Salvar e de Carregar,
tenho certeza que todos irão gostar^^
=end
module Vocab
File = "Arq." # Aqui tá bom, mas se quise mexer...
end
module GuiRPG
NUMERO_MAX_DE_SAVES = 3 # Número Máximo de Saves
DIR_SAVES = "GuiRPG/" # Diretório dos Arquivos Salvos (Nunca Mude)
end
class Game_Temp
attr_accessor :menu_bitmap
attr_accessor :sub_menu_bitmap
attr_accessor :save_bitmap
alias ini initialize
def initialize
ini
@menu_bitmap = Bitmap.new(1, 1)
@sub_menu_bitmap = Bitmap.new(1, 1)
@save_bitmap = Bitmap.new(1, 1)
end
end
class Window_SaveFile < Window_Base
attr_reader :filename
attr_reader :file_exist
def initialize(file_index, filename)
super(176, 59, 304, 298)
@file_index = file_index
@filename = filename
load_gamedata
refresh(@file_index)
end
def load_gamedata
@file_exist = FileTest.exist?(GuiRPG::DIR_SAVES + @filename)
if @file_exist
file = File.open(GuiRPG::DIR_SAVES + @filename, "r")
begin
@characters = Marshal.load(file)
@frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
@game_system = Marshal.load(file)
@game_message = Marshal.load(file)
@game_switches = Marshal.load(file)
@game_variables = Marshal.load(file)
@total_sec = @frame_count / Graphics.frame_rate
rescue
@file_exist = false
ensure
file.close
end
end
end
def refresh(index)
file_index = index
self.contents.clear
self.contents.font.color = normal_color
if @file_exist
self.contents.fill_rect(0, 0, 272,208+2, Color.new(0,0,64))
if FileTest.exist?(GuiRPG::DIR_SAVES + @filename.split(/\\./)[0] + ".png")
self.contents.blur
draw_save_bitmap(0,0)
else
self.contents.draw_text(0, 64, 304-32, 24, "inválido", 1)
end
draw_party_characters(108, 288-56)
draw_playtime(0, 288+8-56, contents.width-4, 2)
else
self.contents.draw_text(0, 288-56, contents.width-4, 24, "Nenhum Arquivo Salvo", 1)
end
end
def file_index=(file_index)
@file_index = file_index
end
def draw_party_characters(x, y)
for i in [Tienes que estar registrado y conectado para ver este vínculo]
name = @characters[i][0]
index = @characters[i][1]
draw_character(name, index, x + i * 48, y)
end
end
def draw_save_bitmap(x, y)
bitmap = Bitmap.new(GuiRPG::DIR_SAVES + @filename.split(/\\./)[0] + ".png")
rect = Rect.new(0, 0, 0, 0)
rect.width = bitmap.width
rect.height = bitmap.height
self.contents.blt(x, y, bitmap, rect)
bitmap.dispose
end
def draw_playtime(x, y, width, align)
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, WLH, time_string, 2)
end
end
class Window_Menu_Command < Window_Selectable
attr_reader :commands
def initialize(width, commands, column_max = 16, row_max = 0, spacing = 8)
if row_max == 0
row_max = (commands.size + column_max - 1) / column_max
end
super(0, 416-54, width, row_max * WLH + 32, spacing)
@commands = commands
@item_max = commands.size
@column_max = column_max
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
end
def update_help
text = $data_system.game_title
if @commands[self.index] != nil
text += ": " + @commands[self.index]
end
@help_window.set_text(text)
end
end
class Scene_Base
def create_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
update_menu_background
end
def create_sub_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.sub_menu_bitmap
update_menu_background
end
def snapshot_for_save
d_rect = Rect.new(0, 0, 272, 208)
s_rect = Rect.new(0, 0, 544, 416)
save_bitmap = Graphics.snap_to_bitmap
$game_temp.save_bitmap.dispose
$game_temp.save_bitmap = Bitmap.new(272, 208)
$game_temp.save_bitmap.stretch_blt(d_rect, save_bitmap, s_rect)
end
end
class Scene_Map < Scene_Base
def terminate
super
snapshot_for_save
if $scene.is_a?(Scene_Battle)
@spriteset.dispose_characters
end
snapshot_for_background
snapshot_for_menu
@spriteset.dispose
@message_window.dispose
if $scene.is_a?(Scene_Battle)
perform_battle_transition
end
end
def snapshot_for_menu
$game_temp.menu_bitmap.dispose
$game_temp.menu_bitmap = Graphics.snap_to_bitmap
end
def call_menu
if $game_temp.menu_beep
Sound.play_decision
$game_temp.menu_beep = false
end
$game_temp.next_scene = nil
$scene = Scene_Menu.new
end
end
class Scene_Title < Scene_Base
def check_continue
@continue_enabled = (Dir.glob(GuiRPG::DIR_SAVES + 'Save*.rvdata').size > 0)
end
end
class Scene_Status < Scene_Base
def start
super
create_sub_menu_background
@actor = $game_party.members[@actor_index]
@status_window = Window_Status.new(@actor)
@status_window.openness = 0
end
def post_start
super
open_status_window
end
def pre_terminate
super
close_status_window
end
def open_status_window
@status_window.open
begin
@status_window.update
Graphics.update
end until @status_window.openness == 255
end
def close_status_window
@status_window.close
begin
@status_window.update
Graphics.update
end until @status_window.openness == 0
end
end
class Scene_File < Scene_Base
def initialize(saving, from_title, from_event)
@saving = saving
@from_title = from_title
@from_event = from_event
end
def start
super
@help_window = Window_Help.new
unless $game_temp.sub_menu_bitmap.width == 1
@help_window.opacity = 0
create_sub_menu_background
else
create_title_graphic
end
create_command_window
if @saving
@index = $game_temp.last_file_index
@help_window.set_text(Vocab::SaveMessage)
else
@index = self.latest_file_index
@help_window.set_text(Vocab::LoadMessage)
end
@refresh_index = @command_window.index = @index
@item_max = GuiRPG::NUMERO_MAX_DE_SAVES
create_savefile_window
@savefile_window.openness = 0
end
def terminate
super
dispose_menu_background
@help_window.dispose
dispose_item_windows
end
def return_scene
if @from_title
$scene = Scene_Title.new
elsif @from_event
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(4)
end
end
def update
super
update_menu_background
@help_window.update
update_savefile_windows
update_savefile_selection
end
def post_start
super
open_savefile_window
end
def pre_terminate
super
close_savefile_window
end
def create_title_graphic
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = Cache.system("Title")
end
def create_command_window
file_names = []
for i in 0...GuiRPG::NUMERO_MAX_DE_SAVES
id = sprintf("%02d", i+1)
file_names.push(Vocab::File + "\\s" + id)
end
@command_window = Window_Command.new(112, file_names)
@command_window.height = 298
@command_window.x = 64
@command_window.y = 59
@command_window.openness = 0
end
def create_savefile_window
@savefile_window = Window_SaveFile.new(@command_window.index, make_filename(@command_window.index))
end
def dispose_item_windows
@command_window.dispose
@savefile_window.dispose
end
def open_savefile_window
@command_window.open
@savefile_window.open
begin
@command_window.update
@savefile_window.update
Graphics.update
end until @savefile_window.openness == 255
end
def close_savefile_window
@command_window.close
@savefile_window.close
begin
@command_window.update
@savefile_window.update
Graphics.update
end until @savefile_window.openness == 0
end
def update_savefile_windows
@command_window.update
@savefile_window.update
end
def update_savefile_selection
if Input.trigger?(Input::C)
determine_savefile
end
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
end
if @refresh_index != @command_window.index
@refresh_index = @command_window.index
@savefile_window.dispose
create_savefile_window
end
end
def determine_savefile
if @saving
Sound.play_save
do_save
else
if @savefile_window.file_exist
Sound.play_load
do_load
else
Sound.play_buzzer
return
end
end
$game_temp.last_file_index = @index
end
def make_filename(file_index)
return "Save#{file_index + 1}.rvdata"
end
def latest_file_index
index = 0
latest_time = Time.at(0)
for i in 0...GuiRPG::NUMERO_MAX_DE_SAVES
file_name = make_filename(i)
if FileTest.exist?(GuiRPG::DIR_SAVES + file_name)
file = File.open(GuiRPG::DIR_SAVES + file_name, "r")
if file.mtime > latest_time
latest_time = file.mtime
index = i
end
end
end
return index
end
def do_save
file_name = make_filename(@command_window.index)
$game_temp.save_bitmap.make_png(file_name.split(/\\./)[0], GuiRPG::DIR_SAVES)
file = File.open(GuiRPG::DIR_SAVES + file_name, "wb")
write_save_data(file)
file.close
return_scene
end
def do_load
file_name = make_filename(@command_window.index)
file = File.open("GuiRPG/" + file_name, "rb")
read_save_data(file)
file.close
$scene = Scene_Map.new
RPG::BGM.fade(1500)
Graphics.fadeout(60)
Graphics.wait(40)
@last_bgm.play
@last_bgs.play
end
end
module Zlib
class Png_File < GzipWriter
def make_png(bitmap_Fx)
@bitmap_Fx = bitmap_Fx
self.write(make_header)
self.write(make_ihdr)
self.write(make_idat)
self.write(make_iend)
end
def make_header
return [0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a].pack("C*")
end
def make_ihdr
ih_size = [13].pack("N")
ih_sign = "IHDR"
ih_width = [@bitmap_Fx.width].pack("N")
ih_height = [@bitmap_Fx.height].pack("N")
ih_bit_depth = [8].pack("C")
ih_color_type = [6].pack("C")
ih_compression_method = [0].pack("C")
ih_filter_method = [0].pack("C")
ih_interlace_method = [0].pack("C")
string = ih_sign + ih_width + ih_height + ih_bit_depth + ih_color_type +
ih_compression_method + ih_filter_method + ih_interlace_method
ih_crc = [Zlib.crc32(string)].pack("N")
return ih_size + string + ih_crc
end
def make_idat
header = "\\x49\\x44\\x41\\x54"
data = make_bitmap_data
data = Zlib::Deflate.deflate(data, 8)
crc = [Zlib.crc32(header + data)].pack("N")
size = [data.length].pack("N")
return size + header + data + crc
end
def make_bitmap_data
gz = Zlib::GzipWriter.open('hoge.gz')
t_Fx = 0
w = @bitmap_Fx.width
h = @bitmap_Fx.height
data = []
for y in 0...h
data.push(0)
for x in 0...w
t_Fx += 1
if t_Fx % 10000 == 0
Graphics.update
end
if t_Fx % 100000 == 0
s = data.pack("C*")
gz.write(s)
data.clear
end
color = @bitmap_Fx.get_pixel(x, y)
red = color.red
green = color.green
blue = color.blue
alpha = color.alpha
data.push(red)
data.push(green)
data.push(blue)
data.push(alpha)
end
end
s = data.pack("C*")
gz.write(s)
gz.close
data.clear
gz = Zlib::GzipReader.open('hoge.gz')
data = gz.read
gz.close
File.delete('hoge.gz')
return data
end
def make_iend
ie_size = [0].pack("N")
ie_sign = "IEND"
ie_crc = [Zlib.crc32(ie_sign)].pack("N")
return ie_size + ie_sign + ie_crc
end
end
end
class Bitmap
def make_png(name="Gui_Img_Save", path="",mode=0)
make_dir(path) if path != ""
Zlib::Png_File.open("temp.gz") {|gz|
gz.make_png(self)
}
Zlib::GzipReader.open("temp.gz") {|gz|
$read = gz.read
}
f = File.open(path + name + ".png","wb")
f.write($read)
f.close
File.delete('temp.gz')
end
def make_dir(path)
dir = path.split("/")
for i in 0...dir.size
unless dir == "."
add_dir = dir[0..i].join("/")
begin
Dir.mkdir(add_dir)
rescue
end
end
end
end
end
Última edición por LordLucius el Sáb 17 Oct 2009, 2:03 pm, editado 1 vez
Invitado- Invitado
Re: Scripit Save Game - By LordLucius
Excelente aportazo!
solo lo edité un poco por eso de los emoticons :)
cuando pongas otro script usa lo de [code*] Script [/*code] (*sin asteriscos*)
y los spoiles para que no se vea el post tan enorme y no se modifique por los emoticosn
+
solo lo edité un poco por eso de los emoticons :)
cuando pongas otro script usa lo de [code*] Script [/*code] (*sin asteriscos*)
y los spoiles para que no se vea el post tan enorme y no se modifique por los emoticosn
+
SoyCanekAdministrador -
35
709
970
111
Extras
Sobre mí::
Re: Scripit Save Game - By LordLucius
Pues la verdad no sé, pero a mi me agrada mucho 8)
SoyCanekAdministrador -
35
709
970
111
Extras
Sobre mí::
Re: Scripit Save Game - By LordLucius
algun problema si uso el script de 16 bloques de memoria???
cloud221- 0
-
33
1
2
0
Re: Scripit Save Game - By LordLucius
me parece que no es compatible con el script de menu en anillo podias comprobarlo tal vez me ekivoke a mi por lo menos no me va
edito: no es por el menu de naillo lo he probado con el menu normal y no me va no me deja guardar, alguna idea?
edito: no es por el menu de naillo lo he probado con el menu normal y no me va no me deja guardar, alguna idea?
Veldar- 300
-
30
333
471
47
Re: Scripit Save Game - By LordLucius
Si, a mi tampoco me funcionó. No me acuerdo si era cuando guardaba, o cuando cargaba, pero me aparecía error. No me acuerdo bien que decía, pero después me fijo y edito el mensaje...
Divalmax- 0
-
33
9
12
1
Re: Scripit Save Game - By LordLucius
pongan un pantallazo del erro y veré si puedo solucionarlo [Tienes que estar registrado y conectado para ver esa imagen]
SoyCanekAdministrador -
35
709
970
111
Extras
Sobre mí::
Re: Scripit Save Game - By LordLucius
Donde no rula es al cargar, pero es porque no encuentra las imagenes o algo de eso.
El problema esta en que no se como cambiar la carpeta de guardado a la carpeta raiz...
Me podrias ayudar Canek?
El problema esta en que no se como cambiar la carpeta de guardado a la carpeta raiz...
Me podrias ayudar Canek?
liol- 50
-
37
79
71
1
Extras
Sobre mí::
Re: Scripit Save Game - By LordLucius
cuando le das a continuar da error con pngs vas a ver t pongo unas screen canek
Esta sale primero:
[Tienes que estar registrado y conectado para ver esa imagen]
Y esta segunda:
[Tienes que estar registrado y conectado para ver esa imagen]
Salu2
Esta sale primero:
[Tienes que estar registrado y conectado para ver esa imagen]
Y esta segunda:
[Tienes que estar registrado y conectado para ver esa imagen]
Salu2
alan234- 30
-
28
43
76
12
Extras
Sobre mí::
Re: Scripit Save Game - By LordLucius
MMM nunca kedo claro esto o si?
TigreX- 500
-
26
1214
1679
105
Extras
Sobre mí::
Temas similares
» adios save
» Neo Save System
» [Aporte]Neo Save System VI[VX]
» ExMenu: Increase Save File
» [Script VX] SM Game Resolution.
» Neo Save System
» [Aporte]Neo Save System VI[VX]
» ExMenu: Increase Save File
» [Script VX] SM Game Resolution.
RPG maker VX :: Scripts ::
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.