You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order for the instance to have access to all the TorqueScript functions you write for the template, it gets the template namespace assigned to it in the instances' C++ onAdd method. This has the negative side effect of removing all access to the BehaviorInstance ConsoleMethods, you get the BehaviorTemplate ConsoleMethods instead.
Would be nice to get more feedback from the community if the solution is to just get rid of any BehaviorInstance ConsoleMethods as you suggested or figure out a way to inherit namespaces better.
Won't that also have the unpleasant side effect of causing the game to crash if somebody calls one of the BehaviorTemplate ConsoleMethods on a BehaviorInstance? This definitely needs to be rethought.
What if BehaviorInstance set its superClass to the BehaviorTemplate instead? The console should then link the BehaviorInstance to the BehaviorTemplate methods as well as any methods defined within the BehaviorInstance class' namespace.
The function getTemplateName in file
\engine\source\component\behaviors\behaviorInstance_ScriptBinding.h
cannot be reached by script.
When called on a valid BehaviorInstace, it outputs the following error to console
"Unknown command getTemplateName"
One way to circumvent this is simply to call BehaviorInstance.template, which happily gives us the name of its template.
I suspect that this has something to do with the way Behaviors are created but this is beyond my comprehension.
I would suggest simply removing the associated ScriptBindings as the simplest solution.
The text was updated successfully, but these errors were encountered: