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.

RGSS Wait command

hey guys, is there a code, that allows me, to say in a script, that the script should wait for i frames.. after that, it goes on??

please help me ^^
 
IN VX there is one, I suggest you look in the Help file as its describe there.
But in any case it's fairly easy to redo on your own....

"passing a frame" is basically calling "Graphics.update"

SO passing X frame is making code that loop x times, which calls "Graphics.update".

In any case this topic should be moved to the RGSS Question forum thingie.
 

Atoa

Member

Code:
#==============================================================================

# ■ Object

#==============================================================================

class Object

#--------------------------------------------------------------------------

  def update_basic

    Graphics.update

    Input.update #only if you want player to be able to enter commands on the wait

    $game_system.update

    $game_screen.update

    @spriteset.update if @spriteset != nil #only if you want the spritset (map, battle...) to update during the wait

    @message_window.update if @message_window != nil #only if you want the message window to update during the wait

  end

  #--------------------------------------------------------------------------

  def wait(duration)

    for i in 0...duration do update_basic end

  end

end
now just add "wait(X)" where "X" is the number of frames in the code of the script.
 
class Ladebildschirm < Window_Base

def main
 
 
end
 
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.size = 15
self.contents.font.name = "Northwood High"
@msk_lay = Sprite.new
@msk_lay.bitmap = RPG::Cache.picture("ladenback")
@msk_lay.z = 0
 
 
@balken_leer = Sprite.new
@balken_leer.bitmap = RPG::Cache.picture("ladenleer")
@balken_leer.z = 10
@balken_leer.x = 228
@balken_leer.y = 207
@text = 0
refresh
 
end
 
 
 
def refresh
 
loop do
loop {
i = 0 if i.nil?
@text += 1
self.contents.clear
self.contents.draw_text(390, 160, 440, 32, @text.to_s + "%")
i += 1
break if i == 50
Graphics.update
}
 
if @text == 100
break
end
end
end
 
 
def Graphics.update
# @bitmap2 = RPG::Cache.picture("ladenvoll")
# ch = @bitmap2.height
# cw = @bitmap2.width * @text / 100
# src_rect = Rect.new(0, 0, cw, ch)
# self.contents.blt(228, 207, @bitmap2, src_rect)
 
end
 
end


t the end, it should be a load system (just a picture) so, don´t wonder, about it´s funktion

what i wanna do, is making a number from 0 to 100 like % (50 %)
but, so i have to make a wait frame, then it adds a % to the 50.. and so on..

pls help me, i´m just a beginner ^^
 

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