So I’m trying to concept this out and I’m mostly just seeing what kind of advice other peeps might provide.
I need a usable actor system, but my specific needs go beyond just a “Use Actor” function.
Take for instance a Door. Users should have the following options:
Open/Close, Search, Pick Lock, Lock/Unlock, Disarm Trap, Bash/Disable, etc
And an NPC might give the following options:
Talk To, Trade With, Attack, Pick Pocket, etc
I am currently thinking of two separate designs. One is to have each item define the actions that can be done to it in a list, and provide functions via interface that implement the specifics. There will be one “GetActions” method in the interface that returns the list of available actions for that actor. Then I’d just pop the list up in a context menu when clicking on the actor.
The other design is a bit more like the existing usable systems on the market place. I would just have one “Use Actor” function that would map to whatever the default action is. Open/Close for a door, Talk for an NPC, Trade for Vendor, etc. And then I would implement the additional functions (Search, Disarm, Bash, etc) via some type of Skill system that would require targeting the specific actor.
Of course I can see benefits and drawbacks to either system. If anyone has any thoughts on this or if you’ve done something similar I’d love to hear about it.
Thanks