Jump to content
Rpg²S Forum
  • 0

Storia/Dettagli sull'arma


nickk.c
 Share

Question

Ciao a tutti, stavolta chiedo uno script un po' più complicato ahhaha, mi piacerebbe mostrare un testo (possibilmente anche abbastanza lungo, non le 4 righe standard di rpg maker)

quando si usa un'arma come se fosse un oggetto (NON quando viene equipaggiata) in modo tale da mostrare una sorta di "storia dell'arma" o dei dettagli su quell'arma. Ho provato a cercare online ma ho trovato soltanto script che permettono di eseguire un evento comune quando vengono equipaggiate o disequipaggiate le armi.

Spero non sia troppo complicata come cosa, grazie in anticipo!! :smileright:

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hola!

Stavolta ci ho messo un poco di più, ma è stato interessante ;P

Ho imbastito uno scriptino abbastanza semplice sullo stesso schema con cui vengono usati gli oggetti nell'inventario: si apre una scheda laterale con le note dell'arma.

Per la larghezza del testo devi impostare te manualmente il testo di ogni riga come per i messaggi normali.

In caso di modifiche scrivi pure qua nel topic ^^

 

 

 

($imported ||= {})["DAX_NoteArmi"] = true

module DAX_OPZIONI_NOTARMI
  
  TEXT_NO_INFO = "Non ci sono informazioni."

end

#==============================================================================
# ■ Window_MenuWeapInfo 
# Nuova finestra da mostrare con il testo delle note dell'arma
#==============================================================================

class Window_MenuWeapInfo < Window_Selectable
  include DAX_OPZIONI_NOTARMI
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize()
    super(0, 0, window_width, window_height)
    self.visible = false
    @itemToShow = nil
    @text = "-"
    @name = "-"
    refresh
  end

  def window_width
    Graphics.width - 160
  end

  def window_height
    Graphics.height
  end
    
  def refresh
    contents.clear
    draw_weapon_text
  end

  def draw_weapon_text
        draw_item_name(@itemToShow, 4, 0, true, contents_width)       
        draw_horz_line(line_height-8)
        draw_text_ex(4, line_height+8, @text)
  end

  def draw_horz_line(y)
    line_y = y + line_height / 2 - 1
    contents.fill_rect(0, line_y, contents_width, 2, normal_color)
  end
  
  def select_item(item)    
      @itemToShow = item
      @text = item.note.to_s
      @name = item.name.to_s
      if (@text == nil || @text == "")
        @text = TEXT_NO_INFO
      end
      refresh
  end

end

#==============================================================================
# ■ Scene_ItemBase  
# Correzioni alla scena che gestisce il menu oggetti
#==============================================================================

class Scene_ItemBase < Scene_MenuBase

  alias dax_notearmi_start start
  def start
    dax_notearmi_start
    create_weap_window
  end

  def create_weap_window
    @weap_window = Window_MenuWeapInfo.new()
    @weap_window.set_handler(:ok,     method(:on_weap_cancel))
    @weap_window.set_handler(:cancel, method(:on_weap_cancel))
  end
  
  #--------------------------------------------------------------------------
  # * Confirm Item
  #--------------------------------------------------------------------------
  def determine_item
    if item.is_a?(RPG::Weapon) 
      show_item_story
      return
    end
    #original part
    if item.for_friend?
      show_sub_window(@actor_window)
      @actor_window.select_for_item(item)
    else
      use_item
      activate_item_window
    end
  end
  
  def show_item_story
    show_sub_window(@weap_window)    
    @weap_window.select_item(item)
  end
  
  def on_weap_cancel
    hide_sub_window(@weap_window)
  end
    
end


#==============================================================================
# ■ Window_ItemList  
# Correzioni alla finestra che gestisce la lista di oggetti
#==============================================================================

class Window_ItemList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # * Display in Enabled State?
  #--------------------------------------------------------------------------
  def enable?(item)
    if item.is_a?(RPG::Weapon) 
      p "x"
      true
    else
      $game_party.usable?(item)
    end
  end
  
end

 

 

 

prova-script-nota-armi.png

prova-script-nota-armi-2.png

Membro Segreto della
Vecchia Guardia del Making [Gif in fase di reload]


SCContest1Oct.gif
gifnatale1.pnggifnatale12.png

Link to comment
Share on other sites

  • 0

Dax TI AMO xD sei veramente fantastico, grazie mille!!! ora lo provo subito

 

Ho appena provato e come tutti i tuoi script funziona benissimo, non so davvero come ringraziarti!!! :biggrin: :biggrin: :biggrin:

Edited by nickk.c
Link to comment
Share on other sites

  • 0

Perbacco, se esiste per MV una cosa del genere faccio i salti di gioia :0

 

Non dovrebbe essere difficile, preferisco Javascript a Ruby xD

Se riesco provo a replicarlo su MV e ti faccio sapere ;P

 

EDIT: ho aggiunto qua il plugin per MV ;) http://www.rpg2s.net/forum/index.php/topic/22908-la-fabbrica-dei-plugin-di-dax/

Membro Segreto della
Vecchia Guardia del Making [Gif in fase di reload]


SCContest1Oct.gif
gifnatale1.pnggifnatale12.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...