Page 1 of 1

Barks as player examine actions

Posted: Wed Nov 15, 2017 5:42 am
by Abelius
Edit: I've just realized I've written a wall of text just to ask for something very simple... :?

So I'll resume it with just one line...: Could you add a 'Starting node ID' field to Adventure Creator's DS Bark action, please?

Edit 2: Btw, I'm assuming the Bark system has the behavior I want... (?) I mean, that the dialogue lines get displayed without the player needing to click anywhere to either recover PC control and/or passing to the next dialogue line in the conversation...


------------------------------------

Hi there, I have this dilemma here...

I'm using Adventure Creator for player and NPC navigation, cutscene playing, DS conversations triggering, etc.

Then I use DS for complex conversations (no surprises here) and many other things that sequences and LUA scripts let me do (which are a lot).

But that leaves me with one use case not covered very well...: complex examine actions. Let me explain what I mean by this...

Let's say I have one AC hotspot that has both Use and Examine interactions. The Use one I've got it covered well, but the Examine interaction is intended for the player character saying something about the relevant game object, not interrupting the gameplay in the process.

For my example, I'll use a landed spaceship. At first, if the PC examines the ship she should say something like "My ship. Pretty much in one piece even after almost crashing...". Then she "talks" with it and the ship goes to standby mode. From that point on, if the PC examines the ship again, she should say something like "It's in standby mode. I hope the battery doesn't degrade anymore until I solve the problem..."

That's only a simple example of what I intend to do for gazillions of game objects throughout the game...: different examine outputs depending on quest and/or variable states.

Now... I know I could use an AC DS Check action to check DS quest states or variables, and then branch the action list according to the result, playing the desired player comment on the background. But that poses two problems for me...:

1. AC's action list editor is HORRIBLE. I reaaaaally want to avoid working with it for something so big as this work will be over time.

2. AC's Play Speech actions are also very limited. If you want to concatenate two dialogue lines, you need to uncheck "Play in background?" for the first one, so it's played in its entirety before the second one. And that leaves the player effectively locked in place until the action list finishes its execution. Clearly unacceptable for a simple examine action, in which the player should be able to continue walking if s/he wants.

So... I read about Barks and thought they could help me with this problem. My intention is to use AC just to run a DS Bark action to a 'PlayerBarks' conversation, where I would have ALL game objects examine lines (for consolidation purposes) in separated internal node trees. Then, according to the aforementioned quest states or boolean variables, it should pick the appropriate line to play in the background.

But for that to happen, I'd need to be able to select the starting conversation node ID in the AC DS Bark action, I think. Right now it assumes you just want to initiate the conversation from the START node, and from there... how would the conversation would know where to go from the myriad trees I have in there? It would be best if I handpick the appropriate starting point from the AC action, and let DS to check the valid "NPC" lines to shout from there, right?

I hope I've been clear enough with my explanation. Thing is, I just want to have dialogue lines displayed without the players being interrupted in their gameplay. :roll:

Thank you for your time.

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 10:07 am
by Tony Li
Hi,

I see your wall of text and raise you one:

Barks are indeed what you're looking for. The Dialogue System selects a node to bark from a conversation's top-level nodes. For example, a villager bark conversation might be:
  • <START>
    • "Hello."
    • "Have a good day."
    • "Nice weather today."
The Dialogue System will bark one of the lines above, either randomly or in order depending on how you've set up the action.

You can add conditions and link priorities:
  • <START>
    • "Hello."
    • "Have a good day."
    • "Nice weather today."
    • "Help! The orcs are coming!" {Conditions: Variable["OrcsComing"]==true} {LinkPriority: AboveNormal}
If the "OrcsComing" variable is true, the villager will always bark "Help! The orcs are coming!"

It also follows group nodes (i.e., Is Group checkbox ticked), so you can group clusters of barks according to conditions:
  • <START>
    • <Group> {Conditions: Variable["Conversant"]=="Spaceship"}
      • "It's in standby mode."
      • "Hopefully the battery doesn't degrade."
    • <Group> {Conditions: Variable["Conversant"]=="Radio"}
      • "A broken radio."
So, instead of specifying a node ID in the bark action, you'll set up conditions that the Dialogue System uses to choose a top-level node.

Often, devs will write two conversations: one for an NPC's barks and another for the NPC's interactive dialogue. However, you can combine them. To keep this example simple, I'll provide a conversation only for the spaceship. You can use groups (and even cross-conversation links) to handle other bark objects in the conversation, too.

First, define a variable to record whether the player has talked to the ship before: Variable["Spaceship.AlreadyTalked"] (initial value false).

Then set up a conversation like this:
  • <START>
    • "It's in standby mode." {Conditions: Variable["Spaceship.AlreadyTalked"]==true}
    • "My ship. Pretty much in one piece..." {Conditions: Variable["Spaceship.AlreadyTalked"]==false}
      {Script: Variable["Spaceship.AlreadyTalked"]=true}
      • [examine ship]
        • "Looks like I need to solve the battery problem."
