Jump to content
Rpg²S Forum

*Advanced Window_Equip


Amos_MHF
 Share

Recommended Posts

Advanced Window_Equip

Descrizione

Se avete delle armi o delle protezioni che, oltre ad aumentare e diminuire

Attacco, Difesa Fisica e Difesa Magica, forniscono bonus alle statistiche

Forza,Destrezza, Agilità o Intelligenza questo script fa per voi.

Non è bello avere delle armi che modificano quei parametri e non

far notare a chi gioca quell'aumento direttamente dalla finestra

di equipaggiamento, per questo, grazie a questo script che non è altro

che una modifica agli script Window_EquipLeft e Scene_Equip, è possibile

visualizzare, nella finestra di sinistra della scena di equipaggiamento,

le modifiche alle statistiche Forza, Destrezza, Agilità e Intelligenza.

Se non avete capito, osservate lo screen XD.

 

Autore

Amos_MHF

 

Allegati

Screenshots:

 

Istruzioni per l'uso

Non dovete fare altro che posizionare questo script sopra il Main e il gioco sarà fatto!

 

Script

 

#==============================================================================
# ** Advanced Window_Equip
#------------------------------------------------------------------------------
#  Autore: Amos_MHF
#  Versione: 1.0
#  Data di rilascio: 13/07/2008
#------------------------------------------------------------------------------
#  Descrizione:
#	Se avete delle armi o delle protezioni che, oltre ad aumentare e diminuire
#	Attacco, Difesa Fisica e Difesa Magica, forniscono bonus alle statistiche
#	Forza,Destrezza, Agilità o Intelligenza questo script fa per voi.
#	Non è bello avere delle armi che modificano quei parametri e non
#	far notare a chi gioca quell'aumento direttamente dalla finestra
#	di equipaggiamento, per questo, grazie a questo script che non è altro
#	che una modifica agli script Window_EquipLeft e Scene_Equip, è possibile
#	visualizzare, nella finestra di sinistra della scena di equipaggiamento,
#	le modifiche alle statistiche Forza, Destrezza, Agilità e Intelligenza.
#------------------------------------------------------------------------------
#  Istruzioni:
#	Non dovete fare altro che posizionare questo script sopra il Main e il
#	gioco sarà fatto!
#==============================================================================

#==============================================================================
# ** Window_EquipLeft
#------------------------------------------------------------------------------
#  This window displays actor parameter changes on the equipment screen.
#==============================================================================

class Window_EquipLeft < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #	 actor : actor
 #--------------------------------------------------------------------------
 def initialize(actor)
super(0, 64, 272, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 180, 0)
draw_actor_parameter(@actor, 4, 32, 0)
draw_actor_parameter(@actor, 4, 49, 1)
draw_actor_parameter(@actor, 4, 66, 2)
draw_actor_parameter(@actor, 4, 83, 3)
draw_actor_parameter(@actor, 4, 100, 4)
draw_actor_parameter(@actor, 4, 116, 5)
draw_actor_parameter(@actor, 4, 132, 6)
if @new_atk != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 32, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 32, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 49, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 49, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 66, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 66, 36, 32, @new_mdef.to_s, 2)
end
if @new_str_plus != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 83, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 83, 36, 32, @new_str_plus.to_s, 2)
end
if @new_dex_plus != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 100, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 100, 36, 32, @new_dex_plus.to_s, 2)
end
if @new_agi_plus != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 116, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 116, 36, 32, @new_agi_plus.to_s, 2)
end
if @new_int_plus != nil
  self.contents.font.color = system_color
  self.contents.draw_text(160, 132, 40, 32, "->", 1)
  self.contents.font.color = normal_color
  self.contents.draw_text(200, 132, 36, 32, @new_int_plus.to_s, 2)
end
 end
 #--------------------------------------------------------------------------
 # * Set parameters after changing equipment
 #	 new_atk  : attack power after changing equipment
 #	 new_pdef : physical defense after changing equipment
 #	 new_mdef : magic defense after changing equipment
 #--------------------------------------------------------------------------
 def set_new_parameters(new_atk, new_pdef, new_mdef, new_str_plus, new_dex_plus, new_agi_plus, new_int_plus)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str_plus != new_str_plus or @new_dex_plus != new_dex_plus or @new_agi_plus != new_agi_plus or @new_int_plus != new_int_plus
  @new_atk = new_atk
  @new_pdef = new_pdef
  @new_mdef = new_mdef
  @new_str_plus = new_str_plus
  @new_dex_plus = new_dex_plus
  @new_agi_plus = new_agi_plus
  @new_int_plus = new_int_plus
  refresh
