• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Picture displaying numbers [RM2k(3)]

funnybunny

Advanced RM2k(3) Coder
  • 178
    Posts
    19
    Years
    This Tutorial is designed to let you know how to display numbers in RM2k(3), already posted this on other forums but hell. You might learns something from this :).

    -------------------------------------------------------------------------------------------

    For this Tutorial, you will need:
    - Advanced Knowledge of Variables.
    - Basic Knowledge of Branches(Forks).
    - Basic Knowledge of Showing Pictures.

    -------------------------------------------------------------------------------------------
    Dividing numbers

    First set var1, var2 and var3 to the HP number example: var1=235, var2=235 and
    var3=235(hero HP = 235)

    Now we are going to change the variable so that every variable will have it's own number of
    the HP.
    The first variable:
    Divide var1 with 100 to get the first number (235 /100=2,35 in rm2k you can't have number
    behind the comma so this will be 2)
    The second variable:
    Divide var2 with 10 to get the first 2 number(235/10=23) then mod with 10 to get the number
    in the first place(23 mod=3)
    The third variable:
    Just mod var3 with 10 to get the number in the first place(235 mod=5)

    You have now divided a number into 3 different variables.
    You should have something like this:
    Code:
    <>Variable Oper: [0001-0003] Set, Hero HP
    <>Variable Oper: [0001:var1] /,100
    <>Variable Oper: [0002:var2] /,10
    <>Variable Oper: [0002:var2] mod,10
    <>Variable Oper: [0003:var3] mod,10
    Showing the numbers

    First of all you need 10 pictures, 0 to 9. Next we are going to show the pictures on the screen. First think up what picture number you can use, make sure you don't use the same number for the pictures of var1 and var2. Else they will be deleted. I am going to use picture numbers 1, 2 and 3.
    Next thing we are going to do is setting up the branches(or forks) in a common event. Call the common event "Show number" or something to recognize it.
    Now the branches, just make an branch for 0 to 9 for the 3 variable. Then add a show picture to every to every branch, this will be the numbers you made. For branches from var1 use picture number 1, for var2 picture number 2 and var3 picture number 3.

    So for branch var1 = 0 show picture #1, num0.png, for branch var1 = 1 show picture #1, num1.png, for branch var1 = 2 show picture #1, num2.png, etc, etc.
    You should get something like this:
    Code:
    <>Branch If Var [0001:var1] is 0
     ?<>Show Picture 1,0, (280,200)
     ?<>
    :End
    <>Branch If Var [0001:var1] is 1
     ?<>Show Picture 1,1, (280,200)
     ?<>
    :End
    <>Branch If Var [0001:var1] is 2
     ?<>Show Picture 1,2, (280,200)
     ?<>
    :End
    (…)
    <>Branch If Var [0001:var1] is 9
     ?<>Show Picture 1,9, (280,200)
     ?<>
    :End
    Do the same with the var2 and 3 but use a different picture number and a different coordinate.
    Something like this:
    Code:
    <>Branch If Var [0001:var2] is 0
     ?<>Show Picture 2,0, (290,200)
     ?<>
    :End
    <>Branch If Var [0001:var2] is 1
     ?<>Show Picture 2,1, (290,200)
     ?<>
    :End
    <>Branch If Var [0001:var2] is 2
     ?<>Show Picture 2,2, (290,200)
     ?<>
    :End
    (…)
    <>Branch If Var [0001:var2] is 9
     ?<>Show Picture 2,9, (290,200)
     ?<>
    :End
    <>Branch If Var [0001:var3] is 0
     ?<>Show Picture 3,0, (300,200)
     ?<>
    :End
    <>Branch If Var [0001:var3] is 1
     ?<>Show Picture 3,1, (300,200)
     ?<>
    :End
    <>Branch If Var [0001:var3] is 2
     ?<>Show Picture 3,2, (300,200)
     ?<>
    :End
    (…)
    <>Branch If Var [0001:var3] is 9
     ?<>Show Picture 3,9, (300,200)
     ?<>
    :End
    Now make the common event parallel processing and add a wait 0.1 or 0.0 to reduce lag.

    That is it, hope you got it all and for any questions, just use this tread.
     
    Back
    Top