In your AC actionlist, check the value of "Spaceship.AlreadyTalked". If it's true, play the conversation through the AC Bark action. Otherwise play it through the AC Conversation action. This will minimize the number of AC actions that you need to work with in the editor.

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 3:16 pm
by Abelius
Thank you for your comprehensive explanation. :mrgreen:

Mmm... okay. I didn't know about groups, neither that you could use a 'conversant' conditional. I guess this last piece of info would be the key to what I'm trying to achieve.

But... I don't quite understand how could you declare a conversant from the AC action (?), because this is what I see...:

Image

There is indeed a 'Conversant' field, but it's expecting a Transform object. What do I need to drag in there? Is it an NPC? Does it need to have something previously configured?

Anyway, I've tried the thing like this...:

Image

Image

Image

Image

If I examine the ship, "I don't know what to say..." gets displayed under my player character, but not "What a bummer...", which is the next node text.

Moreover, those Sequence commands don't run, which are needed for the character actually showing a talking animation. In fact, I get this console error...:

Image

It tries to convert {{end}} to a number...? :?

Does this mean that I can't use Sequence commands in Barks, as in normal conversations? That would be a letdown, as I'd need to catch Bark start and end events to trigger those FSMs, and that would also mean I wouldn't be able to differentiate between 'happy' and 'angry' talking animations, which is one AC limits.

About your suggestion to initially evaluate conditionals inside action lists, I don't really want to do that due to the aforementioned limitations in AC barking system, and because I'd really would want to have all PC barks in one place, even if that conversation is huge. IMHO, it's much easier to write conditionals in the DS editor.

So, to summarize, I need to know...:

1. How to pre-declare the conversant so the conditional is met when starting 'PlayerBarks' conversation.

2. If Sequence commands could run in Barks.

3. If it's possible to play more than one node from a Bark conversation.

Many thanks!

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 4:10 pm
by Tony Li
The Dialogue System automatically sets Variable["Actor"] and Variable["Conversant"] when you start a bark or conversation. They're set to the "character names" of the Transforms assigned to the action's Actor and Conversant fields.

By default, a Transform's "character name" is its GameObject name. You can override this by adding an Override Actor Name component to the GameObject. So if your ship's GameObject is named Ship01, add an Override Actor Name, and set the Override Name to "Ship". If you assign Ship01 to the action's Conversant field, the value of Variable["Conversant"] will be "Ship".
Abelius wrote: Wed Nov 15, 2017 3:16 pmIf I examine the ship, "I don't know what to say..." gets displayed under my player character, but not "What a bummer...", which is the next node text.
Maybe groups are just complicating things in this case. Try this:

I'll assume that when the variable "ShipWentToSleep" is true, you want the ship to bark. When it's false, you want to run an interactive conversation and then set the variable true.
  • <START>
    • "My ship..." {Conditions: Variable["ShipWentToSleep"]==false} {Script: Variable["ShipWentToSleep"]=true}
      • "Better leave it alone."
      • "I should run a diagnostic."
    • "I don't know what to say..." {Conditions: Variable["ShipWentToSleep"]==true}
    • "What a bummer..." {Conditions: Variable["ShipWentToSleep"]==false}
So the first time the player interacts with the ship, it will run an interactive conversation starting with "My ship..." that also sets the variable true. After that, it will choose a random bark between "I don't know what to say" and "What a bummer".
Abelius wrote: Wed Nov 15, 2017 3:16 pmMoreover, those Sequence commands don't run [because they don't recognize {{end}}.]
Unlike sequences in conversations, sequences in barks don't recognize the {{end}} special keyword. I'll add that in version 1.7.8 (or 1.7.7 if I can get it done in time). For now, can you use a literal number such as "required FSMEvent(Reset,Player,SpeakFSM)@3"?

I'm afraid you'll still need to do one check in AC to decide whether to run the Dialogue System Bark or Dialogue System Conversation action based on the value of "ShipWentToSleep".

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 6:20 pm
by Abelius
Oookay...

Uhm... I have three things to say. :lol:

Firstly, I've tried dragging both 'Player' and 'Ship' game objects in here...:

Image

It didn't work at first ("My ship..." didn't get selected), but then I changed the <Ship> group node priority in START to 'Above normal'...:

Image

...and "My ship..." did get displayed.

I don't quite understand this because that node was already the first of the two in the 'Normal' priority tier... :shock:

Although... now that I've seen it closer... aaah, okay. The group node actor was 'NPC' instead of 'Player', so it skipped it for that reason, I presume...?

Anyway...

