[solved] Using text as number

1MrPaul1

  • *
  • Posts: 1285
I use some text lists for setting some attributes as speed health etc, so, sometimes I have not mathematically right digits in text, as 002 or 025 or something like this. If type this digits (like 002) in number settler of cause it will show an error (red cross behind number) but if I convert this digits trough "anything as number" block, this block remove unneeded nulls, and 002 became as just 2, 025 became as 25 and do not show any errors (as in the attachment), So, this is exactly what i need, but is it right way for engine? May be this can be as potential reason of errors in future? Or engine automatically corrects digits for number attributes?

« Last Edit: March 09, 2012, 04:05:57 am by 1MrPaul1 »

captaincomic

  • *
  • Posts: 6108
I think you will be fine, this shouldn't cause any errors. If you enter text "002" (through a text attribute) in a "_ as number" block, it will convert it correctly to the number 2.
If you enter the number 002 directly in the "_ as number" block it also works.

1MrPaul1

  • *
  • Posts: 1285
Good news! Thank you!
Stencyl is a really great developed gametool. Everything is so simple