Jump to content
Rpg²S Forum

*Difficolta in Title Screen


Thejuster
 Share

Recommended Posts

Difficoltà al New Game

Difficoltà nel Title Screen


Dopo aver premuto New Game e possibilie scegliere la difficoltà del gioco tra easy, normal e Hard.
Utile per BS in tempo reale, e decidere la quantità di nemici da mostrare sul campo.


Autore


IO

 

Istruzioni per l'uso


Sostituire il contenuto nella pagina Scene_Title con lo script seguente
la difficoltà viene memorizzata in una variabile, per modificare la variabile che tiene memoria della difficoltà che varia
da 0 a 2, andare alla riga 243

$game_variables[1] = @difficulty
e sostituire 1 con l'id della variabile che vi pare.

 

 

#==============================================================================
# ** Scene_Title Whit Difficulty C
#------------------------------------------------------------------------------
# This class performs title screen processing.
# By Thejuster
#==============================================================================
class Scene_Title
	@difficulty = 0
	#--------------------------------------------------------------------------
	# * Main Processing
	#--------------------------------------------------------------------------
	def main
		# If battle test
		if $BTEST
			battle_test
			return
		end
		# Load database
		$data_actors = load_data("Data/Actors.rxdata")
		$data_classes = load_data("Data/Classes.rxdata")
		$data_skills = load_data("Data/Skills.rxdata")
		$data_items = load_data("Data/Items.rxdata")
		$data_weapons = load_data("Data/Weapons.rxdata")
		$data_armors = load_data("Data/Armors.rxdata")
		$data_enemies = load_data("Data/Enemies.rxdata")
		$data_troops = load_data("Data/Troops.rxdata")
		$data_states = load_data("Data/States.rxdata")
		$data_animations = load_data("Data/Animations.rxdata")
		$data_tilesets = load_data("Data/Tilesets.rxdata")
		$data_common_events = load_data("Data/CommonEvents.rxdata")
		$data_system = load_data("Data/System.rxdata")
		# Make system object
		$game_system = Game_System.new
		# Make title graphic
		@sprite = Sprite.new
		@sprite.bitmap = RPG::Cache.title($data_system.title_name)
		# Make command window
		s1 = "New Game"
		s2 = "Continue"
		s3 = "Shutdown"
		@command_window = Window_Command.new(192, [s1, s2, s3])
		@command_window.back_opacity = 160
		@command_window.x = 320 - @command_window.width / 2
		@command_window.y = 288
		# Continue enabled determinant
		c1 = "Easy"
		c2 = "Normal"
		c3 = "Hard"
		@command_window2 = Window_Command.new(192, [c1, c2, c3])
		@command_window2.back_opacity = 160
		@command_window2.x = 320 - @command_window.width / 2
		@command_window2.y = 288
		@command_window2.visible = false
		@command_window2.index = 0
		# Check if at least one save file exists
		# If enabled, make @continue_enabled true; if disabled, make it false
		@continue_enabled = false
		for i in 0..3
			if FileTest.exist?("Save#{i+1}.rxdata")
				@continue_enabled = true
			end
		end
		# If continue is enabled, move cursor to "Continue"
		# If disabled, display "Continue" text in gray
		if @continue_enabled
			@command_window.index = 1
		else
			@command_window.disable_item(1)
		end
		# Play title BGM
		$game_system.bgm_play($data_system.title_bgm)
		# Stop playing ME and BGS
		Audio.me_stop
		Audio.bgs_stop
		# Execute transition
		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
		# Dispose of command window
		@command_window.dispose
		@command_window2.dispose
		# Dispose of title graphic
		@sprite.bitmap.dispose
		@sprite.dispose
	end
	#--------------------------------------------------------------------------
	# * Frame Update
	#--------------------------------------------------------------------------
	def update
		# Update command window
		@command_window.update
		@command_window2.update
		if @command_window.active
			update_frist
			return
		end
		if @command_window2.active
			update_difficulty
			return
		end
	end
	#--------------------------------------------------------------------------
	# * Update Frist Screen
	#--------------------------------------------------------------------------
	def update_frist
		# If C button was pressed
		if Input.trigger?(Input::C)
			# Branch by command window cursor position
			case @command_window.index
			when 0 # New game
				command_new_game
			when 1 # Continue
				command_continue
			when 2 # Shutdown
				command_shutdown
			end
		end
	end
	#--------------------------------------------------------------------------
	# * Update Difficulty Screen
	#--------------------------------------------------------------------------
	def update_difficulty
		if Input.trigger?(Input::C)
			case @command_window2.index
			when 0
				@difficulty = @command_window2.index
				game_start
			when 1
				@difficulty = @command_window2.index
				game_start
			when 2
				@difficulty = @command_window2.index
				game_start
			end
		end
	end
	#--------------------------------------------------------------------------
	# * Command: New Game
	#--------------------------------------------------------------------------
	def command_new_game
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		@command_window.visible = false
		@command_window2.visible = true
		@command_window.active = false
		@command_window2.active = true
	end
	#--------------------------------------------------------------------------
	# * Command: Continue
	#--------------------------------------------------------------------------
	def command_continue
		# If continue is disabled
		unless @continue_enabled
			# Play buzzer SE
			$game_system.se_play($data_system.buzzer_se)
			return
		end
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Switch to load screen
		$scene = Scene_Load.new
	end
	#--------------------------------------------------------------------------
	# * Command: Shutdown
	#--------------------------------------------------------------------------
	def command_shutdown
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Fade out BGM, BGS, and ME
		Audio.bgm_fade(800)
		Audio.bgs_fade(800)
		Audio.me_fade(800)
		# Shutdown
		$scene = nil
	end
	#--------------------------------------------------------------------------
	# * Command: Game Start
	#--------------------------------------------------------------------------
	def game_start
		# Play decision SE
		$game_system.se_play($data_system.decision_se)
		# Stop BGM
		Audio.bgm_stop
		# Reset frame count for measuring play time
		Graphics.frame_count = 0
		# Make each type of game object
		$game_temp = Game_Temp.new
		$game_system = Game_System.new
		$game_switches = Game_Switches.new
		$game_variables = Game_Variables.new
		$game_self_switches = Game_SelfSwitches.new
		$game_screen = Game_Screen.new
		$game_actors = Game_Actors.new
		$game_party = Game_Party.new
		$game_troop = Game_Troop.new
		$game_map = Game_Map.new
		$game_player = Game_Player.new
		# Set up initial party
		$game_party.setup_starting_members
		# Set up initial map position
		$game_map.setup($data_system.start_map_id)
		# Move player to initial position
		$game_player.moveto($data_system.start_x, $data_system.start_y)
		# Refresh player
		$game_player.refresh
		# Run automatic change for BGM and BGS set with map
		$game_map.autoplay
		# Update map (run parallel process event)
		$game_map.update
		# Switch to map screen
		$game_variables[1] = @difficulty
		$scene = Scene_Map.new
	end
	#--------------------------------------------------------------------------
	# * Battle Test
	#--------------------------------------------------------------------------
	def battle_test
		# Load database (for battle test)
		$data_actors = load_data("Data/BT_Actors.rxdata")
		$data_classes = load_data("Data/BT_Classes.rxdata")
		$data_skills = load_data("Data/BT_Skills.rxdata")
		$data_items = load_data("Data/BT_Items.rxdata")
		$data_weapons = load_data("Data/BT_Weapons.rxdata")
		$data_armors = load_data("Data/BT_Armors.rxdata")
		$data_enemies = load_data("Data/BT_Enemies.rxdata")
		$data_troops = load_data("Data/BT_Troops.rxdata")
		$data_states = load_data("Data/BT_States.rxdata")
		$data_animations = load_data("Data/BT_Animations.rxdata")
		$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
		$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
		$data_system = load_data("Data/BT_System.rxdata")
		# Reset frame count for measuring play time
		Graphics.frame_count = 0
		# Make each game object
		$game_temp = Game_Temp.new
		$game_system = Game_System.new
		$game_switches = Game_Switches.new
		$game_variables = Game_Variables.new
		$game_self_switches = Game_SelfSwitches.new
		$game_screen = Game_Screen.new
		$game_actors = Game_Actors.new
		$game_party = Game_Party.new
		$game_troop = Game_Troop.new
		$game_map = Game_Map.new
		$game_player = Game_Player.new
		# Set up party for battle test
		$game_party.setup_battle_test_members
		# Set troop ID, can escape flag, and battleback
		$game_temp.battle_troop_id = $data_system.test_troop_id
		$game_temp.battle_can_escape = true
		$game_map.battleback_name = $data_system.battleback_name
		# Play battle start SE
		$game_system.se_play($data_system.battle_start_se)
		# Play battle BGM
		$game_system.bgm_play($game_system.battle_bgm)
		# Switch to battle screen
		$scene = Scene_Battle.new
		$game_variables[1] = $difficulty
	end
