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.

Question.

How to show variaveis in windows? self.contents... What more?
How to make that script waits 3 minutes to continue?
How to make one script to be in a window and the SCENE_MAP and that it is if bringing up to date constantly?
Which the difference between ELSIF and IF?
How to calculate many variaves?

* I am using a translator online. Thanks!':| :)
 
1) self.contents.draw_text(x, y, width, height, $game_variables[n])
Where x is the x coordinate of the text in the window, y is the y coordinate of the text in the window, width is the width of the text, height is the height of the text.
2) I don't know what you mean.
3) You could just call the window from Scene_Map.
4) elsif must come after if. It's like saying "If you have three oranges, do this (if). Oh... you don't have three oranges? Then if you have three apples, do something else (elsif)." Bad example, I know.
5) What do you mean by 'calculate variables'?
 
@Dark-Zero it should be "#{$game_variables[n]}" or $game_variables[n].to_s or else you will get an error

2) To wait 3 minutes just do
@wait_count = 3 * 60 * Graphics.frame_rate

make sure that this code appears somewhere in the update method of the Scene that you are using this
Code:
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end

but yeah I really don't know what you are asking for

3) I don't know what you are asking

5) Don't know what you are asking
 
5) Example: @var.total = @var1 + @var 2 + @var3 + $game_variables[1]

This correct one?

-----------------------------------------------
Dark and Trickster, thanks!!!
 
minion said:
5) Example: @var.total = @var1 + @var 2 + @var3 + $game_variables[1]

This correct one?

unless @var is an instance of a class and total is an instance variable, you wont be able to say things like @var.total. Which is just a waist of time unless you want to build a database.

try using this instead:
"@var_total = @var1 + @var 2 + @var3 + $game_variables[1]"
 

Sion

Member

The difference between else if and if.

As you probally know, this is the standard form of an IF statement:
Code:
If boolean = true 
#perform actions
else
#perform actions when boolean = false]
end
#perform general actions
If you wanted something to happen if boolean = false, but boolean2 = true, then you can combine else with another ifstatement, elseif. So you could use it like this.
Code:
if boolean = true
#perform actions
elsif boolean2 = true
#perform actions when boolean = false, but boolean2=true
end
#perform general actions
 

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