But isn't RegisterObjectBehavior the function used to allow casting of a reference type, as shown here? How do I cast a funcdef, if I can't use asBEHAVE_IMPLICIT_REF_CAST, if I can't register a behavior?
It's illegal to register additional behaviours or methods on funcdefs. The funcdefs are built-in types and cannot be modified. It would appear that I need to add verifications for this so that AngelScript doesn't return success in this is attempted.
The RegisterGlobalProeprty() fails because you're not informing the address of the property that you're registering. If you're just registering a dummy, then at least give a false address different from 0
ASengine->RegisterFuncdef("void DifferentFunctionPointer()"); ASengine->RegisterGlobalProperty("DifferentFunctionPointer f", (void*)1);still gives a registration error. EDIT: Oh, wait, I needed to add an @. Let's see if I can make this work... EDIT2: Nope, no help. I can register arbitrary numbers for funcdefs to point to, but if I try to pass one of those arbitrary fundefs as an argument to a function, the program crashes. Apparently passing a pointer in AngelScript involves trying to read the data being pointed to.