The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: Tezuka on February 25, 2009, 09:28:30 PM

Title: [RESOLVED] Showing the Hero's level in a CMS?
Post by: Tezuka on February 25, 2009, 09:28:30 PM
So far my Job System is almost complete, but there is one problem I can't get passed; showing the actual Hero's base level in the menu.

Here I have the menu layout:

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi36.photobucket.com%2Falbums%2Fe9%2FTezuka101%2FLayout.png&hash=711361beea4f18cf6171a8e721f8a4f347f03862)

I have pictures with the numbers 1-9 which would be used to show the base level of the hero (where 00 are), but I can't figure out how I could actually do this.

Does anyone know how I could do this?

Also lol at doing a whole job system, but can't show the base level. :x

EDIT: The numbers have black backgrounds as I am using ImagePositioner to show you the layout.
Title: Re: Showing the Hero's level in a CMS?
Post by: Tezuka on February 26, 2009, 12:26:06 AM
Whoops, I lied. What I thought I would work didn't.

So, anyone got an idea on how I could show the base level of the character?
Title: Re: Showing the Hero's level in a CMS?
Post by: tSwitch on February 26, 2009, 02:03:20 PM
incoming pseudocode


if level < 10
   display 0 in the tens spot
   if level == 1
       display 1 in the ones spot
   [if level == 2,3,4,5,6,7,8,9 obviously]
else
   if level % 10 == 1
       display 1 in the tens spot
        if level - 10 == 1
            display 1 in the ones spot
       [if level - 10 == 2,3,4,5,6,7,8,9 obviously]
   else
      if level % 10 == 2
         [etc...]


might not be the best way and I just came up with it off the top of my head
but that could work.

do you get the idea I was trying to give you?
Title: Re: Showing the Hero's level in a CMS?
Post by: modern algebra on February 26, 2009, 07:24:48 PM
Yeah, that's more or less what I would do. It's a good idea to use a binary tree though.

Something like



if digit < 4
  if digit < 2
    if digit == 0
      Show 0
    else
      Show 1
    end
  else
    if digit == 2
      Show 2
    else
      Show 3
    end
  else
    if digit < 8
      if digit < 6
        if digit == 4
          Show 4
        else
          Show 5
        end
      else
        if digit == 6
          Show 6
        else
          Show 7
        end
      end
    else
      if digit == 8
        Show 8
      else
        Show 9
      end
    end
  end
end


It's not a big deal, but it, on average, reduces the number of con. branches that the program will run through any time it is run. And yeah, NAM's right on for the rest.
Title: Re: Showing the Hero's level in a CMS?
Post by: Nessiah on February 26, 2009, 07:50:43 PM
I really need to make a FAQ for showing up numbers

Variable: thousand is set equal to hero HP
Thousand /1000
Thousand mod 10

if thousand = 1 show pic: 1.png

Variable: hundred is set equal to hero HP
hundred /100
hundred mod 10

if hundred = 1 show pic: 1.png


same thing applies to that.
Title: Re: Showing the Hero's level in a CMS?
Post by: Tezuka on February 26, 2009, 11:28:16 PM
Well I tried Nessiah's way of doing it and it looks like it works!

Thanks to all three of you for your help! :)