/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
I know there are lots of save editors out there, some are pretty good (imo) like saveeditor(dot)online and some are pretty bad (I don't really have any name rn) but I think none of them really allow for an ease of use to an end user which doesn't decompile the base game, especially when you try to "teleport" somewhere in which case you need to know the passage's exact name, so that's with this idea that I started to make a graphical save editor which would allow you to import a story and a save file and then edit whatever you want in your save with the editor helping the user as much as possible. This project kinda serves me to learn rust too so, yea, it's clunky... Anyway, this post is pretty much a mix of advertisement and devlog with a little bit of me asking opinions. For now, I can sucessfully edit the passage at which you are located, tho, I can only put you back to ':: Start' and I am also able to import a story from a .html file and parse it in a struct so that I can later retrieve the names of the passages and display them as a list to the user to allow for safe editing of the "location" the player is at, although, this would require a bit of logic on the passages metadata I think ? Just to be sure not to change the current passage to a "widget" passage... I use some code from tweego (transformed into rust) to import the story so thanks a lot tmedwards for creating this magnificent tool alongside sugarcube, the best story format that have ever been created (not biased at all). I also believe this editor only to be working with sugarcube games ? I have no idea if this is true since I don't know how the saves are made in harlowe, snowman or chapbook sooo... That's pretty much all I had to say about it.
I'm not talking about making Android/iPhone games using Twine. I am aware phonegap and other tools exist. I'm talking about making the Twine Engine itself run natively on Android or at least improve the UI of its web application and make it mobile responsive and optimized.
Yes you can run the twinery website itself on a mobile device but it is not usable as the website is optimized for desktop use. I'm guessing we will face the same issues if we do a containerized approach. The UI needs to be responsive to a mobile device. The popup windows and font need to be properly sized, it shouldn't be a pain to move around passages in the graph view.
I'm not a software dev, so I don't know much about the intricacies involved. If it is at all possible for one person to do, I would be willing to pay someone to do it.
Hi everyone,
I've started learning Twine Harlowe and developing a game since September, but I've trawled all of the guides, Google searches and existing Harlowe asks on here to find an answer to this, and nothing I've found or tried has worked.
I've finally figured out how to create a sidebar in my game. It works beautifully. The thing I haven't been able to work is how to make a sidebar toggle, so the player can open and close the sidebar at will, rather than it being a permanent fixture on every passage. It's unfortunately blocking the text of the game on the mobile-friendly version so I'd like it to be an option to hide.
This is the code I use for the sidebar currently:
(append: ?SideBar)[\
<img src="images/title.jpg">
[[Menu]]
(link:'Save Game')[
(dialog: bind $slotToSave,"Select a slot to save:", "Slot 1","Slot 2","Slot 3","Slot 4","Slot 5","Slot 6")[(save-game:$slotToSave)]]
[[Load Game]]
]
Any help with this would be so so appreciated. Thank you
P.S. I understand SugarCube is the best for stuff like this, but I'm so deep in Harlowe now I want to keep at it
May game utilizes <<export _data $name 'json'>>
method to store user choices. This works fine but, can I dictate the local folder to which the json saves? It would streamline the saving process I have set up immensely. Or is there a better method to accomplish this? Thanks!
Trying and failing, that is. All tutorials I can find are several years old. Went to Github and downloaded the zip, but extracting the files doesn't seem to do anything. I'm aware that's probably not the solution, but I am quite stupid, and would greatly appreciate help.
This is the code which I am using:
<div class="bar">[[New Game|Character Creation]]\
<<if (Save.browser.size > 0)>>\
<<link "Continue">><<script>>
Save.browser.continue()
.catch(error => {
console.error(error);
UI.alert(error);
});
<</script>><</link>>
<<link "Load">><<run UI.saves()>><</link>>
<</if>></div>\
<div class="bar">[[New Game|Character Creation]]\
<<if (Save.browser.size > 0)>>\
<<link "Continue">><<script>>
Save.browser.continue()
.catch(error => {
console.error(error);
UI.alert(error);
});
<</script>><</link>>
<<link "Load">><<run UI.saves()>><</link>>
<</if>></div>\
The issue I'm having is that it doesn't throw an error, and it doesn't load the save. There are no autosaves overwriting themselves on the loading screen, which is the first thing I thought of. Loading from the save UI works normally. I have already tried running a .then() function to log to the console that the load was successful after loading. Which it does, but the proper save does not load, I stay in the same passage. I'm using the latest version of Firefox and compiling with Tweego, if that makes a difference. Clearly there's something I'm overlooking but I'm truly lost.
I’ve been following some tutorials for making maps in Twine Sugarcube. The way the maps are created in the tutorials is 2D arrays. In order to save data associated with those locations, more arrays are needed. I come from a Python background and that seems like something a dictionary could handle well, but I don’t want to pretend I’m good at JavaScript or Twine since I’m quite new to it. So Reddit, please help me understand, why are arrays a better option than the JS equivalent of a dictionary? Will I paint myself into a terrible corner by going down a dictionary/object route?
So currently I'm in the process of attempting to try and figure out a way to create a function saving and load system like there is in sugar cube games but sense I'm doing stuff on browser I'm pretty much stuck with Harlowe and I can't find a way to get that fancy save and load menu form sugar cube into harlowe.
Am I missing something? is it not possibe? If anyone knows please do tell because this mildly frustrating for me
I make my games in harlowe (Because i haven't learned css or javascript and also don't care ) and they look like trash. I am interested in the community's opinion on appearance. Be honest, tell me how you think a text adventure should look like.
What is the value of beauty in a non visual narrative?
I'm having a recurring issue with Objects in Javascript. I've figured out that SugarCube 2 doesn't save an object's methods, that makes sense. But why doesn't it automatically reapply the objects methods when they are loaded out of memory again?
This isn't a big issue for the save system I've finished, because I programmed the save system to do this, but everytime I refresh the page, I have to reset state so that it doesn't give me objects with no methods. Then I have to redeclare a variable right after (I'm hoping I don't end up in the future stuck for 5 days before I remember this).
I ended up fixing the issue for the time being by tracking when the save is reloading, but I'm just confused about the way objects, as well as the save/load/state system handles objects with methods.
Hello! I'm trying to have it so that after a specific variable is made true, other passage links disappear. I'm completely new to Twine, so I don't yet understand how it all works.
I want to make it so that once the player triggers the guards death, the options to engage the guard and distract the guard vanish. This game has a lot of backtracking through passages.
My current code:
Screams echo in the distance. {(if:$guardDeath is true)[<br> <br> The bridge is empty, devoid of all life. <br> [[Proceed into the castle]]]}
{(else:)[At the end of the bridge sits a guard, plated in dark and spiked armour.]
<br> [[Engage the guard in combat]] <br> [[Distract the guard and slip through]]}
As the title suggests, I'd like to know if there is a way to take a number variable, and minus it from another number variable, but as a percentage.
For example, let's say I've got a variable called $Dumb which has a value of 15.
I also have a variable called $Smart which has a value of 10.
Is there a way to convert $Dumb from a whole number to a percentage that can be minused from $Smart to equal 8.5 rather than -5.
Any help at all would be great as I've been struggling with this a little.
I have started to make a game, more so I can get used to how sugarcube codes work, but I can't figure out how to or if I even can have the player/user name a side character, I also want them to be able to name their own character. I don't know if this will make sense, but for the side character, when the player names them I want to be able to have a bit of text and then on the same passage have the box come up for naming the character after clicking anywhere on the screen or the spacebar/enter button (or even a prompt), I guess a better way of putting this would be: first bit of text -> click anywhere on screen/space bar/enter button/prompt -> name box appears. Is this possible?
And can I have a set reaction from the side character, like if the player chooses a specific name the side character will have a certain reaction to being called that name
And finally as I asked above, is it possible to name two different characters? ie, the MC and the side character
Sorry if this is hard to understand and thankyou in advance for any help or advice given.
I am still learning how to code here from YT and so far I am successful but I need one small help.
Can I add bg and sfx here? Also, is there a way to customise texts like fonts and alignments?
Hey everyone,sorry if this has been asked before but I can't find a specific answer to my problem. I want to style certain passages using tags so they have a different background image,like this (using the tag "houseday" for example):
body.houseday {
background-image:[img[Images/Backgrounds/house_day.jpg]];
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}
I also want to add a slight blur to the background image so it doesn't appear completely as-is.The problem is,adding " filter: blur(10px); " blurs both the image and the passage text and other images. I thought to quickly ask chatgpt but it recommended things like adding "z-index: -1;" and also adding " ::before" on the body.houseday class but it doesn't seem to do anything (chatgpt also frequently recommends harlowe code for sugarcube,so it's not really reliable). It pretty much makes all text unreadable. How would I go about adding a slightly blurred background image while keeping all text and images in the passages unaffected?I'm guessing it would also be wise to add a darker border around the text so bright images don't contrast with the passage,with the background image appearing only after the sidelines of the border.
Hi, very recently started work on a twine game with very little coding experience, and I had an idea that I'm not how you would implement.
Basically, I was wondering how you would go about making it so that, when you hover over a choice, additional text fades in beside it? This would basically be used to clarify the mechanics of a choice, since making fun options to click often means that what you're actually doing becomes less clear.
I know you can just add the context in the actual choice itself, but I think the fade-in would be a neat effect. How difficult would it be to do that?
EDIT: Sorry, just realized I forgot a detail that would make this more difficult 💀 Ideally, I would want the text that fades in to be a different color from the link text. As in, link text is blue, and like, white or yellow text fades in next to it. Something like that.
(Also, and this one is a long-shot, would a "text being typed on screen" effect be possible in twine? If not, the fade-in works, but I figured I'd ask.)
I'm very new to the software and am finding the harlowe manual to be a bit confusing. I'm trying to mimic a locked computer. So there would be an (input:) where the player has to enter a certain set of numbers to "unlock" the computer and continue the story. I think I need to use $ to set a value? But I'm not sure. Any recommendations are greatly appreciated.
Hello! I have a text I want to appear sentence by sentence. Like the first sentence is visible then they click anywhere and then the next sentence becomes visible but the first one fades away. Help please 🙏
I'm having such issues with audio. Please help.
I am using Harlowe and the Harlowe Audio Library extension. I'm making a tabletop game to be displayed on an iPad. (This is a game I'm going to play with my family and friends, it's not going to be released publicly.)
I am trying desperately to get it working on my iPad. The sound just doesn't work sometimes. On computer, where I am building the website, it works perfectly all the time every time. I know browsers have a thing where it doesn't play sound unless you interact with the page first, so I have a splash screen with a start button before any sound plays. This works perfectly on PC.
I tried the Twine app for iPad and loaded a .zip with all my images and audio onto the iPad, and launched the game in the Twine app. I had issues with it where it just wouldn't play sound 80% of the time.
So I moved to hosting on itch.io which works perfectly every time, but the game is going to soon grow well beyond the 1GB hosting limit due to many pictures and audio files. This is non-negotiable.
I have now moved to hosting the website on my computer as a "server" and accessing the host server on the iPad. But once again, sound doesn't work 80% of the time.
I should state that images work every time, perfectly, all the time, in all routes I have tried.
It seems random and arbitrary. Sometimes I will load the web page and sound will work seamlessly. If I then close the tab, and re-open it, it won't work. And I can just repeat that closing and re-opening and it simply will not work. A clue as to what might be happening: I then go over to the Apple Music app and try to play music, and it simply will not play. Even music downloaded, won't play. The time does not advance. Eventually after a few minutes it'll play normally again and then I go back to Safari and the game will work.
I've tested it on my husband's iPad Pro and it fails to work every time, we've had no success there at all.
Please help me fix this, or suggest a solution to be able to full-screen display the game on an iPad screen. I am desperate. I've put months into this game.
I try <<if random(1,10) is 1>> your team is in [[Test]] <</if>> But it's not showing anything, did i do it wrong?
I’ve created an extension for VS Code that supports syntax highlighting, variable reference lookup, autocomplete, and custom inserts/modifiers/macros for Chapbook and SugarCube. It also includes a game build system and plays games directly in VS Code. You can install it from the VS Code marketplace. Feedback is welcome!
Hello everyone!
It’s been quite a while since I last dabbled in Twine, but I’m excited to be back. Recently, I’ve started revisiting an old concept I came up with a few years ago. It’s an open-world exploration puzzle game centered on the Anomalous Affairs Office—referred to simply as The Office.
What’s the premise?
The Office is a section of a [yet-to-be-determined agency] tasked with investigating and managing all manner of bizarre phenomena: Lovecraftian horrors, demonic disturbances, and straight-up strange occurrences.
The twist?
The Office is the laughingstock of the agency. Understaffed, underfunded, and perpetually mocked, they’re left to scrape by while tackling the weirdest cases imaginable.
Right now, the game is in its early stages—there’s no story yet, just the framework. I’d love for someone to try it out and share their feedback, particularly on the GUI and menus.
Your input would mean a lot as I shape this concept.
Link for the game (hosted on github):
https://coderxyz7.github.io/TheOffice/
So I've made some extremely dubious javascript for pushing to an array that's a property of my $player object so that I can track status effects and their remaining duration.
From my story Javascript:
setup.exists = function(arr, search) {
return arr.some(row => row.includes(search));
}
setup.addState = function(arr, state, stateDuration) {
if (setup.exists(arr, state) === false) {
arr.push([state, stateDuration]);
}
}
Stuff from the trenches testing passage:
<<set _skillChoice to $skills[2]>> /*Normally there would be combat AI here, but this is a test*/
<<if _skillChoice.setState>> /*check if chosen skill actually does have the .setState property, so skills that don't cause status effects won't interact with any of this code*/
<<print $states[_skillChoice.setState].name>> /*tell if the right effect number is being called*/
<<set _state to $states[_skillChoice.setState]>> /*makes referring to the status effect entry easier*/
<<run setup.addState($player.state, _state.name, _skillChoice.stateDuration)>>
<<run setup.addState($player.state, $states[2].name, _skillChoice.stateDuration)>> /*tests if states stack properly*/
<<run setup.addState($player.state, $states[2].name, _skillChoice.stateDuration)>> /*tests if states stay unique*/
_state.desc
$player.state[0][0]
$player.state[0][1] /*These are just here so I can see if the cells are being assigned properly*/
$player.state[1][0]
$player.state[1][1]
$player.state
<</if>>
Now I have this hot garbage from doing my own research, which produces (or at least seems to in testing) the 2d array I wanted, but how would I push multiple status effects from the same skill? Because this works only so long as blah.setState is an integer, but what if I wanted to call multiple states at once, like a skill that causes confusion and blindness, or whatever? If .setState is an array, or worse, a 2d array that contains its chance to take effect/DC to resist, then what I have here doesn't work.
I assume I want to iterate over _skillChoice.setState (a property of the skill that corresponds to the entry number of the $states array, e.g. {setState: 1} = $states[1]) out to _skillChoice.setState.length in... some way? To find out if it's just a single integer, like 1 (paralysis) or an array of more than one state (i.e. a skill that can cause multiple effects at once)? But like, when I try a <<for>> loop doing that, it completely breaks and won't push anything anymore. Sorry, I have so much trouble envisioning what I want a loop to do in general, so I feel as if I'm making a complete mess of things. Little help?
Edited for clarity, and to rename statePower property to the more accurate stateDuration.
Hello. I'm a beginner so please forgive me if this is a stupid question:
I would like to use a nerd font for my game, because I like them so much and they are so easy to read.
I implemented it in my CSS correctly, everything works in play mode and in debug mode.
@font-face {
font-family: "CodeNewRoman";
src: url("/Users/xxxx/Documents/Twine/storys/CodeNewRomanNerdFontMono-Regular.otf")
format("opentype");
}
If I export it and get it to itch.io, it doesn't work anymore, because the font url is wrong, obviously.
So I was told to copy everything in the project folder and use this instead:
@font-face {
font-family: "CodeNewRoman";
src: url("CodeNewRomanNerdFontMono-Regular.otf")
format("opentype");
}
When I export it, it works. In preview and play mode it doesn't work anymore because it seems that preview and play don't use my actual project file but some temporary?
Does this mean I have to export always to preview it correctly?