User Tag List

Results 1 to 4 of 4

Thread: [2.50.2] Game->Generic[] -> As Unfloored Floats

  1. #1
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,762
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.12%

    [2.50.2] Game->Generic[] -> As Unfloored Floats

    One thing that would, or should, be easy to add to 2.50.2, is a conversion of the values stored in Game->Generic[], so that the user may utilise them as floats. I noticed that, Game->Generic[GEN_MAGICDRAINRATE], if set to '0.5', returns as '0'. This is interesting, as if you wanted to make all magic costs higher, you could set the value of that index to '3', or more; but you cannot actually lower costs below 1/2 (an index value of '1').

    Changing it to a float, would mean that a value of '0.5' in that index spot, would quarter magic costs. I see some other possible uses for this array, but that is the most prominent.

  2. #2
    Quest Builder Anarchy_Balsac's Avatar
    Join Date
    Nov 2005
    Posts
    751
    Mentioned
    11 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    2,592
    Level
    16
    vBActivity - Bars
    Lv. Percent
    63.98%
    A double would be better. Floats sometimes have weird, unintended side effects, which is why I NEVER use them.

  3. #3
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    I pretty sure do to the way the engine handles numbers everything is a fixed point number.
    Why cause ALLEGRO was written in the 90s!

  4. #4
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,762
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.12%
    Quote Originally Posted by Tamamo View Post
    I pretty sure do to the way the engine handles numbers everything is a fixed point number.
    Why cause ALLEGRO was written in the 90s!
    I wouldn't think that there is any reason that floats wouldn't work, but I really doubt it: It shouldn't matter, because the internal value is ZScript * 10000.

    Thus, if Link->X/Y/Z was a float in ZScript, the input would still be an int, for Allegro, but it wouldn't change the position of Link's object, until the value was 10,000, 20,000, ... .

    e.g., You could write Link-X += 0.01 in ZScript, which would add +100 to the internal variable. Once those cumulative +100s reached 10,000, Link's position would change. At least, that seems logical.

    P.S. For whatever reason, Link->Jump is a float when you Trace() it to allegro.log. It's supposed to be a pixel value, but I also know that it as a bug that Saffith only recently resolved, so I'm unsure if the behaviour there, is related to that. The internal variable for Link's XYZ coordinates, may be declared as a fix.

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