Jump to content
Rpg²S Forum

Valentino

Utenti
  • Posts

    463
  • Joined

  • Last visited

Posts posted by Valentino

  1. Cancella tutto quello che ti ho passato prima e sostituiscilo con:

     

     

     

    class Window_Command < Window_Selectable  def command	return @commands[index]  endend  class Scene_Lotta  def main	comandi = ["Pugno","Suplex","Dropkick","Irish whip"]	comandi.unshift("Calcio") if $game_actors[1].sp == $game_actors[1].maxsp	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @window_hud.dispose  end def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.command		when "Calcio"		  $game_variables[4] +=  5		  when "Pugno"		  $game_variables[1] += 3		when "Suplex" 		  $game_variables[1] += 20		when "Dropkick"			$game_variables[1] += 15		  when "Irish whip"		  $game_variables[1] += 5		  end	 $game_system.se_play($data_system.decision_se)		$game_map.need_refresh = true		   $scene = Scene_Map.new	 end   end end

     

  2. si al posto di TOT_MP devi mettere un valore XD

     

    Comunque cosi facendo hai messo che se gli sp massimi dell'eroe sono maggiori dei suoi sp, allora si visualizza la tecnica calcio... QUindi SEMPRE XDXD

     

    Forse volevi mettere il contario :Ok:

     

    Comunque se fai cosi allora è inutile introdurre una 3a variabile, basta usare direttamente quelle degli sp ^^

  3. Beh se devi mettere gli sp massimi metti al posto di:

    $game_actors[iD_EROE].sp

     

    questo:

     

    $game_actors[iD_EROE].maxsp

     

    Cosi:

     

     

     

    class Window_Command < Window_Selectable  def command	return @commands[index]  endend class Game_Systemattr_accessor :calcio  alias calcio_initialize initialize  def initialize	calcio_initialize	@calcio = 0  endend  class Scene_Lotta  def main		 $game_system.calcio = $game_actors[ID_EROE].maxsp	comandi = ["Pugno","Suplex","Dropkick","Irish whip"]	comandi.unshift("Calcio") if $game_system.calcio > TOT_MP	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @window_hud.dispose  end def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.command		when "Calcio"		  $game_variables[4] +=  5		  when "Pugno"		  $game_variables[1] += 3		when "Suplex" 		  $game_variables[1] += 20		when "Dropkick"			$game_variables[1] += 15		  when "Irish whip"		  $game_variables[1] += 5		  end	 $game_system.se_play($data_system.decision_se)		$game_map.need_refresh = true		   $scene = Scene_Map.new	 end   end end

     

  4. Sto cercando di capire come funziona guardando window command, selectable e scene menu ma ancora non mi è ben chiaro, ti posto il codice per intero:

     

    #------------------------------------------------------------------------------##1)Scena del menù															  #				#------------------------------------------------------------------------------#class Scene_Menu1  def initialize#Il ciclo for crea un array all'interno del quale si collocano le istanze della #classe Window_Eroe		for i in 0...$game_party.actors.size		#Creazione array	  @eroe = []		#Assegnazione istanze di classi 	  @eroe[i]=Window_Eroe.new(i)	end	  # Make command window	s1 = "004-Weapon04"	s2 = "004-Weapon04"	s3 = "004-Weapon04"	s4 = "004-Weapon04"	s5 = "004-Weapon04"	s6 = "004-Weapon04"	@command_window = Window_Commandi_or.new(60, [s1, s2, s3, s4, s5, s6])	@command_window.index = 0	# If number of party members is 0	if $game_party.actors.size == 0	  # Disable items, skills, equipment, and status	  @command_window.disable_item(0)	  @command_window.disable_item(1)	  @command_window.disable_item(2)	  @command_window.disable_item(3)	end	@command_window.active = true		  #Scongela una scena	Graphics.transition	  #Aggiorna il contenuto	loop do	  Graphics.update	  Input.update	  update	  if $scene != self		break	  end	end	  #Congela la scena	Graphics.freeze   end   def update	 @command_window.update endend #------------------------------------------------------------------------------##2)Finestre degli eroi														 ##------------------------------------------------------------------------------# class Window_Eroe < Window_Base  def initialize(n)#inizializzazione della variabile da usare per deeterminare la posizione del party  	@n = n	#settaggio dimensioni della finestra super(posiz. X, posiz. Y, largh.,alt.)	  # per la cordinata x: calcola il resto di 2 dall'actor_id e lo moltiplica per 320,		  # per es 0%2=0; 1%2=1; 2%2=0; 3%2=1	super (n % 2 * 320, (n / 2) % 2 * 210,320,210)	  #creazione bitmap	self.contents = Bitmap.new(width - 32,height - 32)	  #formattazione testo	  self.contents.font.name = "AR BERKLEY"	  self.contents.font.size = 28	testo	self.contents.font.name = "Times New Roman"  	self.contents.font.size = 14	parametri	grafica_eroe  end   def testo	  #pulire la finestra	self.contents.clear#La variabile @actor assume l'id dell'eroe che occupa la posizione del party#corrispondente alla finestra su cui si deve scrivere 	@actor = $game_party.actors[@n]	draw_actor_name(@actor, 190, 0)  end   def draw_actor_parameter_personale(actor, x, y, type)	case type	when 0	  bitmap = RPG::Cache.icon("004-Weapon04")	  parameter_value = actor.atk	when 1	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.pdef	when 2	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.mdef	when 3	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.str	when 4	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.dex	when 5	  bitmap = RPG::Cache.icon("020-Accessory05")	  parameter_value = actor.agi	when 6	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.int	end	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))	self.contents.font.color = normal_color	self.contents.draw_text(x + 48, y, 36, 32, parameter_value.to_s, 2)  end   def parametri	draw_actor_parameter_personale(@actor, 0, 70, 0)	draw_actor_parameter_personale(@actor, 100, 70, 1)	draw_actor_parameter_personale(@actor, 100, 94, 2)	draw_actor_parameter_personale(@actor, 0, 94, 3)	draw_actor_parameter_personale(@actor, 0, 119, 4)	draw_actor_parameter_personale(@actor, 100, 119, 5)	draw_actor_parameter_personale(@actor, 0, 144, 6)   end    def grafica_eroe	draw_actor_graphic(@actor, 32, 55)  endend class Window_Commandi_or < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #	 width	: window width  #	 commands : command text string array  #--------------------------------------------------------------------------  def initialize(height, commands)	# Compute window height from command quantity	super(0, 420, commands.size * 64 + 32, height)	@item_max = commands.size	@commands = commands	@column_max = @commands.size	self.contents = Bitmap.new(@item_max * 64, height - 32)	refresh	self.index = 0  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh	self.contents.clear	for i in 0...@item_max	  draw_item(i)	end  end  #--------------------------------------------------------------------------  # * Draw Item  #	 index : item number  #	 color : text color  #--------------------------------------------------------------------------  def draw_item(index)	bitmap = RPG::Cache.icon(@commands[index])	self.contents.blt(64 * index, 0, bitmap, Rect.new(0, 0, 24, 24))  end  #--------------------------------------------------------------------------  # * Disable Item  #	 index : item number  #--------------------------------------------------------------------------  def disable_item(index)	draw_item(index, disabled_color)  endend

     

     

    Al rigo 49 ho inserito @command_window.update, come c'è in scene menu, ma non capisco a quale upfate fa riferimento questo comando, in window_command non c'è un def update.... ummm ci devo lavorare ancora n po' su

     

    Fa riferimento alla superclasse che è la Window_Selectable, l'update è li ^^

  5. Wa!! XD sicuro l'errore c'era, ma comunque aggiustando non cambia la situazione

     

    Adesso ho provato a farla.. XD

    allora aggiungi nel def initialize

    @column_max = @commands.size

     

    poi sostituisci

    self.contents = Bitmap.new(@item_max * 32, height - 32)

     

    con

    self.contents = Bitmap.new(@item_max * 64, height - 32)

     

    e anche nel draw_item e nel Rect

    metti un *64 e aumenta ancora qualcora le scritte si sovvrasrivessero ^^

  6. Quando riesco a trovare un po' di tempo cerco di andare avanti con il laboratorio ^^

     

    Ho cercato di fare due cose:

    1 mostrare icone invece di ATK ecc., direi che ci sono, bisogna solo trovare le icone giuste ^^

    2 Volevo passare al menù sottostante ed ecco che incontro i problemi:

    2.1 (^^) deve essere orizzontale, a scorrimento orizzontale

    2.2 tutte le scritte non ci stanno -> bisogna usare icona e anche qui. (lasciando stare quali icone che poi si trovano o si fanno )

     

    Intanto ho incontrato sempre gli stessi problemi che davvero non mi so spiegare, il fatto che con main non va ma con initialize si

    poi per questo tratto

    for i in 0...$game_party.actor.size	  @eroe[i].dispose	end

    mi dice 'actor' metodo non definito

    Ah, altra cosa d'improvviso sono scomparsi i nomi anche se non ho toccato niente lì, boh per ora fa niente

     

    Cancellando queste parti per fare delle prove alla fine sono arrivato a questo:

    http://img32.imageshack.us/img32/269/immaginesf.png

     

    Con questo tratto di codice mostro le icone:

     def draw_actor_parameter_personale(actor, x, y, type)	case type	when 0	  bitmap = RPG::Cache.icon("004-Weapon04")	  parameter_value = actor.atk	when 1	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.pdef	when 2	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.mdef	when 3	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.str	when 4	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.dex	when 5	  bitmap = RPG::Cache.icon("020-Accessory05")	  parameter_value = actor.agi	when 6	  bitmap = RPG::Cache.icon("009-Shield01")	  parameter_value = actor.int	end	self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))	self.contents.font.color = normal_color	self.contents.draw_text(x + 48, y, 36, 32, parameter_value.to_s, 2)  end   def parametri	draw_actor_parameter_personale(@actor, 0, 70, 0)	draw_actor_parameter_personale(@actor, 100, 70, 1)	draw_actor_parameter_personale(@actor, 100, 94, 2)	draw_actor_parameter_personale(@actor, 0, 94, 3)	draw_actor_parameter_personale(@actor, 0, 119, 4)	draw_actor_parameter_personale(@actor, 100, 119, 5)	draw_actor_parameter_personale(@actor, 0, 144, 6)   end

     

    Mentre poi sto aggiungendo questa classe, un window comandi Orizzontale cerco di fare il menù orizzontale ad icone

    class Window_Commandi_or < Window_Selectable  #--------------------------------------------------------------------------  # * Object Initialization  #	 width	: window width  #	 commands : command text string array  #--------------------------------------------------------------------------  def initialize(height, commands)	# Compute window height from command quantity	super(0, 420, commands.size * 64 + 32, height)	@item_max = commands.size	@commands = commands	self.contents = Bitmap.new(@item_max * 32, height - 32)	refresh	self.index = 0  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh	self.contents.clear	for i in 0...@item_max	  draw_item(i)	end  end  #--------------------------------------------------------------------------  # * Draw Item  #	 index : item number  #	 color : text color  #--------------------------------------------------------------------------  def draw_item(index)	bitmap = RPG::Cache.icon(@commands[index])	self.contents.blt(0, 32 * index, bitmap, Rect.new(0, 0, 24, 24))  end  #--------------------------------------------------------------------------  # * Disable Item  #	 index : item number  #--------------------------------------------------------------------------  def disable_item(index)	draw_item(index, disabled_color)  endend

    Che richiamo in questo modo nel Main\initialize:

     # Make command window	s1 = "004-Weapon04"	s2 = "004-Weapon04"	s3 = "004-Weapon04"	s4 = "004-Weapon04"	s5 = "004-Weapon04"	s6 = "004-Weapon04"	@command_window = Window_Commandi_or.new(60, [s1, s2, s3, s4, s5, s6])	@command_window.index = 0	# If number of party members is 0	if $game_party.actors.size == 0	  # Disable items, skills, equipment, and status	  @command_window.disable_item(0)	  @command_window.disable_item(1)	  @command_window.disable_item(2)	  @command_window.disable_item(3)	end

     

    Il risultato lo vedete, e non va bene, sapete darmi qualche dritta?

    Lo scorrimento orizzontale non l'ho ancora provato a fare, mi sa dovrò fare una nuova window_selectable, ma già così le icone non si mostrano.

    Se c'è bisogno di qualche chiarimento in più ditemelo.

     

    Devi modificare le cordinate del draw_item... XD

    self.contents.blt(0, 32 * index, bitmap, Rect.new(0, 0, 24, 24))

     

    Cosi si svilupperanno solo in verticale, invece prova settando

    self.contents.blt(32*index, 0, bitmap, Rect.new(0, 0, 24, 24))

     

    È una modifica veloce quindi non ti garantisco funzioni

  7. Credo che basti fare cosi:

     

     

    class Window_Command < Window_Selectable  def command	return @commands[index]  endend class Game_Systemattr_accessor :calcio  alias calcio_initialize initialize  def initialize	calcio_initialize	@calcio = 0  endend  class Scene_Lotta  def main		 $game_system.calcio = $game_actors[ID_EROE].sp	comandi = ["Pugno","Suplex","Dropkick","Irish whip"]	comandi.unshift("Calcio") if $game_system.calcio > TOT_MP	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @window_hud.dispose  end def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.command		when "Calcio"		  $game_variables[4] +=  5		  when "Pugno"		  $game_variables[1] += 3		when "Suplex" 		  $game_variables[1] += 20		when "Dropkick"			$game_variables[1] += 15		  when "Irish whip"		  $game_variables[1] += 5		  end	 $game_system.se_play($data_system.decision_se)		$game_map.need_refresh = true		   $scene = Scene_Map.new	 end   end end

     

     

    Dove ID_EROE è l'id dell eroe (Beh si capiva XD) e TOT_MP è la quantità di mp "richiesti"

  8. Ecco, ho creato una versione un po meno intricata, e con la possibilita di tenere salvata l'opzione di calcio true o false (cioe se si salva la partita e calcio è su true, se si carica sarà ancora su true)

     

    class Window_Command < Window_Selectable  def command	return @commands[index]  endend class Game_Systemattr_accessor :calcio  alias calcio_initialize initialize  def initialize	calcio_initialize	@calcio = false  endend  class Scene_Lotta  def main	comandi = ["Pugno","Suplex","Dropkick","Irish whip"]	comandi.unshift("Calcio") if $game_system.calcio	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @window_hud.dispose  end def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.command		when "Calcio"		  $game_variables[4] +=  5		  when "Pugno"		  $game_variables[1] += 3		when "Suplex" 		  $game_variables[1] += 20		when "Dropkick"			$game_variables[1] += 15		  when "Irish whip"		  $game_variables[1] += 5		  end	 $game_system.se_play($data_system.decision_se)		$game_map.need_refresh = true		   $scene = Scene_Map.new	 end   end end

     

     

    il comando per attivare o disattivare il calcio è:

    $game_system.calcio = true/false

     

    Spero vada bene ^^

     

    Comunque per il calcio aumenti una variabile diversa, la n°4 hai fatto apposta o nhai messo per sbaglio? XD

  9. Quindi come risolvo >.<

     

    class Scene_Lotta   def main	comandi = (["Pugno", "Suplex", "Dropkick", "Irish whip"])	comandi.unshift ("Calcio") if $calcio == true	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@spriteset = Spriteset_Map.new	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @window_hud.dispose  @select_window.dispose  end def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.index	  		when 0		  if $calcio == false		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 3		  $game_map.need_refresh = true			  $scene = Scene_Map.new		else 		  $game_system.se_play($data_system.decision_se)		  $game_variables[4] += 5		  $game_map.need_refresh = true			  $scene = Scene_Map.new		end		return		  when 1		  if $calcio == false		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 20		  $game_map.need_refresh = true			$scene = Scene_Map.new			  else 		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 3		  $game_map.need_refresh = true			  $scene = Scene_Map.new		end		return			when 2  			  if $calcio == false			$game_system.se_play($data_system.decision_se)			$game_variables[1] += 15			$game_map.need_refresh = true			  $scene = Scene_Map.new  			else 		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 20		  $game_map.need_refresh = true			$scene = Scene_Map.new		  end		  return			  when 3				if $calcio == false				$game_system.se_play($data_system.decision_se)			  $game_variables[1] += 5				$game_map.need_refresh = true				$scene = Scene_Map.new			  else 			$game_system.se_play($data_system.decision_se)			$game_variables[1] += 15			$game_map.need_refresh = true			$scene = Scene_Map.new  		  end		  return		  when 4				 $game_system.se_play($data_system.decision_se)			  $game_variables[1] += 5				$game_map.need_refresh = true				$scene = Scene_Map.new				return		   end		end	 end   end

     

    Modifica fatta velocemente...

    Da evento adesso prova a scrivere $calcio = true e vedere va..

  10. No no aspetta XD Solo per le condizioni ce il doppio uguale

    Per assegnare un valore è solo uno! Quindi all inizio della scena è calcio = false

    E comunque quella che consideri è una variabile che appartiene alla classe in quella maniera non la puoi richiamare tramite eventi, devi renderla globale.

    Comunque anche se la rendi globale, se la inizializzi come false ogni volta che aprirai la scena sarà sempre settata su false XD

  11. Salve a tutti,oggi mi sono ritrovato davanti il seguente problema:

     

    Ho creato una scena da zero,dove un comando dovrebbe sbloccarsi in base ad una variabile(non di gioco),però quando risulta "false" la scena non entra in atto...Ora la uppo per facilitare la comprensione e capire dov'è l'errore :)

     

     

    class Scene_Lotta   def main 	@calcio = false	comandi = (["Pugno", "Suplex", "Dropkick", "Irish whip"])	comandi.unshift ("Calcio") if @calcio = true	@select_window = Window_Command.new(192, comandi)	@select_window.x = 0	@select_window.y = 100	@select_window.opacity = 255	@spriteset = Spriteset_Map.new	@window_hud = Window_HUD.new	@window_hud.opacity = 255  	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break   	end  end  Graphics.freeze  @window_hud.dispose  @select_window.dispose  end  def update   @select_window.update   @window_hud.update   if Input.trigger?(Input::C)		case @select_window.index	  		when 0		  if @calcio = false		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 3		  $game_map.need_refresh = true			  $scene = Scene_Map.new		else		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 3		  $game_map.need_refresh = true			  $scene = Scene_Map.new 		end		return		  when 1		  if @calcio = false		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 20		  $game_map.need_refresh = true			$scene = Scene_Map.new	 		  else		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 2		  $game_map.need_refresh = true			  $scene = Scene_Map.new 		end		return			when 2  			  if @calcio = false			$game_system.se_play($data_system.decision_se)			$game_variables[1] += 15			$game_map.need_refresh = true			  $scene = Scene_Map.new  			else		  $game_system.se_play($data_system.decision_se)		  $game_variables[1] += 20		  $game_map.need_refresh = true			$scene = Scene_Map.new 		  end		  return			  when 3				if @calcio = false				$game_system.se_play($data_system.decision_se)			  $game_variables[1] += 5				$game_map.need_refresh = true				$scene = Scene_Map.new			  else			$game_system.se_play($data_system.decision_se)			$game_variables[1] += 15			$game_map.need_refresh = true			$scene = Scene_Map.new  		  end		  return		  when 4				 $game_system.se_play($data_system.decision_se)			  $game_variables[1] += 5				$game_map.need_refresh = true				$scene = Scene_Map.new				return		   end		end	 end   end

     

     

    Per mettere la condizione che calcio è falso devi mettere

    if @calcio == false

    con due uguali ^^

     

    e lo stesso vale per il true XD

    if @calcio == true

     

    ma si può anche scrivere solamente

    if @calcio

  12. mmm... Ma in che contesto la metti?

    Perchè nel interpreter, la parte di script che collega gli eventi, il comando è appunto:

    $game_variables += value

     

    dove i e value sono variabili che si definiscono negli eventi.

    Quindi è giusto il comando $game_variables[1] += 1 XD

     

    Il problema probabilmente è dove la inserisci... In caso mandami un mp e gli do un occhiata.

  13. Mmm, ho una domanda: ho notato che se perdi in uno scontro dello Zoolab, è Game Over. Non si potrebbe cambiare l'opzione e far tornare alla mappa?

     

    Ah in effetti non ci avevo pensato, sisi si puo fare dfacilmente XD

     

    Allora basta che vai nella PARTE 2 e nel

    def call_battle

     

    aggiungi sopra $scene= Scene_Battle.new

    $game_temp.battle_can_lose = true

     

    Dovrebbe andare :D

     

    EDIT: Aggiornata la versione nel primo post, e risolto un mini bug.

  14. Bon dipende, perchè adesso nella demo solo Basil e Arshes hanno armi per catturare... (almeno mi pare!)

     

    EDIT: Porca vacca, c'avevi ragione XD Adesso ho messo a posto, spero una volta per tutte!

×
×
  • Create New...