Can you do the following?
1. Bark from a sequence command
2. Set custom bark text from #1 (instead of using a conversation)
If not, how would I go about implementing such a feature? Lua?
EDIT - I found the template, giving this a go now
Barking from a sequence
Re: Barking from a sequence
Ok, 1 tiny bug I need help with:
Sequence Command:
Source:
Test Sequence: Bark(Hello?, Townsfolk1,)
Result:
Hello?: Hello?
Any thoughts as to why that is?
Sequence Command:
Code: Select all
Bark(string barkText, subject, null)
Code: Select all
namespace PixelCrushers.DialogueSystem.SequencerCommands
{
public class SequencerCommandBark : SequencerCommand
{
// Use this for initialization
void Start()
{
string barkString = GetParameter(0);
Transform subject = GetSubject(GetParameter(1));
DialogueManager.BarkString(barkString, subject);
}
// Update is called once per frame
void Update()
{
}
public void OnDestroy()
{
}
}
}
Result:
Hello?: Hello?
Any thoughts as to why that is?
Re: Barking from a sequence
Hi,
You might want to use a Lua function instead of a sequencer command so you can pass more complicated strings. For example, this won't work as a sequence:
But you can do it in Lua:
If you stick with the sequencer command, remember to call Stop() at the end of your Start() method.
What kind of bark UI does Townsfolk1 have? You might want to uncheck Include Name -- or, if Townsfolk1 isn't defined as an actor in the database, add an Override Actor Name and set the name to use. I'm not exactly sure why it seems to be using the bark text as the barker's name.
You might want to use a Lua function instead of a sequencer command so you can pass more complicated strings. For example, this won't work as a sequence:
Code: Select all
Bark(Hello, world!, Townsfolk1)
Code: Select all
Bark("Hello, world!", "Townsfolk1")
What kind of bark UI does Townsfolk1 have? You might want to uncheck Include Name -- or, if Townsfolk1 isn't defined as an actor in the database, add an Override Actor Name and set the name to use. I'm not exactly sure why it seems to be using the bark text as the barker's name.
Re: Barking from a sequence
Just your basic run of the mill Unity UI Bark.
Is the Lua code already implemented or do I need to write my own function?
Is the Lua code already implemented or do I need to write my own function?
Re: Barking from a sequence
You'd need to write your own function. There's a template script for Lua functions.
Re: Barking from a sequence
Ok so this is why that was happening:
I created my own bark ui, and removed the name text field, but left "include name" ticked.
Got the Lua code working. Thanks Tony.
I created my own bark ui, and removed the name text field, but left "include name" ticked.
Got the Lua code working. Thanks Tony.
Re: Barking from a sequence
Happy to help! I'm glad it's working!