Hello.
When Monster attack (or attacked), Game display Some Dialogue like "I'll kill you".
I thought bark system can maybe do this.
I didn't know how do i do. I didn't find helpful something in documentation and example.
Can I use bark trigger or something?
Use Bark...
Re: Use Bark...
Hello,
Yes, the bark system works well for this. The main documentation on barks is here: How to Play Barks
Here's a simple example:
1. Prepare a bark conversation with lines such as "I'll kill you!" and "Prepare to die!".
2. Add a Bark UI to your monster. <-- That link is for Unity UI. Here's the main page for all GUI systems if you want to use a different GUI system: Bark UIs.
3. Add a Bark Trigger to your monster. Select the bark conversation, and set the Trigger type to OnUse.
4. When the monster attacks or is attacked, send an "OnUse" message to the monster. For example:
Extra info:
If you want to make more advanced barks, you can add conditions to your bark conversation nodes. For example, you could set a Lua variable before sending "OnUse". Something like:
And set up your bark conversation like this:
Yes, the bark system works well for this. The main documentation on barks is here: How to Play Barks
Here's a simple example:
1. Prepare a bark conversation with lines such as "I'll kill you!" and "Prepare to die!".
2. Add a Bark UI to your monster. <-- That link is for Unity UI. Here's the main page for all GUI systems if you want to use a different GUI system: Bark UIs.
3. Add a Bark Trigger to your monster. Select the bark conversation, and set the Trigger type to OnUse.
4. When the monster attacks or is attacked, send an "OnUse" message to the monster. For example:
Code: Select all
void Attack(Transform player) {
SendMessage("OnUse", player);
}
Extra info:
If you want to make more advanced barks, you can add conditions to your bark conversation nodes. For example, you could set a Lua variable before sending "OnUse". Something like:
Code: Select all
void Attack(Transform player) {
BarkInResponseTo("attack");
}
void Attacked(Transform player) {
BarkInResponseTo("attacked");
}
void Damaged(Transform player) {
BarkInResponseTo("damaged");
}
void BarkInResponseTo(string action) {
DialogueLua.SetVariable("Action", action);
SendMessage("OnUse", player);
}
- START
- "I'll kill you!" ( condition: Variable["Action"] == "attack" )
- "So you want to fight, eh?" ( condition: Variable["Action"] == "attacked" )
- "Ouch! That hurt!" ( condition: Variable["Action"] == "damaged" )
-
- Posts: 9
- Joined: Fri Nov 20, 2015 10:48 pm
Re: Use Bark...
Thanks for details.
Your asset is very useful for my game.
Your asset is very useful for my game.
Re: Use Bark...
I'm very glad to hear it! Happy to help!