PDA

View Full Version : abs compile error



ShadowMancer
06-05-2007, 01:22 AM
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:

DarkDragon
06-05-2007, 02:01 AM
All built-in ZScript functions and variables are Capitalized. Try Abs instead of abs.

The documentation (http://www.armageddongames.net/forums/showthread.php?t=93851) 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.

ShadowMancer
06-05-2007, 02:09 AM
Ah silly me I knew that.. :rolleyes:

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..:D

DarkDragon
06-05-2007, 02:21 AM
Cool. I'm happy to help if you run into any more problems.