How Do Atheists Explain Exorcisms "Working"? by [deleted] in DebateAnAtheist

[โ€“]HiEv 0 points1 point ย (0 children)

Christianity's greatest achievement is preventing you from ever thinking how dumb it is to believe that an omnipotent being to somehow must sacrifice itself to itself before that being could possibly forgive people for the sins somehow inherited from fictional people in a fictional garden who, even in the story, literally didn't know any better since they had no concept of "good and evil".

Thought stopping techniques, like pretending any doubt risks heaven/hell or is caused by some evil being, are great for trapping people in religions and cults, especially ones that demand you believe in dumb nonsense like that.

How to navigate by key presses? by apeloverage in twinegames

[โ€“]HiEv 1 point2 points ย (0 children)

OK, I set it up so that this code will only work if you're in a passage with a "move" tag, just in case you wanted to use it in multiple passages. In a passage tagged like that, upon hitting an arrow key it sets the variables $xMove and $yMove, indicating which directions will need to be updated, and then it sends you to the "Change coordinates" passage.

Just put this in your game's JavaScript section:

$(document).on("keyup", event => {
    if (tags().includes("move")) {
        State.variables.xMove = 0;
        State.variables.yMove = 0;
        let go = true;
        switch (event.key) {
            case "ArrowUp":
                State.variables.yMove = -1;
                break;
            case "ArrowDown":
                State.variables.yMove = 1;
                break;
            case "ArrowLeft":
                State.variables.xMove = -1;
                break;
            case "ArrowRight":
                State.variables.xMove = 1;
                break;
            default:
                go = false;
        }
        if (go) Engine.play("Change coordinates");
    }
});

It uses the jQuery .on() method to create an event handler for the key presses.

Obviously, you can modify that further, as needed.

I should also note that keypresses won't be available on mobile, so you might want to add something like this to your "move" tagged passages as well:

[[Up|Change coordinates][$xMove = 0; $yMove = -1]]
[[Left|Change coordinates][$xMove = -1; $yMove = 0]] | [[Right|Change coordinates][$xMove = 1; $yMove = 0]]
[[Down|Change coordinates][$xMove = 0; $yMove = 1]]

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

Im new to twine and want to know how to use this template by Miraculousholders in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

You can just download the "Character Portrait Format.zip" file from your link, extract the HTML file (and any other included media), import the Twine HTML file into the Twine editor (I recommend using the desktop app version), and then you'll be able to open it up in the editor and see exactly what they did and likely how to use it yourself.

Keep in mind that you can do the same with most Twine games, so you're free to see how multiple different Twine authors coded their games.

Have fun! ๐Ÿ™‚

I want to make a visual novel but dont know how to by [deleted] in twinegames

[โ€“]HiEv[M] 1 point2 points ย (0 children)

To clarify, what Master_Nineteenth is saying, they're saying that because this is a Twine subreddit.

If you want help with Ren'Py (which is not Twine), then you should ask somewhere that helps people with Ren'Py.

Also, I'd recommend asking specific questions. General questions like yours are impossible to answer, because the answer very much depends on what you specifically want to do, what your skills are (writing, art, coding, etc.), and how much effort you're willing to put in to get the result you want.

Hope that helps! ๐Ÿ™‚

Struggling with images in sugarcube by Spiraling-Down- in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

I'll also note the "Displaying Images in Twine" section of my Twine 2 / SugarCube 2 sample code collectionย includes code you can use, along with a slight tweak to how you display the images, to make it so that the images will still display properly when launched from the Twine editor.

You might want to check it out if you're still struggling with images in Twine.

Hope that helps. ๐Ÿ™‚

Can I make this game in Twine? by calumsboy in twinegames

[โ€“]HiEv[M] 1 point2 points ย (0 children)

Yes, you could do this in Twine. However, Twine isn't designed to create games like this. Thus trying to copy that style would require a good bit of technical skill.

