HELP WITH CMS NUMBERS

Posts

Pages: 1
I really didn't want to ask for help, but I've exhausted my mind trying to do this. Images speak louder than words, so I'll just show you my problem.



As you can see, there are those zeros in front of the actual number. I've tried to think of a way to get rid of them, but my method only seems to work when the value is a certain number. Other times like this, the zeros pop up again. It's very annoying.

Here's a part of my code/event/whatever that handles the numbers.



As you can see with the beginning of second digit, I try to get rid of the zero if the total value is less than a certain amount. I do this with all digits beyond the first. It seems to work sometimes, but as I said before, the zeros still pop up now and then.

Can anyone give me any insight on this? Or should I just stick with the zeros?
If its too much of a hassle and error prone, I'd say stick with the zeros. I don't find them all that distracting anyhow.

If it were me, and I had spent the time you seem to have on getting them to disappear and have yet to be successful, I'd chalk this issue up into the "It's good enough" pile and work on other things.

Of course, I can't see the screen with the code (since the image is blocked). I can see the menu screen.
Yellow Magic
Could I BE any more Chandler Bing from Friends (TM)?
3154
If SPDigit(whatever) is equal to 0
Erase Picture(whatever)?

Surely you just have to do that much for the digits before the actual number?

EDIT: Oh wait, I think I get it now. If you did it the way it appears in the code (and if you used 10^x for the comparison for each digit) it should ideally work, maybe it's a good idea to check for mistakes again? (sorry I couldn't be of more help)
Craze
why would i heal when i could equip a morningstar
15150
...didn't you start using XP for a while?
I've had a problem like this and fix it but I don't remember how. I think I used some if commands when a certain number is more than 9 the picture for the number that I didn't want would be a blank pic. But seriously I don't remember what I did.
author=kentona link=topic=3955.msg79052#msg79052 date=1244485031
If its too much of a hassle and error prone, I'd say stick with the zeros. I don't find them all that distracting anyhow.

If it were me, and I had spent the time you seem to have on getting them to disappear and have yet to be successful, I'd chalk this issue up into the "It's good enough" pile and work on other things.

Of course, I can't see the screen with the code (since the image is blocked). I can see the menu screen.

Well, I'm going to try another method Ocean came up with. If that doesn't work then I guess I'll just stick with the zeros.

author=Craze link=topic=3955.msg79062#msg79062 date=1244486830
...didn't you start using XP for a while?

...Project DOAD was not a permanent move to XP. It was just a side project. I know how to use RMXP/VX perfectly well, but my current project is in 2k3 so *shrug*

alsololcan'tscript
Yellow Magic
Could I BE any more Chandler Bing from Friends (TM)?
3154
Hang on - where is the "End" statement for the conditional branch for SP Digit = 9?
Can you just check the total value afterwards and if it's too high erase the picture? I don't know eventing code very well so don't know what is and isn't possible :/

Psuedo Example:


===
Keep all your code to calculate each digit even with the unwanted zeros but then afterwards check the total and erase the pictures you don't need.
===
if (total < 1000)
erase Picture(40) // Pic 40 being the digit 1 in 1000

if (total < 100)
erase Picture(39) // Pic 39 being the digit 1 in 100

if (total < 10)
erase Picture(38) // Pic 38 being the digit 1 in 10

something like that.
author=Yellow Magic link=topic=3955.msg79073#msg79073 date=1244487423
Hang on - where is the "End" statement for the conditional branch for SP Digit = 9?

It's there. I guess I cut that off when I was taking a screenshot.

author=statistic link=topic=3955.msg79075#msg79075 date=1244487496
Can you just check the total value afterwards and if it's too high erase the picture? I don't know eventing code very well so don't know what is and isn't possible :/

Psuedo Example:


===
Keep all your code to calculate each digit even with the unwanted zeros but then afterwards check the total and erase the pictures you don't need.
===
if (total < 1000)
erase Picture(40)

if (total < 100)
erase Picture(39)

if (total < 10)
erase Picture(38)

something like that.

Ah, all right, I'll give that a try. Thanks.
Here's what I'm doing. If the thousands place = 0, turn on an empty switch and display nothing. Check if the hundreds place is 0, then if the switch is off, display 0. If the hundreds place isn't 0, turn the switch off. Do the same for the tens place, and the ones place should display a zero regardless.
All this should be done while it checks which pictures to display.
Okay, false alarm. I'm a huge idiot.

I was looking through my code once more and I noticed that once I got to the 5th and 6th digits, I forgot to change the value in the conditional branch that checks to see if the total value is less then number XXXX and the erase the picture if it is.

So basically digits 5 and 6 had the same zero erase condition of digit 4, which was causing the zeros.

I can't believe I passed over this time and time again until now. Sorry for the trouble. What a waste of time. *sigh*
It is always the smallest little mistakes possible that mess things up. =|

Good thing you fixed it!


One time I had a battle event page where the monsters health was one of the conditions for it attacking. And for some reason my monster would still attack even though he was dead. I spent hours trying to figure out the problem only to find out that the health condition for that battle event page was set to a completely different monster... :(
WIP
I'm not comfortable with any idea that can't be expressed in the form of men's jewelry
11363
Skie, you have no idea how many issues like that come up in coding. Copy/paste bugs are notorious!

Good to see you fixed it. I was starting to formulate my own crazy solution.
Pages: 1