Random posts

Twine: A script to convert parser IF transcripts into linear Twines

I've devised a way to convert game transcripts exported from Gargoyle (using the "script" command) directly into basic Twine games, programmatically. Here is a two-step process:

0) Open a new Twine 1 story.

1) Include this script:

var currentPassage=new Passage("Start");currentPassage.text="";var id=currentPassage.id=1;tale.get("Transcript").text.split(/\n/g).forEach(function(b){var a=b.indexOf(">");if(a===-1){currentPassage.text+=b+"\n"}else{id+=1;var c="Turn "+id;currentPassage.text+=b.slice(0,a)+"\n ''>'' [["+b.slice(a+1)+"|"+c+"]]\n";tale.passages[currentPassage.title]=currentPassage;currentPassage=new Passage(c);currentPassage.id=id;currentPassage.text=""}});currentPassage.text=currentPassage.text.trim()||"<<set window.close()>>";tale.passages[currentPassage.title]=currentPassage;Wikifier.formatters.forEach(function(a){if(a.name=="list"){a.match="^(?!.)(?=.)"}});

2) Paste the entire transcript, from beginning to end, into a passage named "Transcript".

When you run the game, the Start passage and all other passages will be replaced with passages derived from the transcript. Each passage will only have 1 command.

Limitations:
* This assumes that the ">" character is only used for player commands throughout the entire story - and it also assumes that all player commands end in a line break. If these aren't the case, there'll be trouble.
* If the transcript contains other text structures which correspond to Twine syntax, those may unwittingly activate. This script removes one fairly common occurrence - HTML bullet points denoted by * - but leaves the others present.

Suggestions:
* Play in the Jonah format (and optionally remove the title using CSS).
* Use basic CSS to make the links larger (similar to how MS Paint Adventures displays its page links).

FAQ:
Q: Is this Lighan ses Lion compliant???
A: Naturally!

avery's picture

h

2017-09-19 23_04_16-bug on Twitter_ _@snoozysoft i..._ - Nightly.png

no promises

thesycophant's picture

Demon Forest

screenshot183.png
Game File: 

Ryutaro Onigoro must escape the demon forest! He has two double jumps, but gains extra ones from slaying demons midair. Find the portal (up in the treetops) and escape!

Jump: X
Sword: Z

Event Created For: 
Made For: 
An event
juliette's picture

Eat Game

EAT 2012-02-27 14-52-31-44.png
Game File: 

Eat as much food as you want in this gripping eating simulation.

Author: 
Juliette Porée
Made For: 
An event

Dino Defend

dinoscreen.png
Game File: 

Ben's first Knp.

Event Created For: 
Made For: 
An event
Danni's picture

Pre-Pirate Kart Knytt Stories Collaboration Level

Sat, Feb 18 2012 01:00 AM
02/18/2012 - 00:00
02/25/2012 - 00:00
Etc/GMT-8

Inspired by this.

From now until the start of Pirate Kart V, we're gonna collaborate on a single level, and then submit it to the Kart! Some rules/guidelines:

  1. Each participant takes turns making a section of the level
  2. Only one section per participant
  3. Make your section between ten and twenty screens long (more of a guideline really)
  4. Try not to spend more than two hours on your section
  5. Please don't edit someone else's section (unless you have a really good idea)
  6. Add a sign message to your first screen stating that you made the section
  7. First person should start the level off with the Run and Climb abilities. Feel free to introduce the other abilities but try to be gradual about it.
  8. When you've finished your section, upload it as a packed file.
  9. Whoever is working on the next section should say so, just so that we don't have two people trying to make section X and thus conflicting with each other.

Submit WIP versions as an attachment to COMMENTS, not as a new game. The final version will get submitted as a game entry to PKV but WIP versions as game entries will just clutter up the database.


Games made for Pre-Pirate Kart Knytt Stories Collaboration Level

denson's picture

-

Screen Shot 2018-02-24 at 23.49.18.png

Event Created For: 
Made For: 
An event
mkapolk's picture

Scribbage

Screen Shot 2015-11-29 at 1.25.47 PM.png
Game File (Linux): 
Game File (Mac): 
Game File: 

ITS EVERYONES FAVORITE game, scribbage!!
dip ur balls into the hole before the BLOOD GOD consumes you

Made For: 
An event
SpindleyQ's picture

Hey, you can link to wiki pages in BBcode now.

So, I hacked the site to add internal wiki page linking to BBcode, and turned off that fucking irritating default-to-wiki-formatting hack that I'd put in originally. To link to a wiki page, just enclose the page name (with underscores instead of spaces) in double square brackets, like so:
[[I_Am_Sorry,_Bio-Zombie]] becomes I Am Sorry, Bio-Zombie
If, for some reason, you want to link to a wiki page with different text than its title, just leave a space after the page name and then write the text before you close the brackets, like so:
[[Klik_of_the_Month_Klub Kotmk]] becomes Kotmk
Pretty sweet, yes?

Syndicate content
pensive-mosquitoes