SHOWING VARIABLE NUMBERS ON SCREEN

A tutorial for showing a number in a variable appear on the screen without a message box.

Introduction
You know how you want to make a custom menu and you want to show how much currency you have but you just can't code it? Well this is what this tutorial is about. It can be used in other things besides custom menus such as mini-games (the amount of points you have). It's all up to you on how you want to use it.

What You'll Need:
Images of numbers 0-9
You can choose to make your own numbers or copy them from your system(2). Just get the numbers 0-9 into an image and imported to your "Picture" folder in your game folder.

Variables
-the number you will put on the screen
-a copy of the number

Tutorial
Now starts the hard part, making the event. First you have to make a variable operation. Set the number copy to number. Then, create another variable operation for number copy to modulus by 10. the modulus command takes out all numbers higher than the number selected in this case is 10. now make a new conditional branch saying if the number copy is 0. if it is, go to show picture and show the picture of the number zero. under that, put another conditional branch saying if the number copy is 1. if it is, go to show picture and show the picture of the number 1. repeat this process for each other number. once you have gone to 9, make another conditional branch saying if the number (not number copy) is higher than 10. if it is, set a variable operation for number copy to number. now this time, we modulus with 100. and below that, divide the number copy by 10. now below that, make new conditional branch saying if the number copy is 0. if it is, show a different picture for the picture number of the number 0. again, do the same with all the other numbers. now you've understand how to make numbers appear on your game screen. if you are thinking, "what about 100 and higher?" just divide the number by 100. each place will determine what you should divide it by. do the same for the modulus too. NOTE: Make sure that all the pictures are in different X and Y screen relatives(next to each other, not on top of each other). here's how the event should look like.

Variable Oper: Set, Money (it doesn't have to be money. if it is a mini-game, don't even set it. just make the event parallel process and it will keep adding up as you get the points.)
Variable Oper: Set, Var 's Value
Variable Oper: Mod, 10
Branch if Var is 0
Show Picture: 1, Number 0, (X,Y)
End
Branch if Var is 1
Show Picture: 1, Number 1, (X,Y)
End
Branch if Var is 2
Show Picture: 1, Number 2, (X,Y)
End
Branch if Var is 3
Show Picture: 1, Number 3, (X,Y)
End
Branch if Var is 4
Show Picture: 1, Number 4, (X,Y)
End
Branch if Var is 5
Show Picture: 1, Number 5, (X,Y)
End
Branch if Var is 6
Show Picture: 1, Number 6, (X,Y)
End
Branch if Var is 7
Show Picture: 1, Number 7, (X,Y)
End
Branch if Var is 8
Show Picture: 1, Number 8, (X,Y)
End
Branch if Var is 9
Show Picture: 1, Number 9, (X,Y)
End
Branch if Var is 10 or more
Variable Oper: Set, Var 's Value
Variable Oper: Mod 100
Variable Oper: /10
Branch if Var is 0
Show Picture: 2, Number 0, (X,Y)
End
Branch if Var is 1
Show Picture: 2, Number 1, (X,Y)
End
Branch if Var is 2
Show Picture: 2, Number 2, (X,Y)
End
Branch if Var is 3
Show Picture: 2, Number 3, (X,Y)
End
Branch if Var is 4
Show Picture: 2, Number 4, (X,Y)
End
Branch if Var is 5
Show Picture: 2, Number 5, (X,Y)
End
Branch if Var is 6
Show Picture: 2, Number 6, (X,Y)
End
Branch if Var is 7
Show Picture: 2, Number 7, (X,Y)
End
Branch if Var is 8
Show Picture: 2, Number 8, (X,Y)
End
Branch if Var is 9
Show Picture: 2, Number 9, (X,Y)
End
End


Thanks, and hopefully this tutorial helped you.

Posts

Pages: 1
As far as I can see you forgot to add a reminder variable that reminds the initial value, it works now because you do it with the money, however if you want to show the numbers pure of the variable you'll need a reminder.
Pages: 1