Secondly, I'm guilty of not having been clear enough in my example. I don't actually want to trigger normal (interactive) conversations with any examine action. Not from AC action lists, nor from a Bark conversation. All "dialogue" that is generated from this kind of player interactions are for the sole purpose of showing one or two sequential player subtitles without the player needing to lose control over the character.

That's why I think a single Bark conversation triggered from AC action lists by just a single action is enough for my purposes of having all of those in one place.

So, let's examine my ship bark tree again...:

Image

Now that the 'Ship' group node gets selected, "My ship..." gets displayed in the next node. Then it needs to choose between these two nodes...:

Image

"Better leave it alone until I find a way to charge it." should get selected if the ship is in standby mode (Variable["ShipWentToSleep"] == true).

"I should run a diagnostic before I leave." should get selected if the above condition is false. Just to clarify, the above variable switches to True after doing that diagnostic.

And those two nodes at the bottom...:

Image

"I don't know what to say..." followed by "What a bummer...", are actually a joke of mine...: if the ship group node didn't get selected it was because I did something wrong, so the poor character didn't know what to say... :P

However, in both situations, when the next node was supposed to appear after the first one was "barked", that didn't happen.

These...:

Image

...never get displayed for me.

And thirdly... erm... okay, there were actually two things. :lol:

Mmm... well, just another question...: what does it need the player as a minimum to show barks? A 'Unity Bark UI' component and a trigger? That's it...? Because I've noticed that I have these two in my player gameobject...:

Image

...and now I'm not sure if I've put them myself or not...

Okay, time to sleep on it. :roll:

Edit: I've forgot to mention that I've deleted all the FSMEvent commands, while the "second nodes not being displayed" issue gets solved, for simplicity purposes.

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 6:54 pm
by Tony Li
Hi,

To display barks, the only thing a GameObject needs is a Unity UI Bark UI.

The Bark Trigger component listens for an event (such as OnTriggerEnter) and starts a bark when that event occurs. Since you're starting the bark from an AC action, you don't need Bark Trigger.

Thanks for clearing up my understanding of what you want to do. What you're asking for is actually simpler than splitting functionality between barks and conversations.

Barks always show only one node. They stop after that node. You can run a conversation, however, that bypasses the response menu and plays subtitles through the speaker's bark UI. To bypass the response menu, override the conversation's Input Settings, and untick Always Force Response Menu. To play subtitles through the speaker's bark UI, use an Override Dialogue UI component that points to a Bark Dialogue UI.

I'll post an example later today.

Re: Barks as player examine actions

Posted: Wed Nov 15, 2017 8:43 pm
by Tony Li
Here's an example scene: AC_BarkConversationExample_2017-11-15.unitypackage

It's based on AC's Demo scene. The player, Tin Pot, can examine a Camera and a Barrel. Camera and Barrel are grouped under an empty GameObject named EXAMPLE INTERACTIONS.

Tin Pot and Camera have Unity UI Bark UIs.

Camera and Barrel have a Bark Dialogue UI and an Override Dialogue UI that points to it. When a conversation involves Camera or Barrel, it will use Bark Dialogue UI, which plays subtitles through the participants' bark UIs. (Unless the other participant has an Override Dialogue UI with a higher Priority, in which case it will use that UI for the whole conversation.)

Image

I wasn't sure whether you wanted the bark to appear on the object (e.g., Camera) or the player, so I configured one of each. In both cases, the bark lines are assigned to the conversant:

Image

(The conversation above also shows an example of using {{end}} in a Sequence.)

When you examine the Camera, the barks will play on the Camera. I set up the action like this:

Image

When you examine the Barrel, the barks will play on the player because I set the player as the Conversant:

Image

Other things to note:
  • In the conversations' properties, I ticked Override Display Settings > Input Settings and unticked Always Force Response Menu.
  • In the AC actions, I ticked Override Bridge Control and set "Use dialog state" and "Take camera control" to Never.
  • The conversations use variables ExaminedCamera and ExaminedBarrel.
  • If you want the player to be able to play multiple bark conversations simultaneously, inspect the Dialogue Manager and tick Allow Simultaneous Conversations. I'd think this might get a little chaotic, though.

Re: Barks as player examine actions

Posted: Thu Nov 16, 2017 6:01 am
by Abelius
Thanks, Tony!

I actually got it working in a slightly different way, but this has helped me greatly in finding the sweet spot. :mrgreen:

I'll place a reminder for me to come back and explain what I've done exactly, for others to take a look. I've got five days before launching the beta...

Thing is, I forgot again to tell you a little detail about my configuration... :lol:

Thank you again.

Re: Barks as player examine actions

Posted: Thu Nov 16, 2017 9:03 am
by Tony Li
Glad to be of some help.

Good luck on your beta!

Re: Barks as player examine actions

Posted: Tue May 29, 2018 6:53 am
by 23loise23
Hello,

Thanks for sharing the information :)