writefloat and readfloat

Blitz3D Forums/Blitz3D Beginners Area/writefloat and readfloat

Hujiklo(Posted 2004) [#1]
I'm making an object/entity placement utility. I need to save my target node positions out and then load them back in to my game for enemy and object placements.
My problem is that once I read my float data back in my objects are not in the same place as the nodes, they are a little offset (by what seems to be anything up to + or - a metre). I've come to the conclusion that the writefloat is only writing integer values even though the variables I grabbed are written to the screen as the float values that they are - All my variables for positions are set as float values but I'm only able to write or read integer values. I've gone through my code about 50 times looking for where I might just be grabbing integer values but it simply isn't so...
Am I missing something? Can arrays only hold integers or something?? It's driving me up the freaking wall!!
I do a test and lay out about 30 nodes, save the file and then load it back in - I then see all my nodes again in roughly the same positions near their grabbed positions but as I say they are not exact.
Can anybody give me a clue what I may be doing wrong??

X Y and Z positions the only problem..rotations are grabbed as integers and are exactly reproduced.

Thanks.


Koriolis(Posted 2004) [#2]
Can arrays only hold integers or something
By any chance, did you declare somthing like that:
Dim entitiesX(100))

If so do this:
Dim entitiesX#(100))
Yep, this is pretty obvious, but it can't hurt to check.


Hujiklo(Posted 2004) [#3]
Koriolis it may be obvious to a superior form of life like you! - but to a mud-dwelling troglydite whose closest living relative is a toss-up between a sausage or donkey like me....well, it was simply the furthest thing from my mind!!...sniff....weep... for your sagaciousness and graciousness you have my undying gratitude!!!!!! THANKYOU!!

GAAAH! What an Oaf I am! Sniff..please don't eat me.


TomToad(Posted 2004) [#4]
Dim entitiesX#(100))


Koriolis it may be obvious to a superior form of life like you!

Don't feel too bad, Hujiklo. This superior form of life missed the glaringly obvious mismatched parenthises, twice. :D


Koriolis(Posted 2004) [#5]
LOL