User Tag List

Results 1 to 2 of 2

Thread: Reading floating point values from array file and into global values

  1. #1
    No Products Registered

    Join Date
    Jan 2017
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading floating point values from array file and into global values

    Got a bit of a problem. In my game, I have a table of difficulty values (speeds, spawn rates etc.) in an Array file. I import this on load, and when the player starts a level, I read from the array into Global Values, and use these values throughout my program.

    The problem is that the values are being rounded to the nearest integer value.

    Is it impossible to read floating point values from an array file? Do you maybe need to import them as a string, and convert them somehow? That seems very clunky.

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    alexexhowl's Avatar
    Join Date
    Jan 2015
    Location
    RU, YKT
    Posts
    348
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Arrays can only store integer values. All you need to do is multiply your value by 100 before you insert it into the array, and divide it by 100.0 when you retrieve it. Or, alternatively, you can use a text array. Then all you do is convert the float value to a string before you insert it, and could convert it back when you retrieve it. (c)

Similar Threads

  1. Array vs Global Values
    By comrade_yak in forum Fusion 2.5
    Replies: 0
    Last Post: 9th April 2014, 09:41 PM
  2. Positions with Floating Point Values
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 28th April 2011, 12:07 AM
  3. Don't know how to use floating point values
    By garciafigueres in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 4th January 2007, 07:30 AM
  4. Suggestion: Floating point values in Properties
    By Dines in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 29th November 2006, 10:53 AM

Posting Permissions

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