Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

abs compile error

3 replies · 1,429 views · Started 05 June 2007

ok, i am almost done writeing my first real zscript
after much editing i am still left with one confuseing compile error..

the line:
return abs((Link->x - x) + (Link->y - y))

the error:
function abs is a unknown function

???!
abs is a built in function right?

ok, i see it is 'float abs()' in the docs
i am passing an int
could that be the problem?

i tried various attempts such as

return float abs()
get something about an unexpected float in token int

any ideas??

btw thank you DarkDragon for your answers to my previous questions :thumbsup:

All built-in ZScript functions and variables are Capitalized. Try Abs instead of abs.

The documentation at the top of this forum should list the exact syntax of all built-in functions and variables, as well as a brief description of what they do. You can also bring up the documentation from inside the ZQuest script editor by hitting F1.

Ah silly me I knew that.. 🙄

thank you again DarkDragon.

I have been reading the docs (again and again and again)
my first script should be compleate now, it compiled now to test
and debug and test and debug... you get the point..😃