Forum rules - please read before posting.

Shared actionlist asset for speech

Hey Chris,

I was wondering if there is a way to dynamically assign the Speaker to a Dialogue: Play Speech at runtime for an ActionList Asset?

  • I have generic NPCs that are spawned at runtime. These NPCs have a name and label colour randomly generated for them
  • When interacting using talk with the NPCs it triggers an ActionList Asset
  • In the ActionList Asset there is a variable: check random number between 1-30
  • Each branch of the random number leads to a unique dialogue: play speech line

This currently works well- and when talking to a random NPC the subtitles will pop up the random text. However, I also want to assign the NPC name and colour as the Speaker field is currently blank- so it is being treated as narration.

Is there a clean way to assign the speaker dynamically without having to do this through custom code?

I've attempted to store the speaker name in a local variable and then use a Menu: Set Input Box text for the Subtitles speaker label- but this doesn't seem to work.

The only other thing I can think of is swapping from AC UI to Unity UI and updating the label with custom code outside of AC, but I'd rather not if it is avoidable.

Thanks

Comments

  • You can override a speech Action's "Speaker" field with a GameObject parameter.

    If your Hotspot component is on the same object as the NPC, and the Hotspot references an ActionList asset with a GameObject parameter, you can assign the Hotspot in the Hotspot parameter field, which will automatically set parameter's value to the Hotspot (and the NPC, if the same object) when the interaction is run.

    Otherwise, you can attach a Set Interaction Parameters component to the Hotspot to configure exactly which object is set to the parameter.

    A tutorial on ActionList parameters can be found here.

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.