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.

bug in mining script

hey,

This is the bugged script:


class Scene_Mining
#------------------------------------------------------------------------------
# * Begin of the scene_mining
#------------------------------------------------------------------------------

attr_reader : ore
attr_accessor :id
attr_accessor :item_chanse
attr_accessor :chanse1

def initialize
@ore = $data_items[$mining.id].name
@item_chanse = $data_items[$mining.id].hit
end

def main


$mining.chanse1 = rand(100)

@spriteset = Spriteset_Map.new
@window1 = Window1.new


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

Graphics.freeze
@window1.dispose

end


def chanse

if $mining.item_chanse <= @chanse1



else

end
end
#---------------------------------------------------------------------------------

#---------------------------------------------------------------------------------
def update

@window1.update #menu
Keyboard.update
if Input.trigger?(Input::B) or Keyboard.trigger?(Keyboard::Mouse_Right) #Press ESCAPE to exit
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
$game_map.autoplay #Because we play music in the menu...
end

end
end
#------------------------------------------------------------------------------
# * End of the scene_mining
#------------------------------------------------------------------------------

class Window1 < Window_Base
#------------------------------------------------------------------------------
# * Begin of window 1
#------------------------------------------------------------------------------
def initialize
super(0, 0, 223,55)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
self.contents.draw_text(0, 0, 33, 33, $mining.ore.to_s )
end
#---------------------------------------------------------------------------------

end
#------------------------------------------------------------------------------
# * End of window1
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

# you better not touch the part below, game might crash
class Scene_Title
alias pe_command_new_game command_new_game
def command_new_game
$mining = Scene_Mining.new
$mining.id = [1]
pe_command_new_game
end
end

#===================================================
# - Scene_Mstats
#===================================================
class Scene_Mstats

#---------------------------------------------------------------------------------
def initialize
end
#---------------------------------------------------------------------------------

def main
@window1 = Window_Mstats.new
@window1.x =0
@window1.y =0
@window1.height = 480
@window1.width = 640
#@window1.z = 200

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

Graphics.freeze
@window1.dispose

end
#---------------------------------------------------------------------------------

#---------------------------------------------------------------------------------
def update

@window1.update #menu
Keyboard.update
if Input.trigger?(Input::B) or Keyboard.trigger?(Keyboard::Mouse_Right) #Press ESCAPE to exit
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
$game_map.autoplay #Because we play music in the menu...
end

end
#---------------------------------------------------------------------------------

end


class Window_Mstats < Window_Base

#---------------------------------------------------------------------------------
def initialize
super(0, 0, 640,480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 22
self.contents.font.color = text_color(0)
self.contents.draw_text(0, 0, 33, 33, "1")
end

(note $mining.id = 94)

the bug is:
He always thinks the item is perfume, (item 94 = iron ore, perfume = item 4)
 

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