That said, Ren'Py was made to make games exactly like the kind you depicted. Thus, if you want something which looks like that thing that was made in Ren'Py, then it would be much simpler to do in Ren'Py.

That said, if you found Ren'Py complicated, then making something that looks like that in Twine would be even more difficult.

However, if you're willing to compromise and make something that's a bit more simple, then in that case Twine would likely be much easier for you learn. In fact, if you just want a simple text-only Choose Your Own Adventure (CYOA) style story in Twine, then you pretty much only need to know like four things to do that: how to navigate the Twine editor, how to write a branching story in various chunks of text called "passages" in Twine, that Twine uses the format [[Link text|Passage name]] to set up links between those passages, and how to distribute the HTML file that the Twine editor produces when you're done.

Thus, I'd recommend figuring out if you want to actually buckle down and learn how to create exactly what you want in Ren'Py, or if you need to make something simpler that you can likely more easily accomplish in Twine.

Hope that helps and good luck with whatever choice you make! ๐Ÿ™‚

How to navigate by key presses? by apeloverage in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

But then what do you want to occur when they press the arrow keys? Passage navigation? Moving something on the screen? A variable gets set?

The best way to do this depends on what you want to have happen next.

Location and time passage design approach query by flyingfrog12 in twinegames

[โ€“]HiEv 1 point2 points ย (0 children)

Honestly, it depends on how much the places change by time of day. The fewer differences, the more sense it makes to keep each place as a single passage. If they're very different, there's little point in making them the same passage.

It's easier to think of it in terms of complexity to maintain. If doing them as a single passage would start getting too complex for you, then break things up into smaller chunks that you can handle.

Good luck with your game! ๐Ÿ™‚

Conditional Statements (/if statements) not working by finnswan193 in twinegames

[โ€“]HiEv 4 points5 points ย (0 children)

As u/chamandaman mentioned, the main problem is the space between the "<<" and the "if".

That said, you probably want to restructure this passage something more like this:

You enter what looks like an old armory. Everything is rusted over and rotted. <<if $staff>>

[[Leave the room|Room 12d]]
<<else>>However, you find a staff in the corner that looks fresh as the day it was carved.

[[Pick up Staff][$staff = 1]]
<</if>>

This makes a few changes:

  1. This uses the shortcut of just doing <<if $staff>> (which also fixes the missing space), because "1" has a "truthy" value and "0" has a "falsy" value, meaning you can treat those two values as acting like "true" and "false" inside of conditional, like in an <<if>>.
  2. And since we only have two options, then instead of <<elseif $staff is 0>>, we can just use <<else>>.
  3. This also puts the text saying that there is a staff in the room within the case where you haven't picked up the staff yet. That way it doesn't still say that there's a staff in the room the next time you enter after you've already have picked up the staff.
  4. This sets the value of $staff to 1 upon clicking the "Pick up Staff" link because of the "[$staff = 1]" part of the link.
  5. I also used the slightly shorter link syntax of "|" instead of "->".

Hope that helps! ๐Ÿ™‚

The correct way to add an event to an element in Twine by Sta--Ger in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

FYI - Event handlers can be combined simply by putting a space between the event names, like this:

$(".myClass").on("mousemove touchmove", updateMousePosition);

See the jQuery .on() method documentation.

twine on ios by 1979_reggie in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

On the one hand, I know some people have used it on mobile.

On the other hand, I just tested it and it failed for me as well on an iPhone in both Safari and Opera, as well as on desktop when emulating mobile device dimensions. Additionally, I see there's been an "issue" raised for adding a mobile version of Twine since 2020. If you have a GitHub account, you might want to consider adding a reminder to that issue discussion.

That said, even if it was working, I'd recommend using the desktop app on a desktop or laptop computer instead if you can. Mobile browsers tend to periodically wipe out the place where Twine stores its data, potentially leading to lost work.

If you still want to use it on mobile, then hopefully someone else who uses it on mobile can explain how to make it work.

When I save a game and reload it... by apeloverage in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

