Notifications
Clear all
[Closed] format float output trailing f?
Dec 04, 2014 1:50 pm
Hi There
I am writing a simple script to output some values to a text file, I have this simple bit of code
life = pf.getParticleLifeSpan i
pf.particleIndex = i
format "% % % % %
" pf.particlePosition.x pf.particlePosition.z pf.particlePosition.y pf.particleAge life to: file
This outputs the values but for some reason the position values are output with no trailing ‘f’ but the aga and life values have a trailing ‘f’ for example:
-18.3405 9.11838 -94.5673 1f 40.5313f
How do I tell the format command to not put a trailing f on the age and life values?
Jasper
3 Replies
Dec 04, 2014 1:50 pm
they’re time values, so
(<time>as float)/ticksperframe
will cast into the correct format. just as
<float> as time
does the reverse.
Dec 04, 2014 1:50 pm
Alternatively, use the .Frame property of the time value.
t = 15.5f
t.Frame <-- 15.5
Dec 04, 2014 1:50 pm
The problem was it was a TimeValue so just used it as a float and all is good. Thanks for the help.