Jump to content
Rpg²S Forum

Andre4e

Utenti
  • Posts

    158
  • Joined

  • Last visited

Posts posted by Andre4e

  1. Sono andato a ritorvare uno script che visualizzava la barra della vita dei mostri, purtroppo era veramente pietoso e quindi mi è toccato migliorarlo




    Screen prima:
    post-2796-1251970006.jpg

    Screen adesso:
    post-2796-1251969808_thumb.jpg


    Ecco lo script:

     

     

     

    #########################
    #Vita Mostri #
    #########################
    #Originale creato da SephirothSpawn ##
    #########################
    #Modificato interamente da Andre4e ###
    #########################
    
    
    
    class Window_Base
    	#--------------------------------------------------------------------------
    	# œ ƒ‰ƒCƒ“•`‰æ by ÷‰ë Ý“y
    	#--------------------------------------------------------------------------
    	def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
    		# •`ŽÊ‹——£‚ÌŒvŽZB‘å‚«‚߂ɒ¼ŠpŽž‚Ì’·‚³B
    		distance = (start_x - end_x).abs + (start_y - end_y).abs
    		# •`ŽÊŠJŽn
    		if end_color == start_color
    			for i in 1..distance
    				x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
    				y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
    				self.contents.fill_rect(x, y, width, width, start_color)
    			end
    		else
    			for i in 1..distance
    				x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
    				y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
    				r = start_color.red * (distance-i)/distance + end_color.red * i/distance
    				g = start_color.green * (distance-i)/distance + end_color.green * i/distance
    				b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
    				a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
    				self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
    			end
    		end
    	end
    end
    class Window_Base < Window
    	#--------------------------------------------------------------------------
    	# * Draw Slant Bar(by SephirothSpawn)
    	#--------------------------------------------------------------------------
    	def draw_slant_bar(x, y, min, max, width = 152, height = 6,
    		bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    		# Draw Border
    		for i in 0..height
    			self.contents.fill_rect(x+i+3, y + height - i + 3, width+ 2,1, Color.new(0, 0, 0, 128))
    			#self.contents.fill_rect(x + i + 4, y + height - i + 4, width + 2, 1, Color.new(50, 50, 50, 255))
    		end
    		# Draw Background
    		for i in 1..(height - 1)
    			r = 100 * (height - i) / height + 0 * i / height
    			g = 100 * (height - i) / height + 0 * i / height
    			b = 100 * (height - i) / height + 0 * i / height
    			a = 255 * (height - i) / height + 255 * i / height
    			self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    		end
    		# Draws Bar
    		for i in 1..( (min / max.to_f) * width - 1)
    			for j in 1..(height - 1)
    				r = bar_color.red * (width - i) / width + end_color.red * i / width
    				g = bar_color.green * (width - i) / width + end_color.green * i / width
    				b = bar_color.blue * (width - i) / width + end_color.blue * i / width
    				a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
    				self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
    			end
    		end
    	end
    end
    
    
    
    
    def draw_enemy_hp_meter_line(x, y, width = 356, height = 4)
    	w = width * @enemy.hp / @enemy.maxhp
    	hp_color_1 = Color.new(255, 0, 0, 192)
    	hp_color_2 = Color.new(255, 255, 0, 192)
    	self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    	x -= 1
    	y += (height/4).floor
    	self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    	x -= 1
    	y += (height/4).ceil
    	self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    	x -= 1
    	y += (height/4).ceil
    	self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    end
    
    
    
    def draw_enemy_sp_meter_line(x, y, width = 156, height = 4)
    	w = width * @enemy.sp / @enemy.maxsp
    	hp_color_1 = Color.new( 0, 0, 255, 192)
    	hp_color_2 = Color.new( 0, 255, 255, 192)
    	self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    	x -= 1
    	y += (height/4).floor
    	self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    	x -= 1
    	y += (height/4).ceil
    	self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
    	x -= 1
    	y += (height/4).ceil
    	self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
    	draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
    end
    
    
    
    def draw_shadow_text_enemy(x, y, width, height, string, align = 0)
    	# Œ³‚ÌF‚ð•Û‘¶‚µ‚Ä‚¨‚
    	color = self.contents.font.color.dup
    	# •Žš‚ʼne•`‰æ
    	self.contents.font.color = Color.new(0, 0, 0)
    	self.contents.draw_text(x + 2, y + 2, width, height, string, align)
    	# Œ³‚ÌF‚É–ß‚µ‚Ä•`‰æ
    	self.contents.font.color = color
    	self.contents.draw_text(x, y, width, height, string, align)
    end
    
    
    
    def draw_enemy_cp_meter(x, y, width = 156, type = 0)
    	self.contents.font.color = system_color
    	self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
    	if @enemy.cp == nil
    		@enemy.cp = 0
    	end
    	w = width * [@enemy.cp,65535].min / 65535
    	self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
    	self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
    	self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
    	self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
    end
    
    #alias xrxs_bp7_draw_enemy_state draw_enemy_state
    #def draw_enemy_state(x, y, width = 120)
    #xrxs_bp7_draw_enemy_state(x, y, width) if @draw_ban != true
    #end
    
    
    class Window_EnemyHP < Window_Base
    	
    	def initialize
    		super(0, 0, 640, 480)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		self.opacity = 0
    		refresh
    	end
    	
    	def refresh
    		self.contents.clear
    		for i in 0...$game_troop.enemies.size
    			@enemy = $game_troop.enemies[i]
    			
    			#no# @percent = (@enemy.hp * 100) / @enemy.maxhp
    			unless @enemy.hp == 0
    				#per abilitare mp togliere astersico alle righe
    				#con scritto si e ad ogni parola sottostante
    				#e non soprastante sostituire sp con hp
    				#e viceversa
    				# @enemy.hp, @enemy.maxhp
    				#draw_slant_bar(@enemy.screen_x - 65, @enemy.screen_y - 60, @enemy.hp, @enemy.maxhp, width = 85, height = 12, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    				#si# draw_enemy_sp_meter_line(@enemy.screen_x - 62, @enemy.screen_y - 120, width = 85, height = 8)
    				draw_enemy_hp_meter_line(@enemy.screen_x - 62, @enemy.screen_y - 90, width = 85, height = 8)
    				
    				
    				
    				
    				#no# draw_slant_bar(@enemy.screen_x - 65, @enemy.screen_y - 60, @enemy.hp, @enemy.maxhp, width = 85, height = 12, bar_color = Color.new(255, 0, 0, 192), end_color = Color.new(255, 255, 0, 192))
    				#no# self.contents.draw_text(@enemy.screen_x - 20, @enemy.screen_y - 75, 100, 32, "#{@enemy.hp}")
    				
    				self.contents.font.size = 30 # HP/SP”’l‚Ì•¶Žš‚̑傫‚³
    				#si# self.contents.font.color = @enemy.sp == 0 ? knockout_color :
    				#si# @enemy.sp <= @enemy.maxsp / 4 ? crisis_color : normal_color
    				#si# draw_shadow_text_enemy(@enemy.screen_x - 80, @enemy.screen_y - 142, 100, 32, @enemy.sp.to_s, 2)
    				
    				self.contents.font.color = @enemy.hp == 0 ? knockout_color :
    				@enemy.hp <= @enemy.maxhp / 4 ? crisis_color : normal_color
    				draw_shadow_text_enemy(@enemy.screen_x - 80, @enemy.screen_y - 112, 100, 32, @enemy.hp.to_s, 2)
    				self.contents.font.size = 12 # —pŒêuHP/SPv‚Ì•¶Žš‚̑傫‚³
    				self.contents.font.color = system_color # —pŒêuHP/SPv‚Ì•¶Žš‚ÌF
    				#si# draw_shadow_text_enemy(@enemy.screen_x - 63 , @enemy.screen_y - 132, 96, 12, $data_system.words.sp)
    				draw_shadow_text_enemy(@enemy.screen_x - 63 , @enemy.screen_y - 102, 96, 12, $data_system.words.hp)
    				#si# draw_enemy_cp_meter(@enemy.screen_x - 70, @enemy.screen_y - 65, 120, 0)
    				#no# draw_enemy_state(@enemy.screen_x - 68, @enemy.screen_y - 56)
    				
    			end
    			
    		end
    	end
    end
    
    
    
    
    
    
    
    class Scene_Battle
    	
    	alias raz_update update
    	alias raz_update_phase5 update_phase5
    	alias raz_update_phase4_step1 update_phase4_step1
    	alias raz_update_phase4_step5 update_phase4_step5
    	alias raz_enemy_hp_main main
    	
    	
    	def main
    		@troop_id = $game_temp.battle_troop_id
    		$game_troop.setup(@troop_id)
    		@enemy_window = Window_EnemyHP.new
    		@enemy_window.z = 95
    		raz_enemy_hp_main
    		
    		@enemy_window.dispose
    	end
    	
    	
    	def update
    		@enemy_window.update
    		raz_update
    	end
    	
    	def update_phase5
    		# If wait count is larger than 0
    		if @phase5_wait_count > 0
    			# Decrease wait count
    			@phase5_wait_count -= 1
    			# If wait count reaches 0
    			if @phase5_wait_count == 0
    				@enemy_window.visible = false
    				# Show result window
    				@result_window.visible = true
    				# Clear main phase flag
    				$game_temp.battle_main_phase = false
    				# Refresh status window
    				@status_window.refresh
    				@enemy_window.refresh
    			end
    			return
    		end
    		raz_update_phase5
    	end
    	
    	def update_phase4_step1
    		raz_update_phase4_step1
    		@enemy_window.refresh
    	end
    	
    	def update_phase4_step5
    		# Hide help window
    		@help_window.visible = false
    		# Refresh status window
    		@status_window.refresh
    		@enemy_window.refresh
    		raz_update_phase4_step5
    	end
    end
    
    
    
    =begin
    class Window_BattleStatus < Window_Base
    	#--------------------------------------------------------------------------
    	# * Object Initialization
    	#--------------------------------------------------------------------------
    	def initialize
    		super(0, 320, 640, 160)
    		self.contents = Bitmap.new(width - 32, height - 32)
    		@level_up_flags = [false, false, false, false]
    		refresh
    	end
    	#--------------------------------------------------------------------------
    	# * Dispose
    	#--------------------------------------------------------------------------
    	def dispose
    		super
    	end
    	#--------------------------------------------------------------------------
    	# * Set Level Up Flag
    	# actor_index : actor index
    	#--------------------------------------------------------------------------
    	def level_up(actor_index)
    		@level_up_flags[actor_index] = true
    	end
    	#--------------------------------------------------------------------------
    	# * Refresh
    	#--------------------------------------------------------------------------
    	def refresh
    		self.contents.clear
    		@item_max = $game_party.actors.size
    		for i in 0...$game_party.actors.size
    			actor = $game_party.actors[i]
    			actor_x = i * 160 + 4
    			draw_slant_bar(actor_x, 55, actor.hp, actor.maxhp, 120)
    			draw_slant_bar(actor_x, 88, actor.sp, actor.maxsp, 120, 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))
    			draw_actor_name(actor, actor_x, 0)
    			draw_actor_hp(actor, actor_x, 32, 120)
    			draw_actor_sp(actor, actor_x, 64, 120)
    			if @level_up_flags[i]
    				self.contents.font.color = normal_color
    				self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
    			else
    				draw_actor_state(actor, actor_x, 96)
    			end
    		end
    	end
    	#--------------------------------------------------------------------------
    	# * Frame Update
    	#--------------------------------------------------------------------------
    	def update
    		super
    		# Slightly lower opacity level during main phase
    		if $game_temp.battle_main_phase
    			self.contents_opacity -= 4 if self.contents_opacity > 191
    		else
    			self.contents_opacity += 4 if self.contents_opacity < 255
    		end
    	end
    end
    =end
    

     

     

  2. ho riscontrato un piccolo problemino nel menu di Gabriel http://www.rpg2s.net/forum/index.php?showtopic=361

     

    il problema è che se aggiungo un oggetto, armatura, o qualsiasi altra cosa creata da me...ad esempio io ho creato una armatura aumentando il numero di oggetti nel database, però se poi faccio un evento con aggiungi armatura..poi però nel menu non me la fa vedere. fa vedere solo quelle rtp

    e lo stesso vale per gli oggetti, le armi e le armature(scudi, elmi ecc..)

     

    helpp

  3. Istruzioni all'interno dello script

    Screen:
    Prima:
    post-2796-1238183610_thumb.jpg
    Adesso:
    post-2796-1238183627_thumb.jpg


    Script:

     

     

    #=====================================
    #Gradient Bars with customizable lengths, thicknesses, types and Colors
    #By AcedentProne
    # Inserire questo in un evento:
    #
    # $game_variables[1] = Percentuale di Completamento
    # $scene = Scene_Progress.new
    #
    #=====================================
    class Window_Base
    	def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
    		if type == "horizontal"
    			width = length
    			height = thick
    			self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
    			self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
    			w = width * e1 / e2
    			for i in 0..height
    				r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
    				g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
    				b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
    				a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
    				self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
    			end
    		elsif type == "vertical"
    			width = thick
    			height = length
    			self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
    			self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
    			h = height * e1 / e2
    			for i in 0..width
    				r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width
    				g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width
    				b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width
    				a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width
    				self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
    			end
    		end
    	end
    	def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255))
    		if type == "horizontal"
    			width = length
    			height = thick
    			self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
    			self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
    			w = width * e1 / e2
    			for i in 0..height
    				r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
    				g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
    				b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
    				a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
    				self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
    			end
    		elsif type == "vertical"
    			width = thick
    			height = length
    			self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255))
    			self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255))
    			h = height * e1 / e2
    			for i in 0..width
    				r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width
    				g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width
    				b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width
    				a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width
    				self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a))
    			end
    		end
    	end
    end
    
    #Game Progress Screen made by osbornecreations A.K.A Lewis Osborne
    #This was made by an englishman!!! (thats me) go on son!
    #Just put in a new screen above main. it shouldn't interfere with anything.
    #To call the script, use $scene = Scene_Progress.new and to change the
    #game progress bar, it is assigned using $game_variables[1] so through the game
    #call a script and type in something like $game_variables[1] =10 to make the game 10% complete.
    
    #===================================================
    # - ClassScene_Progress
    #===================================================
    class Scene_Progress
    	
    	#---------------------------------------------------------------------------------
    	def initialize
    	end
    	#---------------------------------------------------------------------------------
    	
    	def main
    		@window1 = Window_Progress.new
    		@window1.x =160
    		@window1.y =200
    		@window1.height = 100
    		@window1.width = 341
    		#@window1.z = 200
    		
    		Graphics.transition
    		loop do
    			Graphics.update
    			Input.update
    			if Input.trigger?(Input::B)
    				# キャンセル SE を演奏
    				$game_system.se_play($data_system.cancel_se)
    				# マップ画面に切り替え
    				@sprite = Sprite.new
    				@sprite.bitmap = RPG::Cache.panorama("", 0)
    				$scene = Scene_Menu.new
    			end
    			#update
    			if $scene != self
    				break
    			end
    		end
    		
    		Graphics.freeze
    		@window1.dispose
    		
    	end
    	#---------------------------------------------------------------------------------
    	
    	#---------------------------------------------------------------------------------
    	def update
    	end
    	#---------------------------------------------------------------------------------
    	
    end
    class Window_Progress < Window_Base
    	
    	#---------------------------------------------------------------------------------
    	def initialize
    		super(0, 0, 341,100)
    		self.contents = Bitmap.new(width - 50, height - 32)
    		self.contents.font.name = "Tahoma" #o --> $fontface
    		self.contents.font.size = 20
    		self.contents.font.color = text_color(0)
    		
    		self.contents.draw_text(200, 0, 200, 33, $game_variables[1]. to_s + "%")
    		self.contents.draw_text(40, 0, 200, 33, "Progresso Gioco")
    		draw_actor_barz(0,20,35, "horizontal", 255, 28,$game_variables[1],100)
    		@sprite = Sprite.new
    		@sprite.bitmap = RPG::Cache.panorama("004-CloudySky01", 0)
    	end
    	
    end
    

     

     

  4. Avete presente quando in battaglia un mostro ti attacca e ti ingligge un danno? ecco quando ti attacca compare un numero di quanto ti toglie..siccome io per la battaglia uso immagini abb grandi sono costretto a fargli vedere solo la faccia al pg aumentandogli la y ...però in questo modo anche il numero di quando ti attacca un mostro si sposta verso il basso e quindi alla fine scompare..questo perchè il numero è settato per default che deve apparire al centro dell'immagine del personaggio..

    ecco io vorrei sapere dove posso modificare le coordinate di quel numero!!spero di essermi spiegato abb bene..grx tnt

  5. c'è qualcuno ch emi potrebbe trasformare queste immagini italiano?

    post-2796-1237992038_thumb.png

    post-2796-1237992047_thumb.png

    post-2796-1237992057_thumb.png

     

    magari allungando i riquadri

    perchè in italiano vengono più lunghe le parole

    "Compra"

    "Vendi"

    "Esci"

     

    basta solo ke non superino questo riquadro

    post-2796-1237992162_thumb.png

     

    se ci riuscite lasciate gli effetti delle immagini uguali

    grx in anticipo

×
×
  • Create New...