Browse Source

Added anchors & TOC in pages

master
Christopher 8 years ago
parent
commit
f03b3305f6
  1. 17
      Docs/fungus_docs/about.md
  2. 17
      Docs/fungus_docs/articles.md
  3. 31
      Docs/fungus_docs/blocks.md
  4. 10
      Docs/fungus_docs/conduct.md
  5. 13
      Docs/fungus_docs/conversation.md
  6. 62
      Docs/fungus_docs/faq.md
  7. 13
      Docs/fungus_docs/flowcharts.md
  8. 27
      Docs/fungus_docs/getting_started.md
  9. 13
      Docs/fungus_docs/install.md
  10. 2
      Docs/fungus_docs/narrative_parser_tokens.md
  11. 13
      Docs/fungus_docs/playing_audio.md
  12. 25
      Docs/fungus_docs/telling_a_story.md
  13. 18
      Docs/fungus_docs/training_course.md
  14. 15
      Docs/fungus_lua/create_menu.md
  15. 7
      Docs/fungus_lua/execute_lua.md
  16. 63
      Docs/fungus_lua/fungus_module.md
  17. 1
      Docs/fungus_lua/lua_bindings.md
  18. 1
      Docs/fungus_lua/lua_controlling_fungus.md
  19. 1
      Docs/fungus_lua/lua_environment.md
  20. 16
      Docs/fungus_lua/lua_fungus_module.md

17
Docs/fungus_docs/about.md

@ -1,25 +1,26 @@
# About %Fungus {#about}
[TOC]
## What is %Fungus?
# What is Fungus? # {#what_is_fungus}
%Fungus is a tool which makes it easy to add colourful characters and craft gripping storylines in your game, even if you have never used <a href="http://unity3d.com" target="_blank">Unity</a> before. Our intuitive interface lets everyone create beautiful story games easily - <b>for free and with no coding</b>!
![img fungus_town]
## Who's it for?
# Who's it for? # {#whos_it_for}
%Fungus is popular with writers, illustrators, animators and game designers, especially visual novel & interactive fiction authors. Many people using %Fungus are creating games in Unity for the very first time. It is a popular choice for game jams and game design courses.
## Free & Open Source
# Free & Open Source # {#open_source}
We believe that interactive storytelling should be accessible to everyone, so %Fungus is <b>100% free & open source</b>. It works great with both the free and pro versions of Unity 3D. %Fungus is inspired by other great open source storytelling tools like [Twine], [Ren'Py] and [Scratch].
## Community
# Community # {#community}
The %Fungus community is very welcoming and helpful to newcomers. Many people using %Fungus have never used Unity or even made a game before, so feel free to ask questions on our [community forum]. Helping other people with their questions is a fantastic and very welcome way to contribute back to the community.
![img community]
## Features
# Features # {#features}
@htmlonly
<div align="center" style="float:right;">
@ -38,14 +39,14 @@ The %Fungus community is very welcoming and helpful to newcomers. Many people us
- Powerful Lua scripting support for more experienced users
- 100% free and open source
## Contribute
# Contribute # {#contribute}
We welcome all sorts of contributions to %Fungus. You can report bugs, suggest new features, contribute source code, write an article, help answer questions on the forums or even just tell your friends about the project!
- Issue Tracker: [GitHub issue tracker]
- Source Code: [GitHub code repository]
## Credits
# Credits # {#credits}
[Chris Gregan] is the main author and maintainer of %Fungus. He's co-founder of [Snozbot], along with [John O' Kane] and [Ronan Pearce].
@ -57,7 +58,7 @@ We welcome all sorts of contributions to %Fungus. You can report bugs, suggest n
%Fungus wouldn't be possible without all the awesome people in our community who have contributed to the project and supported us in myriad ways. Thank you all!
## License
# License # {#license}
The %Fungus software is licensed under the [Open Source MIT License].

17
Docs/fungus_docs/articles.md

@ -1,21 +1,22 @@
# Community Articles {#articles}
# Community Articles # {#articles}
[TOC]
If you've created an article or video about %Fungus let us know on the forum and we'll add it here.
## Morning Fun Games
# Morning Fun Games # {#morning_fun}
- [Custom Dialog Like A Comic](https://www.youtube.com/watch?v=RdCAjpQ3iGE)
## Sercan Altun
# Sercan Altun # {#sercun_altun}
- [Input Dialog & Writing Custom Commands](http://sercanaltun.com/blog/fungus-game-input-dialog-writing-custom-commands)
- [Loading Characters Dynamically](http://sercanaltun.com/blog/fungus-game-loading-characters-dynamically)
## David Arcila
# David Arcila # {#david_arcila}
- [Game Development Resources](https://game-development.zeef.com/david.arcila?utm_source=Facebook&utm_medium=Post&utm_content=game-development&utm_campaign=Rob#block_60669)
## David Sherlock
# David Sherlock # {#david_sherlock}
[http://davidsherlock.co.uk](http://davidsherlock.co.uk)
@ -24,7 +25,7 @@ If you've created an article or video about %Fungus let us know on the forum and
- [Creating your own hidden object game](http://davidsherlock.co.uk/starting-your-own-hidden-object-game)
- [Setting up Unity and %Fungus to make #appliedgames](https://youtu.be/t1zf4Qq_GS8)
## Leah Lee
# Leah Lee # {#leah_lee}
[http://leahlee.studio](http://leahlee.studio)
@ -32,11 +33,11 @@ If you've created an article or video about %Fungus let us know on the forum and
- [Contributing to %Fungus](http://leahlee.studio/contributing-to-fungus-for-unity-week-2/)
- [Using a video as a texture](http://leahlee.studio/using-a-video-as-a-texture)
## Konrad Gadzina
# Konrad Gadzina # {#konrad_gadzina}
- [Visual scripting w Unity (Polish)](https://www.youtube.com/watch?v=sXRt7pKT4ls&feature=youtu.be)
## Chen
# Chen # {#chen}
[2D text adventure game dialogue system in Unity 5 (Chinese)](https://www.youtube.com/playlist?list=PLYGd-m5DMaRZgSXtQ4JX3uEKXN67_Jzrp)

31
Docs/fungus_docs/blocks.md

@ -1,9 +1,10 @@
# Blocks {#blocks}
# Blocks # {#blocks}
[TOC]
A fundamental concept of %Fungus is the **Block**. Blocks contain your %Fungus Commands, and reside inside Flowcharts.
<!-- **************************************************** -->
## Blocks (and how to inspect Block properties)
# Inspecting Block properties # {#inspect_block}
Blocks are found inside Flowcharts. Blocks are where your %Fungus Commands are stored. Each Block can contain 1 or more %Fungus Commands:
@ -17,7 +18,7 @@ To inspect the properties of a Block do the following:
![block properties]
<!-- **************************************************** -->
## Setting Block name and description
# Setting Block name # {#set_block_name}
When working with more than one Block, its important to name each Block in a meaningful way. To rename a Block do the following:
@ -32,7 +33,7 @@ When working with more than one Block, its important to name each Block in a mea
![block description]
<!-- **************************************************** -->
## Creating a block
# Creating a Block # {#create_block}
To create a new Block do the following:
@ -45,7 +46,7 @@ To create a new Block do the following:
Note - a good time to choose a meaningful name a Block is immediately after creating a new Block ...
<!-- **************************************************** -->
## Delete a Block
# Delete a Block # {#delete_block}
To delete a Block from the current Flowchart, do the following:
@ -56,7 +57,7 @@ To delete a Block from the current Flowchart, do the following:
![deleted block]
<!-- **************************************************** -->
## Duplicate a Block
# Duplicate a Block # {#duplicate_block}
To duplicate (clone / make an exact copy of) a Block from the current Flowchart, do the following:
@ -69,7 +70,7 @@ To duplicate (clone / make an exact copy of) a Block from the current Flowchart,
Note - a good time to choose a meaningful name a Block is immediately after duplicating one ...
<!-- **************************************************** -->
## Moving blocks
# Moving blocks # {#move_block}
To move / rearrange Blocks in the Flowchart window do the following:
@ -83,7 +84,7 @@ To move / rearrange Blocks in the Flowchart window do the following:
![animated move block]
<!-- **************************************************** -->
## The 3 types of Block (Event Block, Branching Block, Standard Block)
# The 3 types of Block # {#three_types}
%Fungus Flowcharts visually differentiate three differents kinds of Block behavior:
@ -91,7 +92,7 @@ To move / rearrange Blocks in the Flowchart window do the following:
2. Branching Block - orange polygon (passes control to 2 or more other Blocks, and not and Event Block)
3. Standard Block - yellow rectangle (no event, passes control to 0 or 1 other blocks)
### 1: Event Block - blue rounded rectangle
## 1: Event Block - blue rounded rectangle ##
One way %Fungus decides when to start executing the Commands inside a Block is if a Block has defined an Execute On Event. If a Block has any of the possible Execute On Events chosen (such as Game Started, Message Received, Sprite Drag Completed, Key Pressed etc.) then this Block will be displayed as a **blue rounded rectangle**:
![event block]
@ -100,18 +101,18 @@ As we can see, the default Block created with every new Flowchart automatically
NOTE: A Block with an Execute On Event will always appear as an Event Block in the Flowchart, regardless of whether its Commands contain menus or calls to 2 or more Blocks). In other words, in terms of Flowchart appearance, display of an Event Block overrides display of a Branching Block.
### 2: Branching Block - orange polygon
## 2: Branching Block - orange polygon ##
If a Block is *not* an Event Block, and its Commands include Calls and/or Menu commands to execute Commands in 2 or more other Blocks, then in the Flowchart window this Block will be displayed as a Branching Block, visually appearing as an **orange polygon**.
![branching block]
### 3: Standard Block - yellow rectangle
## 3: Standard Block - yellow rectangle ##
If a Block is *neither* an Event Block *nor* a Command Block, then it is a Standard Block, and will be displayed as an **yellow rectangle**.
![standard block]
<!-- **************************************************** -->
## Connections between Blocks: Flow of Execution
# Connections between Blocks # {#block_connections}
A whole scene's logic can rarely fit all into a single Block, therefore we need ways for one Block to pass execution control to other Blocks. There are several ways to do this, the most common being:
@ -142,7 +143,7 @@ To pass control to another Block, and stop executing Commands in the current Blo
![arrow between blocks]
<!-- **************************************** -->
## Executing Commands in another Block with Menu Commands
# Executing another Block # {#executing_block}
Let's use a Say command above to ask a tricky mathematical question, and demonstrate the Menu command by offering the user a choice been "correct' and "incorrect" answers. Menu commands transfer control to another block - so we'll need to add 2 new blocks to correspond to the 2 answers.
Do the following:
@ -174,14 +175,14 @@ Do the following:
![wrong screen]
<!-- **************************************************** -->
## Highlighting connection between blocks by selecting command
# Highlighting connections # {#highlighting_connections}
In the Inspector window, if you select a Call or Menu Command (executing Commands in another Block in **the same Flowchart**), then you'll see the arrow between the 2 Blocks highlighted in GREEN:
![green arrow highlight]
<!-- **************************************************** -->
## Setting a Block event handler
# Setting an Event Handler # {#set_event_handler}
Events are one way to declare when you want execution of the Commands in a Block to begin. Typical events include:

10
Docs/fungus_docs/conduct.md

@ -1,14 +1,14 @@
# Code of conduct {#code_of_conduct}
# Code of conduct # {#code_of_conduct}
## TL;DR
# TL;DR #
Be nice to each other :)
We want an open and respectful community at %Fungus. So we would ask you when communicating (for example, posting on our Forums, Comments or github repository ) to be friendly and helpful. We find, for most people, this is not a problem. Our list of guidelines below is not exhaustive but should give a strong indication of what we consider acceptable community behaviour.
## Be welcoming
# Be welcoming #
We welcome and support people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
## Be respectful
# Be respectful #
It's ok to disagree with someone. It's not ok to personally attack someone. Instead, focus on helping to resolve issues and learning from mistakes.
Bullying or Harassment will not be tolerated
@ -25,7 +25,7 @@ The following behaviours are not acceptable:
- Repeated harassment of others. In general, if someone asks you to stop, then stop.
- Advocating for, or encouraging, any of the above behaviour.
## Assume Good Intentions
# Assume Good Intentions #
Give people the benefit of the doubt. If you believe they have acted against the code of conduct, please refer them to this document. Remember, although English is the primary language of %Fungus development, that not all members have English as their primary language.
Thanks to [http://www.apache.org/foundation/policies/conduct.html](http://www.apache.org/foundation/policies/conduct.html) and [https://www.djangoproject.com/conduct](https://www.djangoproject.com/conduct) for inspiration and content.

13
Docs/fungus_docs/conversation.md

@ -1,4 +1,5 @@
# The Conversation system {#conversation}
# Conversation system # {#conversation}
[TOC]
The Say and Portrait commands are a powerful way to build character dialogue, but it can be tedious to add large amounts of dialogue this way.
@ -11,7 +12,7 @@ The Conversation system provides a simplified format that allows you to quickly
To create a conversation, add the Conversation command (Narrative > Conversation) to a Block and enter the conversation text.
# Example
# Example # {#example}
```text
john bored left: Oh, so that's how you use the Conversation command.
@ -33,7 +34,7 @@ john hide:
sherlock hide:
```
# Format
# Format # {#format}
The format for conversation text is:
```text
@ -47,7 +48,7 @@ The format for conversation text is:
Parameters go on the left of the colon and the dialogue text goes on the right. You can omit any parameter and specify them in any order. Parameters are separated by spaces. If you need to use a name which contains spaces, wrap it in quotation marks e.g. "John Watson". Parameters are case insensitive. Blank lines and comment lines starting with -- are ignored. A line of dialogue text on its own will be spoken by the most recent character. You can omit dialogue text, but remember you still need to add the : character at the end of the line.
# String substitution
# String substitution # {#string_substitution}
You can use the normal string subsitution syntax {$VarName} anywhere in the conversation text. For example if you have a string Flowchart variable called PlayerName you can embed this in a conversation like this:
@ -55,12 +56,12 @@ You can use the normal string subsitution syntax {$VarName} anywhere in the conv
john: Hi there {$PlayerName}.
```
# Localization
# Localization # {#localization}
You can use the string substitution feature above with a @ref lua_string_table "Lua string table" to localize the conversation for multiple languages.
The Conversation system does not work with the Localization component in %Fungus because the syntax makes it difficult to localize that way.
# Lua
# Lua # {#lua}
The conversation system can also be used @ref lua_controlling_fungus "from Lua".

62
Docs/fungus_docs/faq.md

@ -1,58 +1,64 @@
# Frequently Asked Questions {#faq}
# Frequently Asked Questions # {#faq}
[TOC]
## What is %Fungus ?
# What is Fungus? # {#what_is_fungus}
%Fungus is a free open source tool for creating storytelling games, with a strong focus on accessibility for novice game developers. Users all over the world are now using it to create a wonderfully diverse range of storytelling games.
## Who makes %Fungus ?
%Fungus is developed by [Snozbot](http://snozbot.com), a small independent games company. Chris Gregan is the main developer of %Fungus.
# Who makes Fungus? # {#who_makes}
%Fungus is developed by [Snozbot], a small independent games company. Chris Gregan is the main developer of %Fungus.
## Where do I get %Fungus ?
%Fungus is available on the [Unity Asset Store](http://u3d.as/f0T) and in the download section of this website.
# Where do I get Fungus? # {#where_get}
%Fungus is available on the [Unity Asset Store] and in the download section of this website.
## Is %Fungus really free to use?
# Is Fungus really free to use? # {#really_free}
Yes. %Fungus has an Open Source M.I.T. license. You can use %Fungus with any version of the Unity game engine, including the freely available personal edition.
## Can I sell the apps I make with %Fungus ?
# Can I sell the apps I make with Fungus? # {#can_sell}
Yes. We do not charge a license fee.
## What platforms does %Fungus support ?
# What platforms does Fungus support? # {#platforms}
%Fungus runs on any platform supported by the Unity game engine. See here for a list of supported platforms.
## Do I need to be a programmer to use %Fungus ?
# Do I need to be a programmer to use Fungus? # {#non_coders}
No. %Fungus can be used to make a variety of story-driven games with no coding required.
## Is %Fungus useful for programmers ?
# Is Fungus useful for programmers? # {#coders}
Yes. %Fungus provides an easy way to add visual novel features to any Unity game. It is also possible to extend %Fungus to customise the workflow for your team. Checkout the documentation and tutorials for more information.
## Where can I learn more about %Fungus ?
# Where can I learn more about Fungus? # {#learn_more}
We provide extensive tutorials and documentation on our website here. There is also a comprehensive online training course suitable for beginners at Udemy.
## I've made something cool with %Fungus. Wanna see?
# I've made something cool with Fungus. Wanna see? # {#show_and_tell}
Most definitely! Please tweet @gofungus and/or post an item in the announcements section of our forum.
## How can I upload my %Fungus game for others to see?
After creating a build, you can use a hosting service such as [itch.io](http://itch.io), [gamejolt.com](http://gamejolt.com) or [newgrounds.com](http://newgrounds.com)
# How can I upload my Fungus game for others to see? # {#where_upload}
After creating a build, you can use a hosting service such as [itch.io], [gamejolt.com] or [newgrounds.com]
## How can I suggest new features for %Fungus ?
Please use the forum to request new features. You can also checkout our github issues list to see what we have planned.
# How can I report a bug or suggest new features for Fungus? # {#bug_reports}
Please use the forum to report bugs and request new features. You can also checkout our github issues list to see what we have planned.
## How do I report a bug in %Fungus?
Please use the forum to report bugs.
## How long will I have to wait for a bug-fix ?
# How long will I have to wait for a bug-fix? # {#how_long}
If a bug is critical and we can't offer a sensible workaround, we will try to fix it as soon as possible. Otherwise, we will aim to fix the issue in the next release.
## Can I get my hands on beta versions of %Fungus ?
The very latest version is always available at our [github repository](https://github.com/snozbot/fungus)
# Can I get my hands on beta versions of Fungus? # {#beta_version}
The very latest version is always available at our [github repository]
## How can I contribute to %Fungus?
There are lots of ways to help the %Fungus community to grow
# How can I contribute to Fungus? # {#contribute}
There are lots of ways to help the %Fungus community to grow!
1. Answer questions and post tips on the forum
2. Contribute code either via a Github pull request or post code snippets in the forums.
3. Improve the documentation by editing the [fungus-site repo](https://github.com/snozbot/fungus-site) and send in a pull request.
3. Improve the documentation by editing the Docs folder on github and send in a pull request.
4. Let us know on the forum if you've made a game with %Fungus so we can add it to the site.
5. If you write an article, blog post, podcast, etc. about %Fungus send it in and we'll add it to the [community articles](../articles/index.md) section.
5. If you write an article, blog post, podcast, etc. about %Fungus send it in and we'll add it to the [community articles] section.
## Are you planning to integrate %Fungus into other game engines ?
# Are you planning to integrate Fungus into other game engines? # {#other_engines}
Not currently. We're sticking with Unity for the foreseeable future.
[Snozbot]: http://snozbot.com
[Unity Asset Store]: http://u3d.as/f0T
[itch.io]: http://itch.io
[gamejolt.com]: http://gamejolt.com
[newgrounds.com]: http://newgrounds.com
[github repository]: https://github.com/snozbot/fungus
[community articles]: ../articles/index.md

13
Docs/fungus_docs/flowcharts.md

@ -1,9 +1,10 @@
# Flowcharts {#flowcharts}
# Flowcharts # {#flowcharts}
[TOC]
A fundamental concept of %Fungus is the **Flowchart**. Scenes can contain a single Flowchart or multiple Flowcharts.
<!-- **************************************************** -->
## What is a Flowchart?
# What is a Flowchart? # {#flowchart}
A %Fungus **Flowchart** contains the Blocks in which all your %Fungus Commands are located. A Unity scene can contain multiple Flowcharts, and commands can be executing simultaneously in different Flowcharts. However, for many games it is sufficient for one Block in one Flowcart to be executing at any one time.
@ -12,7 +13,7 @@ Here is an example of a %Fungus Flowchart:
![flowchart example]
<!-- **************************************************** -->
## Opening and docking the Flowchart window
# The Flowchart window # {#flowchart_window}
You'll need the %Fungus Flowchart window when working with %Fungus. Open and dock this window somewhere handy by following these steps:
1. Choose menu: ``Tools | %Fungus | Flowchart Window``
@ -28,7 +29,7 @@ You'll need the %Fungus Flowchart window when working with %Fungus. Open and doc
![Docked %Fungus window]
<!-- **************************************************** -->
## Creating a Flowchart
# Creating a Flowchart # {#creating_flowchart}
To create a %Fungus Flowchart do the following:
1. Choose menu: ```Tools | %Fungus | Create Flowchart```
@ -48,7 +49,7 @@ To create a %Fungus Flowchart do the following:
5. As you can see, when a new Flowchat is created a single command Block named "New Block" is automatically created, with the Event handler "Game Started" (so it will start executing %Fungus commands as soon as the scene goes into **Play Mode**).
<!-- **************************************************** -->
## Panning the Flowchart window
# Panning the Flowchart # {#panning}
Panning means moving the contents of the Flowchart window as if they are on a piece of paper. Click and drag with the RIGHT mouse button to pan the contents of the Flowchart window.
![pan flowchart 1]
@ -58,7 +59,7 @@ Panning means moving the contents of the Flowchart window as if they are on a pi
![pan flowchart animated]
<!-- **************************************************** -->
## Zooming the Flowchart window
# Zooming the Flowchart # {#zooming}
Zooming refers to making the contents larger or smaller. To zoom the Flowchart window contents either click and drag the UI slider, or use the mouse wheel (or trackpad).
![zoom flowchart 1]

27
Docs/fungus_docs/getting_started.md

@ -1,9 +1,10 @@
# Getting Started {#getting_started}
# Getting Started # {#getting_started}
[TOC]
Follow these steps to get up and running with %Fungus quickly, then learn more about what %Fungus can do and how to do it from the other documentation pages and videos.
<!-- **************************************************** -->
## Opening and docking the Flowchart window
# The Flowchart window # {#flowchart_window}
You'll need the %Fungus Flowchart window when working with %Fungus. Open and dock this window somewhere handy by following these steps:
1. Choose menu: ``Tools | %Fungus | Flowchart Window``
@ -19,7 +20,7 @@ You'll need the %Fungus Flowchart window when working with %Fungus. Open and doc
![Docked %Fungus window]
<!-- **************************************************** -->
## Finding the example folders and scene files
# Example scenes # {#examples}
Two folders are created when you install %Fungus, the %Fungus features themslves (in folder '%Fungus') and a set of examples (in folder 'FungusExamples').
Examples include Drag and Drop, Sherlock and %Fungus Town:
@ -39,7 +40,7 @@ You can cancel the filter by clicking the 'x' in the search bar:
![%Fungus Examples Project window filter scenes cancel]
<!-- **************************************************** -->
## Loading and playing the example scenes
# Running the examples # {#running_examples}
To **load** an example scene, double click the desired example's scene object in the Project window, and the scene should load. For example, this screenshot shows the scene and Flowchart windows when the DragAndDrop example scene has been loaded:
![%Fungus Examples Drag Drop]
@ -51,7 +52,7 @@ To **run** the currently loaded scene (i.e. to enter **Play-mode**), click the U
Note: you click the 'play' button a second time to end **Play-mode**.
<!-- **************************************************** -->
## Changes made during playmode don't persist
# Playmode changes # {#playmode}
As with all Unity projects, you can **change** the properties of gameObjects while a scene is running, but these changes are 'ephemeral' - they only last while the scene is running. As soon as you end play mode the properties of all objects in the Hierarchy will revert to those saved in the Scene file.
This makes it easy to 'tweak' values of objects in **Play-mode**, and then when the desired behaviour is achieved, those values can be set for the saved scene properties.
@ -59,7 +60,7 @@ This makes it easy to 'tweak' values of objects in **Play-mode**, and then when
Values set when Unity is in **Edit-mode** will be saved when you saved your scene (``CTRL-S`` / ``Command-S``, or menu: ``File | Save Scene``).
<!-- **************************************************** -->
## Change your preferences to highlight Play-mode
# Playmode tint # {#playmode_tint}
Sometimes we can forget we are in Unity **Play-mode**, and then make changes to Hierarchy gameObject values that are then 'fogotton' when we do stop playing the scene. A good way to avoid this problem is to to set a 'tint' to the Unity editor to make it visually very clear to us when we are in **Play-mode**. To add a tint to **Play-mode** do the following:
1. Open the Unity preferences dialog by choosing menu: ```File | Preferences ...```
@ -75,7 +76,7 @@ Sometimes we can forget we are in Unity **Play-mode**, and then make changes to
![Unity Play Mode tinted]
<!-- **************************************************** -->
## Creating, naming and saving a new scene from scratch
# Creating a new scene # {#new_scene}
To create a new scene in Unity do the following:
1. Choose menu: ```File | New Scene```
@ -97,7 +98,7 @@ To create a new scene in Unity do the following:
![Editing newly saved scene]
<!-- **************************************************** -->
## Menu: Tools | %Fungus
# Menu: Tools | Fungus # {#fungus_menu}
The core %Fungus operations are available from the Unity ```Tools``` menu.
Choose menu: ```Tools | %Fungus``` to see the options available:
@ -107,19 +108,19 @@ Choose menu: ```Tools | %Fungus``` to see the options available:
As can be seen, there are 2 submenus, ```Create``` and ```Utilities```, plus the ```Flowchart Window``` action (which reveals the window if already open, or opens a new window if the Flowchart window was not previously opened).
<!-- *********** -->
### Menu: Tools | %Fungus | Create
# Menu: Tools | Fungus | Create # {#create_menu}
The %Fungus Tools ```Create``` submenu offers the following actions:
![%Fungus Tools Create menu]
<!-- *********** -->
### Menu: Tools | %Fungus | Utilities
# Menu: Tools | Fungus | Utilities # {#utilities_menu}
The %Fungus Tools ```Utilties``` submenu offers the following actions:
![%Fungus Tools Utilties menu]
<!-- **************************************************** -->
## Create a Flowchart
# Create a Flowchart # {#create_flowchart}
To create a %Fungus Flowchart do the following:
1. Choose menu: ```Tools | %Fungus | Create Flowchart```
@ -139,7 +140,7 @@ To create a %Fungus Flowchart do the following:
5. As you can see, when a new Flowchat is created a single command Block named "New Block" is automatically created, with the Event handler "Game Started" (so it will start executing %Fungus commands as soon as the scene goes into **Play Mode**).
<!-- **************************************************** -->
## Flowchart Block property viewing and editing
# Block properties # {#block_properties}
Let's change the name of the default command Block of a new Flowchart in the Flowchart window to "hello". Do the following:
1. Create a new %Fungus Flowchart (if you haven't already done so).
@ -151,7 +152,7 @@ Let's change the name of the default command Block of a new Flowchart in the Flo
![rename Block]
<!-- **************************************************** -->
## Add a Say command
# Add a command # {#add_command}
To add a "Say" command to a Block do the following:
1. (setup) Create a new scene, add a %Fungus Flowchart to the scene.

13
Docs/fungus_docs/install.md

@ -1,8 +1,9 @@
# Install {#install}
# Installation # {#install}
[TOC]
This page explains how to download and install Unity and %Fungus.
# Video Tutorial
# Video Tutorial # {#video}
@htmlonly
<div align="center">
@ -10,7 +11,7 @@ This page explains how to download and install Unity and %Fungus.
</div>
@endhtmlonly
# How do I install %Fungus?
# How do I install Fungus? # {#how_install}
1. Install the latest version of [Unity].
3. Launch Unity and create a new Project by selecting File > New Project.
@ -27,7 +28,7 @@ This page explains how to download and install Unity and %Fungus.
1. Download the latest %Fungus .unitypackage from [Github]
2. Import %Fungus into the new project by selecting Assets > Import Package > Custom Package.
# First steps
# First steps # {#first_steps}
1. Display the Flowchart editor window by selecting Window > Tools > %Fungus > Flowchart Window.
2. For convenience, you should dock the Flowchart window somewhere in the editor window.
@ -36,7 +37,7 @@ This page explains how to download and install Unity and %Fungus.
Try playing the other example scenes and watch how the gameplay is controlled by the flowchart in the %Fungus Script window.
# How do I upgrade an existing %Fungus project ?
# How do I upgrade? # {#upgrade}
To upgrade an existing project to the latest version of %Fungus.
@ -47,7 +48,7 @@ To upgrade an existing project to the latest version of %Fungus.
We try to maintain backwards compatibility between releases but sometimes breaking changes are necessary. If you're having trouble upgrading your project just ask for assistance on the forum.
# %Fungus System Requirements
# System Requirements # {#system_requirements}
- We recommend installing the latest version of [Unity].
- %Fungus requires at least Unity 5.0 and is not compatible with Unity 4.x or earlier.

2
Docs/fungus_docs/narrative_parser_tokens.md

@ -1,4 +1,4 @@
# Narrative Parser Tags {#narrative_tags}
# Narrative Parser Tags # {#narrative_tags}
The following tokens can be used within Story Text to do things such as change the styling of text or clear the contents of a dialog area on input and much more. You can see this list in the editor by pressing the Tag Help button in the Say command.

13
Docs/fungus_docs/playing_audio.md

@ -1,4 +1,5 @@
# Playing Audio {#playing_audio}
# Playing Audio # {#playing_audio}
[TOC]
Almost every game benefits from some sound! Often we categorise audio clips into three kinds:
@ -9,7 +10,7 @@ Almost every game benefits from some sound! Often we categorise audio clips into
%Fungus provides straightforward ways to include all 3 kinds of audio clip in your game, using the techniques presented here.
<!-- **************************************** -->
# Sources of free to use audio clips and music
# Sources of free audio # {#free_audio}
Before you can **add** audio clips to a game you need to get some audio clips. Here are some sources of audio clips to use when learning about audio in %Fungus, in case you don't have some of your own to hand.
The following are some good places online to fine music and sound effects for games. Some are free for any use (including commerical), some are just free for personal use. As always, check the licence of media assets before using them for any commerical products ...
@ -23,7 +24,7 @@ You'll find a range of audio clips included inside the %Fungus Examples folders:
![%Fungus Examples audio]
# Adding audio assets to your project
# Adding audio to your project # {#adding}
Once you have some audio clips on your computer, you need to import them into your Unity project.
## Method 1 (menu)
@ -35,13 +36,13 @@ Alternatively you can **drag** files or entire folders into your Unity Project w
![drag audio folder into Unity]
<!-- **************************************** -->
# Three ways to work with audio in %Fungus games
# Working with audio # {#working}
There are 3 main ways to work with audio in %Fungus games. These are the Audio commands, the Say command, and gameObjects containing Unity Audio Source components. All three are discussed below:
![audio big picture]
<!-- **************************************** -->
## List of %Fungus audio commands
# Fungus audio commands # {#commands}
The range of audio **Commands** you can add to a Block are as follows:
![%Fungus audio commands]
@ -162,7 +163,7 @@ We'll learn about this with a simple Unity gameObject that plays a bear sound tw
13. Now when you play the scene, first the bear sound linked to in the Audio Source component of gameObject "GameObject - bear sound" should play at full volume, then (after having its volume reduced to 25%) it should play a second time at a much reduced volume.
<!-- **************************************** -->
## Audio Tags (in Say Commands)
# Audio Tags # {#tags}
Since often dialog authors will know just what sound effects or music they wish to associate with their characters utterances, %Fungus allows audio-related 'tags' to be embedded in the text of Say Commands. There are four audio related tags:

25
Docs/fungus_docs/telling_a_story.md

@ -1,9 +1,10 @@
# Telling a story {#telling_a_story}
# Telling a story # {#telling_a_story}
[TOC]
Having got up and running, here are some next steps to get you familiar with the storytelling features in %Fungus.
<!-- **************************************** -->
## Adding Characters, for use in Say commands
# Adding Characters # {#characters}
We can associated words spoken by the Say Command with a particular Character. Consider the following Tom and Jerry scene:
@ -41,7 +42,7 @@ Assigning the appropriate Character for each Say Command from the menu of Charac
![tom jerry conversation output]
<!-- **************************************** -->
## Listing portrait image(s) for use by Characters
# Character portrait images # {#portraits}
If you add one or more portrait images to a character, then each Say command for that character can define which of those portrait images should be displayed, alongside the (colored) name of the Character.
@ -67,7 +68,7 @@ As you can see in some of the %Fungus Example projects, many games will have a w
![sherlock image list]
<!-- **************************************** -->
## Add a Stage
# Character Stage # {#stage}
Portrait images can be used in two ways in %Fungus.
@ -89,7 +90,7 @@ Create a simple stage that covers the whole game Window as follows:
Now you have added a %Fungus Stage to your scene, you will be able to make large Portrait images appear / move in-out of the screen using the **Portrait** Command in %Fungus Flowchart Blocks...
<!-- **************************************** -->
## Displaying Portrait images on stages with the Portrait command
# Portrait command # {#portrait_command}
Once you have a %Fungus Stage, and a character then you can instruct %Fungus to display / move onscreen the Character Portrait images. To make character images appear as part of a scene do the following:
@ -131,7 +132,7 @@ Here we see the Play Mode user experience of the output of running such a workfl
![john portrait then say]
<!-- **************************************** -->
## Play some music
# Playing music # {#playing_music}
Music sound clips loop, so they are restarted once they have finished playing. Often the first Command in a Block is a **Play Music** Command. Add music to a Block as follows:
1. (setup) Create a new scene, add a %Fungus Flowchart to the scene, and select the Block in the Flowchart.
@ -145,7 +146,7 @@ Music sound clips loop, so they are restarted once they have finished playing. O
NOTE: If you wish to start playing the music clip from a known time-point (rather than from the beginning), then enter the desired time-point in the Inspector property "At Time" for your Play Music command.
<!-- **************************************** -->
## Add menu commands to branch to other blocks
# Branching narrative # {#branching}
Let's use a Say command above to ask a tricky mathematical question, and demonstrate the Menu command by offering the user a choice been "correct' and "incorrect" answers. Menu commands transfer control to another block - so we'll need to add 2 new blocks to correspond to the 2 answers.
Do the following:
@ -176,7 +177,7 @@ Do the following:
![wrong screen]
<!-- **************************************** -->
## Change Camera background colour
# Change background colour # {#background_color}
Unity cameras determine what the user sees when a scene is running. When nothing is present in all or part of the camera's rectangle a solid "Background" colour is displayed. Unity cameras have a default Background of a medium dark blue colour. You can change this as follows:
@ -187,7 +188,7 @@ Unity cameras determine what the user sees when a scene is running. When nothing
4. Now when any part of the camera rectangle (frustrum) shows no gameOjects then your custom Background colour will be what the user sees.
<!-- **************************************** -->
## Add a background sprite
# Background sprite # {#background_sprite}
To add any sprite image file from your Unity Project folder into the current scene, simply drag a reference to the sprite image file from the Project window onto the Scene window, and rotate / resize desired. The sprite will appear as a new gameObject (with same name as Sprite Project image file) in the Hierarchy window:
@ -196,7 +197,7 @@ To add any sprite image file from your Unity Project folder into the current sce
NOTE: You may not be able to see the sprite, because what we see depends on the current settings for the camera. What the camera shows, how it moves etc. can be controlled by %Fungus Views and Commmands relating to Views.
<!-- **************************************** -->
## Adding and customising a view
# Using Views # {#view}
What the main camera of a scene displays to the user, and how it moves etc. can be controlled by %Fungus Views and %Fungus Commmands relating to Views. A %Fungus View is a special gameObject in the Hierarchy, it appears as a green outlined inner rectangle, with two filled green rectangles on the left and the right. The ratio of the outlined inner rectangle is 4:3. The ratio of the outer rectangle (which includes the two filled green left and right rectangles) is 16:9. These two ratios cover almost every common phone, tablet and computer screen width-to-height ratio. So arranging the view so that a background Sprite image looks good for both inner- and outer- rectangles of a view, pretty much ensures your game will look good on any device. Setting the background color of the camera to something like black also means on the rare device that has an odd ratio showing content outside of the view outer rectangle, the game should still look perfectly acceptable.
@ -214,10 +215,10 @@ To add a view to the current scene do the following:
![resize view]
7. Note: You can also rotate the view with the Unity Rotate tool
NOTE: Utnil you add a "Fade To View" %Fungus command, you still may not see the Sprite in the Game window when the scene plays, since the Main Camera has not been oriented to resize and align with the view.
NOTE: Until you add a "Fade To View" %Fungus command, you still may not see the Sprite in the Game window when the scene plays, since the Main Camera has not been oriented to resize and align with the view.
<!-- **************************************** -->
## Add a Fade To View command
# Fade To View command # {#fade_to_view}
Once you have a Scene that contains some background Sprites and %Fungus Views, you are ready to use the %Fungus camera related Commands to control what the user sees. The simplest camera control is to make the Game window fade from a solid colour to the Main Camera being sized, positioned (and if necessary rotated) to show a specified %Fungus View. Do the following:

18
Docs/fungus_docs/training_course.md

@ -1,28 +1,26 @@
# %Fungus Training Course {#training_course}
# Fungus Training Course # {#training_course}
@htmlonly
# Course Description # {#description}
We've teamed up with Paul Mc Grath to create an extensive [training course] which teaches how to make storytelling games using %Fungus and Unity. Sales of this course help us to continue developing %Fungus, so it's a nice way to learn %Fungus and to support the work we're doing on the project.
@htmlonly
<div>
<a target="_blank" href="https://www.udemy.com/make-interactive-games-with-fungus-unity3d-no-coding-required/?couponCode=FungusDiscount2016"><img hspace="20" src="./training.png"></a>
</div>
@endhtmlonly
## Course Description
We've teamed up with Paul Mc Grath to create an extensive [training course] which teaches how to make storytelling games using %Fungus and Unity. Sales of this course help us to continue developing %Fungus, so it's a nice way to learn %Fungus and to support the work we're doing on the project.
This course is aimed at anyone who wants to make interactive story based games, but, who doesn't know how to code.
%Fungus is a free Unity 3D plugin that allows non coders (like Paul) access to some of Unity's core features. If you have never used game development software, or if you have struggled with code trying to make games, %Fungus and this course are exactly what you need.
## What are the requirements?
# Course requirements # {#requirements}
- A Mac or PC that is capable of running Unity 3D.
- The latest version of Unity 3D (we will talk you through download and install on the course).
- The latest Version of %Fungus (we will talk you through download and install on the course).
## What am I going to get from this course?
# What to expect # {#expect}
- Over 43 lectures and 8 hours of content!
- You will have a full working knowledge of %Fungus and how it integrates with Unity.
@ -30,7 +28,7 @@ This course is aimed at anyone who wants to make interactive story based games,
- You will be able to publish your games to Unity’s WebGL platform and have them on your own website, publish them to Android and iOS versions (if you have a Apple developer Licence) and sell them through Google play or the iOS Store.
- Most importantly you will be able to do all of this **without writing a line of code.**
## What is the target audience?
# Target audience # {#target_audience}
- If you don’t know how to code and want to make interactive storytelling games, this course is for you.
- If you’re an artist, illustrator or writer and would like to delve into game development in an easy and approachable manner, this course if for you.

15
Docs/fungus_lua/create_menu.md

@ -1,4 +1,5 @@
# The Create Menu {#lua_create_menu}
# The Create Menu # {#lua_create_menu}
[TOC]
The easiest way to add Lua scripting to your scene is via the Tools > %Fungus > Create menu. This allows you to quickly instantiate one of the Lua prefabs that comes with FungusLua. The FungusLua prefabs all begin with 'Lua'.
@ -6,7 +7,7 @@ You can also access these prefabs from %Fungus/Thirdparty/FungusLua/Resources/Pr
![%Fungus Create Menu](fungus_lua/create_menu.png)
# Lua Prefab
# Lua Prefab # {#lua_prefab}
This prefab provides a complete Lua setup, including the @ref lua_environment "LuaEnvironment", @ref lua_utils "LuaUtils", @ref lua_bindings "LuaBindings" and @ref lua_script "LuaScript" components in a single game object.
@ -14,28 +15,28 @@ This is perfect when you want to quickly set up a single script with a few bindi
For more sophisticated scenarios it can be better to place these components in different game objects, e.g. one LuaEnvironment object, one LuaBindings object and multiple LuaScript objects that share the environment and bindings. The other prefab types listed below make it easy to set up this kind of configuration.
# Lua File
# Lua File # {#lua_file}
This option creates a Lua file in the folder you select. In Unity, Lua files use the .txt extension so they work properly with TextAsset properties and can be opened in the code editor.
When you create a Lua file, add your Lua script to it in a text editor, and then select the file in the Lua File property of a LuaScript component or Execute Lua command to execute it. You can also use Lua's @ref lua_script "module system" and the require() function to include Lua code from other files.
# Lua Environment Prefab
# Lua Environment Prefab {#lua_environment_prefab}
This prefab provides a @ref lua_environment "LuaEnvironment" component for executing Lua script, and the @ref lua_utils "LuaUtils" component which provides useful utilities for working with Lua, Unity and %Fungus.
FungusLua will automatically create a default LuaEnvironment if none exists when the scene starts, so you really only need to create a Lua Environment in your scene when you want to customize the default environment setup (e.g. Adding a string table file or registering additional c# types).
# Lua Bindings Prefab
# Lua Bindings Prefab # {#lua_bindings_prefab}
This prefab provides a @ref lua_bindings "LuaBindings" component which you can use to bind objects in your scene / project to Lua variables so they can be accessed from Lua script. You can have multiple Lua Bindings in a scene, or additively load in a scene which contains a Lua Bindings for objects in that scene. At startup, all loaded Lua Bindings register their bindings with every Lua Environment in the scene (unless the All Environments option is switched off).
If you want to make a prefab using Lua Bindings, all the bound objects must be children of the Lua Bindings prefab in the hierarchy so that Unity can maintain the object references correctly. This is a limitation of how Unity works.
# Lua Script Prefab
# Lua Script Prefab # {#lua_script_prefab}
This prefab contains a @ref lua_script "Lua Script" component which you can use to execute Lua script, either typed in the inspector window or loaded via a text file. It also contains an Execute Handler component which supports executing the Lua Script when a Unity event occurs (e.g. start, update, on enter trigger, etc.)
# Lua Store Prefab
# Lua Store Prefab # {#lua_store_prefab}
This prefab contains a @ref lua_store "Lua Store" component which you can use to persist Lua variables between scene loads.

7
Docs/fungus_lua/execute_lua.md

@ -1,4 +1,5 @@
# ExecuteLua Command {#execute_lua}
# ExecuteLua Command # {#execute_lua}
[TOC]
This command allows you to embed a Lua script to be executed as part of a command sequence in a Block. The Lua script to be executed can be specified in the inspector or in a text file, in the same way as the @ref lua_script component.
@ -8,7 +9,7 @@ The parent Flowchart will be bound to a global Lua variable prior to executing t
You can also store the return value from the Lua script in a Flowchart variable.
# Evaluating expressions
# Evaluating expressions # {#evaluating}
The %Fungus If command can only compare 2 variables at a time. For more complex expressions involving multiple variables or [math functions], you can use Lua to evaluate the expression and store the result in a Flowchart variable.
@ -21,7 +22,7 @@ The %Fungus If command can only compare 2 variables at a time. For more complex
In the Execute Lua command, you can use the getvar() function to get any Flowchart variables to be used in the expression.
Note: getvar() returns a reference to the %Fungus variable object. To access the value of this variable use the .value property.
# Example
# Example code # {#example_code}
Here's an example Lua script which evaluates a complex expression involving 3 integer variables defined on a bound Flowchart.

63
Docs/fungus_lua/fungus_module.md

@ -1,63 +0,0 @@
# %Fungus Module {#lua_fungus_module}
This Lua module provides handy functions for working with Lua, Unity and %Fungus.
In this page we cover some of the more generic functionality in the module, other major features are described elsewhere in the documentation.
# Inspecting Lua objects
You can use Lua's built in print() function to get a basic description of any object printed to the console. When you want to get a more detailed description of an object, use inspect().
```lua
-- Prints a short description of object v
print(v)
-- Prints a summary of object v in a human readable format.
inspect(v)
```
# Running Unity coroutines
When you bind to a C# component using Lua Bindings, you can access any public method in the class. If a method returns IEnumerator then that method can be executed as a [Unity coroutine], which is a powerful way to run asynchronous code.
The runwait() function allows you to call a C# coroutine method from Lua which may take multiple frames to finish its work, and then carry on with the rest of the Lua code once that C# method has finished executing. This is how the say() function works for example.
This is the list of available functions for waiting and working with coroutines.
```lua
-- Waits for a number of seconds, then continue execution of Lua script
wait(duration)
-- Waits until the Lua function provided returns true, or the timeout expires.
-- Returns true if the function succeeded, or false if the timeout expired
waitfor(fn, timeoutduration)
-- Run a C# coroutine and continue execution of Lua script
run(co)
-- Run a C# coroutine, wait until it completes, then continue execution of Lua script
runwait(co)
```
# Globals vs Table mode
The %Fungus module can be used in three modes, controlled by the %Fungus Module option in the LuaUtils component.
1. Use Global Variables: all module functions are mapped to global functions. This allows for convenient access, but it runs the risk that you might accidentally declare a variable with the same name as a %Fungus module function.
2. Use %Fungus Variable: all module functions are accessed through a global table called 'fungus'. This gives a degree of namespace safety at the cost of more typing.
3. No %Fungus Module: the %Fungus module will not be registered. Used if you don't want to use the %Fungus module.
Options 1 and 2 are functionaly equivalent, it's just a matter of personal preference which you want to use.
```lua
-- sub is a function in the %Fungus module, mapped to a global variable
-- Use Global Variables
sub('a string')
-- Use Fungus Variable
fungus.sub('a string')
```
[Unity coroutine]: http://docs.unity3d.com/Manual/Coroutines.html

1
Docs/fungus_lua/lua_bindings.md

@ -1,4 +1,5 @@
# LuaBindings {#lua_bindings}
[TOC]
The LuaBindings component allows you map gameobjects and components in your scenes to Lua variables which you can then access in your Lua scripts. You can bind to any component, including standard Unity components, components from the Unity Asset Store and your own custom scripts.

1
Docs/fungus_lua/lua_controlling_fungus.md

@ -1,4 +1,5 @@
# Controlling %Fungus {#lua_controlling_fungus}
[TOC]
The %Fungus module provides several functions for working with the standard %Fungus narrative features and flowcharts.

1
Docs/fungus_lua/lua_environment.md

@ -1,4 +1,5 @@
# LuaEnvironment {#lua_environment}
[TOC]
The LuaEnvironment component manages all the variables, functions, executing code, etc. for a single Lua context, and provides handy functions for loading and running Lua scripts. In order to run Lua code there must be at least one LuaEnvironment component present in the scene.

16
Docs/fungus_lua/lua_fungus_module.md

@ -1,10 +1,11 @@
# %Fungus Module {#lua_fungus_module}
# Fungus Lua Module # {#lua_fungus_module}
[TOC]
This Lua module provides handy functions for working with Lua, Unity and %Fungus.
In this page we cover some of the more generic functionality in the module, other major features are described elsewhere in the documentation.
# Inspecting Lua objects
# Inspecting Lua objects # {#inspecting_lua_objects}
You can use Lua's built in print() function to get a basic description of any object printed to the console. When you want to get a more detailed description of an object, use inspect().
@ -16,15 +17,14 @@ print(v)
inspect(v)
```
# Running Unity coroutines
# Running Unity coroutines # {#run_unity_coroutines}
When you bind to a C# component using Lua Bindings, you can access any public method in the class. If a method returns IEnumerator then that method can be executed [as a coroutine](http://docs.unity3d.com/Manual/Coroutines.html), which is a powerful way to run asynchronous code.
When you bind to a C# component using Lua Bindings, you can access any public method in the class. If a method returns IEnumerator then that method can be executed as a [Unity coroutine], which is a powerful way to run asynchronous code.
The runwait() function allows you to call a C# coroutine method from Lua which may take multiple frames to finish its work, and then carry on with the rest of the Lua code once that C# method has finished executing. This is how the say() function works for example.
This is the list of available functions for waiting and working with coroutines.
```lua
-- Waits for a number of seconds, then continue execution of Lua script
wait(duration)
@ -40,7 +40,7 @@ run(co)
runwait(co)
```
# Globals vs Table mode
# Globals vs Table mode # {#globals_vs_tables}
The %Fungus module can be used in three modes, controlled by the %Fungus Module option in the LuaUtils component.
@ -51,7 +51,7 @@ The %Fungus module can be used in three modes, controlled by the %Fungus Module
Options 1 and 2 are functionaly equivalent, it's just a matter of personal preference which you want to use.
```lua
-- sub is a function in the Fungus module, mapped to a global variable
-- sub is a function in the %Fungus module, mapped to a global variable
-- Use Global Variables
sub('a string')
@ -59,3 +59,5 @@ sub('a string')
-- Use Fungus Variable
fungus.sub('a string')
```
[Unity coroutine]: http://docs.unity3d.com/Manual/Coroutines.html
Loading…
Cancel
Save