end
 end
end

#==============================================================================
# ** Scene_Equip
#------------------------------------------------------------------------------
#  This class performs equipment screen processing.
#==============================================================================

class Scene_Equip
 #--------------------------------------------------------------------------
 # * Object Initialization
 #	 actor_index : actor index
 #	 equip_index : equipment index
 #--------------------------------------------------------------------------
 def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
 end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make windows
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
# Associate help window
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# Set cursor position
@right_window.index = @equip_index
refresh
# Execute transition
@spriteset = Spriteset_Map.new
@background = RPG::Sprite.new
@background.bitmap = Bitmap.new(640,480)
@background.bitmap.fill_rect(@background.bitmap.rect,Color.new(0,0,0,120))
Graphics.transition
# Main loop
loop do
  # Update game screen
  Graphics.update
  # Update input information
  Input.update
  # Frame update
  update
  # Abort loop if screen is changed
  if $scene != self
	break
  end
end
# Prepare for transition
Graphics.freeze
@spriteset.dispose 
@background.dispose
# Dispose of windows
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
# Set item window to visible
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
# Get currently equipped item
item1 = @right_window.item
# Set current item window to @item_window
case @right_window.index
when 0
  @item_window = @item_window1
when 1
  @item_window = @item_window2
when 2
  @item_window = @item_window3
when 3
  @item_window = @item_window4
when 4
  @item_window = @item_window5
end
# If right window is active
if @right_window.active
  # Erase parameters for after equipment change
  @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
# If item window is active
if @item_window.active
  # Get currently selected item
  item2 = @item_window.item
  # Change equipment
  last_hp = @actor.hp
  last_sp = @actor.sp
  @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
  # Get parameters for after equipment change
  new_atk = @actor.atk
  new_pdef = @actor.pdef
  new_mdef = @actor.mdef
  new_str_plus = @actor.str
  new_dex_plus = @actor.dex
  new_agi_plus = @actor.agi
  new_int_plus = @actor.int
  # Return equipment
  @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
  @actor.hp = last_hp
  @actor.sp = last_sp
  # Draw in left window
  @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str_plus, new_dex_plus, new_agi_plus, new_int_plus)
end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
# Update windows
@left_window.update
@right_window.update
@item_window.update
refresh
# If right window is active: call update_right
if @right_window.active
  update_right
  return
end
# If item window is active: call update_item
if @item_window.active
  update_item
  return
end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when right window is active)
 #--------------------------------------------------------------------------
 def update_right
# If B button was pressed
if Input.trigger?(Input::B)
  # Play cancel SE
  $game_system.se_play($data_system.cancel_se)
  # Switch to menu screen
  $scene = Scene_Menu.new(2)
  return
end
# If C button was pressed
if Input.trigger?(Input::C)
  # If equipment is fixed
  if @actor.equip_fix?(@right_window.index)
	# Play buzzer SE
	$game_system.se_play($data_system.buzzer_se)
	return
  end
  # Play decision SE
  $game_system.se_play($data_system.decision_se)
  # Activate item window
  @right_window.active = false
  @item_window.active = true
  @item_window.index = 0
  return
end
# If R button was pressed
if Input.trigger?(Input::R)
  # Play cursor SE
  $game_system.se_play($data_system.cursor_se)
  # To next actor
  @actor_index += 1
  @actor_index %= $game_party.actors.size
  # Switch to different equipment screen
  $scene = Scene_Equip.new(@actor_index, @right_window.index)
  return
end
# If L button was pressed
if Input.trigger?(Input::L)
  # Play cursor SE
  $game_system.se_play($data_system.cursor_se)
  # To previous actor
  @actor_index += $game_party.actors.size - 1
  @actor_index %= $game_party.actors.size
  # Switch to different equipment screen
  $scene = Scene_Equip.new(@actor_index, @right_window.index)
  return
end
 end
 #--------------------------------------------------------------------------
 # * Frame Update (when item window is active)
 #--------------------------------------------------------------------------
 def update_item
# If B button was pressed
if Input.trigger?(Input::B)
  # Play cancel SE
  $game_system.se_play($data_system.cancel_se)
  # Activate right window
  @right_window.active = true
  @item_window.active = false
  @item_window.index = -1
  return