end

 



Bugs e Conflitti Noti

 

boh, per ora nessuno


Altri Dettagli


Buon Divertimento

Edited by Dilos
Script monoriga sistemato.

Rpgmaker Asset Converter & UI Tool by Making Italia


______________________________________________________
Produzione Software, Componenti e Controlli
_______________________________________________________

*** Linguaggi di Programmazione Conosciuti e competenze Tecniche ***

C#, Javascript, Java, PHP, SQL, Autoit , JQuery, HTML, HTML5, C++, VB.NET,
Android, DirectX, HLSL, XML, Access, LUA, Delphi, Pascal, Assembly, Fortan, Angular JS

Python, Delphi, OpenGL, Git, Bash, ASP, CMake, WinService


Making Italia

 

Link to comment
Share on other sites

Mmmh abbastanza semplice come script... in pratica se appena inizio il gioco metto un mostra scelta ad eventi ottengo lo stesso risultato! :D Beh dai come primo script per imparare va bene, buon lavoro :biggrin:

^ ^

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^

REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

grazie mille, si

in effetti sto imparando pian piano.

una domanda gino.

se la command_window vorrei esporre i comandi in orizzontale come posso fare?

Rpgmaker Asset Converter & UI Tool by Making Italia


______________________________________________________
Produzione Software, Componenti e Controlli
_______________________________________________________

