User Tag List

Results 1 to 9 of 9

Thread: Negative fixed values

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Negative fixed values

    I'm having an unexpected problem, it turns out MMF2 can assign negative fixed values to objects. Thing is, I need a null value that I can use as "no object is selected", I used to let -1 represent this, but now I realize that doesn't work. Sure, it's extremely unlikely that the value -1 will be assigned to an object, but I always try to go for the scientifically correcy solution. Is there any fixed value an object can not have?

    There's no need to suggest a workaround btw, I know about them all. I just strive to to have the smallest possible solution to every problem.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Negative fixed values

    It seems to me that 0 should work.

    Based on a function in the extension SDK, a fixed value is:
    (Creation ID << 16)+Object Number

    I guess that you have reached such a high number of objects that the last bit of the number turned 1 which results in a negative value.

    I've just done some tests and the first fixed value seems to be 65536, and it will always increase - at one point, you'll get negative values.

    So I guess 0 works. The fixed value increases with each object, there's just this one point where it will start all over again (at 65536?), but with a minus.

  3. #3
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Negative fixed values

    Given that function, I think you're safe with -1, as that equally can't be a fixed value assigned to an object (for active ones, at least).

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Negative fixed values

    Oops, typo there. It's not *, it's +.

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Negative fixed values

    As Looki says, the fixed value uses the high 16 bits for the creation id (IIRC it is the frame number) and the low 16 bits for the object number (which is its index in MMF's fixed-length object list).
    The frame number can in theory be any value, but the object number is always between 0 and the "number of objects" setting in the frame properties (which is capped at 20000). Using a value with the low 16 bits (the object number) set to between that and 65535 (max of a 16 bit number) should be guaranteed invalid.

    -1 fits this, as it would be interpreted as 65535,65535.

    0 is unsafe, if unlikely to be hit.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Negative fixed values

    Oh, I wasn't aware that both of the components can be zero. Your method seems to make more sense

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Negative fixed values

    Awesome, thanks for checking it out!

  8. #8
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Negative fixed values

    Also, it's worth remembering that the fixed value of a destroyed object will be reused eventually. It may take a long time to be reused, but it will be.

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Negative fixed values

    Thanks for the info! That won't be a problem though.

Similar Threads

  1. Fixed values?
    By ChrisBurrows in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd June 2012, 06:52 PM
  2. What are fixed values?
    By pinacoladaxb in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd November 2008, 11:15 PM
  3. Negative values in a List, and Global Values
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th January 2007, 06:08 AM
  4. Fixed Values?
    By Durnus in forum Extension Development
    Replies: 17
    Last Post: 25th July 2006, 03:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •