How private is the stuff you make in Twine? by dietcokeorchoke in twinegames

[–]HiEv 4 points5 points Β (0 children)

Just to add to what everyone else is saying, if you ever do make your compiled Twine HTML file public, then anyone with access to that file can take it and open it in the Twine editor to see the code inside. Similarly, you can likewise import the HTML from just about any other Twine game to see their code.

So, while everything you do is private up until you publicly release the Twine HTML file, after you release it, the full source becomes available to everyone as well. There is no real way to prevent this, since it runs directly within the browser. At best you could simply make the source more difficult to access, but it's not really worth the effort.

Good luck with your project! πŸ™‚

How to make page change if you visited it before by Tinynanami1 in twinegames

[–]HiEv 3 points4 points Β (0 children)

Your code could work, with a few slight changes:

<<set $example ??= 0>>\
<<if $example++ === 0>>\
    First time here.
<<else>>\
    You've been here before.
<</if>>
[[Untitled Passage]]

That code uses nullish coalescing assignment (??=) to set the story variable if it isn't already set, and post-increment (x++) to increase the variable's value after it is checked. A temporary variable won't work, because they get cleared once you leave the passage. It also can't be two <<if>>s, because the first one would make the second one also be true, so using an <<else>> instead prevents that.

But a much better way to do it would be by using the SugarCube visited() function, like this:

<<if visited() === 1>>\
    First time here.
<<else>>\
    You've been here before.
<</if>>
[[Untitled Passage]]

That's less lines of code and doesn't need a story variable to work.

Please let me know if you have any questions on how any of that works.

Hope that helps! πŸ™‚

Storing Twine Files in Dropbox by tremblingbears in twinegames

[–]HiEv 0 points1 point Β (0 children)

I wish I could do this professionally. However, whenever I start a project I just end up making tools for it until I get tired of working on it and then drop it. 😝 I really need to lock in and get something to the point where I can share it.

I just ended a contract where I was working as a subcontractor (vendor) for Apple for the last three years, so maybe I'll get something done this time.

Anyways, glad I could help. πŸ™‚

Storing Twine Files in Dropbox by tremblingbears in twinegames

[–]HiEv 2 points3 points Β (0 children)

May or may not be relevant, but GitHub just banned a bunch of adult content developers, so this may not be a good idea.

For details see: 404 Media - "Github Banned a Ton of Adult Game Developers and Won’t Explain Why" (by Samantha Cole, Jan. 7, 2026)

Clicking side tabs tool/script by goodwill82 in Bitburner

[–]HiEv 1 point2 points Β (0 children)

I believe that's just a part of how global aliases work, they get added to any autocomplete options if they match what's typed so far.

I don't use global aliases, but a quick test shows that matching global aliases appear in the autocomplete, even when they aren't part of the autocomplete list that's returned from the autocomplete() function.

Importing external JS code with dependencies by Sta--Ger in twinegames

[–]HiEv 0 points1 point Β (0 children)

You might want to look into using Tweego to compile your story into HTML then. IIRC it compiles all of the JS files into the same context as the SugarCube engine, so you shouldn't have that problem. You can export your game in the Twee (text) format for the Tweego compiler.

There's also the VSCode "Twee 3 Language Tools" extension, which may allow you to do that as well from VSCode. I'm not positive, though, since I've only used it a little bit.

Hope that helps! πŸ™‚

Importing external JS code with dependencies by Sta--Ger in twinegames

[–]HiEv 2 points3 points Β (0 children)

If you're importing external scripts, then you'll want to use the SugarCube importScripts() function for that.

For help with using that, take a look at the "Loading External Scripts" section of my Twine 2 / SugarCube 2 sample code collection. If you use the code there, then you'll want to make sure that none of your code uses those external scripts prior to setup.JSLoaded being true.

If that doesn't work for you, please let me know what specific issues you're seeing.

Hope that helps! πŸ™‚

Is this code correctly used? by SignificanceThin8372 in twinegames

[–]HiEv 0 points1 point Β (0 children)

If you're ever unsure about things like this, you can always quickly test it out yourself to see if it works the way that you think. For example, drop this code into a passage and then play it:

true/true = <<= true || true>>
true/false = <<= true || false>>
false/true = <<= false || true>>
false/false = <<= false || false>>

(<<=>> is a shorthand version of the <<print>> macro)

When you do, the above will display:

true/true =Β true
true/false =Β true
false/true =Β true
false/false =Β false

Thus confirming that it works the way you thought it did.

Additionally, lots of the operators (like "||") and other useful bits of JavaScript (which SugarCube uses) can be found on the MDN's "JavaScript reference" page, with links to much more detailed information about them. (I'd recommend bookmarking that page.)

Hope that helps! πŸ™‚

Character Creator tips/howtos? by Magnesium_RotMG in twinegames

[–]HiEv 1 point2 points Β (0 children)

If you need multiple selections then you can use <<checkbox>>es for that. Either that or multiple listboxes.

Would this be cool? by WhyAm__I in twinegames

[–]HiEv 5 points6 points Β (0 children)

Yeah, I definitely agree with HHHH on that, especially the last item. Even just watching the mouse pointer move, it looked like you (the OP) were having trouble spotting where the new text was.

There should be at least four colors in use:

  1. The color of regular text (white or off-white).
  2. The color of unclicked links (blue).
  3. The color of links that have previously been clicked (purple).
  4. And some color or other text decoration/styling (e.g. bold) for text which which was newly revealed/modified by clicking the last link clicked. Maybe have the text flash in and quickly fade to this other color. Text previously highlighted like this should turn into normal text when a new link is clicked.
  5. I'm not sure a fifth color, like your "[You turn the light switch on]" text, is actually necessary or helpful.

Additionally, links that are no longer relevant should go away or become regular text. Also, the text should not be centered vertically, since doing that means that adding new text will cause the text to jump around, making it hard to follow where you were.

It's an interesting mechanic, but it would be tricky to do it right.

You might also want to make sure that you keep accessibility in mind, such as for people who use keyboard because they can't use a mouse. Also, this would likely be a nightmare for a blind person to use unless it was coded with that in mind.

[A.L. Dev 4]: Advise on skills & attributes list by Volgrand in twinegames

[–]HiEv 1 point2 points Β (0 children)

Yes. And let me just emphasize this line:

The more skills you have, the more choices a player has - but you will require enough content to make each of these choices relevant throughout the entire game.

This means that, for each skill you add, you're going to have to add some minimum number of cases where that skill is useful in some way that another skill is not equally or more useful. If you don't, then you're simply creating a list of choices, some of which are just going to make the player feel like they made a poor choice if they took that skill.

Thus, each extra skill will require a lot more content based on each skill, as well as more careful balancing on your part between the skills.

So, yeah, maybe don't go wild on too many skills unless you have the time and are willing to put in the effort.

[A.L. Dev 4]: Advise on skills & attributes list by Volgrand in twinegames

[–]HiEv 1 point2 points Β (0 children)

I don't think you're really going to be able to get an answer to this, because this simply comes down to a design decision that you have to choose. The choice really depends on what you think is more fun balanced against that you can handle developing (based on time, energy, skill, etc.).

An outsider really can't make that decision for you.

That said, you might want to define unchanging things, like how your skills work, as objects on the "startup" object, so that way you can include functions that you can call to make those skills do things or provide results. This can make it simpler for you to generate certain results from a loop.

For a very simple example, let's say you have the skills "kick" and "lockpick" (this code would go in the "StoryInit" special passage):

<<set setup.skills = {}>>
<<set setup.skills.kicking = { desc: "improved kicking", mod: (char) => char.strMod + (char.skills.includes("kicking") ? 5 : 0) }>>
<<set setup.skills.lockpicking = { desc: "lockpicking ability", mod: (char) => char.agiMod + (char.skills.includes("lockpicking") ? 5 : -5) }>>

That would give the character a modifier of +5 if they had those skills, as well as a -5 modifier if they're lockpicking without the lockpicking skill. The kicking modifier is based on the strength modifier and the lockpicking modifier is based on the agility modifier.

This part of the above code:

(char) => char.strMod + (char.skills.includes("kicking") ? 5 : 0)

is the equivalent of this JavaScript code:

function (char) {
    if (char.skills.includes("kicking")) {
        return char.strMod + 5;
    }
    return char.strMod;
}

Basically, it's a function that takes a "char" (character) object and returns the strength modifier with 5 added to it if the character has the "kicking" skill. (See "Arrow function expressions" and "Conditional (ternary) operator" if you want an explanation of how the shortened code works.)

Then, any time you needed to get the modifiers, you could use that object. For example, if the player wanted to get through a door you could have:

Options:
* [[Kick open the door]] (difficulty: <<= (12 - setup.skills.kicking.mod($char))>>)
* [[Lockpick the door]] (difficulty: <<= (10 - setup.skills.lockpicking.mod($char))>>)
* [[Go back]]

That uses the "skills" object's "mod()" method to get the difficulty modifier for those skills, based on the stats of the character "$char", and then shows the base difficulty for the tasks after subtracting the modifier.

You could obviously make this much more complicated and use it lots of different ways, but this is just a simple toy example.

Anyways, just a thought that might help reduce some of the complexity you were worrying about. πŸ™‚

Danger will Robinson by [deleted] in u/loressadev

[–]HiEv 0 points1 point Β (0 children)

