Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualViolet CLM

Posted 26 June 2013 - 10:08 PM

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.

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?

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

Nope,
	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.

#2Violet CLM

Posted 26 June 2013 - 07:55 PM

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.

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?

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

Nope,
	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...

#1Violet CLM

Posted 26 June 2013 - 07:53 PM

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.

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?

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

Nope,
	ASengine->RegisterFuncdef("void DifferentFunctionPointer()");
    ASengine->RegisterGlobalProperty("DifferentFunctionPointer f", (void*)1);
still gives a registration error.

PARTNERS