Forum rules - please read before posting.

Check which character a dialogue line is showing text of

I've knocked together a system for a speech bubble to use with background, non-blocking speech. It can follow the player around quite happily, thanks to AC, but I've also given it a dynamic "tail", that will point to whoever's talking. That's the idea, at least - right now it can only do it for the player.

Is there any way to check which character's speech is assigned to a UI that's been instatiated for this line?


  • I'm not sure what information you have, but here's a hacky way to get started from no information.

    This gets a list of all active speech, then gets all the menus assigned to that speech, and then the character that is speaking from the speech object attached to the menu.

    `List list = KickStarter.dialog.speechList;

    foreach(Speech item in list)
    Menu[] menus = KickStarter.playerMenus.GetMenusAssignedToSpeech(item);
    foreach(Menu menu in menus)
    Speech _speech = menu.speech;

  • That's along the right lines, but if you know which Canvas is being used, you can use that to find the Menu class and then the Speech class:

    Menu myMenu = KickStarter.playerMenus.GetMenuWithCanvas (myCanvas);
    Speech mySpeech = myMenu.speech;
    Char myChar = mySpeech.GetSpeakingCharacter ();
  • It's working, fantastic! I've gotten it to look for a marker on the characters' chests, otherwise the arrow seems to think their feet are talking.

    Thanks for your support!

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.