Page 1 of 1

AreaTriggers created from extension scripts cannot call functions from extension scripts

Posted: Sun Feb 25, 2018 1:20 am
by JakSparro98
When an Areatrigger that is created by an extension script uses OnEnterMethod or OnLeaveMethod, it will search the method from the map script instead of the script file.

Map and Script examples.

Re: AreaTriggers cannot call functions from extension scripts

Posted: Sun Feb 25, 2018 12:19 pm
by Gurt
Fixed after Beta 1.0.2c

Turns out that this works already for the generic IObjectTrigger.SetScriptMethod, which all triggers call when something happens. Turns out that the AreaTrigger's SetOnEnterMethod / SetOnLeaveMethod called the wrong internal function to make the magic work.

ScriptAPI: Fixed following to work with extension script functions:
IObjectElevatorAttachmentJoint.SetOnDestinationReachedMethod
IObjectElevatorPathJoint.SetOnElevatorReachedMethod
IObjectRailAttachmentJoint.SetOnDestinationReachedMethod
IObjectAreaTrigger.SetOnEnterMethod
IObjectAreaTrigger.SetOnLeaveMethod

Also fixed a bug where IObjectTrigger.SetScriptMethod didn't always trigger functions in extension scripts if the script was deactivated and then re-activated.