Posts Tagged ‘yarn’

Yaaaarn

Posted by (twitter: @amras0000)
Saturday, December 12th, 2015 10:58 am

Got some yarn physics working, I’m liking how this looks.
LD34_Demo0_

Declaration of base code!

Posted by (twitter: @blubberquark)
Friday, December 11th, 2015 12:55 pm

I have written some base code to import Yarn conversation files into HaxeFlixel and called it FlxYarn.

look at it here: https://gist.github.com/robertpfeiffer/e00a88fa1d514cc4302b

Are you tired of writing your dialogues in HaxeFlixel games as big nested if-statements inside of monstrous loops? Then FlxYarn might be right for you!

two talking heads and speech bubbles

I have built a Yarn parser, loader, NPC dialog engine and speech bubble UI for HaxeFlixel. I finished just in time in time for Ludum Dare. Now we can split up the work on a story-driven game into code(Haxe), levels(Tiled) and dialogue(Yarn). Each NPC has his own state machine.

Conversation nodes can contain multiple speech bubbles and dialog options. Nodes can contain Haxe code for scripting, which will be executed with the HScript interpreter. You can share variables from your Yarn state with the game code.

screenshot of conversation node syntax

The Yarn dialogue editor was built by Alec Holowka and heavily inspired by Twine. The syntax you see above is half my own design, half based on Yarn and HScript. The <<run $X>> macro runs haxe statements. The <<print $X>> macro evaluates Haxe expressions and pastes the result into the conversation state. Links to other nodes have the same syntax as in Yarn and Twine.

 

yarn conversation state graph

Get Yarn Here:

https://github.com/infiniteammoinc/yarn

Try out the cobbled-together nonsense Demo conversation between the neo-baroque technocrat and the spaghetti wizard (requires Flash):

http://blubberquark.itch.io/flixel-yarn-test

[cache: storing page]