So, I cam trying to call a function on a script object from not inside that script object. Anglescript.
Basically, I have come across 2 scenarios where this is something i have failed on so far.
Once, When I wanted to kind of make a controller. I was trying to put the functions to move the node inside the script object, but I couldnt find a way to call those function from a controller class I made. I ended up using a second class to move the node, instead of using the script object to move it.
Second, now I am trying to assign a enemy target. Currently have two layers of classes. One that holds data like this, and one that is the script object just to handle the update calls, and collision detection, but then it refers to the class that created it. I pass it that class when created, and just refer to it in the scriptobject, and grab any data I want. So if I want to set a target, I set it on that parent class, then look for it from my script object…
Does that make sense? Is that acceptable? What would be cool, If I could just say something like:
Pawn@ pawn = cast<Pawn>(some_node.scriptObject);
pawn.set_enemy(someother_node);