Author Topic: RMXP Custom Picture Menu  (Read 1712 times)

Offline Seda

  • Total Beginner
  • Posts: 4
  • LV: 0
    • View Profile
RMXP Custom Picture Menu
« on: July 17, 2015, 05:40:52 AM »
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:



Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2943
  • LV: 368
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #1 on: July 17, 2015, 09:49:30 PM »
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.
« Last Edit: July 19, 2015, 07:59:19 PM by KK20 »



(click to show/hide)
NNID: KK20-CP

Offline Seda

  • Total Beginner
  • Posts: 4
  • LV: 0
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #2 on: July 19, 2015, 12:10:05 AM »
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:

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2943
  • LV: 368
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #3 on: July 19, 2015, 01:13:12 AM »
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.



(click to show/hide)
NNID: KK20-CP

Offline Seda

  • Total Beginner
  • Posts: 4
  • LV: 0
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #4 on: July 19, 2015, 07:27:24 PM »
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:
« Last Edit: July 19, 2015, 07:34:15 PM by Seda »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2943
  • LV: 368
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #5 on: July 19, 2015, 07:59:01 PM »
Ah hell I got lazy with copy pasting again

That's what I meant to do.



(click to show/hide)
NNID: KK20-CP

Offline Seda

  • Total Beginner
  • Posts: 4
  • LV: 0
    • View Profile
Re: RMXP Custom Picture Menu
« Reply #6 on: July 20, 2015, 08:20:27 AM »
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