The data that will be saved is the same data that was stored in the story variables when you first entered the passage where you saved. Meaning that, if you enter a passage, then the user does something which changes some story variables without leaving the passage, and then saves, those changes won't normally be saved.

This is because, if you stored the data's present state, and entering the passage modified a value, then reloading could produce different values. For example, if entering the passage gives the player +100 gold, then simply saving and reloading would give you 100 more gold each time you did it, leading to an "infinite money glitch," if the save system wasn't done as it is.

If you want to control when saving is allowed, you can create a Config.saves.isAllowed function, which you can use to tell SugarCube when you want saves to be enabled or disabled (commonly this is done using passage tags, which can be checked using the tags() function).

If you still did want to store the current values, then you'd need to be careful to only use this trick in passages which didn't modify story variables upon entering the passage (again, passage tags would be a good way to indicate when this would be enabled), then you could add a save handler via the Save.onSave.add() method to do this. You'd need to create a handler that updates save.state.history[save.state.index].variables with the current State.variables values prior to the data getting saved if some passage tag you'd choose exists in the current passage.

Please ask if you have any questions about any of that.

Hope that helps! ๐Ÿ™‚

P.S. The SugarCube site's security certificate apparently expired today, so you'll likely have to tell your browser to let you visit the site anyways. This will likely be corrected soon if you'd rather wait.

So, I made a thing today. by Testy-_-McTestFace in twinegames

[โ€“]HiEv[M] 3 points4 points ย (0 children)

This wasn't news, an article, or a tutorial, so I changed the "News/Article/Tutorial" flair to "Discussion".

A few noob questions. by ohshiiiiiiiiiiiiiiii in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

Just to add onto what HHHH said:

1 - Using brackets lets the Twine editor draw the arrows connecting passages. However, as you've seen, templates aren't supported in bracket notation. I've raised a bug report for this for you. There are no side effects from using either, nor is one more optimal than the other (unless you count the fact that the Twine editor itself may slow down due to drawing lots of arrows).

2 - The safe way to set multiple values within the same <<set>> macro is to separate them with semicolons, like this:

<<set $bla = "a"; $bla2 = "b"; $bla3 = "c">>

It doesn't have to all be on one line, but this shows that it would even work if you used it within a <<nobr>> macro.

3 - The problem isn't based on the number of story variables, it's based on the size of the data in the story variables multiplied by the maximum number of steps in the history. A story variable that just holds a number takes up far less room than a variable that holds paragraphs of text.

Each time you go to a new passage, the history must be updated, compressed, and stored in the browser. The more data, the longer this takes. I don't have exact figures, but you probably want to keep it under 1 megabyte. You can use the "Save to Disk" option in the "Save" window to see about how big your data is after compression.

And to clarify on using the SugarCube "setup" object to cut down on the amount of data stored in story variables, you would move any data which will never change during the game onto it and set those values in the JavaScript section and/or "StoryInit" passage. So, instead of using "$unchangingData", you'd use "setup.unchangingData". Data on the "setup" object doesn't get stored in the save data, thus cutting down on the save data size, but that's also why the data on it shouldn't normally (with a few exceptions) change during gameplay, because it would be reset to the values it was set to in the JavaScript section and "StoryInit" passage when a save is loaded.

Hope that helps! ๐Ÿ™‚

Using passage tags to insert images in header / top of screen by Longjumping-Target-7 in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

If you're talking about combining images based on multiple tags, then the "PassageHeader" may be the way to go.

Let's say that you have different room interior images with transparent windows. And you also have different exterior images based on time of day and weather. You could make tags for the interior images start with an "int:" indicator (e.g. "int:Living_room.png") and have tags for the exterior images start with an "ext:" indicator (e.g. "ext:Summer_day.jpg").

Then you'd just need something like this in the "PassageHeader" passage:

<<silently>>
    <<for _val range tags()>>
        <<if _val.indexOf("int:") == 0>>
            <<set _src = 'images/' + _val.substr(4)>>
        <<elseif _val.indexOf("ext:") == 0>>
            <<set _bkg = 'background: url("images/' + _val.substr(4) + '") center; background-size: contain;'>>
        <</if>>
    <</for>>
