Jump to content
Rpg²S Forum

Peco92

Utenti
  • Posts

    26
  • Joined

  • Last visited

Posts posted by Peco92

  1. Ciao, forse sto dicendo delle scemenze, ma perchè usi c_lar per definire l'estremo del ciclo for e poi lo modifichi all'interno del ciclo for? (riga 18)

     

          for i in 1..c_lar
           colore.red -= 1
           colore.blue += 0
           colore.green += 2
           self.contents.fill_rect(x + 5, y + 10, c_lar, c_alt, colore)
           x += 1
           c_lar -= 1
         end

     

    Tra l'altro se leggo bene, c_lar non dovrebbe essere un float compreso tra 0 e 1?

     

    In ogni caso per disegnare delle barre, c'è Custom Bar Graphic se può esserti utile.

     

     

    uso c_lar perchè nel for loop disegno la barra in modo che ad ogni pixel il colore cambi un pochino, capito ora? ( e comunque c_lar non è compreso tra 0 e 1 anche se è vero che sembra, ora è tanto che non riprendevo sto script e non ricordo bene come l'avevo fatto). Alla fine però ero riuscito a renderla fluida, grazie lo stesso ^^

  2. Vorrei appunto che la barra non scatti ma sia fluida.. qualcuno sa come farla? probabilmente è più semplice farla con immagini, cmq vi posto lo script per provarlo, la scene è: Scene_Fish_Lancio.

     

    class Window_Base < Window   ########################################################################   ########################################################################   def draw_bar_potenza( x, y, barra_lar, barra_alt, corrente, max, colore) 	c_lar = barra_lar - 4	c_alt = barra_alt - 4 	# ombra ^^	ombra = Color.new(0, 0, 0, 255)	self.contents.fill_rect(x + 5, y + 10, c_lar, c_alt, ombra) 	if max != 0 	  percent = (corrente.to_f * 100) / max.to_f	  c_lar = (c_lar.to_f * percent.to_f) / 100.to_f 	  for i in 1..c_lar		colore.red -= 1		colore.blue += 0		colore.green += 2		self.contents.fill_rect(x + 5, y + 10, c_lar, c_alt, colore)		x += 1		c_lar -= 1	  end	   	end     end   ########################################################################   ########################################################################end ########################################################################################################################################################################################################################################################################################################################################################################  class Window_Direzione_Lancio < Window_Base   def initialize	super(0, 0, 640, 480)	self.contents = Bitmap.new(width - 32, height - 32)	self.back_opacity = 0	refresh  end   def refresh	self.contents.font.color = system_color  end   def refresh1	self.contents.clear  end end class Window_Lancio < Window_Base   def initialize(lancio, corrente)	super(0, 0, 640, 480)	self.contents = Bitmap.new(width - 32, height - 32)	self.back_opacity = 0	@lancio = lancio	@pot = corrente	refresh  end   def refresh	self.contents.clear#	self.bitmap.clear  	self.contents.font.color = system_color	draw_bar_potenza( 50, 90, 180, 11, @pot, @lancio, knockout_color)  end   def refresh1	self.contents.clear  end end ######################################################################## ######################################################################## ########################################################################   class Scene_Fish_Lancio   def initialize	if $ino_variables [99] == 0 # canna da pesca 1 scelta	  @lancio = 500	end	if $ino_variables [99] == 1 # canna da pesca 2 scelta	  @lancio = 60	end	@direzione = 0	@potenza = 0  end    def main	@spriteset = Spriteset_Map.new	@message_window = Window_Message.new	@lancio_w = Window_Lancio.new(@lancio, @potenza)	@dir_w = Window_Direzione_Lancio.new 	@lancio_w.visible = false	@lancio_w.active = false	@dir_w.visible = true	@dir_w.active = true 	Graphics.transition 	loop do	  Graphics.update	  Input.update	  update	  if $scene != self		break	  end	end 	Graphics.freeze 	@spriteset.dispose	@message_window.dispose	@lancio_w.dispose	@dir_w.dispose   	if $scene.is_a?(Scene_Title)	  Graphics.transition	  Graphics.freeze	end  end ########################################################################   def update	@spriteset.update	@message_window.update	@lancio_w.update	@dir_w.update 	if @lancio_w.active 	  update_lancio	  return	end	if @dir_w.active	  update_dir	  return	end  end ########################################################################    def update_dir 	if $ino_variables [98] == 0	  @direzione = @direzione + 5	elsif $ino_variables [98] == 1	  @direzione = @direzione - 5	end 	if @direzione == 560	  $ino_variables [98] = 1	elsif @direzione == 0	  $ino_variables [98] = 0	end 	if Input.trigger?(Input::C)	  @dir = @direzione	  print @dir	  @dir_w.active = false	  @dir_w.visible = false	  @lancio_w.active = true	  @lancio_w.visible = true	end   end########################################################################   def update_lancio 	if @potenza == @lancio + 10	  @potenza = 0	end 	@lancio_w.refresh	@potenza = @potenza + 5	@lancio_w = Window_Lancio.new(@lancio + 10, @potenza)	@lancio_w.refresh  	if Input.trigger?(Input::C)	  @pot = @potenza	  print @pot	  $scene = Scene_Fish_Lancio.new(@dir,@pot)	end   end########################################################################   def refresh  end ########################################################################end

     

    per visualizzare la barra cliccate due volte sull'omino dove avete posizionato il call script.

     

    Grazie in anticipo per l'aiuto! =)

  3. Dopo una settimana e passa ritorno al lavoro!!

     

    Prova ad aggiungere ".to_f" alla fine della variabile di cui ti interessa il valore decimale ;)

    grazie mille tio il tuo è il metodo più funzionante, comunque per farlo funzionare bisogna mettere .to_f anche ai numeri normali tipo:

     

    @f = 27.to_f / 4.to_f

    print @f

     

     

    così @f ha già i decimali e oltre.

    Se invece viene scritto così non funziona:

     

    @f.to_f = 27 / 4

    print @f.to_f

     

    perchè da errore di sintassi e togliendo alla prima riga .to_f viene restituito un valore intero nella seconda con la virgola e lo zero che segue.

     

    grazie a tutti cmq ^^

  4. dato che è già la terza volta che incappo nel blocco dei numeri che in rpgm xp non salvano i decimali chiedo se qualcuno può aiutarmi.

     

    Qualcuno sa come far si che lo script riconosca un numero decimale salvandolo in una variabile?

  5. Se invece il tuo problema è che la vorresti vedere subito tutta allora il problema è che crei i punti nel refresh e poi incrementi la variabile, ed il refresh lo chiama appunto ad ogni refresh (quindi l'ultimo punto lo ricrei un'infinità di volte - dovresti fare un check della posizione e fermarlo ad un certo punto).

     

    Ecco il punto è prorpio questo ^^, che si crea pian piano va bene per il lancio ma poi non saprei farla apparire tutta di un colpo quando il pesce si muoverà a destra o sinistra..

    scusa ma non ho capito come fermare il problema...

    se non lo metto nel refresh non riesco a disegnarlo....

     

    grazie per l'aiuto che mi stai dando ^^

  6. è che è un pochino incasinato... se qualcuno riesce a capirci qualcosa...

    io lo metto:

     

    #================================================================
    # ** Window_Help
    #------------------------------------------------------------------------------
    #  This window shows skill and item explanations along with actor status.
    #==============================================================================
    
    class Window_Fish < Window_Base
     #--------------------------------------------------------------------------
     # * Object Initialization
     #--------------------------------------------------------------------------
     def initialize ( a, b, c, d)
       super(0, 0, 640, 480)
       self.contents = Bitmap.new(width - 32, height - 32)
       self.back_opacity = 0
       @a = a
       @b = b
       @c = c
       @d = d
      # @mab = @d / @c
      # @a = @b / @mab
      # @b = @b - 2
       refresh
     end
     #--------------------------------------------------------------------------
     # * Set Text
     #  text  : text string displayed in window
     #  align : alignment (0..flush left, 1..center, 2..flush right)
     #--------------------------------------------------------------------------
     def refresh
       #self.contents.clear
       self.contents.font.color = system_color
       self.contents.draw_text(@a, @b, 10, 32, ".")
       @mab = @d / @c
       @a = @b / @mab
       @b = @b - 2
       #@c = 320#x - 320
       #@d = 389#364 - y
       
    
     end
     
     def refresh1
       self.contents.clear
     end
     
    end
    
    ########################################################################
    
    ########################################################################
    
    ########################################################################
    
    
    
    class Scene_Fishing
     
     def main
       @spriteset = Spriteset_Map.new
       @message_window = Window_Message.new
       
       x = 150
       y = 300
       
       @Pesce_x = 50
       @Pesce_y = 300
       
       @xc = 0
       @yc = 0
       
       @xg = 50#x - 100#320
       @yg = 300#364 - y
       
       @mab = @yg / (-@xg)#(@yc - @yg) / (@xc - @xg)
       
       if @Pesce_y == @yg and @Pesce_x == @xg
         @y1 = @Pesce_y
         @Pesce_y = 0
       elsif $ino_variables [1] == 1 #abboccato
         @y1 = @y1
       else
         #@y1 = 0
       end
      # @y1 = @Pesce_y
       @x1 = @y1 / @mab
       if @y1 != @yc
         @o = @x1 + 360
         @p = 364 - @y1
      #   self.draw_text( @o, @p, 10, 32,'-')
       #  @y1 = @y1 - 1
         
     end
     
         @w_fish = Window_Fish.new(@o,@p, @xg, @yg)
         @w_fish.active = true
    
       Graphics.transition
       
       loop do
         Graphics.update
         Input.update
         update
         
         if $scene != self
           break
         end
       end
       
      # @w_fish = Window_Fish.new(@o,@p)
       
       Graphics.freeze
    
       @spriteset.dispose
       @message_window.dispose
       @w_fish.dispose
       
       if $scene.is_a?(Scene_Title)
         Graphics.transition
         Graphics.freeze
       end
     end
     
     def update
       @spriteset.update
       @message_window.update
       @w_fish.update
       @w_fish.refresh
       if @w_fish.active
         update_command
         return
       end
     end
     
     
     
     def update_command
       if Input.trigger?(Input::C)
         @y1 = @y1 - 20
         @o = @y1 / @mab
         @p = @y1
         @w_fish.refresh1
         @w_fish = Window_Fish.new(@o,@p, @xg, @yg)
         @w_fish.refresh
       end
     end
     
     def refresh
     end
     
    end
    

     

    ecco è questo qui.. bisogna richiamarlo tramite eventi. è agli inizi ma è la parte più importante..

  7. Salve! Ho un problemino: sto creando uno script per pescare da capo e la lenza risulta veramente difficile da fare..

    Allora per disegnarla ci riesco tramite una window. solo che per fargli disegnare tutti i punti l'ho messa nell'update della scene... ma i punti si disegnano uno alla volta...

    Qualcuno saprebbe aiutarmi??

    la schermata di pesca prevede una normalissima mappa come questa:

    http://img156.imageshack.us/img156/7961/immaginepa.jpg

  8. Skill Menu

    Descrizione





    Script che permette di classificare le skill praticamente in qualsiasi modo si voglia


    Autore





    Peco92


    (ho preso spunto da un menu per oggetti realizzato da Tio)



    Allegati

    un piccolo screen:


     

    http://img850.imageshack.us/img850/6150/aaat.jpg



    questo è lo script:

     

    # -> Questo script è stato creato da Ino (Peco92) prendendo spunto
    #	  da un menu ad oggetti realizzato da Tio.
     
     
    ### Ora vi illustrerò come utilizzarlo, allora per prima cosa questo
    #	 script classifica le magie in base alle loro capacità. Nel
    #	 Database -> Skill scegliete una magia e noterete che ha tante
    #	 caratteristiche come il costo mp il danno eccetera..
    #   Io le ho divise per la loro usabilità (occasion), ma ora vi
    #	 elenco le possibili classificazioni:
     
    #	 occasion (Usabile in)
    #	 power (Danno)
    #	 sp_cost (costo)
    #	 atk_f (attacco)
    #	 eva_f (evasione)
    #	 str_f (Forza)
    #	 dex_f (Destrezza)
    #	 agi_f (Agilità)
    #	 int_f (Intelligenza)
    #	 hit (Precisione)
    #	 pdef_f (Difesa fisica)
    #	 mdef_f (Difesa magica)
    #	 variance (Variazione)
     
    #	Per occasion la prima scelta equivale a 0 la seconda a 1 ed ecc.
    #	Comunque per classificarle dovete scegliere un tipo di magia: ad
    #	 esempio curative, vi basta scrivere:
    #		if skill.power < 0
     
    #	Allora per far si che lo script capisca l'ugualianza bisogna mettere
    #	 2 uguali == .
    #	allora: == ugualianza
    #			!= diverso
    #			< minore
    #			> maggiore
    #			<= minore o uguale
    #			>= maggiore o uguale
     
    #	Ora andate ad una di queste righe per modificare la classificazione:
    #	 187, 261, 335, 410.
    #	Per fare in modo che una magia sia classificata per due qualità
    #	 basta aggiungere un and in questo modo
    #		if skill.occasion == 0 and skill.power < 0
     
    #	In pratica lo script ti classifica le skill per le loro capacità
    #	 puoi ad esempio mettere a tutte le magie elementali una agilità
    #	 pari ad 1 e nello script scriverai: if skill.agi_f == 1 . così
    #	 quando sceglierai nel menu magie -> elementali ti appariranno solo
    #	 di quel tipo.
    #	é tutto chiaro?
     
    #	Un'altra cosa andate alla riga 569 per modificare il nome delle scelte
    #	Boh.. finito, se avete problemi non esitate a chiedere!!
     
    #	Ciaoooo!!! =D
     
     
    #### Help window ########################################################
     
    class Window_Help_Skill < Window_Base
     
      def initialize
    	super(0, 0, 640, 64)
    	self.contents = Bitmap.new(width - 32, height - 32)
    	self.back_opacity = 255
      end
     
      def set_text(text, align = 0)
    	if text != @text or align != @align
    	  self.contents.clear
    	  self.contents.font.color = normal_color
    	  self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
    	  @text = text
    	  @align = align
    	  @actor = nil
    	end
    	self.visible = true
      end
     
      def set_actor(actor)
    	if actor != @actor
    	  self.contents.clear
    	  draw_actor_name(actor, 4, 0)
    	  draw_actor_state(actor, 140, 0)
    	  draw_actor_hp(actor, 284, 0)
    	  draw_actor_sp(actor, 460, 0)
    	  @actor = actor
    	  @text = nil
    	  self.visible = true
    	end
      end
     
      def set_enemy(enemy)
    	text = enemy.name
    	state_text = make_battler_state_text(enemy, 112, false)
    	if state_text != ""
    	  text += "  " + state_text
    	end
    	set_text(text, 1)
      end
    end
     
    ################################################## End Help window ##########
     
    #############################################################################
     
    #### Target window ##########################################################
     
    class Window_Target_Skill < Window_Selectable
     
    def initialize
    super(0, 0, 320, 416)
    self.index = 0
    self.active = false
    self.z += 10
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    self.back_opacity = 255
    @item_max = $game_party.actors.size
    refresh
    end
     
    def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
       x = 4
       y = i * 95
       actor = $game_party.actors[i]
       draw_actor_graphic(actor, x + 10, y + 75)
       draw_actor_name(actor, x, y)
       draw_actor_class(actor, x + 129, y)
       draw_actor_level(actor, x + 25, y + 32)
       draw_actor_state(actor, x + 25, y + 64)
       draw_actor_hp(actor, x + 137, y + 32)
       draw_actor_sp(actor, x + 137, y + 64)
    end
    end
     
    def update_cursor_rect
    if @index < 0
       self.cursor_rect.empty
    else
       self.cursor_rect.set(0, @index * 95, self.width - 32, 96)
    end
    end
    end
     
    ################################################ End Target window ##########
     
    #############################################################################
     
    #### Always window ##########################################################
     
    class Window_Skill_Always < Window_Selectable
     
      def initialize(actor)
    	super(0, 128, 320, 352)
    	@actor = actor
    	@column_max = 1
    	self.active = false
    	self.visible = false
    	self.back_opacity = 5
    	refresh
    	self.index = 0
    	if $game_temp.in_battle
    	  self.y = 64
    	  self.height = 256
    	  self.back_opacity = 160
    	end
      end
     
      def skill
    	return @data[self.index]
      end
     
      def refresh
    	if self.contents != nil
    	  self.contents.dispose
    	  self.contents = nil
    	end
    	@data = []
    	for i in 0...@actor.skills.size
    	  skill = $data_skills[@actor.skills[i]]
    	  
    	  if skill.occasion == 0
    		@data.push(skill)
    	  end
    	end
     
    	@item_max = @data.size
    	if @item_max > 0
    	  self.contents = Bitmap.new(width - 32, row_max * 32)
    	  for i in 0...@item_max
    		draw_item(i)
    	  end
    	end
      end
     
      def draw_item(index)
    	skill = @data[index]
    	if @actor.skill_can_use?(skill.id)
    	  self.contents.font.color = normal_color
    	else
    	  self.contents.font.color = disabled_color
    	end
    	x = 4 + index % 1 * (288 + 32)
    	y = index / 1 * 32
    	rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    	self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    	bitmap = RPG::Cache.icon(skill.icon_name)
    	opacity = self.contents.font.color == normal_color ? 255 : 128
    	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    	self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    	self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
      end
     
      def update_help
    	@help_window.set_text(self.skill == nil ? "" : self.skill.description)
      end
    end
     
    ################################################ End Always window ##########
     
    #############################################################################
     
    #### In-Battle window #######################################################
     
    class Window_Skill_In_Battle < Window_Selectable
     
      def initialize(actor)
    	super(0, 128, 320, 352)
    	@actor = actor
    	@column_max = 1
    	self.active = false
    	self.visible = false
    	self.back_opacity = 5
    	refresh
    	self.index = 0
    	if $game_temp.in_battle
    	  self.y = 64
    	  self.height = 256
    	  self.back_opacity = 160
    	end
      end
     
      def skill
    	return @data[self.index]
      end
     
      def refresh
    	if self.contents != nil
    	  self.contents.dispose
    	  self.contents = nil
    	end
    	@data = []
    	for i in 0...@actor.skills.size
    	  skill = $data_skills[@actor.skills[i]]
    	  
    	  if skill.occasion == 1 #Only in Battle
    		@data.push(skill)
    	  end
    	end
     
    	@item_max = @data.size
    	if @item_max > 0
    	  self.contents = Bitmap.new(width - 32, row_max * 32)
    	  for i in 0...@item_max
    		draw_item(i)
    	  end
    	end
      end
     
      def draw_item(index)
    	skill = @data[index]
    	if @actor.skill_can_use?(skill.id)
    	  self.contents.font.color = normal_color
    	else
    	  self.contents.font.color = disabled_color
    	end
    	x = 4 + index % 1 * (288 + 32)
    	y = index / 1 * 32
    	rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    	self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    	bitmap = RPG::Cache.icon(skill.icon_name)
    	opacity = self.contents.font.color == normal_color ? 255 : 128
    	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    	self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    	self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
      end
     
      def update_help
    	@help_window.set_text(self.skill == nil ? "" : self.skill.description)
      end
    end
     
    ############################################# End In-Battle window ##########
     
    #############################################################################
     
    #### Out-Battle window ######################################################
     
    class Window_Skill_Out_Battle < Window_Selectable
     
      def initialize(actor)
    	super(0, 128, 320, 352)
    	@actor = actor
    	@column_max = 1
    	self.active = false
    	self.visible = false
    	self.back_opacity = 5
    	refresh
    	self.index = 0
    	if $game_temp.in_battle
    	  self.y = 64
    	  self.height = 256
    	  self.back_opacity = 160
    	end
      end
     
      def skill
    	return @data[self.index]
      end
     
      def refresh
    	if self.contents != nil
    	  self.contents.dispose
    	  self.contents = nil
    	end
    	@data = []
    	for i in 0...@actor.skills.size
    	  skill = $data_skills[@actor.skills[i]]
    	  
    	  if skill.occasion == 2 #Only in Battle
    		@data.push(skill)
    	  end
    	end
     
    	@item_max = @data.size
    	if @item_max > 0
    	  self.contents = Bitmap.new(width - 32, row_max * 32)
    	  for i in 0...@item_max
    		draw_item(i)
    	  end
    	end
      end
     
      def draw_item(index)
    	skill = @data[index]
    	if @actor.skill_can_use?(skill.id)
    	  self.contents.font.color = normal_color
    	else
    	  self.contents.font.color = disabled_color
    	end
    	x = 4 + index % 1 * (288 + 32)
    	y = index / 1 * 32
    	rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    	self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    	bitmap = RPG::Cache.icon(skill.icon_name)
    	opacity = self.contents.font.color == normal_color ? 255 : 128
    	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    	self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    	self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
      end
     
      def update_help
    	@help_window.set_text(self.skill == nil ? "" : self.skill.description)
      end
    end
     
    ############################################ End Out-Battle window ##########
     
    #############################################################################
     
    #### Never window ###########################################################
     
    class Window_Skill_Never < Window_Selectable
     
      def initialize(actor)
    	super(0, 128, 320, 352)
    	@actor = actor
    	@column_max = 1
    	self.active = false
    	self.visible = false
    	self.back_opacity = 5
    	refresh
    	self.index = 0
     
    	if $game_temp.in_battle
    	  self.y = 64
    	  self.height = 256
    	  self.back_opacity = 160
    	end
      end
     
      def skill
    	return @data[self.index]
      end
     
      def refresh
    	if self.contents != nil
    	  self.contents.dispose
    	  self.contents = nil
    	end
    	@data = []
    	for i in 0...@actor.skills.size
    	  skill = $data_skills[@actor.skills[i]]
    	  
    	  if skill.occasion == 3 #Only in Battle
    		@data.push(skill)
    	  end
    	end
     
    	@item_max = @data.size
    	if @item_max > 0
    	  self.contents = Bitmap.new(width - 32, row_max * 32)
    	  for i in 0...@item_max
    		draw_item(i)
    	  end
    	end
      end
     
      def draw_item(index)
    	skill = @data[index]
    	if @actor.skill_can_use?(skill.id)
    	  self.contents.font.color = normal_color
    	else
    	  self.contents.font.color = disabled_color
    	end
    	x = 4 + index % 1 * (288 + 32)
    	y = index / 1 * 32
    	rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    	self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    	bitmap = RPG::Cache.icon(skill.icon_name)
    	opacity = self.contents.font.color == normal_color ? 255 : 128
    	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    	self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    	self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
      end
     
      def update_help
    	@help_window.set_text(self.skill == nil ? "" : self.skill.description)
      end
    end
     
    ################################################# End Never window ##########
     
    #############################################################################
     
    #### Base window ############################################################
     
    class Window_Base < Window
     
      def draw_sp_chara_b(actor, x, y)
    	self.contents.draw_text(x + 60, y, 32, 32, $data_system.words.sp + ":")
    	self.contents.draw_text(x + 90, y, 48, 32, actor.sp.to_s, 1)#, 2)
    	self.contents.draw_text(x + 128, y, 12, 32, "/", 1)
    	self.contents.draw_text(x + 138, y, 48, 32, actor.maxsp.to_s)
      end
     
      def draw_actor_name_b(actor, x, y)
    	self.contents.font.size = 24
    	self.contents.font.color = normal_color
    	p = contents.text_size(actor.name).width
    	self.contents.draw_text(x, y, p, 32, actor.name)
    	self.contents.font.color = normal_color
      end
     
      def draw_sp_chara(actor, x, y, width = 144)
    	self.contents.font.color = system_color
    	self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    	if width - 32 >= 108
    	  sp_x = x + width - 108
    	  flag = true
    	elsif width - 32 >= 48
    	  sp_x = x + width - 48
    	  flag = false
    	end
    	sp_x = sp_x - 15
    	self.contents.font.color = actor.sp == 0 ? knockout_color :
    	  actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
    	self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
    	if flag
    	  self.contents.font.color = normal_color
    	  self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
    	  self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
    	end
      end
     
    end
     
    ################################################## End Base window ##########
     
    #############################################################################
     
    #### Chara window ###########################################################
     
    class Window_Skill_Chara < Window_Base
     
      def initialize(actor)
    	super(0, 64, 320, 64)
    	self.contents = Bitmap.new(width - 32, height - 32)
    	self.back_opacity = 255
    	@actor = actor
    	@level_up_flags = [false, false, false, false]
    	refresh
      end
     
      def dispose
    	super
      end
     
      def level_up(actor_index)
    	@level_up_flags[actor_index] = true
      end
     
      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 = 4 + 20
    	  draw_actor_graphic(@actor, 13, 45)
    	  draw_actor_name(@actor, actor_x, 0)
    	  draw_sp_chara(@actor, actor_x + 75 + 65, 0)
    	  draw_actor_level(@actor,actor_x + 75, 0)
    	end
      end
     
      def update
    	super
    	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 Chara window ########
     
    #############################################################################
    #############################################################################
    #############################################################################
    #############################################################################
    #############################################################################
    #############################################################################
     
     
    ##							Ino's Script
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>  °Scene_Skill°  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    class Scene_Skill
     
      def initialize(actor_index = 0, equip_index = 0, menu_index = 0)
    	@actor_index = actor_index
    	@menu_index = menu_index
      end
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Main
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def main
    s1 = "Always"
    s2 = "Never"
    s3 = "Out-Battle"
    s4 = "In-Battle"
    @actor = $game_party.actors[@actor_index]
    @command_window = Window_Command.new(160, [s1, s2, s3, s4,])
    @command_window.index = @menu_index
    @command_window.x = 240
    @command_window.y = 120
    @command_window.index = 0
    @command_window.z = 200
    @command_window.back_opacity = 255
    @command_window.active = true
     
    @dummy_window = Window_Base.new(0, 128, 320, 416 - 64)
    @dummy_window.back_opacity = 255
     
    @s_al = Window_Skill_Always.new(@actor)
    @s_i_b = Window_Skill_In_Battle.new(@actor)
    @s_o_b = Window_Skill_Out_Battle.new(@actor)
    @s_n = Window_Skill_Never.new(@actor)
     
    @chara = Window_Skill_Chara.new(@actor)
     
     
    @help_window = Window_Help_Skill.new
    @s_al.help_window = @help_window
    @s_i_b.help_window = @help_window
    @s_o_b.help_window = @help_window
    @s_n.help_window = @help_window
     
    @target_window = Window_Target_Skill.new
    @target_window.x = 320
    @target_window.y = 64
    @target_window.index = -1
     
    Graphics.transition
    loop do
       Graphics.update
       Input.update
       update
       if $scene != self
    	 break
       end
    end
    Graphics.freeze
     
    @help_window.dispose
    @chara.dispose
    @s_al.dispose
    @target_window.dispose
    @s_n.dispose
    @s_o_b.dispose
    @s_i_b.dispose
    @dummy_window.dispose
    end
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def update
     
      @help_window.update
      @s_al.update
      @target_window.update
      @command_window.update
      @s_n.update
      @s_o_b.update
      @s_i_b.update
     
      if @command_window.active
    	update_command
    	return
      end
      if @s_al.active
    	update_s_al
    	return
      end
      if @s_n.active
    	update_s_n
    	return
      end
      if @s_o_b.active
    	update_s_o_b
    	return
      end
      if @s_i_b.active
    	update_s_i_b
    	return
      end
      if @target_window.active
    	update_target
    	return
      end
    end	  
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Command
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def update_command
     
      if Input.trigger?(Input::B)
    	$game_system.se_play($data_system.cancel_se)
    	@command_window.visible = false
    	@command_window.active = false
    	$scene = Scene_Menu.new (1)
    	return
      end
     
    if Input.trigger?(Input::C)
       @command_window.visible = false
       @command_window.active = false
       case @command_window.index
       when 0  # Always
    	  $game_system.se_play($data_system.decision_se)
    	 @s_al.visible = true
    	 @s_al.active = true
    	 @s_al.index = 0
       when 1  # Never
    	 $game_system.se_play($data_system.decision_se)
    	 @s_n.visible = true
    	 @s_n.active = true
    	 @s_n.index = 0
       when 2  # Out-Battle
    	  $game_system.se_play($data_system.decision_se)
    	  @s_o_b.visible = true
    	  @s_o_b.active = true
    	  @s_o_b.index = 0
       when 3  # In-Battle
    	  $game_system.se_play($data_system.decision_se)
    	  @s_i_b.visible = true
    	  @s_i_b.active = true
    	  @s_i_b.index = 0
       end
    end
     
    if Input.trigger?(Input::R)
    	$game_system.se_play($data_system.cursor_se)
    	@actor_index += 1
    	@actor_index %= $game_party.actors.size
    	@command_window.visible = false
    	@command_window.active = false
    	@command_window.refresh
    	@chara.refresh
    	$scene = Scene_Skill.new(@actor_index)
    	update_nad
    	return
      end
     
      if Input.trigger?(Input::L)
    	$game_system.se_play($data_system.cursor_se)
    	@actor_index += $game_party.actors.size - 1
    	@actor_index %= $game_party.actors.size
    	@command_window.visible = false
    	@command_window.active = false
    	@command_window.refresh
    	@chara.refresh
    	$scene = Scene_Skill.new(@actor_index)
    	update_nad
    	return
      end
    end
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Nad ( per cambiare personaggio) =)
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    def update_nad
      if Input.trigger?(Input::B)
    	@command_window.index = @command_window.index
    	@command_window.active = true
    	@command_window.visible = true
      end
    end
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Always
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    	
    def update_s_al
     
    	if Input.trigger?(Input::B)
    	  $game_system.se_play($data_system.cancel_se)
    	  @command_window.index = @command_window.index
    	  @command_window.active = true
    	  @command_window.visible = true
    	  @s_al.active = false
    	  @s_al.visible = false
    	  @s_al.index = -1
    	  @help_window.set_text("")
    	  @dummy_window.visible = true
    	  return
    	end
     
    	if Input.trigger?(Input::C)
    	  @skill = @s_al.skill
    	  if @skill == nil or not @actor.skill_can_use?(@skill.id)
    		$game_system.se_play($data_system.buzzer_se)
    		return
    	  end
    	  $game_system.se_play($data_system.decision_se)
    	  if @skill.scope >= 3
    		@s_al.active = false
    		@target_window.visible = true
    		@target_window.active = true
    		if @skill.scope == 4 || @skill.scope == 6
    		  @target_window.index = -1
    		elsif @skill.scope == 7
    		  @target_window.index = @actor_index - 10
    		else
    		  @target_window.index = 0
    		end
    	  else
    		if @skill.common_event_id > 0
    		  $game_temp.common_event_id = @skill.common_event_id
    		  $game_system.se_play(@skill.menu_se)
    		  @actor.sp -= @skill.sp_cost
    		  @s_al.refresh
    		  @chara.refresh
    		  @target_window.refresh
    		  $scene = Scene_Map.new
    		  return
    		end
    	  end
    	  return
    	end
      end
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Never
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def update_s_n
     
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       @command_window.index = @command_window.index
       @command_window.active = true
       @command_window.visible = true
       @s_n.active = false
       @s_n.visible = false
       @s_n.index = -1
       @help_window.set_text("")
       @dummy_window.visible = true
       return
    end
    if Input.trigger?(Input::C)
    	  @skill = @s_n.skill
    	  if @skill == nil or not @actor.skill_can_use?(@skill.id)
    		$game_system.se_play($data_system.buzzer_se)
    		return
    	  end
    	  $game_system.se_play($data_system.decision_se)
    	  
    	  if @skill.scope >= 3
    		@s_n.active = false
    		@target_window.visible = true
    		@target_window.active = true
    		if @skill.scope == 4 || @skill.scope == 6
    		  @target_window.index = -1
    		elsif @skill.scope == 7
    		  @target_window.index = @actor_index - 10
    		else
    		  @target_window.index = 0
    		end
    	  else
    		
    		if @skill.common_event_id > 0
    		  $game_temp.common_event_id = @skill.common_event_id
    		  $game_system.se_play(@skill.menu_se)
    		  @actor.sp -= @skill.sp_cost
    		  @s_n.refresh
    		  @target_window.refresh
    		  @chara.refresh
    		  $scene = Scene_Map.new
    		  return
    		end
    	  end
    	  return
    	end
    end
     
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Out Battle
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def update_s_o_b
     
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       @command_window.index = @command_window.index
       @command_window.active = true
       @command_window.visible = true
       @s_o_b.active = false
       @s_o_b.visible = false
       @s_o_b.index = -1
       @help_window.set_text("")
       @dummy_window.visible = true
       return
    end
     
    if Input.trigger?(Input::C)
    	  @skill = @s_o_b.skill
    	  
    	  if @skill == nil or not @actor.skill_can_use?(@skill.id)
    		$game_system.se_play($data_system.buzzer_se)
    		return
    	  end
    	  $game_system.se_play($data_system.decision_se)
    	  
    	  if @skill.scope >= 3
    		@s_o_b.active = false
    		@target_window.visible = true
    		@target_window.active = true
    		if @skill.scope == 4 || @skill.scope == 6
    		  @target_window.index = -1
    		elsif @skill.scope == 7
    		  @target_window.index = @actor_index - 10
    		else
    		  @target_window.index = 0
    		end
    	  else
     
    		if @skill.common_event_id > 0
    		  $game_temp.common_event_id = @skill.common_event_id
    		  $game_system.se_play(@skill.menu_se)
    		  @actor.sp -= @skill.sp_cost
    		  @s_o_b.refresh
    		  @target_window.refresh
    		  @chara_refresh
    		  $scene = Scene_Map.new
    		  return
    		end
    	  end
    	  return
    	end
    end
     
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update In Battle
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
     
    def update_s_i_b
     
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       @command_window.index = @command_window.index
       @command_window.active = true
       @command_window.visible = true
       @s_i_b.active = false
       @s_i_b.visible = false
       @s_i_b.index = -1
       @dummy_window.visible = true
       @help_window.set_text("")
       return
    end
    if Input.trigger?(Input::C)
    	  @skill = @s_i_b.skill
    	  if @skill == nil or not @actor.skill_can_use?(@skill.id)
    		$game_system.se_play($data_system.buzzer_se)
    		return
    	  end
    	  $game_system.se_play($data_system.decision_se)
     
    	  if @skill.scope >= 3
    		@s_i_b.active = false
    		@target_window.visible = true
    		@target_window.active = true
    		if @skill.scope == 4 || @skill.scope == 6
    		  @target_window.index = -1
    		elsif @skill.scope == 7
    		  @target_window.index = @actor_index - 10
    		else
    		  @target_window.index = 0
    		end
    	  else
     
    		if @skill.common_event_id > 0
    		  $game_temp.common_event_id = @skill.common_event_id
    		  $game_system.se_play(@skill.menu_se)
    		  @actor.sp -= @skill.sp_cost
    		  @s_i_b.refresh
    		  @target_window.refresh
    		  @chara.refresh
    		  $scene = Scene_Map.new
    		  return
    		end
    	  end
    	  return
    	end
    end
     
    #>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    # $ Update Target Window
    #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    def update_target
     
    if Input.trigger?(Input::B)
       $game_system.se_play($data_system.cancel_se)
       unless $game_party.item_can_use?(@item.id)
    	 @s_al.refresh
       end
       @s_al.active = true
       @target_window.active = false
       @target_window.index = -1
       return
    end
     
    if Input.trigger?(Input::C)
     
    	  unless @actor.skill_can_use?(@skill.id)
    		$game_system.se_play($data_system.buzzer_se)
    		return
    	  end
    	  if @target_window.index == -1
    		used = false
    		for i in $game_party.actors
    		  used |= i.skill_effect(@actor, @skill)
    		end
    	  end
    	  if @target_window.index <= -2
    		target = $game_party.actors[@target_window.index + 10]
    		used = target.skill_effect(@actor, @skill)
    	  end
    	  if @target_window.index >= 0
    		target = $game_party.actors[@target_window.index]
    		used = target.skill_effect(@actor, @skill)
    	  end
    	  if used
    		$game_system.se_play(@skill.menu_se)
    		@actor.sp -= @skill.sp_cost
    		@s_al.refresh
    		@chara.refresh
    		@target_window.refresh
     
    		if $game_party.all_dead?
    		  $scene = Scene_Gameover.new
    		  return
    		end
     
    		if @skill.common_event_id > 0
    		  $game_temp.common_event_id = @skill.common_event_id
    		  $scene = Scene_Map.new
    		  return
    		end
    	  end
     
    	  unless used
    		$game_system.se_play($data_system.buzzer_se)
    	  end
    	  return
    	end
      end
    end
     
      

     

     



    se volete lo potete scaricare da qua:
    http://www.mediafire...39a4z1lr6gesxlc


    Istruzioni per l'uso

    scaricate lo script da qua sopra, è un semplice file txt da 28 kb.
    e copiatene il contenuto incollandolo sopra allo script main, nominatelo come vi pare.
    eccovi le istruzioni


     

    ### Ora vi illustrerò come utilizzarlo, allora per prima cosa questo
    # script classifica le magie in base alle loro capacità. Nel
    # Database -> Skill scegliete una magia e noterete che ha tante
    # caratteristiche come il costo mp il danno eccetera..
    # Io le ho divise per la loro usabilità (occasion), ma ora vi
    # elenco le possibili classificazioni:

    # occasion (Usabile in)
    # power (Danno)
    # sp_cost (costo)
    # atk_f (attacco)
    # eva_f (evasione)
    # str_f (Forza)
    # dex_f (Destrezza)
    # agi_f (Agilità)
    # int_f (Intelligenza)
    # hit (Precisione)
    # pdef_f (Difesa fisica)
    # mdef_f (Difesa magica)
    # variance (Variazione)

    # Per occasion la prima scelta equivale a 0 la seconda a 1 ed ecc.
    # Comunque per classificarle dovete scegliere un tipo di magia: ad
    # esempio curative, vi basta scrivere:
    # if skill.power < 0

    # Allora per far si che lo script capisca l'ugualianza bisogna mettere
    # 2 uguali == .
    # allora: == ugualianza
    # != diverso
    # < minore
    # > maggiore
    # <= minore o uguale
    # >= maggiore o uguale

    # Ora andate ad una di queste righe per modificare la classificazione:
    # 187, 261, 335, 410.
    # Per fare in modo che una magia sia classificata per due qualità
    # basta aggiungere un and in questo modo
    # if skill.occasion == 0 and skill.power < 0

    # In pratica lo script ti classifica le skill per le loro capacità
    # puoi ad esempio mettere a tutte le magie elementali una agilità
    # pari ad 1 e nello script scriverai: if skill.agi_f == 1 . così
    # quando sceglierai nel menu magie -> elementali ti appariranno solo
    # di quel tipo.
    # é tutto chiaro?

    # Un'altra cosa andate alla riga 569 per modificare il nome delle scelte
    # Boh.. finito, se avete problemi non esitate a chiedere!!




    Bugs e Conflitti Noti

    N/A


    Altri Dettagli





    Chiedete pure a me se avete bisogno di modificare un pò lo script. ^^
    Ciaooo!!

  9. Ah capisco è uno script personalizzato! :D ^ ^

    Magari un tutorial generale su come dividere in diverse classi di oggetti se hai voglia/tempo...

    ^ ^

     

    Non ho capito tanto bene quello che intendi, ma quando ho tempo metto a posto lo script con tutte le informazioni che servono per classificare le skill ^^. Così dovrebbe andar bene, no? :sisi:

  10. Non lo posti per condividerlo con tutti? :D

     

    : D

     

    XD

    ^ ^

     

    è che è un pochino base e qualcuno potrebbe non capirne le sue vere capacità.

    Io lo ho adeguato al mio gioco ma non penso che quello personalizzato sia utile a molti..

     

    Quello base (senza picture, barre e cose varie) è strutturato per dividere le magie in:

    1) Sempre utilizzabili

    2) Solo in battaglia

    3) Solo fuori battaglia

    4) Mai

     

    Così non sembra avere molta utilità, no? xD

    Ma se qualcuno mi dà un' idea su come renderlo un pochino usabile da tutti, con funzionalità in più dica pure che lo adeguo e lo pubblico ^^.

    Nel mio le ho divise per Curative, Offensive, Evocazioni e Non in battaglia. Ma devo ancora decidere come sistemarle meglio. :sisi:

  11. ok Grazie guardian ora lo riposto:

    #====================# Script Scene_Menu divisa per categorie		  ultima modifica 28/04/2006# www.rpgshrine.altervista.org# Script by Tio. Special thanks to RagnarokM	  #==================== #=========================================================# - Window_Item	  modificata da RagnarokM  #------------------------------------------------------------------------------# E' la finestra che mostra la lista di oggetti posseduti sullo schermo# degli oggetti e della battaglia#=========================================================class Window_Item < Window_Selectable#--------------------------------------------------------------------------# - Inizializzazione dell'oggetto#--------------------------------------------------------------------------def initialize  super(0, 64, 320, 416)  self.index = -1  self.active = false  self.visible = false  @column_max = 1  refresh  # Durante una finestra si muove al centro dello schermo e diventa  # translucente  if $game_temp.in_battle	self.y = 64	self.height = 256  endend#--------------------------------------------------------------------------# - Acquisizione di un oggetto#--------------------------------------------------------------------------def item  return @data[self.index]end#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def refresh  if self.contents != nil	self.contents.dispose	self.contents = nil  end  @data = []  # Aggiunta di un oggetto  for i in 1...$data_items.size	# Controllo se l'oggetto è utilizzabile.	# Se lo è lo inserisco nela lista degli oggetti che è possibile utilizzare.	oggetto = $data_items[i]	if  (oggetto.occasion == 0) or (oggetto.occasion == 1) or (oggetto.occasion == 2)	  if $game_party.item_number(i) > 0		@data.push($data_items[i])	  end	end  end  # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti  # gli oggetti verranno disegnati  @item_max = @data.size  if @item_max > 0	self.contents = Bitmap.new(width - 32, row_max * 32)	for i in 0...@item_max	  draw_item(i)	end  endend  #--------------------------------------------------------------------------# - Disegna un oggetto#	 index : Numero dell'oggetto#--------------------------------------------------------------------------def draw_item(index)  item = @data[index]  number = $game_party.item_number(item.id)  if item.is_a?(RPG::Item) and	 $game_party.item_can_use?(item.id)	self.contents.font.color = normal_color  else	self.contents.font.color = disabled_color  end  self.contents.font.name = "Arial"  self.contents.font.size = 24  x = 4 + index % 1 * (288 + 32)  y = index  * 32  rect = Rect.new(x, y, self.width / @column_max - 32, 32)  self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))  bitmap = RPG::Cache.icon(item.icon_name)  opacity = self.contents.font.color == normal_color ? 255 : 128  self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)  self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)  self.contents.draw_text(x + 240, y, 16, 32, ":", 1)  self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)end#--------------------------------------------------------------------------# - Aggiornamento del testo di aiuto#--------------------------------------------------------------------------def update_help  @help_window.set_text(self.item == nil ? "" : self.item.description)endend #====================================================# - Window_KeyItem		  Creata da RagnarokM#------------------------------------------------------------------------------# E' la finestra che mostra la lista di oggetti chiave posseduti nella schermata# degli oggetti.#====================================================class Window_KeyItem < Window_Selectable#--------------------------------------------------------------------------# - Inizializzazione dell'oggetto#--------------------------------------------------------------------------def initialize super(0, 64, 320, 416) @column_max = 1 self.index = -1 self.active = false self.visible = false refreshend#--------------------------------------------------------------------------# - Acquisizione di un oggetto#--------------------------------------------------------------------------def itemreturn @data[self.index]end#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def refresh  if self.contents != nil	self.contents.dispose	self.contents = nil  end  @data = []  # Aggiunta di un oggetto  for i in 1...$data_items.size	oggetto = $data_items[i]	# Controllo se l'oggetto è utilizzabile.	# Se non lo è inserisco nella lista degli oggetti chiave.	if  oggetto.occasion == 3	  if $game_party.item_number(i) > 0		@data.push($data_items[i])	  end	end  end  # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti  # gli oggetti verranno disegnati  @item_max = @data.size  if @item_max > 0	self.contents = Bitmap.new(width - 32, row_max * 32)	for i in 0...@item_max	  draw_item(i)	end  endend#--------------------------------------------------------------------------# - Disegna un oggetto#	 index : Numero dell'oggetto#--------------------------------------------------------------------------def draw_item(index)  item = @data[index]  number = $game_party.item_number(item.id)  self.contents.font.color = disabled_color  self.contents.font.name = "Arial"  self.contents.font.size = 24  x = 4 + index % 1 * (288 + 32)  y = index  * 32  rect = Rect.new(x, y, self.width / @column_max - 32, 32)  self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))  bitmap = RPG::Cache.icon(item.icon_name)  opacity = self.contents.font.color == normal_color ? 255 : 128  self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)  self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)  self.contents.draw_text(x + 240, y, 16, 32, ":", 1)  self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)end#--------------------------------------------------------------------------# - Aggiornamento del testo di aiuto#--------------------------------------------------------------------------def update_help  @help_window.set_text(self.item == nil ? "" : self.item.description)endend#============================================================# - Window_Target#------------------------------------------------------------------------------# E' lo schermo degli oggetti e delle abilità ed è la finestra dalla quale# si sceglie il personaggio da usare#============================================================ class Window_Target < Window_Selectable#--------------------------------------------------------------------------# - Inizializzazione dell'oggetto#--------------------------------------------------------------------------def initialize super(0, 0, 320, 416) self.index = 0 self.active = false self.z += 10 self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = "Arial" self.contents.font.size = 24 @item_max = $game_party.actors.size refreshend#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def refresh self.contents.clear for i in 0...$game_party.actors.size   x = 4   y = i * 95   actor = $game_party.actors[i]   draw_actor_graphic(actor, x + 10, y + 75)   draw_actor_name(actor, x, y)   draw_actor_class(actor, x + 144, y)   draw_actor_level(actor, x + 20, y + 32)   draw_actor_state(actor, x + 20, y + 64)   draw_actor_hp(actor, x + 152, y + 32)   draw_actor_sp(actor, x + 152, y + 64) endend#--------------------------------------------------------------------------# - Aggiornamento del rettangolo del cursore#-------------------------------------------------------------------------- def update_cursor_rect if @index < 0   self.cursor_rect.empty else   self.cursor_rect.set(0, @index * 95, self.width - 32, 96) endendend #================================================================# - Window_Weapon#------------------------------------------------------------------------------# E' la finestra che mostra la lista di oggetti posseduti sullo schermo# degli oggetti e della battaglia#================================================================ class Window_Weapon < Window_Selectable#--------------------------------------------------------------------------# - Inizializzazione dell'oggetto#--------------------------------------------------------------------------def initialize super(0, 64, 320, 416) self.index = -1 self.active = false self.visible = false @column_max = 1 refresh # Durante una finestra si muove al centro dello schermo e diventa # translucente if $game_temp.in_battle   self.y = 64   self.height = 256 endend#--------------------------------------------------------------------------# - Acquisizione di un oggetto#--------------------------------------------------------------------------def item return @data[self.index]end#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def refresh if self.contents != nil   self.contents.dispose   self.contents = nil end @data = [] # Aggiunta di un oggetto# Vengono anche aggiunti un'arma e uno scudo se è possibile, # eccetto durante una battaglia unless $game_temp.in_battle   for i in 1...$data_weapons.size	 if $game_party.weapon_number(i) > 0	   @data.push($data_weapons[i])	 end   end end # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti # gli oggetti verranno disegnati @item_max = @data.size if @item_max > 0   self.contents = Bitmap.new(width - 32, row_max * 32)   for i in 0...@item_max	 draw_item(i)   end endend#--------------------------------------------------------------------------# - Disegna un oggetto#	 index : Numero dell'oggetto#--------------------------------------------------------------------------def draw_item(index) item = @data[index] number = $game_party.weapon_number(item.id) if item.is_a?(RPG::Item) and	$game_party.item_can_use?(item.id)   self.contents.font.color = normal_color else   self.contents.font.color = disabled_color end self.contents.font.name = "Arial" self.contents.font.size = 24 x = 4 + index % 1 * (288 + 32) y = index  * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)end#--------------------------------------------------------------------------# - Aggiornamento del testo di aiuto#--------------------------------------------------------------------------def update_help @help_window.set_text(self.item == nil ? "" : self.item.description)endend #=================================================================# - Window_Armor#------------------------------------------------------------------------------# E' la finestra che mostra la lista di oggetti posseduti sullo schermo# degli oggetti e della battaglia#================================================================= class Window_Armor < Window_Selectable#--------------------------------------------------------------------------# - Inizializzazione dell'oggetto#--------------------------------------------------------------------------def initialize super(0, 64, 320, 416) self.index = -1 self.active = false self.visible = false @column_max = 1 refresh # Durante una finestra si muove al centro dello schermo e diventa # translucente if $game_temp.in_battle   self.y = 64   self.height = 256 endend#--------------------------------------------------------------------------# - Acquisizione di un oggetto#--------------------------------------------------------------------------def item return @data[self.index]end#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def refresh if self.contents != nil   self.contents.dispose   self.contents = nil end @data = [] # Vengono anche aggiunti un'arma e uno scudo se è possibile, # eccetto durante una battaglia unless $game_temp.in_battle   for i in 1...$data_armors.size	 if $game_party.armor_number(i) > 0	   @data.push($data_armors[i])	 end   end end # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti # gli oggetti verranno disegnati @item_max = @data.size if @item_max > 0   self.contents = Bitmap.new(width - 32, row_max * 32)   for i in 0...@item_max	 draw_item(i)   end endend#--------------------------------------------------------------------------# - Disegna un oggetto#	 index : Numero dell'oggetto#--------------------------------------------------------------------------def draw_item(index) item = @data[index]   number = $game_party.armor_number(item.id) if item.is_a?(RPG::Item) and	$game_party.item_can_use?(item.id)   self.contents.font.color = normal_color else   self.contents.font.color = disabled_color end self.contents.font.name = "Arial" self.contents.font.size = 24 x = 4 + index % 1 * (288 + 32) y = index  * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 212, 32, item.name, 0) self.contents.draw_text(x + 240, y, 16, 32, ":", 1) self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)end#--------------------------------------------------------------------------# - Aggiornamento del testo di aiuto#--------------------------------------------------------------------------def update_help @help_window.set_text(self.item == nil ? "" : self.item.description)endend #===================================================================# - Scene_Item#------------------------------------------------------------------------------# Scena degli oggetti#=================================================================== class Scene_Item def initialize(menu_index = 0) @menu_index = menu_indexend#--------------------------------------------------------------------------# - Processo Principale#--------------------------------------------------------------------------def main s1 = $data_system.words.item s2 = "Armi" s3 = "Armature" s4 = "Rarità" @command_window = Window_Command.new(160, [s1, s2, s3, s4,]) @command_window.index = @menu_index @command_window.x = 240 @command_window.y = 120 @command_window.index = 0 @command_window.z = 200 @command_window.active = true  @dummy_window = Window_Base.new(0, 64, 320, 416)  @weapon_window = Window_Weapon.new @armor_window = Window_Armor.new @keyItem_window = Window_KeyItem.new @item_window = Window_Item.new    # Creazione finestra d'aiuto @help_window = Window_Help.new @item_window.help_window = @help_window @keyItem_window.help_window = @help_window @armor_window.help_window = @help_window @weapon_window.help_window = @help_window # Creazione finestra dell'obiettivo @target_window = Window_Target.new @target_window.x = 320 @target_window.y = 64 @target_window.index = -1  # Fade Graphics.transition # Loop Principale loop do   # Aggiornamento Grafica   Graphics.update   # Aggiornamento Input   Input.update   # Aggiornamento Frame   update   # Quando cambia la scena blocca il loop   if $scene != self	 break   end end # Preparazione Fade Graphics.freeze # Eliminazione Finestre @help_window.dispose @item_window.dispose @target_window.dispose @weapon_window.dispose @armor_window.dispose @keyItem_window.dispose @dummy_window.disposeend#--------------------------------------------------------------------------# - Aggiornamento#--------------------------------------------------------------------------def update  # Aggiornamento Finestre  @help_window.update  @item_window.update  @target_window.update  @command_window.update  @weapon_window.update  @armor_window.update  @keyItem_window.update  if @command_window.active	update_command	return  end  # Chiama update_item se è attiva la finestra degli oggetti  if @item_window.active	update_item	return  end  if @weapon_window.active	update_weapon	return  end  if @armor_window.active	update_armor	return  end  if @keyItem_window.active	update_KeyItem	return  end  # Chiama update_target se è attiva la finestra dell'obiettivo  if @target_window.active	update_target	return  endend	   # Quando è attiva la finestra dei comandidef update_command  # Quando B è premuto  if Input.trigger?(Input::B)	# Suona SE Annulla	$game_system.se_play($data_system.cancel_se)	# Torna al menu	@command_window.visible = false	@command_window.active = false	$scene = Scene_Menu.new (0)	return  end # Quando C è premuto if Input.trigger?(Input::C)   @command_window.visible = false   @command_window.active = false   # Scelta del comando da eseguire   case @command_window.index   when 0  # Oggetti	  # Suona SE Azione	  $game_system.se_play($data_system.decision_se)	  # Vai alla scena degli oggetti	 @item_window.visible = true	 @item_window.active = true	 @item_window.index = 0   when 1  #Armi	 # Suona SE Azione	 $game_system.se_play($data_system.decision_se)	 @weapon_window.visible = true	 @weapon_window.active = true	 @weapon_window.index = 0   when 2  # Armature	  # Suona SE Azione	  $game_system.se_play($data_system.decision_se)	  @armor_window.visible = true	  @armor_window.active = true	  @armor_window.index = 0   when 3  # Rarità	  # Suona SE Azione	  $game_system.se_play($data_system.decision_se)	  @keyItem_window.visible = true	  @keyItem_window.active = true	  @keyItem_window.index = 0   end end  end#--------------------------------------------------------------------------# - Aggiornamento Frame (Quando è attiva la finestra degli oggetti)#--------------------------------------------------------------------------def update_item # Quando B è premuto if Input.trigger?(Input::B)   # Suona SE Annulla   $game_system.se_play($data_system.cancel_se)   # Torna al menu   @command_window.index = @command_window.index   @command_window.active = true   @command_window.visible = true   @item_window.active = false   @item_window.visible = false   @item_window.index = -1   # Cancella il testo d'aiuto   @help_window.set_text("")   @dummy_window.visible = true   return end # Quando C è premuto if Input.trigger?(Input::C)   # Acquisizione dei dati selezionati   @item = @item_window.item   # Quando l'oggetto è un'arma o un'armatura   unless @item.is_a?(RPG::Item)	 # Suona SE Azione Impossibile	 $game_system.se_play($data_system.buzzer_se)   return   end   # Quando l'oggetto non può essere usato   unless $game_party.item_can_use?(@item.id)	  # Suona SE Azione Impossibile	  $game_system.se_play($data_system.buzzer_se)	  return   end   # Suona SE Azione   $game_system.se_play($data_system.decision_se)   # Controlla l'obiettivo dell'oggetto   if @item.scope >= 3	 # La finestra dell'obiettivo viene attivata	 @item_window.active = false	 @target_window.active = true	 # Setta il cursore in base all'obiettivo	 if @item.scope == 4 || @item.scope == 6	   @target_window.index = -1	 else	   @target_window.index = 0	 end   # Quando l'obiettivo non sono gli eroi   else	  # Quando c'è un evento comune	  if @item.common_event_id > 0		# Chiama l'evento comune		$game_temp.common_event_id = @item.common_event_id		# Suona SE dell'oggetto		$game_system.se_play(@item.menu_se)		# Se l'oggetto si consuma		if @item.consumable		  # Elimina un oggetto		  $game_party.lose_item(@item.id, 1)		  # Aggiorna la finestra degli oggetti		  @item_window.draw_item(@item_window.index)		end		# Torna alla mappa		$scene = Scene_Map.new		return	  end   end   return endend #--------------------------------------------------------------------------# - Aggiornamento Frame (Quando è attiva la finestra delle armi)#--------------------------------------------------------------------------def update_weapon # Quando B è premuto if Input.trigger?(Input::B)   # Suona SE Annulla   $game_system.se_play($data_system.cancel_se)   # Torna al menu   @command_window.index = @command_window.index   @command_window.active = true   @command_window.visible = true   @weapon_window.active = false   @weapon_window.visible = false   @weapon_window.index = -1   # Cancella il testo d'aiuto   @help_window.set_text("")   @dummy_window.visible = true   return endend  #--------------------------------------------------------------------------# - Aggiornamento Frame (Quando è attiva la finestra delle armature)#--------------------------------------------------------------------------def update_armor # Quando B è premuto if Input.trigger?(Input::B)   # Suona SE Annulla   $game_system.se_play($data_system.cancel_se)   # Torna al menu   @command_window.index = @command_window.index   @command_window.active = true   @command_window.visible = true   @armor_window.active = false   @armor_window.visible = false   @armor_window.index = -1   # Cancella il testo d'aiuto   @help_window.set_text("")   @dummy_window.visible = true   return endend   #--------------------------------------------------------------------------# - Aggiornamento Frame (Quando è attiva la finestra delle armi)#--------------------------------------------------------------------------def update_KeyItem # Quando B è premuto if Input.trigger?(Input::B)   # Suona SE Annulla   $game_system.se_play($data_system.cancel_se)   # Torna al menu   @command_window.index = @command_window.index   @command_window.active = true   @command_window.visible = true   @keyItem_window.active = false   @keyItem_window.visible = false   @keyItem_window.index = -1   @dummy_window.visible = true   # Cancella il testo d'aiuto   @help_window.set_text("")   return endend #--------------------------------------------------------------------------# - Aggiornamento Frame (Quando è attiva la finestra dell'obiettivo)#--------------------------------------------------------------------------def update_target # Quando B è Premuto if Input.trigger?(Input::B)   # Suona SE Annulla   $game_system.se_play($data_system.cancel_se)   # Quando l'oggetto non può essere usato   unless $game_party.item_can_use?(@item.id)	 # Aggiornamento finestra degli oggetti	 @item_window.refresh   end   # Eliminazione finestra dell'obiettivo   @item_window.active = true   @target_window.active = false   @target_window.index = -1   return end # Quando c è premuto if Input.trigger?(Input::C)   # Quando un oggetto è finito   if $game_party.item_number(@item.id) == 0	 # Suona SE Azione Impossibile	 $game_system.se_play($data_system.buzzer_se)	 return   end   # Quando l'obiettivo sono tutti gli eroi   if @target_window.index == -1	 # L'effetto dell'oggetto colpisce tutti gli eroi	 used = false	 for i in $game_party.actors	   used |= i.item_effect(@item)	 end   end   # Quando l'obiettivo è un eroe   if @target_window.index >= 0	 #  L'effetto dell'oggetto colpisce l'eroe selezionato	 target = $game_party.actors[@target_window.index]	 used = target.item_effect(@item)   end   # Quando l'oggetto viene usato   if used	 # Suona SE dell'oggetto	 $game_system.se_play(@item.menu_se)	 # Se l'oggetto si consuma	 if @item.consumable	   # Elimina un oggetto	   $game_party.lose_item(@item.id, 1)	   # Aggiorna la finestra degli oggetti	   @item_window.draw_item(@item_window.index)	 end	 # Aggiorna la finestra dell'obiettivo	 @target_window.refresh	 # Se gli eroi muoiono	 if $game_party.all_dead?	   # Vai al gameover	   $scene = Scene_Gameover.new	   return	 end	 # Se c'è un evento comune	 if @item.common_event_id > 0	   # Chiama l'evento comune	   $game_temp.common_event_id = @item.common_event_id	   # Torna alla mappa	   $scene = Scene_Map.new	   return	 end   end   # Se l'oggetto non è stato usato   unless used	 # Suona SE Azione Impossibile	 $game_system.se_play($data_system.buzzer_se)   end   return endendend

     

    ma così viene un pò lunghino..

    Comunque squall non voglio dividerle per tipo (acqua, fuoco o roba del genere) ma solo in base al loro occasion poi me lo ultimo da solo. Capito? =)

  12. Assì.. scusate mi spiego meglio.

    Gli oggetti qua sono classificati in base al loro occasion ( se possono essere usati in battaglia o meno) e poi in armi e armature.

    A me basta che togliendo la parte armature e armi, funzioni allo stesso modo degli oggetti ma per le magie.

     

    Ripeto ci avevo già provato a cambiarlo ma sbagliavo qualcosa e non funzionava.

     

    Squall: come faccio a postarlo in codice ruby? comunque divide la schermata degli oggetti in due (oggetti e target), in più aggiunge al centro una finestrella dove puoi scegliere il tipo di oggetti da utilizzare (oggetti normali, armi, armature, rari)

     

    MasterSion: più o meno è quello che intendi tu, comunque un pochino me la cavo con gli script, quindi mi basta che qualcuno riesca a sistemarmelo come detto poco fa. Poi il resto me lo modifico io.

     

    Grazie in anticipo!! =) se qualcuno lo fa xD

  13. Io ho uno script per il menu degli oggetti. Avevo già provato a modificarlo ma qualcosa andava storto e non andava.

    Qualcuno può modificare questo script facendolo funzionare per le skill?

     

    #====================
    # Script Scene_Menu divisa per categorie ultima modifica 28/04/2006
    # www.rpgshrine.altervista.org
    # Script by Tio. Special thanks to RagnarokM
    #====================
    
    #=========================================================
    # - Window_Item modificata da RagnarokM
    #------------------------------------------------------------------------------
    # E' la finestra che mostra la lista di oggetti posseduti sullo schermo
    # degli oggetti e della battaglia
    #=========================================================
    class Window_Item < Window_Selectable
    #--------------------------------------------------------------------------
    # - Inizializzazione dell'oggetto
    #--------------------------------------------------------------------------
    def initialize
    super(0, 64, 320, 416)
    self.index = -1
    self.active = false
    self.visible = false
    @column_max = 1
    refresh
    # Durante una finestra si muove al centro dello schermo e diventa
    # translucente
    if $game_temp.in_battle
    self.y = 64
    self.height = 256
    end
    end
    #--------------------------------------------------------------------------
    # - Acquisizione di un oggetto
    #--------------------------------------------------------------------------
    def item
    return @data[self.index]
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def refresh
    if self.contents != nil
    self.contents.dispose
    self.contents = nil
    end
    @data = []
    # Aggiunta di un oggetto
    for i in 1...$data_items.size
    # Controllo se l'oggetto è utilizzabile.
    # Se lo è lo inserisco nela lista degli oggetti che è possibile utilizzare.
    oggetto = $data_items[i]
    if (oggetto.occasion == 0) or (oggetto.occasion == 1) or (oggetto.occasion == 2)
    if $game_party.item_number(i) > 0
    @data.push($data_items[i])
    end
    end
    end
    # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti
    # gli oggetti verranno disegnati
    @item_max = @data.size
    if @item_max > 0
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end
    #--------------------------------------------------------------------------
    # - Disegna un oggetto
    # index : Numero dell'oggetto
    #--------------------------------------------------------------------------
    def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    if item.is_a?(RPG::Item) and
    $game_party.item_can_use?(item.id)
    self.contents.font.color = normal_color
    else
    self.contents.font.color = disabled_color
    end
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    x = 4 + index % 1 * (288 + 32)
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento del testo di aiuto
    #--------------------------------------------------------------------------
    def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
    end
    end
    
    #====================================================
    # - Window_KeyItem Creata da RagnarokM
    #------------------------------------------------------------------------------
    # E' la finestra che mostra la lista di oggetti chiave posseduti nella schermata
    # degli oggetti.
    #====================================================
    class Window_KeyItem < Window_Selectable
    #--------------------------------------------------------------------------
    # - Inizializzazione dell'oggetto
    #--------------------------------------------------------------------------
    def initialize
    super(0, 64, 320, 416)
    @column_max = 1
    self.index = -1
    self.active = false
    self.visible = false
    refresh
    end
    #--------------------------------------------------------------------------
    # - Acquisizione di un oggetto
    #--------------------------------------------------------------------------
    def item
    return @data[self.index]
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def refresh
    if self.contents != nil
    self.contents.dispose
    self.contents = nil
    end
    @data = []
    # Aggiunta di un oggetto
    for i in 1...$data_items.size
    oggetto = $data_items[i]
    # Controllo se l'oggetto è utilizzabile.
    # Se non lo è inserisco nella lista degli oggetti chiave.
    if oggetto.occasion == 3
    if $game_party.item_number(i) > 0
    @data.push($data_items[i])
    end
    end
    end
    # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti
    # gli oggetti verranno disegnati
    @item_max = @data.size
    if @item_max > 0
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end
    #--------------------------------------------------------------------------
    # - Disegna un oggetto
    # index : Numero dell'oggetto
    #--------------------------------------------------------------------------
    def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = disabled_color
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    x = 4 + index % 1 * (288 + 32)
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento del testo di aiuto
    #--------------------------------------------------------------------------
    def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
    end
    end
    #============================================================
    # - Window_Target
    #------------------------------------------------------------------------------
    # E' lo schermo degli oggetti e delle abilità ed è la finestra dalla quale
    # si sceglie il personaggio da usare
    #============================================================
    
    class Window_Target < Window_Selectable
    #--------------------------------------------------------------------------
    # - Inizializzazione dell'oggetto
    #--------------------------------------------------------------------------
    def initialize
    super(0, 0, 320, 416)
    self.index = 0
    self.active = false
    self.z += 10
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    @item_max = $game_party.actors.size
    refresh
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
    x = 4
    y = i * 95
    actor = $game_party.actors[i]
    draw_actor_graphic(actor, x + 10, y + 75)
    draw_actor_name(actor, x, y)
    draw_actor_class(actor, x + 144, y)
    draw_actor_level(actor, x + 20, y + 32)
    draw_actor_state(actor, x + 20, y + 64)
    draw_actor_hp(actor, x + 152, y + 32)
    draw_actor_sp(actor, x + 152, y + 64)
    end
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento del rettangolo del cursore
    #--------------------------------------------------------------------------
    
    def update_cursor_rect
    if @index < 0
    self.cursor_rect.empty
    else
    self.cursor_rect.set(0, @index * 95, self.width - 32, 96)
    end
    end
    end
    
    #================================================================
    # - Window_Weapon
    #------------------------------------------------------------------------------
    # E' la finestra che mostra la lista di oggetti posseduti sullo schermo
    # degli oggetti e della battaglia
    #================================================================
    
    class Window_Weapon < Window_Selectable
    #--------------------------------------------------------------------------
    # - Inizializzazione dell'oggetto
    #--------------------------------------------------------------------------
    def initialize
    super(0, 64, 320, 416)
    self.index = -1
    self.active = false
    self.visible = false
    @column_max = 1
    refresh
    # Durante una finestra si muove al centro dello schermo e diventa
    # translucente
    if $game_temp.in_battle
    self.y = 64
    self.height = 256
    end
    end
    #--------------------------------------------------------------------------
    # - Acquisizione di un oggetto
    #--------------------------------------------------------------------------
    def item
    return @data[self.index]
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def refresh
    if self.contents != nil
    self.contents.dispose
    self.contents = nil
    end
    @data = []
    # Aggiunta di un oggetto
    # Vengono anche aggiunti un'arma e uno scudo se è possibile,
    # eccetto durante una battaglia
    unless $game_temp.in_battle
    for i in 1...$data_weapons.size
    if $game_party.weapon_number(i) > 0
    @data.push($data_weapons[i])
    end
    end
    end
    # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti
    # gli oggetti verranno disegnati
    @item_max = @data.size
    if @item_max > 0
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end
    #--------------------------------------------------------------------------
    # - Disegna un oggetto
    # index : Numero dell'oggetto
    #--------------------------------------------------------------------------
    def draw_item(index)
    item = @data[index]
    number = $game_party.weapon_number(item.id)
    if item.is_a?(RPG::Item) and
    $game_party.item_can_use?(item.id)
    self.contents.font.color = normal_color
    else
    self.contents.font.color = disabled_color
    end
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    x = 4 + index % 1 * (288 + 32)
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento del testo di aiuto
    #--------------------------------------------------------------------------
    def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
    end
    end
    
    #=================================================================
    # - Window_Armor
    #------------------------------------------------------------------------------
    # E' la finestra che mostra la lista di oggetti posseduti sullo schermo
    # degli oggetti e della battaglia
    #=================================================================
    
    class Window_Armor < Window_Selectable
    #--------------------------------------------------------------------------
    # - Inizializzazione dell'oggetto
    #--------------------------------------------------------------------------
    def initialize
    super(0, 64, 320, 416)
    self.index = -1
    self.active = false
    self.visible = false
    @column_max = 1
    refresh
    # Durante una finestra si muove al centro dello schermo e diventa
    # translucente
    if $game_temp.in_battle
    self.y = 64
    self.height = 256
    end
    end
    #--------------------------------------------------------------------------
    # - Acquisizione di un oggetto
    #--------------------------------------------------------------------------
    def item
    return @data[self.index]
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def refresh
    if self.contents != nil
    self.contents.dispose
    self.contents = nil
    end
    @data = []
    # Vengono anche aggiunti un'arma e uno scudo se è possibile,
    # eccetto durante una battaglia
    unless $game_temp.in_battle
    for i in 1...$data_armors.size
    if $game_party.armor_number(i) > 0
    @data.push($data_armors[i])
    end
    end
    end
    # Se il numero degli oggetti è 0, verrà creato un bitmap e tutti
    # gli oggetti verranno disegnati
    @item_max = @data.size
    if @item_max > 0
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max
    draw_item(i)
    end
    end
    end
    #--------------------------------------------------------------------------
    # - Disegna un oggetto
    # index : Numero dell'oggetto
    #--------------------------------------------------------------------------
    def draw_item(index)
    item = @data[index]
    number = $game_party.armor_number(item.id)
    if item.is_a?(RPG::Item) and
    $game_party.item_can_use?(item.id)
    self.contents.font.color = normal_color
    else
    self.contents.font.color = disabled_color
    end
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    x = 4 + index % 1 * (288 + 32)
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento del testo di aiuto
    #--------------------------------------------------------------------------
    def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
    end
    end
    
    #===================================================================
    # - Scene_Item
    #------------------------------------------------------------------------------
    # Scena degli oggetti
    #===================================================================
    
    class Scene_Item
    def initialize(menu_index = 0)
    @menu_index = menu_index
    end
    #--------------------------------------------------------------------------
    # - Processo Principale
    #--------------------------------------------------------------------------
    def main
    s1 = $data_system.words.item
    s2 = "Armi"
    s3 = "Armature"
    s4 = "Rarità"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4,])
    @command_window.index = @menu_index
    @command_window.x = 240
    @command_window.y = 120
    @command_window.index = 0
    @command_window.z = 200
    @command_window.active = true
    
    @dummy_window = Window_Base.new(0, 64, 320, 416)
    
    @weapon_window = Window_Weapon.new
    @armor_window = Window_Armor.new
    @keyItem_window = Window_KeyItem.new
    @item_window = Window_Item.new
    
    
    
    # Creazione finestra d'aiuto
    @help_window = Window_Help.new
    @item_window.help_window = @help_window
    @keyItem_window.help_window = @help_window
    @armor_window.help_window = @help_window
    @weapon_window.help_window = @help_window
    # Creazione finestra dell'obiettivo
    @target_window = Window_Target.new
    @target_window.x = 320
    @target_window.y = 64
    @target_window.index = -1
    
    # Fade
    Graphics.transition
    # Loop Principale
    loop do
    # Aggiornamento Grafica
    Graphics.update
    # Aggiornamento Input
    Input.update
    # Aggiornamento Frame
    update
    # Quando cambia la scena blocca il loop
    if $scene != self
    break
    end
    end
    # Preparazione Fade
    Graphics.freeze
    # Eliminazione Finestre
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @weapon_window.dispose
    @armor_window.dispose
    @keyItem_window.dispose
    @dummy_window.dispose
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento
    #--------------------------------------------------------------------------
    def update
    # Aggiornamento Finestre
    @help_window.update
    @item_window.update
    @target_window.update
    @command_window.update
    @weapon_window.update
    @armor_window.update
    @keyItem_window.update
    if @command_window.active
    update_command
    return
    end
    # Chiama update_item se è attiva la finestra degli oggetti
    if @item_window.active
    update_item
    return
    end
    if @weapon_window.active
    update_weapon
    return
    end
    if @armor_window.active
    update_armor
    return
    end
    if @keyItem_window.active
    update_KeyItem
    return
    end
    # Chiama update_target se è attiva la finestra dell'obiettivo
    if @target_window.active
    update_target
    return
    end
    end
    
    # Quando è attiva la finestra dei comandi
    def update_command
    # Quando B è premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Torna al menu
    @command_window.visible = false
    @command_window.active = false
    $scene = Scene_Menu.new (0)
    return
    end
    # Quando C è premuto
    if Input.trigger?(Input::C)
    @command_window.visible = false
    @command_window.active = false
    # Scelta del comando da eseguire
    case @command_window.index
    when 0 # Oggetti
    # Suona SE Azione
    $game_system.se_play($data_system.decision_se)
    # Vai alla scena degli oggetti
    @item_window.visible = true
    @item_window.active = true
    @item_window.index = 0
    when 1 #Armi
    # Suona SE Azione
    $game_system.se_play($data_system.decision_se)
    @weapon_window.visible = true
    @weapon_window.active = true
    @weapon_window.index = 0
    when 2 # Armature
    # Suona SE Azione
    $game_system.se_play($data_system.decision_se)
    @armor_window.visible = true
    @armor_window.active = true
    @armor_window.index = 0
    when 3 # Rarità
    # Suona SE Azione
    $game_system.se_play($data_system.decision_se)
    @keyItem_window.visible = true
    @keyItem_window.active = true
    @keyItem_window.index = 0
    end
    end
    end
    #--------------------------------------------------------------------------
    # - Aggiornamento Frame (Quando è attiva la finestra degli oggetti)
    #--------------------------------------------------------------------------
    def update_item
    # Quando B è premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Torna al menu
    @command_window.index = @command_window.index
    @command_window.active = true
    @command_window.visible = true
    @item_window.active = false
    @item_window.visible = false
    @item_window.index = -1
    # Cancella il testo d'aiuto
    @help_window.set_text("")
    @dummy_window.visible = true
    return
    end
    # Quando C è premuto
    if Input.trigger?(Input::C)
    # Acquisizione dei dati selezionati
    @item = @item_window.item
    # Quando l'oggetto è un'arma o un'armatura
    unless @item.is_a?(RPG::Item)
    # Suona SE Azione Impossibile
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Quando l'oggetto non può essere usato
    unless $game_party.item_can_use?(@item.id)
    # Suona SE Azione Impossibile
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Suona SE Azione
    $game_system.se_play($data_system.decision_se)
    # Controlla l'obiettivo dell'oggetto
    if @item.scope >= 3
    # La finestra dell'obiettivo viene attivata
    @item_window.active = false
    @target_window.active = true
    # Setta il cursore in base all'obiettivo
    if @item.scope == 4 || @item.scope == 6
    @target_window.index = -1
    else
    @target_window.index = 0
    end
    # Quando l'obiettivo non sono gli eroi
    else
    # Quando c'è un evento comune
    if @item.common_event_id > 0
    # Chiama l'evento comune
    $game_temp.common_event_id = @item.common_event_id
    # Suona SE dell'oggetto
    $game_system.se_play(@item.menu_se)
    # Se l'oggetto si consuma
    if @item.consumable
    # Elimina un oggetto
    $game_party.lose_item(@item.id, 1)
    # Aggiorna la finestra degli oggetti
    @item_window.draw_item(@item_window.index)
    end
    # Torna alla mappa
    $scene = Scene_Map.new
    return
    end
    end
    return
    end
    end
    
    #--------------------------------------------------------------------------
    # - Aggiornamento Frame (Quando è attiva la finestra delle armi)
    #--------------------------------------------------------------------------
    def update_weapon
    # Quando B è premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Torna al menu
    @command_window.index = @command_window.index
    @command_window.active = true
    @command_window.visible = true
    @weapon_window.active = false
    @weapon_window.visible = false
    @weapon_window.index = -1
    # Cancella il testo d'aiuto
    @help_window.set_text("")
    @dummy_window.visible = true
    return
    end
    end
    
    
    #--------------------------------------------------------------------------
    # - Aggiornamento Frame (Quando è attiva la finestra delle armature)
    #--------------------------------------------------------------------------
    def update_armor
    # Quando B è premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Torna al menu
    @command_window.index = @command_window.index
    @command_window.active = true
    @command_window.visible = true
    @armor_window.active = false
    @armor_window.visible = false
    @armor_window.index = -1
    # Cancella il testo d'aiuto
    @help_window.set_text("")
    @dummy_window.visible = true
    return
    end
    end
    
    
    #--------------------------------------------------------------------------
    # - Aggiornamento Frame (Quando è attiva la finestra delle armi)
    #--------------------------------------------------------------------------
    def update_KeyItem
    # Quando B è premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Torna al menu
    @command_window.index = @command_window.index
    @command_window.active = true
    @command_window.visible = true
    @keyItem_window.active = false
    @keyItem_window.visible = false
    @keyItem_window.index = -1
    @dummy_window.visible = true
    # Cancella il testo d'aiuto
    @help_window.set_text("")
    return
    end
    end
    
    #--------------------------------------------------------------------------
    # - Aggiornamento Frame (Quando è attiva la finestra dell'obiettivo)
    #--------------------------------------------------------------------------
    def update_target
    # Quando B è Premuto
    if Input.trigger?(Input::B)
    # Suona SE Annulla
    $game_system.se_play($data_system.cancel_se)
    # Quando l'oggetto non può essere usato
    unless $game_party.item_can_use?(@item.id)
    # Aggiornamento finestra degli oggetti
    @item_window.refresh
    end
    # Eliminazione finestra dell'obiettivo
    @item_window.active = true
    @target_window.active = false
    @target_window.index = -1
    return
    end
    # Quando c è premuto
    if Input.trigger?(Input::C)
    # Quando un oggetto è finito
    if $game_party.item_number(@item.id) == 0
    # Suona SE Azione Impossibile
    $game_system.se_play($data_system.buzzer_se)
    return
    end
    # Quando l'obiettivo sono tutti gli eroi
    if @target_window.index == -1
    # L'effetto dell'oggetto colpisce tutti gli eroi
    used = false
    for i in $game_party.actors
    used |= i.item_effect(@item)
    end
    end
    # Quando l'obiettivo è un eroe
    if @target_window.index >= 0
    # L'effetto dell'oggetto colpisce l'eroe selezionato
    target = $game_party.actors[@target_window.index]
    used = target.item_effect(@item)
    end
    # Quando l'oggetto viene usato
    if used
    # Suona SE dell'oggetto
    $game_system.se_play(@item.menu_se)
    # Se l'oggetto si consuma
    if @item.consumable
    # Elimina un oggetto
    $game_party.lose_item(@item.id, 1)
    # Aggiorna la finestra degli oggetti
    @item_window.draw_item(@item_window.index)
    end
    # Aggiorna la finestra dell'obiettivo
    @target_window.refresh
    # Se gli eroi muoiono
    if $game_party.all_dead?
    # Vai al gameover
    $scene = Scene_Gameover.new
    return
    end
    # Se c'è un evento comune
    if @item.common_event_id > 0
    # Chiama l'evento comune
    $game_temp.common_event_id = @item.common_event_id
    # Torna alla mappa
    $scene = Scene_Map.new
    return
    end
    end
    # Se l'oggetto non è stato usato
    unless used
    # Suona SE Azione Impossibile
    $game_system.se_play($data_system.buzzer_se)
    end
    return
    end
    end
    end

     

     

    Grazieee!!! biggrin.gif

  14. Ok, forse ho capito. In effetti così non arriverà mai nessuno ad aiutarmi xD. Grazie Guardian.

     

    Ora spiego un pochino di cosa si tratta:

    Allora innanzi tutto non è un gran progetto, volevo solo fare un giochino divertente e non molto lungo giusto per imparare e poi buttarsi in un progetto più grande.

     

    Diciamo che molto non ho ancora costruito, però la trama sostanzialmente è questa:

    Il protagonista si ritrova alle prese con una fata che chiederà aiuto, decidendo di aiutarla recluterai persone e partirai per il mondo delle fate. Una fata oppressa dal male ucciderà le proprie compagne per usarle come sacrificio: non solo il mondo fatato è in pericolo, ma anche quello umano anzi, quest'ultimo subisce più conseguenze. Sventato il tentativo di distruggere il magico mondo partirai alla liberazione della terra.

    Per quanto riguarda l'ambientazione, non riguarda di certo gli anni moderni diciamo più o meno il tempo medievale.

    Il sistema di battaglia sarebbe quasi un final fantasy 5, avevo preso uno script che sto finendo di modificare, assieme ai vari menu.

     

    Visto? sembrerebbe proprio un progetto da buttare xD.

    Quel che richiedo non è un bravissimo grafico, ma qualcuno che vuole provare a fare qualcosina; non farà solo il grafico, ma ci aiuteremo su tutto il progetto.

     

    Il nome del progetto è: The fairy world secret. :unsure:

     

    p.s: in seguito metterò screen e più informazioni.

  15. Salve ho iniziato da poco un nuovo progetto per prenderci un pò di più la mano con script, dialoghi e roba del genere, ma di disegnare e pixellare non ne ho proprio voglia!! e anche se ne avessi verrebbe comunque da schifo xD.

    Aspetto compagni! :unsure:

  16. Veramente un bellissimo script, però ho un prolemino xD. Nel gioco che sto creando vorrei che l'arma poi risulti scomponibile.. Si può fare?

     

    jojo dovresti avere tutte le informazioni necessarie xD sennò prova a dirci cosa non riesci a fare =)

  17. Infatti xD, così sarebbe un pò bruttino. Io intendevo chiedere qualche linea di script che richiamasse il nome dell'elemento o il suo ID (poi dal numero riesco a far appariare il nome che voglio), da poterlo mettere in diversi menu tipo status, equip e dove serve. Capito? xD
×
×
  • Create New...