How to Generate a Typed getBehavior Method in GeneratePropertySetterWithoutCasting

When implementing source code generation for a strongly-typed language like GD CPP/CS, the GeneratePropertySetterWithoutCasting method will generate source code that fails to compile.

I know this problem doesn’t occur in GDJS, but I hope someone can give me a few hints on how to solve it.

eventsFunctionContext.returnValue = eventsFunctionContext.getObjects(“Object”)[0].getBehavior(eventsFunctionContext.getBehaviorName(“Behavior”))._getXXXX();

What are you trying to do?

attempt to implement the export of source code to other programming languages

The C++ code generator hasn’t been used since the migration from GDevelop 4 to GDevelop 5. It hasn’t really been maintained since it’s currently dead code. So, you will have to implement some missing features to be able to use it.
Also, any extension that uses JavaScript will have to be re-implemented.

I might have found what to use to get the type: EventsBasedBehavior, EventsBasedObject