The comment set system is for that. You can create multiple comment sets & swap to them as needed.
If you wanted to make it global then I suppose a small loop would work ok. Inside this loop you could listen out for the type of command is currently active. So in this loop you would have it check the currently selected command or if an item is held & then you set the active comment set based on that.
I suppose there would be other ways you could do this, such as creating an on cursor enters action for each object & then defining the active comment set in that, but I'm not sure how accurate that would be, plus it would require a lot of work.
chkCommentSet()
if not game.UsedItem:isEmpty() then
game.CurrentCharacter.CurrentCommentSet = CommentSets["comment_set_name"]
elseif game.ActiveCommand:getName() == "use" then
game.CurrentCharacter.CurrentCommentSet = CommentSets["comment_set_name"]
elseif game.ActiveCommand:getName() == "talk" then
...
end
end
registerEventHandler("mainLoop", "chkCommentSet")
The code above is just a raw example. It's untested so I have no idea if it will work. You need to finish it off & edit the names of things. For instance "use" & "talk" are the names you gave to the buttons containing the commands. "comment_set_name" would be the name of the comment set. Remember that names are case sensitive.
* hehe: I see ke4 beat me to it!