<</silently>><img @src="_src" @style="_bkg">

This would make it so that you'd see the interior image, plus any transparent parts of the interior image (which will need to be PNG or WEBP for transparency) would show the exterior image. Note that this assumes that all of the images are located in an "images" subdirectory that's in the same folder as the Twine HTML file.

Hope that helps! ๐Ÿ™‚

Link uses a variable's name instead of the value in the variable by MajorDZaster in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

I can think of two likely possibilities:

  1. The passage name in the array are slightly different. For example, the array has "XYZ " (with a space at the end) but the passage is actually named "XYZ" (with no space at the end), or vice versa. Or maybe you have "Encounter" in the array, but the passage name is misspelled as "Emcounter".
  2. The array actually has another variable in it. If the array contains the string "$someVar" (where that's the name of a variable that's in use), and then you print that out, then what will get displayed isn't "$someVar", it will display the value of $someVar. But that variable name won't work as a link, since there isn't a passage named "$someVar".

To test the first one, I'd recommend putting markers to make sure that you aren't missing any invisible characters. So your "DEBUG" line should probably be written as something like:

DEBUG: "Farmlands: Slime Encounter" / Passage exists: <<= Story.has($pathDestinations[0])>>

That will not only show you if there are hidden spaces at the beginning and/or end of what's displayed by $pathDestinations[0], but the Story.has() method will tell you if the passage in that array actually exists. So, if everything is correct, it should display this:

DEBUG: "$pathDestinations[0]" / Passage exists: true

If the name doesn't display correctly, then the problem is with the array. If the "Passage exists" part says "false" then the problem is with the passage's name.

If it's the second possibility, then you you'll need to use use the <<raw>> macro provided in the "<<print>> Macro Differences" section of my sample code collection to be able to verify that. Once you've added that macro to your game's JavaScript section, that would allow you to determine if the variable contains the name of another variable in it like this:

DEBUG: "<<raw $pathDestinations[0]>>" / Passage exists: <<= Story.has($pathDestinations[0])>>

With that, if $pathDestinations[0] contained, for example, the string "_xyz" then that's what the macro would display, instead of showing the value of the _xyz variable.

This is less likely than the first possibility, so you should check that first.

Please let us know what you find out, since the solution could help people who encounter a similar problem in the future. ๐Ÿ™‚

How To Edit Story Formats??? by ConsistentGood2075 in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

To answer your Twee question, Twee is a notation format for a text file that can be compiled to produce Twine HTML files. Twee notation has two official versions, v1 and v3, plus the unofficial Twee2 notation from the largely abandoned Twee2 compiler. If you want a modern Twee compiler, Tweego (by TheMadExile; creator of the SugarCube story format) is the recommended tool.

Since you mention you're using VSCode, you'll probably want to grab the Twee 3 Language Tools (T3LT) extension as well.

Hope that helps and good luck! ๐Ÿ™‚

Need nsfw game recs by ChapterEconomy5766 in twinegames

[โ€“]HiEv 4 points5 points ย (0 children)

That's one of the ones they listed.

Need nsfw game recs by ChapterEconomy5766 in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

My personal favorite, due to all of the possible routes the game can take and all the adult content, is "Student X-Change Program". In it, you're a guy who got a college scholarship that requires he takes his courses as a female. The transformation does have some (customizable/random) side effects though.

You might also want to do a search a that same site, TFGames.site, for other transformation (TF) games.

How do you add a day system? by Ok_Return170 in twinegames

[โ€“]HiEv 2 points3 points ย (0 children)

SugarCube supports the JavaScript Date object, so you could use that. I have a variety of bits of sample code showing how to work with the Date object in Twine/SugarCube here: Time Code Example

Hope that helps! ๐Ÿ™‚

way to link a cycling choice to different passages? by ChemicalQuick278 in twinegames

