Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: RickJ on Sun 15/11/2009 00:10:26

Title: Can extender funtions be defined in a module?
Post by: RickJ on Sun 15/11/2009 00:10:26
In the latest V3.2RC it would appear that it's not permitted to define extender functions in a module.  Doing so produces an error as shown in the example below.

*** Module Header ***
import function FunctionName(this *Character);

*** Module Script ***
function FunctionName(this *Character) {
}

*** Compiler Message ***
Failed to save room room0.crm; details below
BluTemplate.ash(125): Error (line 125): 'this' must be followed by a struct name


I thought we used to be able to do this but I may be mis-remembering.  Could someone verify if this is the correct operation or if it's a bug.
Title: Re: Can extender funtions be defined in a module?
Post by: Lufia on Sun 15/11/2009 01:17:13
Try is with this Character* ? That's how the example for extender functions is written in the manual.
Title: Re: Can extender funtions be defined in a module?
Post by: TerranRich on Sun 15/11/2009 02:48:43
That's how I have it:

Quote
function FadeObject(this Object*, FadeDirection fdDir, String sSeconds)
{
    ...
}
Title: Re: Can extender funtions be defined in a module?
Post by: RickJ on Sun 15/11/2009 02:56:12
Thanks guys.  I had looked at the example in the help but didn't see the difference... I feel so stupid.   :=