Jump to content
Rpg²S Forum

*Chara Maker ZVB


amivaleo
 Share

Recommended Posts

Chara Maker ZVB



Descrizione



Grazie a questo script, potrete creare il charaset dei vostri eroi con le risorse contenute nelle cartelle scaricabili da qui o aggiunte da voi stessi. I chara creati in questo modo, NON possono essere usati subito, senza interrompere la sessione di gioco.



Autore



Ziel van Brand
Le risorse grafiche provengono da un progetto di Akabane



Allegati



Le cartelle di questo archivio vanno inseriti nella cartella Pictures: Archivo cartelle



Istruzioni per l'uso



Copiate lo script riportato di seguito in una nuova classe sopra il Main e chiamatelo "Chara Maker ZVB":


#=====================================
# Chara Maker ZVB
# by Ziel van Brand
#=====================================

#=====================================
# Module ZVB
#=====================================

module ZVB
	# Scrivete quanti file meno 1 contiene la relativa cartella. In questo caso,
	# la cartella PELLE contiene 14 file, quindi bisogna scrivere:
	# PELLE = 13 (ed è scritto infatti). Quando AGGIUNGI o RIMUOVI
	# file da queste cartelle, ricorda di modificare anche questi valori!
	PELLE = 12
	OCCHI = 26
	ORECCHIE = 5
	CAPELLI = 137
	MAGLIETTA = 130
	PANTALONI = 28
	SCARPE = 16
	CAPPELLO = 19
	GUANTI = 14
	EXTRA = 14
	# Per sapere quanti file contiene una cartella è sufficiente leggere
	# il nome dell'ultimo file (il nome dei file contenuti in queste cartelle
	# è un numero, bisogna scrivere qui il numero più alto).
end


#=====================================
# Window_Res
#=====================================

class Window_Res < Window_Selectable
	#--------------------------------------------------------------------------
	def initialize
		super(0, 64, 240, 480-64)
		@commands = ["Pelle", "Occhi", "Orecchie", "Capelli", "Maglietta",
		"Pantaloni", "Scarpe", "Cappello", "Guanti", "Extra"]
		@description = ["Pelle", "Occhi", "Orecchie", "Capelli", "Maglietta",
		"Pantaloni", "Scarpe", "Cappello", "Guanti", "Extra"]
		@item_max = 10
		@column_max = 1
		self.contents = Bitmap.new(width - 32, height-32)
		self.contents.font.name = $fontface
		self.contents.font.size = $fontsize
		for i in 0..(@item_max-1)
			draw_item(i)
		end
		self.z = 100
		self.index = 0
	end
	#--------------------------------------------------------------------------
	def draw_item(index)
		self.contents.font.color = normal_color
		self.contents.draw_text(4, 32*index, width-32, 32, @commands[index], 0)
	end
	#--------------------------------------------------------------------------
	def update_help
		@help_window.set_text(@description[index], 1)
	end
	#--------------------------------------------------------------------------
end

#=====================================
# Window_Number
#=====================================

class Window_Number < Window_Base
	#--------------------------------------------------------------------------
	def initialize
		super(240-3*32, 64, 32*4, 480-64)
		self.contents = Bitmap.new(width - 32, height-32)
		self.contents.font.name = $fontface
		self.contents.font.size = $fontsize
		self.opacity = 0
		self.z = 200
		refresh
	end
	#--------------------------------------------------------------------------
	def refresh(pelle = 0, occhi = 0, orecchie = 0, capelli = 0, maglietta = 0,
		pantaloni = 0, scarpe = 0, cappello = 0, guanti = 0, extra = 0)
		self.contents.clear
		self.contents.font.color = system_color
		for i in 0..9
			self.contents.draw_text(0, 32*i, 16, 32, "<", 1)
			self.contents.draw_text(48, 32*i, 16, 32, ">", 1)
		end
		self.contents.font.color = normal_color
		self.contents.draw_text(16, 32*0, 32, 32, pelle.to_s, 1)
		self.contents.draw_text(16, 32*1, 32, 32, occhi.to_s, 1)
		self.contents.draw_text(16, 32*2, 32, 32, orecchie.to_s, 1)
		self.contents.draw_text(16, 32*3, 32, 32, capelli.to_s, 1)
		self.contents.draw_text(16, 32*4, 32, 32, maglietta.to_s, 1)
		self.contents.draw_text(16, 32*5, 32, 32, pantaloni.to_s, 1)
		self.contents.draw_text(16, 32*6, 32, 32, scarpe.to_s, 1)
		self.contents.draw_text(16, 32*7, 32, 32, cappello.to_s, 1)
		self.contents.draw_text(16, 32*8, 32, 32, guanti.to_s, 1)
		self.contents.draw_text(16, 32*9, 32, 32, extra.to_s, 1)
	end
	#--------------------------------------------------------------------------
