The new instructions on how to use the portrait functions I made are on the wiki.
I also created an example project if you prefer to see it in action. It’s in the FungusExamples/FungusLua/Narrative folder and called PortraitControlExample.unity.
It was pretty easy working with Chris Gregan on planning for the portrait refactor. Next time I’ll make sure to rebase my pull request commits into one commit to make it easier to read and so I get that sweet, sweet contribution line count.
I’ve been working with Chris Gregan, developer of Unity Fungus, to refactor the stage portrait command so that you will be able to use lines like this to control your characters on stage:
All you have to do is add the Stage object to your Lua Bindings and you can refer to it as its default name “stage” or specify different names for your different stages if you have more than one.
Narrative Editor-san wrote five-chapters worth of the original comic.
Yay Editor-san!
Code
I found a handy way to use the new Fungus Lua script to make the script-writing more streamlined.
You can use aliases to shorten existing function names.
1
2
3
4
5
local sc=setcharacter
sc(character,"portrait")
You can define functions per Character and overload the function to offer the ability to specify which picture to use.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
functionrsay(text)
setcharacter(rinku,“happy”)
say(text)
end
functionhsay(text,portrait)
portrait=portrait or“angry”
setcharacter(hojun,portrait)
say(text)
end
rsay“Hi there,my name isRinku”
hsay“Well,my name isHojun.”
hsay(“I'mgetting kind of bored though.”,“bored”)
If you want to play with Lua yourself, GOOD NEWS! It’s in the latest 3.0 beta release of Fungus! Here is the impressive changelog listing the new features. I added the “Play from Selected” and “Stop All and Play” features 🙂 Check it out and give it a spin.