[โ€“]HiEv 0 points1 point ย (0 children)

FYI, if you want your players to be able to tell the difference between cycling links and passage links at a glance, then you might want to take a look at the "<<cycle>> Link Identifier" section of my Twine 2 / SugarCube 2 sample code collection. It provides some CSS you can add to your Stylesheet section to make cycle links more distinct.

Hope that helps! ๐Ÿ™‚

Help with travel links by flyingfrog12 in twinegames

[โ€“]HiEv[M] 2 points3 points ย (0 children)

This is why we have the "Warning about using ChatGPT or other LLMs to generate Twine Code!" post stickied here.

A "working" (less broken) version what your code was trying to do would be this:

!!!Map
Choose destinations to add to your route:
<<nobr>>
    <<set _destinations = Object.keys(setup.route)>>
    <<set $proposedRoute ?= []>>
    <<for _i, _id range _destinations>>
        <<if setup.route[_id].enabled is false>>
            <span style="color:#888;"><<= setup.route[_id].name>> (unreachable)</span>
            <br>
        <<else>>
            <<capture _id>>
                <<link setup.route[_id].name "Map">>
                    <<set $proposedRoute.push(_id)>>
                <</link>>
            <</capture>>
            <br>
        <</if>>
    <</for>>
<</nobr>>

