Conversation
jamiltron
commented
Apr 24, 2017
- Updating console to allow for setting/getting conversation subjects.
| end | ||
|
|
||
| function Commands:get_conversation_subject_command(session, response, entity, subject) | ||
| local conversation_component = entity:add_component('stonehearth:conversation') |
There was a problem hiding this comment.
The getters should check if the component exists before calling a function on it instead of automatically adding the component. Otherwise players may add the conversation component to any selected entity if they call this on it.
There was a problem hiding this comment.
Good point. I considered that but kind of wanted to just add it to anything to test. But now that we're formalizing how it should work, changing it to work the way you describe is better. Thanks!
There was a problem hiding this comment.
yup, the conversation component is added to base humans from the json file, so you shouldn't have to add it for testing unless you're testing on goblins or something else.
ui/console/debug_console_commands.js
Outdated
| radiant.console.register('add_conversation_subject', { | ||
| call: function(cmdobj, fn, args) { | ||
| var subject = args._[0]; | ||
| var polarity = args.polarity; |
There was a problem hiding this comment.
You probably mean sentiment, instead of polarity
There was a problem hiding this comment.
Yep, thanks for catching that.