Jump to content
Rpg²S Forum
  • 0

Problema con i comandi


Squall_Leonheart
 Share

Question

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

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

Recommended Posts

  • 0
Esattamente

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0

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

 

Link to comment
Share on other sites

  • 0
Mi dà un errore di metodo evidenziando la classe window_command O.o

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0
Mi dà un errore di metodo evidenziando la classe window_command O.o

 

 

Strano a me non da nessun errore e fila tutto liscio O_o

 

Comunque avevo dimenticato di aggiungere ai dispose lo @spriteset.dispose

 

 

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  @spriteset.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   endend

 

 

Non so perchè ma senza la prima volta andava normale, poi crashava XD

Prova con questo a me va ^^

Link to comment
Share on other sites

  • 0

 

 

 

Continua a darmi questo errore..

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0

 

 

Continua a darmi questo errore..

 

 

No, se hai preso il mio ultimo script e l'hai sostituito a tutto la variabile calcio non c'è più, è impossibile che ti dia quell'errore, probabilmente hai mantenuto qualche pezzo e allora dato che nello script che ti ho dato non ce più, da errore!

Copia esattamente sostituendo tutto :sisi:

Link to comment
Share on other sites

  • 0

Purtroppo no °_° Ora ti posto quello che ho copiato nella classe e che continua a darmi per errato!

 

 

 

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 = 100	@window_hud_tigre = Window_HUD_Tigre.new	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @spriteset.dispose  @window_hud_tigre.dispose  end def update   @select_window.update   @window_hud_tigre.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   endend

 

 

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0
Purtroppo no °_° Ora ti posto quello che ho copiato nella classe e che continua a darmi per errato!

 

 

 

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 = 100	@window_hud_tigre = Window_HUD_Tigre.new	@spriteset = Spriteset_Map.new	Graphics.transition	loop do	Graphics.update	Input.update	update	if $scene != self  	  break  	end  end  Graphics.freeze  @select_window.dispose  @spriteset.dispose  @window_hud_tigre.dispose  end def update   @select_window.update   @window_hud_tigre.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   endend

 

 

Oddio XD Rpg maker schizza male XD Prova a fare cosi:

 

Fai clic destro sulla lista degli script (a sinistra)

fai FIND

E scrivi Calcio

Vedi se trova qualcosa...

Se trova qualcosa vuol dire che non hai cancellato tutta la parte che non serve

Link to comment
Share on other sites

  • 0
Trova solo il comando .unshift e il when :/

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0
Link to comment
Share on other sites

  • 0

No >.<

Ho cancellato pure tutti gli script sotto main ma niente..

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0
  • 0

Ma non è possibile °_°

 

Continua a darmi l'errore di metodo con la variabile calcio ç_ç

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0

Ma è IMPOSSIBILE XDXD La variable calcio non è stata creata XDXD

 

Riesci a mandarmi il progetto (quello nuovo appena creato), e vedo sto errore e controll per bene O_o

Ora è una questione di principio XD

Link to comment
Share on other sites

  • 0

Ho risolto,era rimasto l'evento che portava la variabile calcio = true .-.

Madò mi sono dannato per niente >.<

 

Però ora mi sorge un altro dubbio,per impostare una condizione inerente al numero di eroi nel party bisogna seguire lo stesso procedimento solo inserendo

$game_party.actors == 2

?

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

  • 0

non è proprio quello ma ci sei andato vicino XD per avere il numero di eroi del party il comando è:

 

$game_party.actors.size

 

Cioe se tu per esempio devi verificare che ci siano almeno 4 eroi nel party metti condizione:

 if $game_party.actors.size > 3QUALCOSA_SUCCEDEend

 

E cosi via...

Edited by Valentino
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...