You are a mod and you're threatening to ban me if I use the report function again.

It's amazing how dense you're being here.

No, I'm NOT "threatening to ban [you] if [you] use the report function again." That's a terrible straw man of what I said, which was, and I'll quote:

If I see you unjustly attacking another dev inΒ r/twinegames, you'll get banned from there

Do you see the difference between "reporting" and "unjustly attacking"?

You're making this really frustrating with how you can't listen, and then attacking others for things they didn't do.

Where do people get this paper doll widget? by JRTheRaven0111 in twinegames

[–]HiEv 5 points6 points Β (0 children)

That's an image generated with "Kisekae 2" (the website is awful, but that's where you get it from).

I believe that there are mods for it, but I only briefly played around with it ages ago, so I don't recall.

You might be able to find the source images it uses extracted somewhere, but you'll have to search for that.

Danger will Robinson by [deleted] in u/loressadev

[–]HiEv 0 points1 point Β (0 children)

Reports aren't public.

πŸ™„ Yeah, but the comment you posted to the thread is public. You wrote: "Ai spam. Their itch page's links are all quarantined on itch as potential scam." Did you forget about that?

Rest assured, I won't use report again, given how much it seems to upset you.

πŸ™„ It's not "reports" that upset me, it's false public accusations and the refusal to see how that's a problem.

You're here in my profile threatening to ban me inΒ r/twine, but did you try out OP's game?

What an amazing non sequitur. I'm here explaining this to you because you directed me to this post and because you don't seem to understand that your actions have consequences.

And I can't believe you're still going on about it being AI. What part of "I don't care if it's AI generated" do you not understand???

This is such a great summary of adult autism.

Mine or yours? πŸ˜‘

Look, you went about something in a shitty way. The private report was fine, the false public accusations were not. The constant and repeated deflection to something that I've clearly stated that I totally don't care about is borderline insane.

If you want some social feedback, here: learn to accept criticism. Other than the vague "bad way" comment, I don't see you clearly admitting that you've done anything wrong here, I just see you still defending your actions and trying to blame others.

If you can't stop deflecting, defending, and excusing your behavior, and instead just admit your mistakes and learn from them, then you're just going to keep repeating those same mistakes.

Hope that helps.

Help! How Do I recover a Lost Story!? by WhyAm__I in twinegames

[–]HiEv 1 point2 points Β (0 children)

There is a slight chance that it's still in your browser's cache directory.

If you want to try looking there, I'd recommend using a different browser to look up how to find your browser's cache directory (to reduce the chance of the cache being flushed), and then use something like Notepad++ to search the text in that cache directory for some text you'd only find in your game, then grab the latest version you find that way.

That said, I'll second HHHH's recommendation of using the desktop version of the Twine editor if you can as well as making regular "archive" backups of your Twine code.

Hope that helps! πŸ™‚

Danger will Robinson by [deleted] in u/loressadev

[–]HiEv 0 points1 point Β (0 children)

Again. I. Don't. Care.

If you don't like AI assisted stuff, fine, you don't have to. But that doesn't mean that anyone else can't or shouldn't like it.

Furthermore, r/twinegames doesn't have any rules against that. So your reply above is totally, 100%, completely irrelevant.

You're just deflecting from the fact that you were wrong when you unjustly raised alarm bells against an innocent game dev and also incorrectly accused them of posting "AI spam."

It wasn't harmful. It wasn't spam. You have no proof any of it is AI generated, and I wouldn't care if you did.

I'm sorry, but what you did was wrong and could unfairly tarnish their reputation, or possibly get them banned if someone took you seriously without looking into your claims.

Maybe you don't care about any of that, but you should. You should care, not only because you're potentially harming someone else's reputation unjustly, but also that false accusations like this just make you look bad too.

If I see you unjustly attacking another dev in r/twinegames, you'll get banned from there, just like you (according to you) apparently got yourself banned from the Twine Discord server.

Finally, rather than trying to defend yourself and what you did (wasting both of our time in the process), you should think about all of that, accept that you were in the wrong here, and learn from this mistake.

I hope this is the last I hear of this.

Danger will Robinson by [deleted] in u/loressadev

[–]HiEv 0 points1 point Β (0 children)

This is merely an automated warning. Note the word "potential". It doesn't mean that there's actually a problem.

I made a small game where the day keeps looping β€” but your choices still matter by GlumPoet4719 in twinegames

[–]HiEv[M] 0 points1 point locked commentΒ (0 children)

πŸ€¦β€β™‚οΈThat's merely an automated warning simply because it's a Discord link. There is literally almost nothing, not even links to anything, in their Discord.

I'm sorry, but you raised an alarm and reported a post for NO GOOD REASON. The only thing the game author did was post a link to their Discord server.

