HTML I can't figure out how to modify a Twine game in Twine, instead of just having to mess around in Notepad

rb813

Active Member
Aug 28, 2018
989
580
There's this game that was abandoned, and I'm kinda interested in modifying it (even though I have zero experience with Twine before today). I've played around with it a little and confirmed that I can effectively make minor changes by right-clicking on the HTML file, opening it in Notepad, and editing the raw code. When I save the HTML file in Notepad and then fire it up in a browser again, the changes I made do take effect, so I could just keep going on like that. But obviously, for changes that are more than a line or two, it's gonna be awfully cumbersome to attempt it in raw HTML without an IDE making the lines orderly and color-coded.

So I downloaded Twine (I made sure to get the same version the game was built in) and selected Import > Compiled HTML File. It loaded up okay, and I did Verify All Passages to iron out a couple minor syntax issues. And yet, when I try to run the game (either with Test Play or Build Story), I get a bunch of errors. The main ones that make the game absolutely unplayable are No macro or passage called "click" and No macro or passage called "replace". Obviously, you're not gonna get very far in an HTML game if you can't click on a link and replace it with another part of the game.

Why is that happening in my build that was just directly imported from a game that works fine? (I have confirmed that the HTML file I just modified in Notepad and not in Twine still works.) Does it have something to do with Sugarcube? I don't really understand what that is, I just know the game was made with Sugarcube. Do I need to import that into Twine too? Or is there some other IDE I can use to have the HTML file be laid out nice and orderly, but not have to worry about understanding how Twine works?
 

rb813

Active Member
Aug 28, 2018
989
580
Okay, I figured it out. I'll leave the problem and solution here in case anyone else can benefit from it in the future.

It turns out I was on the right track, that Sugarcube was the problem. To solve it, I downloaded Sugarcube and unzipped it. I put the Sugarcube folder inside Twine\targets, then opened Twine, loaded the story, and selected Sugarcube under Story > Story Formats. It still has issues with "Test Play from Here" on a particular package, but I can play from a savegame, so that should be good enough.