end
# If C button was pressed
if Input.trigger?(Input::C)
  # Play equip SE
  $game_system.se_play($data_system.equip_se)
  # Get currently selected data on the item window
  item = @item_window.item
  # Change equipment
  @actor.equip(@right_window.index, item == nil ? 0 : item.id)
  # Activate right window
  @right_window.active = true
  @item_window.active = false
  @item_window.index = -1
  # Remake right window and item window contents
  @right_window.refresh
  @item_window.refresh
  return
end
 end
end

 

 

Bugs e Conflitti Noti

N/A

Edited by Amos_MHF

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Oromis' Tale

Premi Rpg2s.net Game Contest 2008/2009:
http://www.rpg2s.net/gif/GC_programmazione2.gif Miglior Programmazione XP: 2°
http://www.rpg2s.net/gif/GC_premio3.gif Longevità: 3°

Hiken... Tsubame Gaeshi!

Link to comment
Share on other sites

  • 2 weeks later...
Molto utile,bravo! :) Lo userò sicuramente! :sisi:

I miei tutorial
BS in tempo reale ad eventi
Tecnica Ruba
Pesca ad eventi
Evocare
Lancio del masso
Minigioco del Negozio

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Factions

http://img252.imageshack.us/img252/8742/bannerinoteamlrmiu6.png
 

http://img393.imageshack.us/img393/9920/legenrpgmaniamu3.gif
Forum:The legend of making

 

 

26373462 I love you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Mai Dire Speciale Cinema
L'Uomo che Usciva Tutti
Botte e Risposte / Rapine a mano a mano
Mobbasta
Mobbasta veramente per�
Mani in Alto
Per un pelo
Giammangiato
Anche no / Il buio / Ahia
Burle
Acqua Corrente / Urgenze

LegendRpgMania

Il 70% dei ragazzi pensa che GTA sia il miglior gioco del mondo. Il restante 30% pensa che Kingdom Hearts sia il gioco pi� bello. Se fai parte di questo 30% copia e incolla questa frase nella tua firma/blog.

MITICO OBSIDIAN LORD!!!
The March of The Swordmaster
Holy Thunderforce
Bard's Song

TALES OF MAGIC
Entra nella scuola di magia e diventa il mago pi� grande del mondo!

Tales of Magic � completamente gratuito e senza alcun obbligo! Il manuale ti fornir� informazioni sulle modalit� di funzionamento del gioco.
LINK DEL GIOCO

Bunnies Area
Bunnies Can't Phone
Bunnies Can't play 360
Bunnies Can't play Rugby
Bunnies Can't win races
Bunnies Can't Cook Eggs
Bunnies Can't cook turkey
Bunnies Can't Date
Bunnies Can't Park
Bunnies Can't play with Fireworks


Mi conoscete???
Se s� cliccate qui

 



Epitaffi:
1)E' diventato carne secca...
2)Giocava a buttarsi gi� dal castello...
3)Stava abbracciando una bomba a mano...
4)Gli piaceva bere nitroglicerina...
5)Ha ingoiato un candelotto di dinamite...
6)Ha effettuato il salto in lungo nel cratere di un vulcano...
7)Quando i suoi compagni di classe giocavano a calcio lui era la palla...



________________________________________________________________________________
A prescindere dal colore della pelle e dalla religione siamo tutti uguali e tutti abbiamo ugal diritto di vivere. Credi la scuola sia una seccatura? Un'imposizione dei genitori? Sai quanto darebbero questi bambini per avere un'istruzione? Invece loro ed i loro genitori vengono sfruttati nelle industrie delle pi� note multinazionali americane ed europee: Nike, Nestl�, Kraft...
Se sei anche tu contro il razzismo e contro lo sfruttamento inserisci questa frase nella tua firma.
________________________________________________________________________________
Now Playing:
PS3 : Soul Calibur 4
PS2 : Kingdom Hearts Re Chain of Memories
DS : Final Fantasy IV / Final Fantasy XII : Revenant Wings / Spore Creatures / Dinosaur King
PSP : Ratchet and Clank : Size Matters / Secret Agent Clank / Naruto Ultimate Ninja Heroes 2 / GuitarWay To Heaven 4 Amplified
PC : Frets on Fire con la chitarra!!! O_O

Rpg Maker Xp

I miei progetti:

Per ora nulla...

http://team.ffonline.it/imgpersonaggio/cloud_it.jpg
http://img230.imageshack.us/img230/608/pencehaynerroxasolettejyt1.th.jpg
http://r3.fodey.com/15d01c4c6f2dd4908b320f697f7fbe7bd.1.gif


