Forum rules - please read before posting.

Get NPC to say player's name during conversation

I must be searching with the wrong terms -- this seems like such an obvious question for others to have asked. But how does one do the equivalent of [speaker] in speech text, except that instead of [speaker], it's basically [person being spoken to]? I want NPCs to say the name of the character (there are multiple characters and character switching). I realize there's no "target" value associated with ActionSpeech, so maybe this is more complicated than I think, but "Hi, [target]" is the idea. So if Bob is talking to the NPC, I want the NPC to respond with "Hi, Bob", and if Keith is talking to the NPC, "Hi, Keith". Does this require variables in some way? Thanks!


  • Does this require variables in some way?

    Yes - you can rely on the [var:X] token, which gets replaced by the value of Global Variable "X" (where X is the ID number shown beside its name in the Variables Manager).

    For example, if Global Variable ID #3 is a String variable, then you can begin your conversation sequence with a Variable: Set Action to set this Variable's value to Bob, and then insert the token [var:3] inside your speech Actions to show Bob's name in subtitles.

  • Suspected as much, since there's not a "listener" Char object in ActionSpeech. Thanks as always for the quick reply and explanation, Chris!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.