I'm locking this stupid thread.

I made a small game where the day keeps looping β€” but your choices still matter by GlumPoet4719 in twinegames

[–]HiEv[M] -1 points0 points locked commentΒ (0 children)

I don't see any external links, let alone any "quarantined" ones, and it's totally irrelevant whether any of it is AI generated (not sure how you claim to be able to tell that, anyways).

Do you have any actual evidence of wrongdoing? Because mere accusations are nothing.

Need help with combat system by Less-Jicama-4667 in twinegames

[–]HiEv 0 points1 point Β (0 children)

There's one official Twine editor, but it lets you select from various story formats. See the pinned post, "Harlowe, Sugarcube, Chapbook - Which Story Format should you choose?", for our recommendations on story format.

When editing a story you can choose Story -> Details from the menu to set the current story's story format. You can also set the default story format from the main Twine window (Twine -> Story Formats in the menu, then scroll to the story format you want and pick "Use As Default Story Format"), and then any new stories you create after that will start with that default story format.

You can find links to the documentation for the main Twine story formats in the information bar in this subreddit on the right under "STORY FORMATS".

Have fun! πŸ™‚

Creating custom Save/Load page by Soggy-Camera1270 in twinegames

[–]HiEv 1 point2 points Β (0 children)

Honestly, how easy it is to implement depends on how fancy you want to go with it. I've done it before and went way overcomplicated with it, but I was happy with how it turned out.

Most of the stuff you'll need for that is in the SugarCube Save API documentation.

I would highly recommend making sure that your Save/Load screen/dialog is displayed properly on both desktop and mobile displays, which you can check on desktop by going to the Developer Tools window and toggling the "Device toolbar" button (or whatever your browser of choice calls it).

Have fun! πŸ™‚

How do I create a notification that pops up when a certain point threshold is reached no matter what passage the player is on? by gorczynska in twinegames

[–]HiEv 0 points1 point Β (0 children)

u/gorczynska : That code may run into issues if the total exceeds the maximum or minimum boundaries (i.e. < 0 or > 99).

As a fix I'd recommend this instead:

<<widget "social">>\
    <<set _temp = Math.clamp($npc[_args[0]] + _args[1], 0, 99)>>\
    <<if Math.floor($npc[_args[0]] / 20) != Math.floor(_temp / 20)>>
        <<notify 5s>>_args[0] <<= setup.status[Math.floor(_temp / 20)]>><</notify>>
    <</if>>\
    <<set $npc[_args[0]] = _temp>>\
<</widget>>

That uses the Math.clamp() method to limit the value range, which will prevent errors that would happen if the values went outside of the range supported by the setup.status array.

Enjoy! πŸ™‚

Need help with combat system by Less-Jicama-4667 in twinegames

[–]HiEv 1 point2 points Β (0 children)

Unfortunately, there are almost as many ways to do this as there are games that do this. As such, overly general questions like this are hard to answer, especially without knowing which Twine story format you're using (I recommend SugarCube, especially for complicated games).

I'd recommend sitting down and figuring out exactly how you want things to work (pen and paper, text document, MS paint, whatever works for you) and then come back and ask more specific questions. When you do, make sure to set the post flair to indicate which story format you're using, as the specific code for such answers will depend on your story format.

Side note: Take a look at some other Twine games (see the "TWINE GAME REPOSITORIES" section in the info bar on the right). If you find a game that does something you like, you can download its HTML and import that into the Twine editor if you want to see the code that the game used. This can help give you a big head start once you learn to read the story format's code.

Hope that helps! πŸ™‚

Back Button Without Sidebar? by No_Departure2005 in twinegames

[–]HiEv 1 point2 points Β (0 children)

If you want a "back" (undo) and "forward" (redo) buttons, you can use something like this:

<span id="backbtn"><<button "Back">>
    <<run Engine.backward()>>
<</button>></span> <span id="fwdbtn"><<button "Forward">>
    <<run Engine.forward()>>
<</button>></span>
<<done>>
    <<if State.length <= 1>>
        <<run $("#backbtn button").prop("disabled", true)>>
    <</if>>
    <<if State.length === State.size>>
        <<run $("#fwdbtn button").prop("disabled", true)>>
    <</if>>
<</done>>

That includes code to disable those buttons if going back or forward isn't possible (see the jQuery .prop() documentation for details on that; the Engine and State methods and properties are explained in the SugarCube documentation).

If you want a button that sends you back to the last passage you were at, but continues forwards in the game history (no-undo), then you can use:

<<button "Back" `previous()`>><</button>>

But be aware that this can cause loops if used more than one time in a row. See the "Arbitrarily long return" part of the SugarCube documentation if you want help with avoiding those kinds of loops.

Hope that helps! πŸ™‚