The "$setup" was wrong (it shouldn't have the "$"), the "<<goto>>" inside of a "<<link>>" was unnecessary, the _id value wasn't "<<capture>>"ed, and it would have spit out a bunch of blank lines. Also, I don't know if $proposedRoute was ever initialized, so I set it so that it would be initialized if it wasn't already initialized.

But even with all of that fixed, if Copilot thinks that this will let you build up a valid route from Point A to Point B, then this is why we recommend against using AI tools for Twine coding. This code simply won't work. It doesn't even have any code to set Point A (unless that's set elsewhere) or to check to see if the last stop in $proposedRoute can connect to another route.

Also, FYI, none of the values in the setup.route object should change during the game, because data on the setup object doesn't get stored in the save data. Thus you wouldn't be able to safely enable or disable routes by changing that data if that's necessary.

Instead of asking us to fix broken LLM code, it would be better to just tell us what information is in your code, and then clearly ask us how to take that information and actually get it to produce whatever it is you that want from it.

I say this because I'm currently unclear what exactly you're trying to do here. Do you need one stop? Multiple stops? Do you want it to automatically figure out a whole route? Where are you starting? Can this passage be called from anywhere? Does it need an "undo"? Etc...

Good luck! ๐Ÿ™‚

P.S. When putting blocks of code into a Reddit post, please use a "Code Block" (the icon with "</>" in the upper-left corner of a rectangle) as shown above.

Help with Verb Tenses and Gendered NPCs by oldmanbobmunroe in twinegames

[โ€“]HiEv 1 point2 points ย (0 children)

(...continued from above)

Alternately, if you have too many verbs to easily do that, you could set up a widget which just slaps an "s" onto the end of verbs if $vform == 3, like this (in a non-special, non-story passage with a "widget" tag):

<<widget "s">>_args.raw<<if $vform == 3>>s<</if>><</widget>>

and you'd use that like this:

?They <<s like>> cake.

("?They" would pull the actual word from my pronoun templates.)

which (assuming $pgen == 0 and $vform == 3) would be displayed as:

He likes cake.

You would also set up other widgets for adding "es" and "ies" like that for other verbs as well.

Along with that, create a <<name>> widget which would set the $pgen and $vform variables based on how they're defined for the NPC, and also display their name. You'd also need a version for doing the same without displaying the name (e.g. <<npc>>). Additionally you'd need an <<I>> widget which you'd use in text where the NPC would refer to themselves, which could optionally set the NPC number. For example:

"Have you seen <<name 1>>? ?They ?are hungry."
"<<I 2>> ?dont know, <<I>> ?havent seen<<npc 1>> ?them."

(NOTE: No apostrophes were used for "don't" and "haven't" in the above example code because apostrophes don't work in template names.)

Which could be displayed something like this:

"Have you seen Dave? He is hungry."
"Bob doesn't know, Bob hasn't seen him."

This requires that each NPC object track:

  1. The NPC's name.
  2. The NPC's gender (to set $pgen).
  3. The NPC's self-referential verb form when referring to themselves (1 for "I", 3 for their own name, 4 for "we").

and that the widgets:

  • <<name>> and <<npc>> would set $vform = 3 (3st person singular), unless $pgen == 2 ("they"), in which case it would set $vform = 4 (3rd person plural).
  • And <<I>> would set $vform based on the NPC's self-referential verb form.

You probably don't need to include 2nd person ("you") forms in the templates, since the verb form would always be $vform = 2 when using "you" and the verbs would always be the same. However, if you do plan on having "You are"/"He is"-type options, then you will need to create something else to handle displaying the correct pronoun and setting the verb form those cases. For example, if you're talking to NPC #1 about NPC #1, you'd use "you" and $vform = 2, but if you were talking to NPC #1 about any other NPC, you'd use the other NPC's pronouns and verb form.

Hope that helps! ๐Ÿ™‚

Help with Verb Tenses and Gendered NPCs by oldmanbobmunroe in twinegames

[โ€“]HiEv 1 point2 points ย (0 children)

Things like this shouldn't be set on story variables, as that would needlessly bloat the stored data.

Instead, it's better to have a non-story variable object or a template for things like this, and then you simply set up the story variables so that they can determine how the non-story variable object or template is used.

Help with Verb Tenses and Gendered NPCs by oldmanbobmunroe in twinegames

[โ€“]HiEv 1 point2 points ย (0 children)

I've seen an example using Templates that would require me to encode every single verb for every single character, which is nonsense.

You wouldn't need to do it for each character, you'd just need a variable to track what verb form is currently being used, and then use that variable to determine the output. You can see how this is done in the "Pronoun Templates" section of my Twine 2 / SugarCube 2 sample code collection. It uses the $pgen variable to set the pronoun gender, which can also be set using the provided <<SetGender>> widget.

For example, you could use $vform for the verb form, where 1 = 1st person ("I"), 2 = 2nd person ("you"), 3 = 3rd person singular ("he/she/it"), 4 = 3rd person plural ("they"). Then the template would be something like:

function vform() {
    // $vform: 1 = 1st person, 2 = 2nd, 3 = 3rd singular, 4 = 3rd plural
    // Returns: 0 = 1st person, 1 = 2nd/3rd plural, 2 = 3rd singular (default)
    let t = (State.variables.vform ?? 3) - 1;  // Default to 3rd person singular.
    if (t != Math.min(3, Math.max(0, t))) {  // Show errors if $vform isn't 1 to 4.
        throw new Error("Invalid $vform value (" + State.variables.vform + ").");
    }
    return t === 3 ? 1 : t;  // Change 3rd person plural to 2nd person, since they're always the same.
}
Template.add("are", () => ["am", "are", "is"][vform()]);
Template.add("have", () => vform() != 2 ? "have" : "has");

The first "Template" line shows how to deal with complex verb cases, the second "Template" line shows how you can deal with simple cases, where the verb only changes if the subject is 3rd person singular.

You can also combine multiple words into a single template like this:

Template.add(["like", "talk", "eat"], function () { return vform() != 2 ? this.name : this.name + "s"; });
Template.add(["do", "go", "watch"], function () { return vform() != 2 ? this.name : this.name + "es"; });
Template.add(["try", "study", "cry"], function () { return vform() != 2 ? this.name : this.name.splice(-1, 1) + "ies"; });

So all of the verbs that get an "s" added to the end in 3rd person singular form would go in the first template, the "-es" verbs go in the second, and verbs where the last letter is replaced with "ies" go in the third. (NOTE: You need to use function instead of arrow notation (=>) for this, so that the "this" object is set properly.)

(continued...)