http://img801.mytextgraphics.com/flamewordmaker/2008/03/28/2554b85201dbda32d87d5873d964a4fd.gif

 

 

Link to comment
Share on other sites

Beh, grazie.

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Oromis' Tale

Premi Rpg2s.net Game Contest 2008/2009:
http://www.rpg2s.net/gif/GC_programmazione2.gif Miglior Programmazione XP: 2°
http://www.rpg2s.net/gif/GC_premio3.gif Longevità: 3°

Hiken... Tsubame Gaeshi!

Link to comment
Share on other sites

  • 2 weeks later...
  • 8 months later...

Davvero Molto bello!! Utilissimo! Volevo tuttavia segnalare un piccolo bug: se sulla mappa in cui viene aperto il menù c'è una picture, questa appare in primo piano anche sulla pagina dell'equipaggiamento... Spero che questa mia segnalazione sia stata gradita.

A presto!

Mio nonno ha il pallino della boccia...è da 3 mesi che la bocciofila gli chiede di restituirglielo
Link to comment
Share on other sites

Davvero Molto bello!! Utilissimo! Volevo tuttavia segnalare un piccolo bug: se sulla mappa in cui viene aperto il menù c'è una picture, questa appare in primo piano anche sulla pagina dell'equipaggiamento... Spero che questa mia segnalazione sia stata gradita.

A presto!

Non è un bug dello script, ma è dovuto ad altri script, come ad esempio le SDK.

Basta modificare le coordinate z del viewport delle pictures (io ho fatto così nel mio gioco, utilizzando le SDK) e il gioco è fatto.

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Oromis' Tale

Premi Rpg2s.net Game Contest 2008/2009:
http://www.rpg2s.net/gif/GC_programmazione2.gif Miglior Programmazione XP: 2°
http://www.rpg2s.net/gif/GC_premio3.gif Longevità: 3°

Hiken... Tsubame Gaeshi!

Link to comment
Share on other sites

Ah, ok!! ^^ scusa se ho dubitato!!

Sinceramente devo ammettere, però, che non ho capito molto della tua spiegazione... non so esattamente dove andare a toccarer per eliminare il problemino...

Mio nonno ha il pallino della boccia...è da 3 mesi che la bocciofila gli chiede di restituirglielo
Link to comment
Share on other sites

Usi l'SDK? Se sì, dimmi la versione.

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Oromis' Tale

Premi Rpg2s.net Game Contest 2008/2009:
http://www.rpg2s.net/gif/GC_programmazione2.gif Miglior Programmazione XP: 2°
http://www.rpg2s.net/gif/GC_premio3.gif Longevità: 3°

Hiken... Tsubame Gaeshi!

Link to comment
Share on other sites

Scusami, sono davvero ignorantissimo!! Faccio ammenda... ma non conosco l'acronimo che hai usato... Per cosa sta SDK?? Comuque ho provato il tuo script in un progetto in cui ho messo altri sript, uno dei quali un sistema che permette di ordinare i personaggi dal menù, ho pensato potesse essere in questo script la risposta al problema, ma invero non capisco molto di RGSS.
Mio nonno ha il pallino della boccia...è da 3 mesi che la bocciofila gli chiede di restituirglielo
Link to comment
Share on other sites

SDK è Standard Developement Kit, ovvero uno script che ti permette di aumentare la compatibilità con altri script.

In ogni caso, se lo script lo metti in un nuovo progetto e lo scherzo delle pictures non lo fa, è sicuramente un altro script.

Partecipante al Rpg2s.net Game Contest 2008/2009
http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg
Gioco in Sviluppo: Oromis' Tale

Premi Rpg2s.net Game Contest 2008/2009:
http://www.rpg2s.net/gif/GC_programmazione2.gif Miglior Programmazione XP: 2°
http://www.rpg2s.net/gif/GC_premio3.gif Longevità: 3°

Hiken... Tsubame Gaeshi!

Link to comment
Share on other sites

Grazie mille per le risposte e per la pazienza sopratutto!!! :rovatfl: cercherò questo SDK di cui mi hai parlato! sono curiosissimo di provarlo!! Qui sul sito non lo sto trovando, senz'altro c'è, sono io che sono impedito!!

Grazie ancora, a presto!!

Mio nonno ha il pallino della boccia...è da 3 mesi che la bocciofila gli chiede di restituirglielo
Link to comment
Share on other sites

  • 3 months later...

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