*** Linguaggi di Programmazione Conosciuti e competenze Tecniche ***

C#, Javascript, Java, PHP, SQL, Autoit , JQuery, HTML, HTML5, C++, VB.NET,
Android, DirectX, HLSL, XML, Access, LUA, Delphi, Pascal, Assembly, Fortan, Angular JS

Python, Delphi, OpenGL, Git, Bash, ASP, CMake, WinService


Making Italia

 

Link to comment
Share on other sites

Guest gino
grazie mille, si

in effetti sto imparando pian piano.

una domanda gino.

se la command_window vorrei esporre i comandi in orizzontale come posso fare?

 

La disposizione verticale è data dal seguente codice:

 

#==============================================================================# ■ Window_Command#------------------------------------------------------------------------------#  一般的なコマンド選択を行うウィンドウです。#============================================================================== class Window_Command < Window_Selectable  #--------------------------------------------------------------------------  # ● オブジェクト初期化  #	 width	: ウィンドウの幅  #	 commands : コマンド文字列の配列  #--------------------------------------------------------------------------  def initialize(width, commands)	# コマンドの個数からウィンドウの高さを算出	super(0, 0, width, commands.size * 32 + 32)	@item_max = commands.size	@commands = commands	self.contents = Bitmap.new(width - 32, @item_max * 32)	self.contents.font.name = $fontface	self.contents.font.size = $fontsize	refresh	self.index = 0  end  #--------------------------------------------------------------------------  # ● リフレッシュ  #--------------------------------------------------------------------------  def refresh	self.contents.clear	for i in 0...@item_max	  draw_item(i, normal_color)	end  end  #--------------------------------------------------------------------------  # ● 項目の描画  #	 index : 項目番号  #	 color : 文字色  #--------------------------------------------------------------------------  def draw_item(index, color)	self.contents.font.color = color	rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)	self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))	self.contents.draw_text(rect, @commands[index])  end  #--------------------------------------------------------------------------  # ● 項目の無効化  #	 index : 項目番号  #--------------------------------------------------------------------------  def disable_item(index)	draw_item(index, disabled_color)  endend

 

Per ottenere quello che vuoi tu devi modificare i metodi initialize e draw_item. (principalmente si tratta di invertire i valori per dimensioni e coordinate fra gli assi x e y)

 

EDIT: Ovviamente se modifichi questa classe , le variazioni si vedranno in tutto il gioco. Se ti serve solo in un punto, puoi creare una nuova classe (Window_Command_H), così che avrai a disposizione sia quella classica che la tua versione orizzontale!

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