OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: McHale on 17 Jan 2003, 01:24:07

Title: Displaying integers?
Post 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.   :-\
Title: Re:Displaying integers?
Post by: Tomb on 17 Jan 2003, 01:37:47
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  :-\ )

Title: Re:Displaying integers?
Post by: McHale on 17 Jan 2003, 03:11:14
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?
Title: Re:Displaying integers?
Post by: Sui on 17 Jan 2003, 04:03:53
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
Title: Re:Displaying integers?
Post by: Bremmer on 17 Jan 2003, 11:10:10
... 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] ]

 :)
Title: Re:Displaying integers?
Post by: McHale on 17 Jan 2003, 20:09:06
Thanks I already figured out. You're too slow!  :)
Title: Re:Displaying integers?
Post by: Tomb on 18 Jan 2003, 02:32:26
 ::) McRude, ye ba*tard.  :D they're not slow - you just went online too frikkin late!  :booty: