OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: McHale on 17 Jan 2003, 01:24:07
-
Im trying to write a script that shows variable numbers. Is it even possible to display integers as text on the screen?
Maybe theres a special way to convert an int to a string? Please help. :-\
-
Yup! 'tis, but ya better check out the cutscenes... board. :) Oh, and search the
Ed.Depot (http://www.ofpec.com/editors/index.php) for already made scrolls.
Ya might get lucky, m8 :-*
(Sorry, I don't think I have a copy to attach right now :-\ )
-
Hmmm I don't think it's possible to display integers. I need to somehow get the numbers 0 to 100, 000 to be able to display on screen(depending on a certain condition)... Is there a script around that does something like this?
-
It sure is possibly... by use of the format command...
eg.
hint format ["Number: %1", num ]
Where num is your variable. The %1 in the line will be replaced in the hint box by the variable you specify after the comma... you can also specify mulitple variables:
hint format ["Value 1: %1 \nValue 2: %2 \nValue 3: %3", num1,num2,num3 ]
The %1, %2 and %3 will be replaced by the variables after the comma. Remember to keep the order correct ;)
The \n in there just makes the text jump down to the next line... it has no effect on the variables... happy coding
-
... and dont forget that you can do the same thing with titletext:
eg.
Titletext [format ["Value 1: %1 \nValue 2: %2 \nValue 3: %3", num1,num2,num3],[plain down] ]
:)
-
Thanks I already figured out. You're too slow! :)
-
::) McRude, ye ba*tard. :D they're not slow - you just went online too frikkin late! :booty: