RMXP Custom Picture Menu

Started by Seda, July 16, 2015, 11:40:52 pm

Previous topic - Next topic

Seda

Hello there! I am currently trying to create a Custom Menu through the use of Events and pictures only. So far I've got my base menu made and functioning just fine from looking around at other tutorials.

Here's the tricky part that I've run into: I'm trying to display my party members stats as well (HP, MP, EXP, Condition, Ect). I thought I had something working but I can't seem to get it to work. I've been trying to solve this problem for roughly 3 days and am at my wits end.

As of right now it displays the numbers then stops working when a number (other than 1000's) rolls over from 9 to 0.

Here's my event so far:



KK20

July 17, 2015, 03:49:30 pm #1 Last Edit: July 19, 2015, 01:59:19 pm by KK20
The problem is definitely obvious in your second picture. Do you know how modulo (%) operations work?

Let's assume the actor's HP is 6789. In your first image, 6789 is divided by 1000 which gives us 6 (in the rules of computer science and dividing integers, you ignore the decimal 0.789). You then do 6 % 1000 which still equals 6 (1000 cannot divide into 6 so the remainder, 6, is returned). Clearly, you can see this step can be removed entirely. But it did get the thousands digit, so no problems here.

Moving onto the second image and still assuming 6789, you divide 6789 by 100 and get 67. Modulo that with 100 and get 67 (again, same reasons, same redundancy). Obviously, you didn't get the 7.

To fix this, you should add another variable (call it Hero's HP) which will be set to the actor's HP. You then modulo the Actor's HP by 1000, then by 100, then by 10 to effectively reduce it and gain access to the other digits.

This is what I would do:

So using our previous example of 6789, the Thousand Digit will be set to this and divided by 1000 to get 6. You then modulo the 6789 by 1000 to get 789. Divide by 100 to get 7. Modulo it by 100 to get 89...etc.

If you want to use one less variable, you can set Hero HP to One Digit, allowing you to remove the last event line in my image above.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Seda

So I tried following your advice as best as I could, yet I am still having some troubles. What did I do incorrectly?
Here's my hundreds event according to what was recommended:

KK20

That's not even similar in the slightest. :|
You should just copy what I wrote. Variables carry over from other Common Events. So make what I wrote one common event and call that first, then you can remove all the Control Variables calls in your Thousands and Hundreds and it should work fine.

The reason for what you have doesn't work is this:
Assuming Hero HP is 6789, variable 13 = 6789. Variable 10 is set to Variable 13, so 6789. You then divide Variable 9 by 100 which, I'm assuming is equal to 6 from your other common event "Thousands", so it now equals 0. Variable 13 is then modded by 100, which would be 89. You are then checking Variable 10 in your conditional branches, which is still equal to 6789.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Seda

July 19, 2015, 01:27:24 pm #4 Last Edit: July 19, 2015, 01:34:15 pm by Seda
Ah, I apologize! The reason it looked so off from yours was because I thought each Digit had to be in a separate common event page. Here's what I've got now. It now only reads out the thousands digit. What did I do wrong this time? (My conditional branches call the variables Thousands, Hundreds, Tens, Ones by the way).
Event:

KK20

Ah hell I got lazy with copy pasting again

That's what I meant to do.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Seda

You're a genius! The event is working now! Thank you SO much for the help! I was close to giving up on this thing. :D