/r/twinegames
r/twinegames is a subreddit dedicated to discussion of the game creation tool Twine.
WHAT IS TWINE?
Twine is a game creation tool that allows anyone to create their own interactive stories and games.
WHAT IS /R/TWINEGAMES?
/r/twinegames is a subreddit dedicated to the discussion of Twine and Twine games. Feel free to share your games here! You can ask technical questions here or at IntFiction.org's official Twine Section.
WHAT SHOULD I KNOW BEFORE I POST HERE?
Be nice.
Please follow Reddiquette.
Please do not delete your post if it contains useful information in the replies, as it may be useful to others.
We have a Discord server.
INTRODUCTIONS TO TWINE
A collection of Twine Resources (by ChapelR)
WORKING WITH TWINE
The Old Twine Q&A (Note: Read only)
The Older Twine Forum (Note: Read only)
STORY FORMATS
COMPILERS
TWINE GAME REPOSITORIES
/r/twinegames
Hi!
We’re working on a visual novel inspired game in Godot that heavily relies on branching narrative. We want to use Twine as our writing tool because its visual representation of story paths is essential for us (as opposed to Ink, which doesn’t offer that). However, we’re trying to figure out the best way to write content in Twine and export it into Godot in a structured, easy-to-use format.
Has anyone successfully integrated Twine into Godot? Have you developed any games using this workflow?
For context, our plan is to:
1️⃣ Write & structure the narrative in Twine (Harlowe, SugarCube, or another format).
2️⃣ Export it in a format that Godot can parse (JSON, CSV, or another structured format).
3️⃣ Use it dynamically in Godot—e.g., storing choices and variables, pulling passages as dialogue, or tracking player decisions.
What's the most efficient way to go about it? Any suggestions for best practices, tools, or plugins that have worked well for others? Any advice, workflows, or resources would be hugely appreciated!
Thanks!
I am in need of assistance. I have an idea where I can make the characters' portraits clickable, and when clicked, they lead to another passage that holds the characters' information. I figured <<button>> is probably the best way to bring this idea to life. This is more or less what I did:
<<button>>
<img src="images/example.jpg" alt="Clickable Image">
<<goto "Target Passage">>
<</button>>
But whenever I run the passage, the <<goto>> macro is triggered, and I find myself sent to the "Target Passage". Also, I want to organize the portraits (images) in a way so that they are not stacked above each other but 3-4 portraits per line. Thanks.
I'm developing a game that will have many different images in the sidebar--I'm talking over 100 potentially planned--that will change with rising stats between 0 to 10, 10 to 20, etc. However, once I got the "too many 'if's as a result of a madness of endless 'gte's and 'lt's" issue out of the way, another problem propped up: now any number that's not something like either 0 or 10 will cause a 'blank' image to pop up, and I don't think the file names of the images can really be changed to er, work the way I'd like.
This is what I have in my 'StoryCaption'; I wonder if I'll need to add anything in particular to 'StoryInit' as well:
<img src="'images/[special images]/' + $var1 + '-' + $var2 + '.png'" width=90%>
Hi, I'm really hoping someone here can help. I'm trying to install Twine on a laptop that only supports Windows 8.1, and the app won't open. I have installed and used Twine on multiple computers in the past, so this isn't a clueless newbie issue.
I have tried both the newest release and the one before it. Upon installation, I received this error when trying to open Twine:
"twine.exe entry point not found discardvirtualmemory"
Running the installer as Administrator does not work. Restarting the laptop and reinstalling does not work. Googling or searching reddit is not pulling up any solutions I can find. Doing a disk scan in the command prompt doesn't pull up any errors.
Windows Smartscteen does try to block the installer download, but choosing "Run Anyway" or completely disabling Smartscreen doesn't change anything.
My best guess is that the newest version of Twine isn't compatible with Windows 8.1 anymore, but I can't find any information online about which version would be compatible.
I'm really hoping someone here either: knows a solution to this installation issue, or could point me toward the newest version of Twine that still supports Windows 8.1 (if my guess is correct). I'd appreciate any help.
Edit/Update: going back to Twine 2.4.1 seems to work. I don't know if there's a later one that's compatible, but 2.4.1 isn't giving me any errors.
I'm trying to add an image like this: [img[images/char profiles/ferPro.jpeg]] and I've also tried to leave it in the images folder, without the deeper folder but it still doesn't show up, just a broken image icon. I tried at frist to write it like: <img src="URL"> but I got the same result. I don't know what I'm doing wrong.
So far, I've used Twine for the basic stuff...branching path adventures and adding a few variables for a bit deeper branches. However, that's just the basic text on a black screen approach. I personally wish to use Twine to try and go for the proper "game" aesthetic, with the goal of trying to do the following:
- Creating custom UI screens, and menus for the game (including the built-in side-menu if possible)
- Changing up fonts and colors to match aesthetics
- Being able to add music, sound effects, or even images/video where possible
- The important game stuff such as saving progress, loading previous games, and going as deep into variable making or other gamey elements.
I guess what I'm asking for is, out of the languages Twine supports, which would offer the greatest degree of freedom, but also be more easier to learn/implement so that I don't stress myself too much?
Hiya I literally just started fooling around with twine for the first time and idk what I'm doing.
Basically, I'm tryna give the player the option to choose the character's eye color, for example, so I give them a bunch of options, and depending on which one they choose, they get that eye color. Simple, right? Well, the only way I can think of doing this is by creating one passage for every option and just type the (set: $eyecolor to "whatever") thingy at the top. But I imagine there's an easier way of doing it that doesn't involve creating a heck ton of passages, because it's honestly a mess.
So my question is, is there any way I can put the variables in the same passage so that when you click on the black eye color, for example, it sends you to the next passage and at the same time triggers the variable to be set to have black eyes. I don't know if I'm making sense.
Hello everyone. I set up an interactive "site" leading to different universes to present my portfolio, my activities and my prices. It is a specific website-game that allows you to navigate between animation and sound atmosphere. I deliberately chose not to use WordPress or Wix and it is a very thoughtful decision, although unconventional.
My question is how to publish this site on the page like https://niksethi.com/. And how can I get my own internet address or return links? How to host this site without being clickable as itch.io or borogove.io. I would really like to do as the mentioned page
I looked everywhere but I can't find an answer. Thank you for your help
Loulou
I made my inventory to check whether an item is a weapon, armor, food, etc. and then print the things inside the datamap, and now how to check an item's rarity? Like if it's normal the style won't change, but when it's rare or excellent, I want to change how it will look in the inventory:
{
(set: $weapons to (dm:
"Rusty Axe", (dm:
"damage", 6,
"image", "https://raw.githubusercontent.com/RadioactiveDog-Games/Fallen-Earth-Age-of-the-Mutants/ef1d8b5d92248a5d257640cacedb2f158024f2c3/images/weapons/melee/RustyAxe.png",
"description", "A dull, rusty axe. Still sharp enough to be dangerous.",
"amount", 1,
"rarity", "Normal"
),
"Metal Bat", (dm:
"damage", 8,
"image", "https://raw.githubusercontent.com/RadioactiveDog-Games/Fallen-Earth-Age-of-the-Mutants/ef1d8b5d92248a5d257640cacedb2f158024f2c3/images/weapons/melee/MetalBat.png",
"description", "A sturdy bat, great for smashing.",
"amount", 1,
"rarity", "Rare"
)
))
}
<!-- Check item's rarity (is this correct?) -->
<div class="item (if: _item's 'rarity' is 'rare')[rare] (else-if: _item's 'rarity' is 'excellent')[excellent] (else-if: _item's 'rarity' is 'epic')[epic] (else-if: _item's 'rarity' is 'legendary')[legendary] (else)[normal]">
<!-- CSS for styling depending on rarity -->
/* Rarity colors */
.item.normal {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.item.normal:hover {
transform: scale(1.05);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.item.rare {
border: 2px solid blue;
background: linear-gradient(145deg, #1f2f5c, #1a264d);
color: white; /* Ensure text color stands out */
padding: 10px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.item.rare h3 {
color: blue; /* Item name will be blue */
}
.item.rare:hover {
transform: scale(1.05);
box-shadow: 0 4px 8px rgba(0, 0, 255, 0.2); /* Blue shadow on hover */
}
I use that to check the item's rarity but it does nothing. (ㅠ﹏ㅠ)
Basically, I've got over a 100 images of which I only want to display one(in the sidebar), based on a combination of one or more $statistics. Is there a way to do this without using an ungodly amount of 'if' statements?
I made my twine game on my iPad without an account so it’s just stored locally on my iPad so logging in on a laptop isn’t an option.
When I try to export my game it either shows up as a flat black screen or my starting page.
To export it I go publish to file>> download >> upload it to google drive
Then I go to view it in google drive and it just shows the title page uninteractable.
When I try to airdrop it or save it to notes it just shows up as a black screen. If anyone else uses mobile for their twine games and knows how to export it please let me know, thanks!
I'm currently trying to set up an Achievement system that uses dialogue boxes.
i have the achievement names and descriptions in an array using a story variable, and i want to use that as the title and wiki for the dialogue box, but if i try and use a story variable in the script it tells me its not defined.
array (for testing, will populate when i get it working)
<<set $Achievements to [
{Name: "1", Wiki: "1"},
{Name: "2", Wiki: "2"},
{Name: "3", Wiki: "3"},
{Name: "4", Wiki: "4"},
{Name: "5", Wiki: "5"},
{Name: "6", Wiki: "6"},
{Name: "7", Wiki: "7"},
{Name: "8", Wiki: "8"},
{Name: "9", Wiki: "9"},
{Name: "10", Wiki: "10"}
]>>
Achievement System
<div class="box">
<h3>Achievements</h3>
<i>
<<for _i to 0; _i<= 9; _i++>>
<<if Setting.getValue(\``AchievementsGot\[${\_i}\]\
) == "true">>`
<<set _acheivementName to $Acheivements[_i].Name>>
<<set _acheivementWiki to $Acheivements[_i].Wiki>>
<li><<button _acheivementName>>
<<script>>
Dialog.setup(_acheivementName);
Dialog.wiki(_acheivementWiki);
Dialog.open();
<</script>>
<</button>></li>
<<else>>
<li><<button 🗝>>
`<<script>>`
`Dialog.setup("🗝");`
`Dialog.wiki("???<br><br>");`
`Dialog.open();`
`<</script>>`
<</button>></li>
<</if>><</for>></i>
</div>
Is this how to show an item image inside a datamp to inventory? I'm following skymahi's inventory template. I tried it but only get broken image. Please help!
(set: $weapons to (dm:
"Rusty Axe", (dm:
"damage", 6,
"image", "images/RustyAxe.png",
"description", "A dull, rusty axe. Still sharp enough to be dangerous."
),
"Metal Bat", (dm:
"damage", 8,
"image", "images/MetalBat.png",
"description", "A sturdy bat, great for smashing."
)
))
<!-- Item List -->
(for: each _item, ...$inventory)[
<div class="item">
<!-- Check if the item is a weapon -->
(if: _item is in $weapons)[
<img src="(print: $weapons's _item's 'image')" alt="weapon image" style="width: 100px; height: auto;">
<h3>(uppercase: _item)</h3>
<p><b>Damage:</b> (print: $weapons's _item's "damage")</p>
<p><b>Description:</b> (print: $weapons's _item's "description")</p>
]
]
I am currently trying to see the code for Degree of Lewdity, a fairly complicated game with around ~12k passages, and whenever I try to open it using Twine it causes a lot of lagging. Is there any way to fix the lag?
Harlowe 3:
I generate a text, in which a four-letter "marker text" is cut out and replaced by the word "mole" which needs t be clickable and leads to a different passage. Every 5s, the mole takes another position - like a whack-a-mole game. Get it? ;)
The issue is that since I replace the marker text with mole and then mole with a link, THEN replace that linky mole with the marker text again, the marker text ends up being a link. There doesn't seem to be any function to un-link a link so I am hoping for the power of community. This is the code:
(set: _MolePos to (random: 8, $totalLetters-10))
(set: _markerText to "")
(for: each _i, ... (range: 1, 4))[
(set: \_markerText to it + $letterString's (\_MolePos + \_i))
]
(replace: _markerText)[(link-goto: "mole")]
(live: 5s)[
(replace: "mole")[_markerText]
(set: _MolePos to (random: 8, $totalLetters-10))
(set: _markerText to "")
(for: each _i, ... (range: 1, 4))[
(set: \_markerText to it + $letterString's (\_MolePos + \_i))
]
(replace: _markerText)[(link-goto: "mole")]
]
Solutions I have tried included making the link-goto: a named hook,
but no dice.
Adapted from a 300 word story I wrote last year, I spent the past week making my first interactive story:
And I would love your feedback!
Hi! I'd love to see a complete Twine Sugarcube 2 game files to learn and understand how all of it works in practice. Is it possible to find stuff like this?
When it comes to programming I'm dumb as hell and tbh I don't want to learn code just for interactive stories made for fun. But after playing some twine games I know that my idea of not using anything like stored variables, saves or JS in some cases, makes the game just boring, unappealing. So I'd like to see how things like that work, preferably in Sugarcube, and just copy some solutions, since I don't intend to make money from Twine projects.
What interests me mostly is:
- "save to disk" system
- using (in dialog for example) main characters name from player input at the beginning
- storing and modifying variables in game, like stats changing values based on certain actions, getting cash after day of work etc.
- simple equipment and "player stash" if possible, like clothes bought and stored in the closet and inventory that's actualy worn and carried by player
How do you think I can find ready-to-use game fragments like that?
I use live macros for updating texts inside the bars (health and mana) and increase or decrease in stats, but as Greyelf said in my last post, using live macro is not really a good way. Can someone correct or teach me please?
<!-- Health Status Text -->
<div class="status-text">
(live: 0.1s)[$playerHealth / $maxHealth]
</div>
<!-- Mana Status Text -->
<div class="status-text">
(live: 0.1s)[$playerMana / $maxMana]
</div>
<!-- Stat Allocation -->
(live: 0.5s)[
<p>Strength: (print: $strength)
<!-- Max stat is 15 -->
(if: $statpoints > 0 and $strength < 15)[(link-repeat: "<span class='button'>+</span>")[(set: $strength to $strength + 1)(set: $statpoints to $statpoints - 1)]]
<!-- Min Stat is 1 -->
(if: $strength > 1)[(link-repeat: "<span class='button'>-</span>")[(set: $strength to $strength - 1)(set: $statpoints to $statpoints + 1)]]
</p>
]
Is there a way to save individual choices while continuing through to the same story? Example: you have people choose one of three things, a hat, a scarf, or gloves. All of the choices, though different, will lead to the same next passage and continue like that until the character needs it. I hope this makes sense? I’m not really sure how to word this well. If the answer is yes, what would the code for that look like? I’m using harlowe.
I want to have the entire page change background color with certain passages (transition from day to night, in this case) which I can do with tags and some css:
:: StoryStylesheet [stylesheet]
tw-story[tags="Red"]{
background: red;
}
tw-story[tags="Blue"]{
background: blue;
}
this is a rather sudden switch, so I thought I would use a css transition:
tw-story{
transition: all 2s ease;
}
This works when I change the tag in the browser console with document.getElementsByTagName("tw-story")[0].setAttribute("tags","Red")
, but when I go to a passage with the corresponding tag, the change is still immediate.
Using (transition:)
macros also does not work, it only transitions the passage, not the background.
Is there a way to do this? Is there a reason why it doesn't work, or is it a bug? As far as I can tell, Harlowe is not removing the tw-story and creating a new one, it it replacing its children and changing the "tags" attribute, so I'm not sure why it would work in the console but not in Harlowe.
Thanks!
This is for a character information page, where a character's info page is locked until you interact with them.
Since I didn't want to do 10 if statements, i thought it would be better to use a for loop and array. this works for displaying the text but it will not link to the passage. am i doing something wrong? is there another way to do this? or do i just need to do the 10 if statements? (code is all on one line, i spaced it out here to make it easier to read)
<<for _i to 0; _i<= 9; _i++>>
<<if $characterMet[_i] == "true">>
<<set _selectedChar to $characters[_i]>>
<li><<link _selectedChar>>_selectedChar<</link>></li>
<<else>><li>🗝</li><</if>><</for>>
I wrote a gamebook using Twine which I plan to post on itch.io in the next month or so - it's based on the Fighting Fantasy gamebooks I read as a kid and was a great learning tool for Twine. I dived in and used the default Harlowe language and found that straightforward enough.
Since finishing the game and reading subreddits and a couple of other forums, I'm sensing most people seem to actively avoid Harlowe and instead use Sugarcube.
I've looked at the Sugarcube documentation which is more of a how to manual and doesn't seem to explain why users might find it better than Harlowe.
As I'm already planning my next gamebook, I'm wondering if I should move over to Sugarcube.
Happy to take some thoughts/opinions from others, but really looking to understand what advantages it has over Harlowe.
hi all, i might sound like a total noob but i was wondering how on earth you do the flashlight effect (like in my father's long long legs) on twine as i have absolutely no clue! this is my first time using twine and it's for a uni project, and i just wanted to try something cool! i am not a programmer so i am totally in the dark haha. any help/video tutorial will be appreciated!! :))
I'm currently making something in Harlowe that requires the player to select specific passages.
The way the game works is you are making potions. You have 30 ingredients in front of you. You have to pick 5 items (no more, no less), throw them into the cauldron, and see what happens. For example, one recipe is 2 lemon zest, 1 rosemary, 1 willow bark, 1 ginger root. Another could be 3 raven feathers and 2 peppermint. You get the idea?
I need help making this work, in a couple ways. If anyone out there would be able to help me, that would be much appreciated.
Firstly, I need Twine to understand when the player has picked five of these passages. Currently when I test it, you can click through as many passages as you want. So, in theory, the player could simply click around as much as they want without solving the puzzles and clues I'm going to hide for them. They could accidentally stumble upon a solution. What it should do is understand that the player clicked on five options, then kick them out of that section into the "failed potion route" (or see that they chose a correct solution, and show them that route)
Secondly, this system doesn't work using the (history:) macro. I have no way of clearing the history, and I can't start the game over because that's simply not how my game works. It's one continuous story. I've already tried it this way and it won't do what I want it to do.
Again, I really appreciate the help!
Please forgive me if I'm asking a stupid question, I'm still new to coding in Twine 2, but I really don't know how to fix this and nothing I'm searching for helps. I'm using Simple Inventory 3 by Chapel and I'm trying to add a a <<print>> function to an item description, but it just won't work. Can someone familiar with this help me?
This is how Chapel has an item description set up in the inventory system in StoryInit:
<<item "key_1" "Crypt Key">>
<<description>>\
An old, rusty key with a skull shape on it. Spoooooky.\
<<unique>>
<</item>>
Then if you use this anywhere:
<<inv $backpack use inspect>>
A pop-up of the inventory will appear if that link is clicked, containing everything that is currently in the inventory. If the key is there, you can click "Crypt Key" and it will open a new dialogue window that prints the description "An old, rusty key with a skull shape on it. Spoooooky.".
I want to add a <<print>> function that will read INSIDE the already printed description, but cannot figure out how to do that.
Let's say for example I wanted to print the variable $itemcolor in the item description, and I already defined $itemcolor as "none" in the StoryInit. I then used this to set the item to a random color like so in the first passage:
<<set $itemcolor to either("red", "green", "yellow")>>
This works fine and the randomized $itemcolor is printable everywhere else in the story, But as soon as I try to put it in the item description, it doesn't work. I would think it should be written like this, as this is how you would write a <<print>> function in a passage:
<<item "key_1" "Crypt Key">>
<<description>>\
An old, rusty key with a skull shape on it. Spoooooky. The key is <<print $itemcolor>>.\
<<unique>>
<</item>>
Now if I do that, the item name is listed but is no longer clickable because the <<print>> function is in there. It works fine without it, but cannot function with <<print>> involved. Is it because the item description is defined in the StoryInit so it doesn't want to print a value set later in the story? Is it a syntax problem? A macro limitation? I have no idea and nothing I've fiddled around with has fixed it.
I really don't want to have to stop using Simple Inventory to build my own macro from the ground up in the Javascript just to do this, but is that my only option? I would also like to add item weight, but it seems like there will be a similar problem, where I can't add anything to this or it will break. I know I can write my own arrays in Javascript but to be honest I feel like I'm too stupid to do it myself, I've tried to learn many times and can't seem to follow how to set this up myself, so any way to use this system would be greatly appreciated.
Hi everyone. This isn't specifically twine related but I'm having fun making a game and I need some idea's on what the user's textbox profile picture should be.
I'm thinking maybe just a hand pointing or just no picture at all but that seems kinda boring.
I would love to hear your suggestions because I'm really just blanking on any ideas