Forum rules - please read before posting.

[speaker] token returns gameobject.name in some cases

Hi

(This potential bug is for a fairly specific situation)

Issue: In some cases during a PlaySpeech action, the [speaker] token is replaced with the game object name, not the AC.Char speaker label.

To Reproduce:

  • Have a AC.Char without a hotspot (for example a NPC)
  • Run a Action PlaySpeech
  • Set the speaker to that AC.Char
  • Ensure the NPC does NOT have a hotspot component (you cant interact with this particular NPC, but it does speak to you)
  • Use the [speaker] token in the Line Text.
  • [speaker] is replaced with the gameobject name of the AC.Char.

Reason: The Spech() constructor defaults the realName member to _speaker.name, which is the game objects name.

log.speakerName = realName = _speaker.name;

Suggested fix:
Initialized the realname member to _speaker.GetName() or something similar.

(This might not be correct, as GetName() does some other things)

I also realize that you might not even intend the realname to be set to the speaker label, since its specifically named "Speaker Label", but defaulting to the game object name dosent feel correct. If the workaround is to put a hotspot on a gameobject, even if you cant interact with it, I can do that too :)

Comments

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.