HOW TO SHOW NUMBERS.

Posts

Pages: 1
I would be very happy if anyone could help me with this problem. Pretty please?

I don't know how to show number in variable, for instance health. I know how to do this trough showing every single picture for every single number, but that would be tedious... I seen it in many RM games and I wonder, how do you actually show or let the system write the number in variable trough the game graphics ?

Big thanks in advance.
author=Bonehead11
through showing every single picture for every single number.


That is the answer you're looking for :/ (at least in every case I can think of, except with RM20XX engine, which can draw numbers)
http://rpgmaker.net/tutorials/83/ here's a general idea on how to do it the hard way.

http://cherrytree.at/cms/lang/en/download/?did=19 using this is how you WANT to do it. Basically instead of showing a picture manually you can set the picture's image based on a variable. Check the example on how it's done.
I wonder if what you're looking for is a way to split variables in RM into their single digits so that you can get away with only creating a few sets of 10 conditional branches (for 0 to 9), because if so, there's a simple way to do that in Rm2k/3.

Here's a screenshot of the code that uses images to display the number.

(I didn't need to use any numbers in the thousands in my game so I ignored checking what the thousand digit is, that's why I start at hundreds instead in the second half of the code in case you're wondering).

Basically the top section of the code is the most important. You need to create 4 variables, one for each digit you will want to retrieve. (ThousandDigit, HundredDigit, TenDigit, and OneDigit). The first thing you do is set all the those variables to be equal to whatever number you want to split (in your case, money). Then for the next line of code select your HundredDigit as your variable, Modulus as your operation, and the number "1000" as your operand. Do the same for the TenDigit and OneDigit, but using the modulus value of 100 and 10 respectively. Then the next line of code you do ThousandDigit minus Hundred Digit. After that, HundredDigit minus TenDigit, and finally, TenDigit minus OneDigit. Your last three lines are to divide the ThousandDigit value by 1000, HundredDigit by 100, and TenDigit by 10. That's it! You've successfully split a number into all its separate digits.

So if your money was 1456 gold, after you run that line of code these would be what the variables would end up as:
ThousandDigit = 1
HundredDigit = 4
TenDigit = 5
OneDigit = 6.

Your next lines of codes would just be what to do with that info. Basically, it would just be 4 sections of conditional branches, one for each digit, with 10 branches in each section (for digits 0 to 9). In my case I have 10 possible pictures (the numbers 0 to 9) and in each branch I just show that digit using a show picture command in the appropriate coordinates of the menu. In the end you only have a few branches instead of thousands if you went about doing this the long way.

Hope that helps you out!
Well thanks all, but I just wanted to know if there was command to show number in RM.

I dont know if I should wait for RPG maker 20XX, or just do everything the tedious way...or no at all.
Max McGee
with sorrow down past the fence
9159
Annnnnnnnnnd this is why I stay away from CBSses. : )
There is no "Show Number", but as Darken already said: Look here - http://cherrytree.at/cms/lang/en/download/?did=19

This is my PicPointerPatch, which makes things a lot easier. There is also an example included - a 6-digit show-number function (with dimmed leading zeroes) in 10 or 15 lines (don't remember how much exactly).

@NewBlack, Fallen-Griever, Mateui, Max McGee: Didn't you know that, or did you just not want to use it? In case so many people don't know it, I might create a new thread for it.
I have an entire set of draw commands (including a straight-up draw number command) in 20XX. The engine is almost finished but it's still missing the last pieces that would complete the battle system(s) so it's better for new and planned projects.
author=Max McGee
Annnnnnnnnnd this is why I stay away from CBSses. : )

The thing is, with how much effort some folks put into modifying the DBS, it probably would save them more time in the end to create a custom one. No need to copy pistachio a bunch of monster group events and tweak them for every encounter, because so many functions can't be called from a common event.
If you're using 2k3, you have to get used to tedious. If you want simple, go to VX and copy-paste scripts.
@Cherry- I tried the PicPointerPatch, followed instructions, got the code running, but when I tried it, got error.
Untitled
Fallo al isertar (D:/ha/...LGD_picture.pas,526 line)


@Wolfcoder- I am following RM20XX, the problem is that I have CBS ready and running,except numbers, CMS too except numbers...so I dont know if I could port it, if yes then I will do it, if not then if I have more time on hands, then I will use it on more ambitious project I have in mind.

@Jude- Exactly.

@Bonehead11: This means you accessed a non-existing picture. Make sure you have the right RPG_RT.exe version and applied the right IPS file on it. Also check your event code. If you use RM2k, you can just use the RPG_RT.exe from the demo, otherwise ask me if you aren't sure if you have the right version.
author=Bonehead11
@Cherry- I tried the PicPointerPatch, followed instructions, got the code running, but when I tried it, got error.
Untitled
Fallo al isertar (D:/ha/...LGD_picture.pas,526 line)


That looks like a Spanish RPG_RT translation, pretty sure that's usually used because it has the fixed enter hero name. I'm not sure if PPP is compatible, but as Cherry said, the way to test that is to copy over the demo RPG_RT and see if the problem's resolved.

If not, I always get assertion failures at line 526 when doing something dumb with picture IDs, for example, trying to change picture 0, or changing pictures >128 (also using an extended picture patch). If you're still having issues, paste your event code as there's almost certainly something wrong with it.

(also how the hell did you get so far on a CBS/CMS without knowing how to display a number??)
author=Cherry
@Bonehead11: This means you accessed a non-existing picture. Make sure you have the right RPG_RT.exe version and applied the right IPS file on it. Also check your event code. If you use RM2k, you can just use the RPG_RT.exe from the demo, otherwise ask me if you aren't sure if you have the right version.


I just copied your code, so I dont think there is something wrong with it. It worked when I changed picture/number, but the picture/number just fucked up, it went trippy on me, was changing colors like mad. I think I am just going to wait for RM20XX, because time I spent trying to figure out your code, how that picpointer works and trying to run it, I just could code it the tedious way...so thanks but no thanks.

author=psy_wombats
(also how the hell did you get so far on a CBS/CMS without knowing how to display a number??)

Read the original post, I know how to show numbers, but I wanted to know if there is some less tedious way, because I saw in some games that you can show variable number in message box, and I wondered how to do it and if there isn't any easier way to show numbers. And making CBS/CMS is not that hard, just read what Jude said.
Pages: 1