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.

[Resolved]Waitin' Problem~

Status
Not open for further replies.

Kaito

Member

Hiya~
Okay...Now I have this problem...I added a wait command in this script, but it doesn't seem to work. What could be wrong eh?

Code:
class Scene_ItemGain
 def initialize(type,id,numb,gold=0)
   Audio.me_play("Audio/ME/011-Item02", 100, 100)
   @type=type
   @id=id
   @numb=numb
   @gold=gold
    @window=Window_ItemGain.new(@type,@id,@numb,@gold)
    @window.update
    @wait_count = 0
 end
 def main
   loop do
     Graphics.update
     Input.update
     update
     if $scene != self
       break
     end
   end
   Graphics.freeze
   @window.dispose
 end
 def update
   if @wait_count > 0
  @wait_count += 1
  return
end
   @window.update
   update_c
 end
 def update_c
       @wait_count = 100
      $game_system.se_play($data_system.decision_se)
      $scene=Scene_Map.new
  end
end

thank you~
cya!
 
Code:
#....
  @wait_count = 0
#....
if @wait_count > 0
  @wait_count += 1
  return
end
#...
@wait_count = 100
What will happen? Wait-count will be initialized with 0, the if-block will be skipped as wait_count > 0 returns false.
update_c will directly processed and the player will be returned to the map.

Either you let the wait-counter counts up to 100 or you will let him count down to 0.
The first is easier with your current code, just change the if-line to
Code:
if @wait_count < 100
Then the code will wait until @wait_count reaches 100.
 
This topic has been resolved. If Kaito or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
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