Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
[RESOLVED] Showing the Hero's level in a CMS?
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RESOLVED] Showing the Hero's level in a CMS?

Started by Tezuka, February 25, 2009, 09:28:30 PM

0 Members and 1 Guest are viewing this topic.

Tezuka

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:



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.

Tezuka

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?

tSwitch

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?


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

modern algebra

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.

Nessiah

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.


Tezuka

Well I tried Nessiah's way of doing it and it looks like it works!

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