Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Goot on Fri 09/07/2004 07:04:48

Title: Using Parameters in custom functions
Post by: Goot on Fri 09/07/2004 07:04:48
I have defined a custom function in my global script:
function lizard_come(int x,int y){
code here
}

Then I imported it in the script header. I then put this in a room script:

lizard_come(131,140);

When I tried to save the game I got an error message telling me I had the wrong number of parameters for lizard_come. Does anyone have any idea of why this didn't work? Does it have something to do with the fact I used x and y for my integers (The function makes a lizard come at coordinates x,y. That's why I used x and y.)
Title: Re: Using Parameters in custom functions
Post by: Gilbert on Fri 09/07/2004 10:34:13
What did you put in the script header? It should be like:

import function lizard_come(int x,int y);

or just:

import function lizard_come(int, int);
Title: Re: Using Parameters in custom functions
Post by: TerranRich on Sun 11/07/2004 06:25:57
BFAQ'ed: http://bfaq.terran-x.com/#coding12

This should've already been in the BFAQ. :)