{"author_name":"blubberquark","cat":"LD #34","comments":[],"epoch":1449856500,"likes":2,"metadata":{"p_key":"12098","p_author":"blubberquark","p_authorkey":"7968","p_urlkey":"47346","p_title":"Declaration of base code!","p_cat":"LD #34","p_event":"LD34","p_time":"1449856500","p_likes":"2","p_comments":"0","p_status":"UPD5","us_key":"7968","us_name":"blubberquark","us_username":"\/author\/rfgpfeiffer\/","event_start":"1449792000","event_key":"31","event_name":"LD34"},"text":"<p>I have written some base code to import Yarn conversation files into HaxeFlixel and called it FlxYarn.<\/p>\n <p>look at it here: <a href=\"https:\/\/gist.github.com\/robertpfeiffer\/e00a88fa1d514cc4302b\">https:\/\/gist.github.com\/robertpfeiffer\/e00a88fa1d514cc4302b<\/a><\/p>\n <p>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!<\/p>\n <figure class=\"tmblr-full\"><img src=\"https:\/\/40.media.tumblr.com\/7149dba7b13cdc47cc8461314cc70982\/tumblr_inline_nz5jiuR1oJ1t25r8z_540.png\" alt=\"two talking heads and speech bubbles\" \/><\/figure>\n <p>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.<\/p>\n <p>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.<\/p>\n <figure class=\"tmblr-full\"><img src=\"https:\/\/40.media.tumblr.com\/980914c34cf7ba973b513f404552bd07\/tumblr_inline_nz5k79p52c1t25r8z_540.png\" alt=\"screenshot of conversation node syntax\" \/><\/figure>\n <p>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 &lt;&lt;run $X&gt;&gt; macro runs haxe statements. The &lt;&lt;print $X&gt;&gt; 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.<\/p>\n <p>&nbsp;<\/p>\n <figure class=\"tmblr-full\"><img src=\"https:\/\/41.media.tumblr.com\/d07f2c9337e91e92b625b266708bed92\/tumblr_inline_nz5kn56PX91t25r8z_540.png\" alt=\"yarn conversation state graph\" \/><\/figure>\n <p>Get Yarn Here:<\/p>\n <p><a href=\"https:\/\/github.com\/infiniteammoinc\/yarn\"> https:\/\/github.com\/infiniteammoinc\/yarn<\/a><\/p>\n <p>Try out the cobbled-together nonsense Demo conversation between the neo-baroque technocrat and the spaghetti wizard (requires Flash):<\/p>\n <p><a href=\"http:\/\/blubberquark.itch.io\/flixel-yarn-test\">http:\/\/blubberquark.itch.io\/flixel-yarn-test<\/a><\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/base-code\/\" rel=\"tag\">base code<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/dialogue\/\" rel=\"tag\">dialogue<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/flixel\/\" rel=\"tag\">Flixel<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/haxe\/\" rel=\"tag\">haXe<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/haxeflixel\/\" rel=\"tag\">HaXeFlixel<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/npc\/\" rel=\"tag\">NPC<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/tools\/\" rel=\"tag\">tools<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/twine\/\" rel=\"tag\">Twine<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/yarn\/\" rel=\"tag\">yarn<\/a><\/p>","time":"December 11th, 2015 12:55 pm","title":"Declaration of base code!"}