Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

IMyInventory.GetItems() Returning MyInventoryItem instead of IMyInventoryItem

Discussion in 'Programming (In-game)' started by Java_SE_Binary, Mar 1, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Old Garyman Trainee Engineer

    Messages:
    10
    I agree with you on that. I don't really need it either.
    For my ingame scripts I only use 2 decimal places with center rounding. It's good to display this on LCDs.
    Maybe there are situations where accuracy is important. MyFixedPoint is not only used for ingame scripts, or maybe it is. You certainly know it better than I do.
     
  2. Malware Master Engineer

    Messages:
    9,866
    No, it is indeed used internally. This is one of my big issues with the scripting api; that it's way too close to the metal and should have been sandboxed properly.
     
  3. Roxette Senior Engineer

    Messages:
    1,546
    Why is this still such a problem everywhere in the game? I move an integral number of components from one inventory to another and then both of them have ~ prefixes on the number, because somehow a floating point error was introduced...
     
  4. Malware Master Engineer

    Messages:
    9,866
    Because it is a problem in general for software. If you first have started getting floating point issues, they tend to spread like viruses... :p

    ... and as I said because they insist on accuracies I don't feel we need.
     
  5. ThisIsADogHello Apprentice Engineer

    Messages:
    123
    MyFixedPoint isn't a floating point type, though, as the name implies. It's a fixed point type, with its underlying type being a long. Floating point errors are only getting introduced because it's getting cast to/from floats/doubles in places.

    It doesn't help any that the type doesn't know whether it's supposed to behave like a count or like an amount, so it's up to the devs, whenever they're using the type, to make sure that they're using it correctly in that context, with the specific types of items involved. Without the type enforcing the constraints itself, all it takes is one intern somewhere to slip up and introduce the possibility of floating point imprecision to knock down the whole house of cards.
     
  6. Malware Master Engineer

    Messages:
    9,866
    My...

    point

    exactly.


    I'm not sorry.
     
  7. ThisIsADogHello Apprentice Engineer

    Messages:
    123
    * Fixed that for you
     
Thread Status:
This last post in this thread was made more than 31 days old.