Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Could someone please fix this script?

Code:
#==============================================================================
# - Scene_Menu
#------------------------------------------------------------------------------
# rewritten so it'll work with pkmn
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # main
  #--------------------------------------------------------------------------
  def main
    # コマンドウィンドウを作成
    s1 = "Pokedex"
    s2 = "Pokemon"
    s3 = "Pokegear"
    s4 = "Bag"
    s5 = $pkmn.trainername
    s6 = "Save"
    s7 = "Options"
    s8 = "Exit"
    s9 = "Radio"
    
    commands = [s1,s2,s3,s4,s5,s6,s7,s8,s9]
    if $pkmn.include_pokedex == false
      commands.delete("Pokedex")
    end
    if $pkmn.include_pokemon == false
      commands.delete("Pokemon")
    end
    if $pkmn.include_pokegear == false
      commands.delete("Pokegear")
    end
    @command_window = Window_Command.new(140, commands)
    @command_window.index = @menu_index
    @command_window.x = ($width - @command_window.width) - 8
    @command_window.y = 8
    
    @spriteset = Spriteset_Map.new
    
    @info = Window_Help2.new
    @info.height = $height / 4 + 16
    @info.width = $width / 2 + 74
    @info.x = 8
    @info.y = $height - @info.height - 8
    @info.z = 9999
    @info2 = Window_Help2.new
    @info2.height = $height / 4 + 16
    @info2.width = $width / 2 + 74
    @info2.x = 8
    @info2.y = $height - @info.height - 8 + 32
    @info2.z = 99999
    @info2.opacity = 0
    @info2.windowskin = @info.windowskin = RPG::Cache.windowskin("infosys")
    
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze

    @command_window.dispose
    @spriteset.dispose
    @info.dispose
    @info2.dispose
  end
  #--------------------------------------------------------------------------
  # update the scene
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @spriteset.update
    @info.update
    @info2.update
    
    #update command window and the info if it's active
    if @command_window.active
      update_command
      update_info
      return
    end
    
  end
  #--------------------------------------------------------------------------
  # update the command window
  #--------------------------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    
    if Input.trigger?(Input::C)
      case @command_window.commands[@command_window.index]
      when "Pokedex"
        print "not availlable in beta 0.2"
        $game_system.se_play($data_system.decision_se)
      when "Pokemon"
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Pokemon.new
      when "Pokegear"
        print "not availlable in beta 0.2"
        $game_system.se_play($data_system.decision_se)
      when $pkmn.trainername
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Trainercard.new
      when "Bag"
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when "Save"
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when "Options"
        print "not availlable in beta 0.2"
        $game_system.se_play($data_system.decision_se)
      when "Exit"
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Map.new
      end
      return
    end
  end
  def update_info
    case @command_window.commands[@command_window.index]
    when "Pokedex"
      @info.set_text("A device that records pokemon")
      @info2.set_text("data when seen or caught.")
    when "Pokemon"
      @info.set_text("check and organize pokemon")
      @info2.set_text("that are in your party.")
    when "Pokegear"
      @info.set_text("View the pokegear to look")
      @info2.set_text("at the map, radio and phone.")
    when $pkmn.trainername
      @info.set_text("Check your money")
      @info2.set_text("and other game data.")
    when "Bag"
      @info.set_text("A bag for storing items")
      @info2.set_text("you bought, recieved or found.")
    when "Save"
      @info.set_text("Save your game with a complete")
      @info2.set_text("record of your progress.")
    when "Options"
      @info.set_text("Adjust various game settings")
      @info2.set_text("such as textspeed.")
    when "Exit"
      @info.set_text("Close this Menu window")
      @info2.set_text("and return to the game.")
    end
  end
end

Could someone fix this so the unavailable features are removed?

Thanks for any help... I'd do it myself, but I am scared that I may delete something the whole script needs.. and that wouldn't be good.
 
Judging by these lines here

Code:
if $pkmn.include_pokedex == false
      commands.delete("Pokedex")
    end
    if $pkmn.include_Pokémon == false
      commands.delete("Pokémon")
    end
    if $pkmn.include_pokegear == false
      commands.delete("Pokegear")
    end

Thats what he wants to remove.
 
There are various functions that aren't available... if I remember correctly, Pokemon works... it's the ones that 'aren't available in Beta 0.2'

They are...

Pokedex, Pokegear, and Options ;)
 
Code:
#==============================================================================
# - Scene_Menu
#------------------------------------------------------------------------------
# rewritten so it'll work with pkmn
#==============================================================================

class Scene_Menu
	#--------------------------------------------------------------------------
	# initialize
	#--------------------------------------------------------------------------
	def initialize(menu_index = 0)
		@menu_index = menu_index
	end
	#--------------------------------------------------------------------------
	# main
	#--------------------------------------------------------------------------
	def main
		# ????????????
		s1 = "Pokémon"
		s2 = "Bag"
		s3 = $pkmn.trainername
		s4 = "Save"
		s5 = "Exit"
		s6 = "Radio"

		commands = [s1,s2,s3,s4,s5,s6]
		commands.delete("Pokémon") if $pkmn.include_Pokémon == false
		@command_window = Window_Command.new(140, commands)
		@command_window.index = @menu_index
		@command_window.x = ($width - @command_window.width) - 8
		@command_window.y = 8

		@spriteset = Spriteset_Map.new

		@info = Window_Help2.new
		@info.height = $height / 4 + 16
		@info.width = $width / 2 + 74
		@info.x = 8
		@info.y = $height - @info.height - 8
		@info.z = 9999
		@info2 = Window_Help2.new
		@info2.height = $height / 4 + 16
		@info2.width = $width / 2 + 74
		@info2.x = 8
		@info2.y = $height - @info.height - 8 + 32
		@info2.z = 99999
		@info2.opacity = 0
		@info2.windowskin = @info.windowskin = RPG::Cache.windowskin("infosys")

		Graphics.transition
		loop do
			Graphics.update
			Input.update
			update
			if $scene != self
				break
			end
		end
		Graphics.freeze

		@command_window.dispose
		@spriteset.dispose
		@info.dispose
		@info2.dispose
	end
	#--------------------------------------------------------------------------
	# update the scene
	#--------------------------------------------------------------------------
	def update
	@command_window.update
	@spriteset.update
	@info.update
	@info2.update

	#update command window and the info if it's active
	if @command_window.active
	update_command
	update_info
	return
	end

	end
	#--------------------------------------------------------------------------
	# update the command window
	#--------------------------------------------------------------------------
	def update_command
		if Input.trigger?(Input::B)
			$game_system.se_play($data_system.cancel_se)
			$scene = Scene_Map.new
			return
		end

		if Input.trigger?(Input::C)
			case @command_window.commands[@command_window.index]
			when "Pokémon"
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Pokémon.new
			when $pkmn.trainername
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Trainercard.new
			when "Bag"
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Item.new
			when "Save"
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Save.new
			when "Exit"
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Map.new
			end
			return
		end
	end
		
	def update_info
		case @command_window.commands[@command_window.index]
		when "Pokémon"
			@info.set_text("check and organize Pokémon")
			@info2.set_text("that are in your party.")
		when $pkmn.trainername
			@info.set_text("Check your money")
			@info2.set_text("and other game data.")
		when "Bag"
			@info.set_text("A bag for storing items")
			@info2.set_text("you bought, recieved or found.")
		when "Save"
			@info.set_text("Save your game with a complete")
			@info2.set_text("record of your progress.")
		when "Exit"
			@info.set_text("Close this Menu window")
			@info2.set_text("and return to the game.")
		end
	end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top