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.

Problem with script

Status
Not open for further replies.
Hi, I'm currently having a problem with one of the scripts I'm using, it is a CMS-script for a Pokemon game from Exteradude's starterkit, but when I press esc, I get this:

Script ‘Menu’ line 27: NoMethodError occurred.
Undefined method ‘include_Pokemon=’ for #<Pkmn:0x1594428>

Could anyone help me out? If this may be of help, here is the script:

#==============================================================================
# - 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
 
commands.delete("Pokémon") if $pkmn.include_Pokémon = false

the error is in this line... It is trying to find the method "include_Pokémon = false"... try to substitute this by "Include_Pokémon = false", "include_pokémon = false" or "include_Pokemon = false", since RGSS is case-sensitive... If don't work, it's because the method doesn't exist, so, you just have to delete this line or comment it...

I'm not really sure, since I don't know witch pokémons script you're using...
 
If your still interested in this perhaps you should replace

Code:
commands.delete("Pokémon") if $pkmn.include_Pokémon = false

With

Code:
    if $pkmn.include_pokemon == false
      commands.delete("Pokemon")
    end
 
Status
Not open for further replies.

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