User Tag List

Results 1 to 10 of 10

Thread: Imzogelmo's Propsal for FF1 character data template

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Floormaster Imzogelmo's Avatar
    Join Date
    Sep 2005
    Location
    Earth, currently
    Age
    45
    Posts
    387
    Mentioned
    7 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    1,463
    Level
    12
    vBActivity - Bars
    Lv. Percent
    95.18%
    // num is the number in question
    // place is the name for the digit you want, 1, 10, 100, etc. A well-formed place will be an integral power of 10, but let's not count on that

    int get_digit (int num, int place)
    {
    if (place < 0)
    // choke and die with nasty error
    else if ( place < 10) return num% 10;
    else return get_digit((int) num / 10, (int) place / 10);
    }

    // if you can guarantee that the number requested is 'well-formed'...

    int get_digit(int num, int place)
    {
    return ((int) num / place) % 10;
    }

    // maybe you're expecting places named 0, 1, 2,... instead of 1, 10, 100...
    int get_digit(int num, int place)
    {
    return ((int) num / pow(10, place)) % 10;
    }
    Last edited by Imzogelmo; 01-16-2013 at 05:31 AM.

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,961
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.43%
    Quote Originally Posted by Imzogelmo View Post
    int get_digit(int num, int place)
    {
    return ((int) num / pow(10, place)) % 10;
    }
    Ahh. That's what I had! ..I could probably do one with exp10, log or something.. but I think this version is the best.

    Anyhoo, what I was hinting to was; why not just treat MP like most rpg's do: Just a MaxMP and MP variable (with some maths for FF1). (That way I don't have to hack anything fancy in also.lol) :lazy:
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social