How to get reference to actor GO from dialogue in custom lua function?
Posted: Tue Jul 23, 2024 2:51 am
Hey Tony and everybody!
I have my own inventory system, and i wish to check for some items during conversations.
So i implemented and register Custom Lua Functions.
But there is 1 problem: i wish i can get a reference to actor gameobject or any component, so i could and get reference to Player's inventory.
In CustomLuaFunctionInfo wizard i can see the only acceptable parameter: actor.
So, my questions is
1) What is actor parameter on C# side? Is it a string?
2) How can i get reference to dialogue actor from my custom lua function to search for required interfaces?
Thanks!
(I know it can be done with singletons and custom actor databases, but is there a shortcut?)
I have my own inventory system, and i wish to check for some items during conversations.
So i implemented and register Custom Lua Functions.
But there is 1 problem: i wish i can get a reference to actor gameobject or any component, so i could
Code: Select all
actorGO.GetComponent<IHaveInventory>()
In CustomLuaFunctionInfo wizard i can see the only acceptable parameter: actor.
So, my questions is
1) What is actor parameter on C# side? Is it a string?
2) How can i get reference to dialogue actor from my custom lua function to search for required interfaces?
Thanks!
(I know it can be done with singletons and custom actor databases, but is there a shortcut?)