OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Iva on 08 Nov 2003, 09:33:04

Title: Numbers Q
Post by: Iva on 08 Nov 2003, 09:33:04
I was wondering how could i make script so my plane vould show Altitude on hud like
DKM mi-28. I dont know how i could separate numbers so i could set textures e.g.

if altitude is 179

i would have 1
                   7
                   9

so i could easely make

_plane setobjecttexture [1, format ["\Bla\Bla\%1.paa" _num select 0]
Title: Re:Numbers Q
Post by: Unnamed on 09 Nov 2003, 20:37:52
Not sure if this is what you want, but to break the number 179 up into units. Then something like this would work, there will be better ways, but in the mean time:

Code: [Select]
_Tens=179 Mod 100

_Hundreds=(179-_Tens) / 100

_Ones=(_Tens Mod 1)

_Tens=(_Tens-_Ones) / 10

_Ones=(_Ones-(_Ones Mod 1))  /  1

If it's altitude, then you will want to include thousands e.t.c.

Anyway hope this helps.
Title: Re:Numbers Q
Post by: Iva on 10 Nov 2003, 18:21:21
Thanks but i have made it my self.