Skynet is a command-line program that can generate stories based on a template written in a scripting language called Sky.
While the program was originally created to generate a novel for National Novel Writing Month, it may also be used for other creative writing projects as well.
Though the program's source code is licensed under the MIT, the Sky files may be placed under their own individual licenses.
$ git clone https://github.com/tra38/Skynet.git
$ gem install skynet-0.1.0.gem
$ skynet path/to/story.sky
puts %{ #{HERO.name} never cared too much about #{NOUN}.
Instead, #{HERO.name} would busy himself with his career as a #{HERO.job},
where he would #{HERO.job_purpose}.
While he would work, #{HERO.name} wished for some adventure in his life.
Sometimes, #{HERO.name} #{HERO.action}, but his life was still boring.
So, one day, #{HERO.name} said "#{HERO.speak}". It did not help.
Oh well.}
Julian never cared too much about Flower Plaza.
Instead, Julian would busy himself with his career as a District Division Coordinator,
where he would repair coats.
While he would work, Julian wished for some adventure in his life.
Sometimes, Julian thought he would be capable enough to handle the task, but his life was still boring.
So, one day, Julian said "The golden age never was the present one". It did not help.
Oh well.
For a 'real-world example' where Skynet may be more useful, look at story.sky.
There are currently 8 different characters...
- the HERO
- the QUEST_GIVER
- the MONSTER
- the FALSE_HERO (in earlier versions, the MONSTER_KID)
- the MONARCH
- the REBEL
- the ADVISOR
- the TRAITOR
NOUN is a "special location" that is meant to be a focus of the story, but it does not have to be.
If you like to create your own random generators, you can specify your own Custom Rules.
CustomRule.generate_rule "animal", %W(dog cat monkey)
puts %{ The #{CustomRule.animal} is on the mat.} #=> The cat is on the mat.
Phrases are a little more complicated.
CustomRule.generate_rule "animal", %W(#{"terrible and hideous tiger"} #{"lovable and pretty dinosaur"})
puts %{ The #{CustomRule.animal} is on the mat.} #=>The lovable and pretty dinosaur is on the mat.
Because Sky is a DSL of Ruby, Ruby code would work just as fine in Sky. There may be quirks in this system that I have to discover and document.
TODO: Provide more detailed documentation.
- Fork it ( https://github.com/tra38/skynet/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request