"0 Basics" "Fungus first Chinese course" 10 minutes to quickly build a universal dialogue system/narrative system/plot system in Unity

Source: Internet
Author: User

I really have not written a complete strategy for a long time (laughter), salted fish for a long time after still want to write a fun. This time it's about combing the core features of Unity's niche plug-in fungus and quickly mastering how it's used.

Official Document: http://fungusdocs.snozbot.com/

Video Tutorial: https://www.youtube.com/watch?v=9zqUx0xZBv4

So what is fungus first? Fungus provides an interactive interface to quickly build a conversation system, or even a core component of a word game (AVG).

Fungus in Unity 3D project, mainly to do the plot narrative part, so I mainly explain how to do a plot fungus.

One, how to create a narrative? The story at the beginning of the scene

First we open a unity project and of course I have a project on hand that is currently participating in Imagine Cup 2018.

First we find fungus in tools. In advance we need to install this plugin in Unity's assets store.

Create a flowchart. In this way we can find that there is an extra flowchart in the tree on the left.

Next we open the Fungus Flowchart window.

Then there will be an interface like this:

Next we click on this block, rename it to "Startstory", then set the trigger condition to "Gamestart".

Next, add some content to the block.

We select "+" and then select say in narrative to add a new narrative.

If you need more than a paragraph of narration, you can continue to add different blocks.

So far we haven't seen a single line of code, is it very concise?

Second, the dialogue system is open! Character and Menu

All the while I was talking about a single line narrative, now I'm introducing a concept: Character.

Next we create a character called Boy.

We can assign a portrait (portrait) to a character to achieve a similar effect:

Operation:

Now that we have a character, we can specify a role to differentiate between the conversations.

And of course there's a way to speed up the plot: narrative > Conversation.

Then add the plot in such a way: [character] [portrait] [position] [hide] [<<< | >>>]: [Dialogue text]

Example:

John Bored Left:oh, so that's how do you use the conversation command.sherlock eyeroll Right:yes, well done john.you Catch on quickly don ' t you?hide John "offscreen left": I sure do.--This was a comment, it doesn ' t appear in the Conversati Onjohn angry middle:wait, What!left:there ' s no need to being rude sherlock!bored:not like that would stop You.sherlock exc ited:aha! So that's how did a conversation from lua! Fascinating.john <<<: Yes, Riveting.john hide:sherlock Hide:

The next step is to start the story smoothly.

Next is an important feature: Menu. Menu can make the plot direction for us, that is, according to the choice to jump to different blocks.

First, we do a simple dialogue to choose a branch: Answer system.

First we create a four menu after block:

Then create a few new blocks and point the target of the menu to the new block.

This allows you to implement a conversation branch.

Take a look at the fungus implementation of the answer system:

Finally, a dialog tree structure can be formed.

Three, triggered dialogue

Of course, we know that a normal character conversation should actually be a trigger-type expansion. For example, if you come close to a person, you start an automatic conversation, or you press the key to automatically talk.

Here is a simple trigger solution, which is not the only solution, of course:

1, first we give the character to add a Collider,box collider can.

It is best to let collider not touch any other object.

Also note that we will create another collider to ensure that the character is not crossed. This time can use Sphere Collider.

2, we tick the trigger, istrigger option.

Then create a new C # script in this character, edit the trigger function:

The message here is similar to a signal, and when we trigger the collider, we broadcast a signal, and I'm named MajorTask1.

At the same time we set the block's trigger condition to "Message Received".

So we can set up a trigger-type conversation.

=================================

This is the independent game we are developing: the endless sound of the sea music Parkour + explore the city. The development phase is currently in progress.

"0 Basics" "Fungus first Chinese course" 10 minutes to quickly build a universal dialogue system/narrative system/plot system in Unity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.