end

#=====================================
# Window_Chara
#=====================================

class Window_Chara < Window_Base
	#--------------------------------------------------------------------------
	def initialize
		super(240, 64, 400, 480-64)
		self.contents = Bitmap.new(width - 32, height-32)
		self.contents.font.name = $fontface
		self.contents.font.size = $fontsize
		@blink = 0
		refresh
		self.z = 200
	end
	#--------------------------------------------------------------------------
	def refresh(pelle = 0, occhi = 0, orecchie = 0, capelli = 0, maglietta = 0,
		pantaloni = 0, scarpe = 0, cappello = 0, guanti = 0, extra = 0)
		self.contents.clear
		x, y = 208-32, 32+32
		rect = Rect.new(x-32, y-32, 128+64, 192+64)
		self.contents.fill_rect(rect, Color.new(255, 255, 255, 255))
		rect = Rect.new(x, y, 128, 192)
		self.contents.fill_rect(rect, Color.new(255, 0, 255, 255))
		
		b_pelle = RPG::Cache.picture("PELLE/" + pelle.to_s)
		self.contents.blt(x, y, b_pelle, Rect.new(0, 0, 128, 192), 255)
		b_occhi = RPG::Cache.picture("OCCHI/" + occhi.to_s)
		self.contents.blt(x, y, b_occhi, Rect.new(0, 0, 128, 192), 255)
		b_pantaloni = RPG::Cache.picture("PANTALONI/" + pantaloni.to_s)
		self.contents.blt(x, y, b_pantaloni, Rect.new(0, 0, 128, 192), 255)
		b_scarpe = RPG::Cache.picture("SCARPE/" + scarpe.to_s)
		self.contents.blt(x, y, b_scarpe, Rect.new(0, 0, 128, 192), 255)
		b_maglietta = RPG::Cache.picture("MAGLIETTA/" + maglietta.to_s)
		self.contents.blt(x, y, b_maglietta, Rect.new(0, 0, 128, 192), 255)
		b_extra = RPG::Cache.picture("EXTRA/" + extra.to_s)
		self.contents.blt(x, y, b_extra, Rect.new(0, 0, 128, 192), 255)
		b_guanti = RPG::Cache.picture("GUANTI/" + guanti.to_s)
		self.contents.blt(x, y, b_guanti, Rect.new(0, 0, 128, 192), 255)
		b_capelli = RPG::Cache.picture("CAPELLI/" + capelli.to_s)
		self.contents.blt(x, y, b_capelli, Rect.new(0, 0, 128, 192), 255)
		b_cappello = RPG::Cache.picture("CAPPELLO/" + cappello.to_s)
		self.contents.blt(x, y, b_cappello, Rect.new(0, 0, 128, 192), 255)
		b_orecchie = RPG::Cache.picture("ORECCHIE/" + orecchie.to_s)
		self.contents.blt(x, y, b_orecchie, Rect.new(0, 0, 128, 192), 255)
		
		x, y = 48, 32
		@cw = 128 / 4
		@ch = 192 / 4
		self.contents.blt(x, y, b_pelle, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_occhi, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_pantaloni, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_scarpe, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_guanti, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_maglietta, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_extra, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_capelli, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_cappello, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		self.contents.blt(x, y, b_orecchie, Rect.new(((@blink/8) % 4)*32, 0, @cw, @ch), 255)
		
		y = 96
		self.contents.blt(x, y, b_pelle, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_occhi, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_pantaloni, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_scarpe, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_guanti, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_maglietta, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_extra, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_capelli, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_cappello, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		self.contents.blt(x, y, b_orecchie, Rect.new(((@blink/8) % 4)*32, 48, @cw, @ch), 255)
		
		y = 160
		self.contents.blt(x, y, b_pelle, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_occhi, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_pantaloni, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_scarpe, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_guanti, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_maglietta, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_extra, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_capelli, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_cappello, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		self.contents.blt(x, y, b_orecchie, Rect.new(((@blink/8) % 4)*32, 96, @cw, @ch), 255)
		
		y = 224
		self.contents.blt(x, y, b_pelle, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_occhi, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_pantaloni, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_scarpe, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_guanti, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_maglietta, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_extra, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_capelli, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_cappello, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		self.contents.blt(x, y, b_orecchie, Rect.new(((@blink/8) % 4)*32, 144, @cw, @ch), 255)
		
		self.contents.draw_text(0, height-64, width, 32, "Premi INVIO per salvare l'immagine", 1)
		
	end
	#--------------------------------------------------------------------------
	def update
		@blink += 1
		refresh
	end
	#--------------------------------------------------------------------------
end

#=====================================
# Scene_Chara
#=====================================

class Scene_Chara
	#--------------------------------------------------------------------------
	def initialize(index=0)
		@index = index
	end
	#--------------------------------------------------------------------------
	def main
		@command_window = Window_Res.new
		@help_window = Window_Help.new
		@command_window.help_window = @help_window
		@number_window = Window_Number.new
		@chara_window = Window_Chara.new
		@pelle = 0
		@occhi = 0
		@orecchie = 0
		@capelli = 0
		@maglietta = 0
		@pantaloni = 0
		@scarpe = 0
		@cappello = 0
		@guanti = 0
		@extra = 0
		Graphics.transition
		loop do
			Graphics.update
			Input.update
			update
			if $scene != self
				break
			end
		end
		Graphics.freeze
		@help_window.dispose
		@command_window.dispose
		@number_window.dispose
		@chara_window.dispose
	end
	#--------------------------------------------------------------------------
	def update
		@help_window.update
		@command_window.update
		@number_window.update
		@chara_window.update
		if @command_window.active
			@command_window.help_window = @help_window
			update_command
			return
		end
	end
	#--------------------------------------------------------------------------
	def update_command
		if Input.trigger?(Input::B)
			$game_system.se_play($data_system.cancel_se)
			$scene = Scene_Map.new
			return
		end
		if Input.repeat?(Input::RIGHT)
			$game_system.se_play($data_system.cursor_se)
			case @command_window.index
			when 0
				@pelle += 1
			when 1
				@occhi += 1
			when 2
				@orecchie += 1
			when 3
				@capelli += 1
			when 4
				@maglietta += 1
			when 5
				@pantaloni += 1
			when 6
				@scarpe += 1
			when 7
				@cappello += 1
			when 8
				@guanti += 1
			when 9
				@extra += 1
			end
			return
		end
		if Input.repeat?(Input::LEFT)
			$game_system.se_play($data_system.cursor_se)
			case @command_window.index
			when 0
				@pelle -= 1
			when 1
				@occhi -= 1
			when 2
				@orecchie -= 1
			when 3
				@capelli -= 1
			when 4
				@maglietta -= 1
			when 5
				@pantaloni -= 1
			when 6
				@scarpe -= 1
			when 7
				@cappello -= 1
			when 8
				@guanti -= 1
			when 9
				@extra -= 1
			end
			return
		end
		@pelle = @pelle < 0 ? ZVB::PELLE : @pelle
		@occhi = @occhi < 0 ? ZVB::OCCHI : @occhi
		@orecchie = @orecchie < 0 ? ZVB::ORECCHIE : @orecchie
		@capelli = @capelli < 0 ? ZVB::CAPELLI : @capelli
		@maglietta = @maglietta < 0 ? ZVB::MAGLIETTA : @maglietta
		@pantaloni = @pantaloni < 0 ? ZVB::PANTALONI : @pantaloni
		@scarpe = @scarpe < 0 ? ZVB::SCARPE : @scarpe
		@cappello = @cappello < 0 ? ZVB::CAPPELLO : @cappello
		@guanti = @guanti < 0 ? ZVB::GUANTI : @guanti
		@extra = @extra < 0 ? ZVB::EXTRA : @extra
		
		@pelle = @pelle > ZVB::PELLE ? 0 : @pelle
		@occhi = @occhi > ZVB::OCCHI ? 0 : @occhi
		@orecchie = @orecchie > ZVB::ORECCHIE ? 0 : @orecchie
		@capelli = @capelli > ZVB::CAPELLI ? 0 : @capelli
		@maglietta = @maglietta > ZVB::MAGLIETTA ? 0 : @maglietta
		@pantaloni = @pantaloni > ZVB::PANTALONI ? 0 : @pantaloni
		@scarpe = @scarpe > ZVB::SCARPE ? 0 : @scarpe
		@cappello = @cappello > ZVB::CAPPELLO ? 0 : @cappello
		@guanti = @guanti > ZVB::GUANTI ? 0 : @guanti
		@extra = @extra > ZVB::EXTRA ? 0 : @extra
		
		@number_window.refresh(@pelle, @occhi, @orecchie, @capelli, @maglietta, @pantaloni, @scarpe, @cappello, @guanti, @extra)
		@chara_window.refresh(@pelle, @occhi, @orecchie, @capelli, @maglietta, @pantaloni, @scarpe, @cappello, @guanti, @extra)
		if Input.trigger?(Input::C)
			$game_system.se_play($data_system.decision_se)
			bitmap = Bitmap.new(128,192)
			b_pelle = RPG::Cache.picture("PELLE/" + @pelle.to_s)
			bitmap.blt(0, 0, b_pelle, Rect.new(0, 0, 128, 192), 255)
			b_occhi = RPG::Cache.picture("OCCHI/" + @occhi.to_s)
			bitmap.blt(0, 0, b_occhi, Rect.new(0, 0, 128, 192), 255)
			b_pantaloni = RPG::Cache.picture("PANTALONI/" + @pantaloni.to_s)
			bitmap.blt(0, 0, b_pantaloni, Rect.new(0, 0, 128, 192), 255)
			b_scarpe = RPG::Cache.picture("SCARPE/" + @scarpe.to_s)
			bitmap.blt(0, 0, b_scarpe, Rect.new(0, 0, 128, 192), 255)
			b_maglietta = RPG::Cache.picture("MAGLIETTA/" + @maglietta.to_s)
			bitmap.blt(0, 0, b_maglietta, Rect.new(0, 0, 128, 192), 255)
			b_guanti = RPG::Cache.picture("GUANTI/" + @guanti.to_s)
			bitmap.blt(0, 0, b_guanti, Rect.new(0, 0, 128, 192), 255)
			b_extra = RPG::Cache.picture("EXTRA/" + @extra.to_s)
			bitmap.blt(0, 0, b_extra, Rect.new(0, 0, 128, 192), 255)
			b_capelli = RPG::Cache.picture("CAPELLI/" + @capelli.to_s)
			bitmap.blt(0, 0, b_capelli, Rect.new(0, 0, 128, 192), 255)
			b_cappello = RPG::Cache.picture("CAPPELLO/" + @cappello.to_s)
			bitmap.blt(0, 0, b_cappello, Rect.new(0, 0, 128, 192), 255)
			b_orecchie = RPG::Cache.picture("ORECCHIE/" + @orecchie.to_s)
			bitmap.blt(0, 0, b_orecchie, Rect.new(0, 0, 128, 192), 255)
			i = 1
			loop do
				unless FileTest.exist?("Graphics/Characters/CharaZVB #{i}.png")
					break
				end
				i += 1
			end
			file = File.open("Graphics/Characters/CharaZVB #{i}.png", "wb")
			bitmap.write_png(file)
			file.close
			return
		end
	end
	#--------------------------------------------------------------------------
end



#=====================================
# Plugin
# by Sleeping Leonhart
#=====================================

#=====================================
# Bitmap
#=====================================

class Bitmap
	#--------------------------------------------------------------------------
	def write_png(f)
		Zlib::Png_File.open('temp.gz') { |gz| gz.make_png(self, 0) }
		Zlib::GzipReader.open('temp.gz') { |gz| $read = gz.read }
		f.write($read)
		File.delete('temp.gz')
	end
	#--------------------------------------------------------------------------
end


#=====================================
# Module Zlib
#=====================================

module Zlib
	class Png_File < GzipWriter
		#--------------------------------------------------------------------------
		def make_png(bitmap, mode = 0)
			@bitmap, @mode = bitmap, mode
			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.width].pack('N')
			ih_height = [@bitmap.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 = "x49x44x41x54"
			data = @mode == 0 ? make_bitmap_data0 : make_bitmap_data1
			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_data0
			gz = Zlib::GzipWriter.open('hoge.gz')
			t_Fx = 0
			w = @bitmap.width
			h = @bitmap.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.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_bitmap_data1
			w = @bitmap.width
			h = @bitmap.height
			data = []
			for y in 0...h
				data.push(0)
				for x in 0...w
					color = @bitmap.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
			return data.pack("C*")
		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

 

All'interno dello script, dopo una decina di righe, troverete un modulo da aggiornare ogni volta che aggiungete o rimuovete file nelle cartelle che avete inserito in Pictures:

module ZVB
	# Scrivete quanti file meno 1 contiene la relativa cartella. In questo caso,
	# la cartella PELLE contiene 13 file, quindi bisogna scrivere:
	# PELLE = 12 (ed è scritto infatti). Quando AGGIUNGI o RIMUOVI
	# file da queste cartelle, ricorda di modificare anche questi valori!
	PELLE = 12
	OCCHI = 26
	ORECCHIE = 3
	CAPELLI = 137
	MAGLIETTA = 130
	PANTALONI = 28
	SCARPE = 16
	CAPPELLO = 18
	GUANTI = 14
	EXTRA = 15
	# Per sapere quanti file contiene una cartella è sufficiente leggere
	# il nome dell'ultimo file (il nome dei file contenuti in queste cartelle
	# è un numero, bisogna scrivere qui il numero più alto).
end

Per usare lo script, creare un evento ed inserire dentro un Call Script la seguente stringa:

$scene = Scene_Chara.new

Le risorse da usare con questo script devono essere grandi 128x192 e devono rispettare rigorosametne il template. Queste vanno poi inserite nelle relative cartelle e il loro nome deve essere il numero immediatamente successivo al più alto numero che denomina l'ultimo file. Non dovete cioè "saltare" dei numeri, non potrete quindi avere nella cartella questi file:

1.png, 3.png, 4.png

dovrete mettere un file col nome "2.png":

1.png, 2.png, 3.png, 4.png

in modo da non saltare nessun numero.


Non bisogna mettere lo "0" prima del numero che denomina i file:

1.png, ... 34.png SI

001.png, ... 034.png NO


I file denominati in modo erroneo (con gli "0" davanti al numero) o contenenti qualsiasi lettera nel nome, non verranno letti dallo script.
Il salto di un numero nei nomi dei file crea problemi quando si seleziona quel numero (mancante): il programma restituisce un errore.


Una volta creato il charaset desiderato, premere il tasto "Invio" per salvare la grafica creata in un file nella cartella del vostro progetto.
Ora potete uscire da RPG Maker e modificare il file con un programma per la modifica delle immagini (photoshop, paint, etc).
NON potete usare il chara appena creato immediatamente, perchè dovete PRIMA inserirlo nella cartella "Charaset".



Bugs e Conflitti Noti



Questo script funziona a prescindere da qualsiasi altro script, in quanto non modifica nè utilizza funzioni o comandi definiti in altri script.



Altri Dettagli



Dato che si tratta di uno script non necessario al gioco, ma di "laboratorio", consiglio di inserirlo in un nuovo progetto. Se inserito nel vostro gioco, non cambia nulla se non la mole di file e quindi la memoria occupata. Lo script, come già detto sopra, funziona a prescindere da tutti gli altri script, necessita solo di risorse.

Sono disponibile per qualsiasi modifica dello script.

Edited by Flame
Link to comment
Share on other sites

Bell'idea, mi sembra una buona alternativa agli altri charamaker :D

in futuro non sarebbe male dare la possibilità anche di cambiare trasparenza/luminosità/tonalità :P

"Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."

Making is not dead. You are dead.
RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna

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

Prova Standrama!

Link to comment
Share on other sites

per la trasparenza, posso farlo subito, ma non so quali sono le stringhe di codice per modificare tonalità e luminosità.

 

OT: tiuzzo, sai cosa fare vero? :D la discussione di alato... e sistema gli errori! u.u

Link to comment
Share on other sites

Molto buono..Legato a un progetto, sarebbe utile ai rpg online..

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

ehm... lusian...

Grazie a questo script, potrete creare il charaset dei vostri eroi con le risorse contenute nelle cartelle scaricabili da qui o aggiunte da voi stessi. I chara creati in questo modo, NON possono essere usati subito, senza interrompere la sessione di gioco.

 

:D

Link to comment
Share on other sites

Ehm..Però con una piccola modifica si può!! :rovatfl:

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

  • 2 weeks later...

io! io! XD

 

lo provo, vedo cosa si può fare e ti dico

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

aspetta ma tu l'hai già usato, di lato c'è il personaggio che si muove... non è che perforza deve essere salvato come immagine per usarlo

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

scusa, mi ero dimenticato di questo topic.

quello che vedi di lato è un insieme di immagini sovrapposte. non è 1 solo chara, ma tanti chara sovrapposti. per usare il pg in gioco, serve avere un solo chara, una sola immagine.

Link to comment
Share on other sites

ma no, puoi far usare lo stesso metodo, tanto se è solo per un personaggio non lagga troppo, basta modificare un pò lo Spriteset_Map credo o al massimo la Scene_Map, ma penso proprio che sia lo spriteset :rovatfl:

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

Se vuoi ti do un metodo per salvare l'insieme in un unica png, credo che funzioni... dovrei provarlo, domani se ho tempo te lo passo ;)

EDIT:
Come non detto, ecco a te:

 

class Scene_Chara_Maker_ZVB
	alias savepng_scenecharamakerzvb_update_command update_command
	def update_command
		if Input.trigger?(Input::C)
			$game_system.se_play($data_system.decision_se)
			bitmap = Bitmap.new(128,192)
			b_pelle = RPG::Cache.picture("PELLE/" + @pelle.to_s)
			bitmap.blt(0, 0, b_pelle, Rect.new(0, 0, 128, 192), 255)
			b_occhi = RPG::Cache.picture("OCCHI/" + @occhi.to_s)
			bitmap.blt(0, 0, b_occhi, Rect.new(0, 0, 128, 192), 255)
			b_pantaloni = RPG::Cache.picture("PANTALONI/" + @pantaloni.to_s)
			bitmap.blt(0, 0, b_pantaloni, Rect.new(0, 0, 128, 192), 255)
			b_scarpe = RPG::Cache.picture("SCARPE/" + @scarpe.to_s)
			bitmap.blt(0, 0, b_scarpe, Rect.new(0, 0, 128, 192), 255)
			b_maglietta = RPG::Cache.picture("MAGLIETTA/" + @maglietta.to_s)
			bitmap.blt(0, 0, b_maglietta, Rect.new(0, 0, 128, 192), 255)
			b_guanti = RPG::Cache.picture("GUANTI/" + @guanti.to_s)
			bitmap.blt(0, 0, b_guanti, Rect.new(0, 0, 128, 192), 255)
			b_extra = RPG::Cache.picture("EXTRA/" + @extra.to_s)
			bitmap.blt(0, 0, b_extra, Rect.new(0, 0, 128, 192), 255)
			b_capelli = RPG::Cache.picture("CAPELLI/" + @capelli.to_s)
			bitmap.blt(0, 0, b_capelli, Rect.new(0, 0, 128, 192), 255)
			b_cappello = RPG::Cache.picture("CAPPELLO/" + @cappello.to_s)
			bitmap.blt(0, 0, b_cappello, Rect.new(0, 0, 128, 192), 255)
			b_orecchie = RPG::Cache.picture("ORECCHIE/" + @orecchie.to_s)
			bitmap.blt(0, 0, b_orecchie, Rect.new(0, 0, 128, 192), 255)
			i = 1
			loop do
				unless FileTest.exist?("CharaZVB #{i}.png")
					break
				end
				i += 1
			end
			file = File.open("CharaZVB #{i}.png", "wb")
			bitmap.write_png(file)
			file.close
			return
		end
		savepng_scenecharamakerzvb_update_command
	end
end

#==============================================================================
# ** Bitmap
#==============================================================================

class Bitmap
	def write_png(f)
		Zlib::Png_File.open('temp.gz') { |gz| gz.make_png(self, 0) }
		Zlib::GzipReader.open('temp.gz') { |gz| $read = gz.read }
		f.write($read)
		File.delete('temp.gz')
	end
end
#==============================================================================
# ** Modules.Zlib
#------------------------------------------------------------------------------
# Description:
# ------------
# Adds PNG_File class to save Bitmap's to PNG Files
#
# Class List:
# -----------
# Png_File
#==============================================================================

#==============================================================================
# ** Zlib
#==============================================================================

module Zlib
	#==========================================================================
	==
	# ** Png_File
	#-------------------------------------------------------------------------
	# Info : Saves Bitmap to File
	# Author : ??? - http://www.66rpg.com/htm/news624.htm
	#==========================================================================
	==
	
	class Png_File < GzipWriter
		#--------------------------------------------------------------------------
		# * Make PNG
		#--------------------------------------------------------------------------
		def make_png(bitmap, mode = 0)
			# Save Bitmap & Mode
			@bitmap, @mode = bitmap, mode
			# Create & Save PNG
			self.write(make_header)
			self.write(make_ihdr)
			self.write(make_idat)
			self.write(make_iend)
		end
		#--------------------------------------------------------------------------
		# * Make Header
		#--------------------------------------------------------------------------
		def make_header
			return [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a].pack('C*')
		end
		#--------------------------------------------------------------------------
		# * Make IHDR
		#--------------------------------------------------------------------------
		def make_ihdr
			ih_size = [13].pack("N")
			ih_sign = 'IHDR'
			ih_width = [@bitmap.width].pack('N')
			ih_height = [@bitmap.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
		#--------------------------------------------------------------------------
		# * Make IDAT
		#--------------------------------------------------------------------------
		def make_idat
			header = "\x49\x44\x41\x54"
			data = @mode == 0 ? make_bitmap_data0 : make_bitmap_data1
			data = Zlib::Deflate.deflate(data, 8)
			crc = [Zlib.crc32(header + data)].pack('N')
			size = [data.length].pack('N')
			return size + header + data + crc
		end
		#--------------------------------------------------------------------------
		# * Make Bitmap Data 0
		#--------------------------------------------------------------------------
		def make_bitmap_data0
			gz = Zlib::GzipWriter.open('hoge.gz')
			t_Fx = 0
			w = @bitmap.width
			h = @bitmap.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.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
		#--------------------------------------------------------------------------
		# * Make Bitmap Data Mode 1
		#--------------------------------------------------------------------------
		def make_bitmap_data1
			w = @bitmap.width
			h = @bitmap.height
			data = []
			for y in 0...h
				data.push(0)
				for x in 0...w
					color = @bitmap.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
			return data.pack("C*")
		end
		#--------------------------------------------------------------------------
		# * Make IEND
		#--------------------------------------------------------------------------
		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

 


 
Basta che lo piazzi sotto al tuo script e dovrebbe funzionare, se premi invio ti salva l'immagine nella cartella principale del gioco e la chiama CharaZVB n, n ? il numero dell'immagine partendo da 0.
Modifica lo script, dagli fuoco, facci ci? che vuoi, spero che ti sia utile ;)

Ps: I metodi bitmap nn li ho fatti io, l'autore per? nn lo conosco.

Edited by Flame
Link to comment
Share on other sites

wow ma questo script è utilissimo, da dove salta fuori?

 

finalmente potrò aprire le immagini png in visual basic *-*

ti ringrazio tanto ^^

Script!

 

Roba scritta, guide:

 

Applicazioni:

 

Progetti!

http://img69.imageshack.us/img69/2143/userbarctaf.png http://img641.imageshack.us/img641/5227/userbartemplateb.pnghttp://i46.tinypic.com/ac6id0.png

Link to comment
Share on other sites

  • 2 months later...

? passato un po' di tempo dall'ultima volta che ho visitato questo forum... universit?...

Leon, non funziona lo script che hai postato insieme al mio. non riconosce questa stringa:

alias savepng_scenecharamakerzvb_update_command update_command

cio? non trova la funzione.

a parte questo... a cosa serve? se ho capito bene, salva il chara creato nella cartella charaset.
sarebbe utile, per? non "riconosce" il colore da far diventare trasparente. quindi l'immagine dovrebbe essere modificata comunque con photoshop et similia.

Link to comment
Share on other sites

Molto strano che ti dia un errore proprio lì datp che li ho definito solo un alias...

Comunque i chara li salva con la trasparenza gia impostata ;)

 

PS:

che poi ho ritestato adesso lo script e a me non da errore...

sicuro di aver messo lo script sotto quello del chara maker?

Link to comment
Share on other sites

anche con la trasparenza?

bravo leon, io non avrei mai saputo farlo.

 

per l'errore... boh, riproverò domani (cioè oggi, ma MOLTO più tardi), magari ricopio anche lo script originale da qui, non vorrei averlo modificato tempo fa.

 

se funge, lo riscrivo e lo posto come un generatore di personaggi in-game (solo della grafica ovviamente).

 

buonanotte!

Edited by Ziel van Brand
Link to comment
Share on other sites

Fatto, modificato!
Editato il primo post.

edit:
leon, la prima stringa dello script che hai postato tu ?:

class Scene_Chara_Maker_ZVB

che non esiste. nel mio script si chiama solo

class Scene_Chara

non so se l'ho modificato io stesso dopo aver aperto tempo fa questo topic o se ho semplicemente sbagliato a trascriverlo qui.
in ogni caso, ora ho risolta e funziona ;)

Edited by Flame
Link to comment
Share on other sites

  • 1 month later...

ho riuppato le immagini, ora il link funziona.

 

per dandee: il salvataggio dell'immagine è una "feature" aggiunta da sleeping leonhart. io non so bene dove mettere le mani su quel che ha aggiunto, anche perchè non l'ho mai letto davvero. forse un problema di versione di rpg maker? boh... a me funziona, ho la 1.01

Link to comment
Share on other sites

  • 2 weeks later...
Link to comment
Share on other sites

  • 8 months later...

ho fatto un nuovo progetto, ho copiato le cartelle nella cartella picture del progetto, poi lo script e lo chiamato come detto nel topic, xò quando vado ad attivare l'evento mi dice " errore di script 'Chara Maker ZVB' sulla linea 47 del tipo 'TypreError' no implicit conversion from nil to integer"

io nn ne capisco molto mi dite come fare?

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...