galaxykate / tracery

Tracery: a story-grammar generation library for javascript
Apache License 2.0
2.11k stars 246 forks source link

Tracery2 has breaking changes with setting variables #14

Closed v21 closed 8 years ago

v21 commented 8 years ago

Specifically, setting variables within a node is no longer supported, as per

{ "name": ["Cheri","Fox","Morgana","Jedoo","Brick","Shadow","Krox","Urga","Zelph"] , "story": ["#hero.capitalize# was a great #occupation#, and this song tells of #heroTheir# adventure. #hero.capitalize# #didStuff#, then #heroThey# #didStuff#, then #heroThey# went home to read a book."] , "monster": ["dragon","ogre","witch","wizard","goblin","golem","giant","sphinx","warlord"] , "setPronouns": ["[heroThey:they][heroThem:them][heroTheir:their][heroTheirs:theirs]","[heroThey:she][heroThem:her][heroTheir:her][heroTheirs:hers]","[heroThey:he][heroThem:him][heroTheir:his][heroTheirs:his]"] , "setOccupation": ["[occupation:baker][didStuff:baked bread,decorated cupcakes,folded dough,made croissants,iced a cake]","[occupation:warrior][didStuff:fought #monster.a#,saved a village from #monster.a#,battled #monster.a#,defeated #monster.a#]"] , "origin": ["#[#setPronouns#][#setOccupation#][hero:#name#]story#"] }

This will produce results like Cheri was a great ((occupation)), and this song tells of ((heroTheir)) adventure. Cheri ((didStuff)), then ((heroThey)) ((didStuff)), then ((heroThey)) went home to read a book.

v21 commented 8 years ago

fixed!