r/twinegames

How to avoid replaying the game each time I add new variables at the start?

I have all my variables set up in a single StoryInit passage, which is pasted in the below link, but I'm getting tired of having to restart anytime I add a new inventory item that isn't something I can just use ndef in combination with checking for false for.

Is there a better way for me to setup variables?

(Also is there an better way for me to organize all the different types of variables I have? Scrolling down to the specific section is starting to get tedius.)
https://hastebin.com/share/abeqilotus.ruby

reddit.com
u/DazzlingWatercress — 2 days ago

Anyone want to make a Twine game for a horror short film? Medieval aesthetic, simple mechanics

Long shot but figured this was the right place to ask.

I'm making a horror-comedy short film and the story involves a mysterious medieval text-based game that kills the Twitch streamers playing it.

Mechanically it's very simple. Three / four rounds. Mix of riddle inputs, multiple choice, and fill-in-the-blank. Pass/fail states with a jester mask appearing on correct answers and a discordant failure screen on wrong ones.

What would take more care is the aesthetic; perhaps parchment textures, blackletter font etc. Cultist Simulator is a visual reference. But I'd rather discuss this all on a call with the Director so that we can figure out what is feasible and what suits the style of the short best.

This is unpaid (sorry I know that is super insulting but I'm self funding this whole project, maybe I can squeeze out an amazon gift card but I need to see what other expenses there are). I want to be upfront about that but depending on what we end up making there could be a future where we work with you to build a full version of the game that gets released (especially if the short does well online, we're in talks to getting proper talent attached).

DM a link to anything you've made and I'll send you the script.

reddit.com
u/SoloMedicScum — 3 days ago

sliders and images

Is there a way to connect a slider value to an image, an example would be if I slide a slider over from red hair to blonde hair and then have an image and text displayed, is that doable and how would one go about it.

reddit.com
u/holzey — 3 days ago
▲ 26 r/twinegames+3 crossposts

The Cats of Crossed Elder - a delve into the petrified corpse on an ancient titan

The Cats of Crossed Elder is a short gamebook about travelling into an Elder, a titanic petrified corpse from ages past. Players look for a lost animal species whose abilities can spread hope for scientific progress.

Free to play on Itch.io:

https://ranarh.itch.io/crossed-elder

I have made several small TTRPG supplements for the setting The Elders. This is the first interactive fiction for it. At about 17K words, playtime may be an hour or so.

u/MiaT_Studio — 3 days ago

Buttons and links do not work

New to Sugarcube, coming over from Harlowe, and I do not understand....

Tried both:

<<link "Test">>

<<print "Test">>

<</link>>

and

<<button "Test">>

<<print "Test">>

<</button>>

and neither work. Neither button reacts to my click.

Can anyone explain this to a total newb?

reddit.com
u/violetandvanilla — 4 days ago

Any easy ways to improve ui?

Are there any ways on Harlow to easily polish ui? I’ve already replaced my (link:) macros with (button:), added a custom font html progress bars, etc. But my game is missing something and still doesn’t work well on mobile. Any suggestions?

reddit.com
u/Skellyman34 — 4 days ago

How to have the text gradually appear in a given passage.

Trying to find how to keep a scene contained in a single passage until bigger decisions have been made or a the player moves to a new location. I could obviously just write them out normally but then the dialogue is just all revealed immediately, meaning I can't add choices for the player.

Is there a way to add choices that will reveal dialogue in the current passage instead of moving to a new one?

reddit.com
u/Rook_Steele — 4 days ago

After two months of work, the demo for my roguelike is complete.

This is the rough demo for the mobile game I plan on releasing soon. I am open to advice as I am releasing the full .twee source to the public.

The game is a basic chaotic presidential Reigns-Like roguelike with minor simulator elements.

Features:

-70+ events

-Unlockable meta progression

-Roguelike gameplay

-Multiple endings

-An hour of gameplay

-Dynamic headlines

-Dynamic reelection

Planned features:

-In depth war mechanics

-events coming in and out of the pool depending on what your stats are at

-more hidden stats/simulator elements

-a secret ending

-150 events

-mobile formatting

I would love your feedback. The game is Harlow :) Modding is welcome tho I doubt anyone will

drive.google.com
u/Skellyman34 — 5 days ago

TEMPORARILY Disable Back Button

[SOLVED] Hey folks. I'm building a game where some actions have a chance of negative consequences. I want to prevent the player from abusing the Back mechanic to avoid those consequences, but I want to keep it in the game for general navigation purposes.

I've searched online, and I've only found references to things that either disable it for the whole game (adding Config.history.controls = false; to the Story JavaScript) or that disable the entire sidebar (tagging the passage "risky" and adding body.risky #ui-bar {display: none;} to the Stylesheet), which I don't want to do.

Help is appreciated :) Story Format is SugarCube 2.37.3

reddit.com
u/TigerSauce2019 — 6 days ago

Permanent effects applied with mouse click accumulation?

For context: I'm working on a group project that focuses on taking inspiration from a book or any piece of literature, and reimagine it in the form of dynamic cybertext. So out of the list of software we could use, my group project decided to use Twine, and we stuck with the default story format since we have zero experience with the software.

So far we've achieved randomized display of passages upon clicking on the link. But now, we're at a point where we want to apply permanent events/effects depending on the accumulation of number of mouse clicks, and I can't for the life of me find a solution that doesn't feel too convoluted, mainly because on the aspect of JavaScript I'm only familiar with the language code from my days in Processing.

For example, after a certain amount of clicks navigating through the passages, we want the screen to start being covered by eyes. And reaching another specific number, the number of eyes increases on the screen.

I also want to know if this will have to do with changing the background itself each time, or have it work with some "randomized array" type of deal using a PNG of an eye.

Thank you in advance for the response/advice!

reddit.com
u/FoxenPyre — 7 days ago

Help with creating stats.

Hi I've been using the introduction to twine handbook by dan cox on youtube. and have followed his examples as closly as I can. how ever I always seem to get the same issue. Error: the passage "Statistics" does not exist <<set $Intelligence to 0>> <<set $Strength to 0>> <<set $Endurance to 0>> <<set $Perception to 0>> <<set $Charisma to 0>> <<set $points to 25>>

[[lets find out what make you S.P.E.C.I.]] [[cheat menu]] Strength: <<link "+" "Statistics">> <<if $points gt 0>> <<set $Strength to $Strength + 1>> <<set $points to $points - 1>> <</if>> <</link>>

(current $Strength)

Perception: <<link "+" "Statistics">> <<if $points gt 0>> <<set $Perception to $Perception + 1>> <<set $points to $points - 1>> <</if>> <</link>>

(current $Perception)

Endurance: <<link "+" "Statistics">> <<if $points gt 0>> <<set $Endurance to $Endurance + 1>> <<set $points to $points - 1>> <</if>> <</link>>

(current $Endurance)

Charisma: <<link "+" "Statistics">> <<if $points gt 0>> <<set $Charisma to $Charisma1 + 1>> <<set $points to $points - 1>> <</if>> <</link>>

(current $Charisma)

Intelligence: <<link "+" "Statistics">> <<if $points gt 0>> <<set $Intelligence to $Intelligence + 1>> <<set $points to $points - 1>> <</if>> <</link>>

(current $Intelligence)

remaining points $points <<link "(reset.)" "statistics">> <<set $Intelligence to 0>> <<set $Strength to 0>> <<set $Endurance to 0>> <<set $Charisma to 0>> <<set $Perception to )>> <<set $points to 25>> <</link>>

reddit.com
u/holzey — 6 days ago

Issue with closing a macro tag

Trying to create a custom macro that creates a tabbed menu - a sidebar with buttons to click to navigate to new panels, and a main content container that manages what each tab contains.

Macro.add('tabmenu', {
    tags: ['tab'],
    handler: function () {
        const tabs = this.payload.slice(1);

        const $wrapper = $('&lt;div&gt;').addClass('tab-wrap');
        const $sidebar = $('&lt;div&gt;').addClass('tab-nav');
        const $content = $('&lt;div&gt;').addClass('tab-content');

        tabs.forEach((tab, i) =&gt; {
            var isFirst = i === 0;

            let $button = $('&lt;button&gt;')
                .addClass(`tab-btn${isFirst ? ' active' : ''}`)
                .attr('data-target', `tab-panel-${i}`)
                .text(tab.args[0]);

            var $panel = $('&lt;div&gt;')
                .addClass(`tab-panel${isFirst ? ' active' : ''}`)
                .attr('id', `tab-panel-${i}`);

            // processes contents and SugarCube logic on the tab
            new Wikifier($panel[0], tab.contents);

            $sidebar.append($button);
            $content.append($panel);
        });

        $wrapper.append($sidebar, $content);

        $wrapper.on('click', '.tab-btn', function () {
            let $menu = $(this).closest('.tab-wrap');

            $menu.find('.tab-btn').removeClass('active');
            $menu.find('.tab-panel').removeClass('active');

            $(this).addClass('active');
            $menu.find('#' + $(this).data('target')).addClass('active');
        });

        $(this.output).append($wrapper);
    },
})

// And then in the Twine passage...

:: SomePassageHere [nobr]

&lt;&lt;tabmenu&gt;&gt;
    &lt;&lt;tab 'Tab 1'&gt;&gt;
        &lt;p&gt;Hello 1&lt;/p&gt;

        &lt;&lt;if (1 + 1) == 2&gt;&gt;Hello&lt;&lt;/if&gt;&gt;
        &lt;&lt;if (2 + 2) == 22&gt;&gt;Goodbye&lt;&lt;/if&gt;&gt;
    &lt;&lt;/tab&gt;&gt;
    &lt;&lt;tab 'Tab 2'&gt;&gt;
        &lt;p&gt;Hello 2&lt;/p&gt;
    &lt;&lt;/tab&gt;&gt;
    &lt;&lt;tab 'Tab 3'&gt;&gt;
        &lt;p&gt;Hello 3&lt;/p&gt;
    &lt;&lt;/tab&gt;&gt;
    &lt;&lt;tab 'Tab 4'&gt;&gt;
        &lt;p&gt;Hello 4&lt;/p&gt;
    &lt;&lt;/tab&gt;&gt;
&lt;&lt;/tabmenu&gt;

This works, however I'm getting a macro error: <</tab>> does not exist. I assume this is because macro tags cannot be containers. If I remove the closing <</tab>> it works just fine and the error goes away, but it looks weird in the Twine passage and I was hoping to avoid doing that. I've tried simply removing it programmatically before rendering the final result but that seems inelegant and I'm hoping for a better solution. May need to split it into a separate macro (<<tabmenu>> and <<tab>>) but not sure. Any advice is appreciated.

reddit.com
u/Venerous — 6 days ago

Potential Collaboration

Hello! I'm not sure if this is allowed, but I'll try it anyways. Because of my limited understanding of Twine and my ambitions for my game, I am seeking out help.

I'm looking for someone who has (preferably) more coding experience than me in Twine, specifically Sugarcube. But it's fine if you’re just as inexperienced ^^

Anyways, my passion project has a game development doc detailing technical aspects, special NPCs, events, and descriptions of places. It is a NSFW RPG where the player lives in a city that will start harassing them. To avoid losing themselves in the process, the player has to figure out a way to live—unless they decide to participate in the debauchery.

It'll be unpaid. But you will be credited as a co-developer. If you want any links to your socials or a way to get paid, I will add it. Please DM me or comment if you want to help! If you have any questions, ask away ^^

Edit: Here are the things I want implemeted, at least for a first version:

  • A leveling systen that develops the PC's skills from different events.
  • A combat system that is inspired by Degrees of Lewdity, as well as an extensive sex system that has different positions and actions.
  • An inventory system with food, drinks, produce, gifts, etc.
  • A clothing system that covers the PC and has special attributes specific for different activities.
  • An intricate relationship system with NPCs where specific requirements meet different relationship types.
  • Maintaining a balance between jobs, needs, and reputation.
reddit.com
u/Few_Cow_3419 — 7 days ago

random password help.

(set: _one to (random: 0,9))
(set: _two to (random: 0,9))
(set: _three to (random: 0,9))
(set: _four to (random: 0,9))
(set: _five to (random: 0,9))
(set: _six to (random: 0,9))

(set: $password to _one + _two + _three + _four + _five + _six)
(set: $password to (str: $password))

This is the code I did. It works, yes, but its ugly to look at progamming wise. Hwlp?

reddit.com
u/umapistolaparadjeca — 8 days ago

Unlockable storylines?

I'm writing a story, and I want players to be able to access a few secret storylines if they get a certain amount of stats and unlock something, and then they'll be able to access storyline 1 and players who didn't unlock it won't notice it's missing, the plays who unlock it will get extra scenes throughout the story, that others won't, how do I code this??

reddit.com
u/Spiraling-Down- — 12 days ago

Trouble with nested span replacements

As the title says, I've been using <span id="name'> and <<replace "#name">> to give the players choices without advancing the passage and also making the unselected choices disappear. However, when I try to use one of these inside another <<replace>> macro, it hangs and doesn't display any of the passage text at all. Rough example below:

&lt;span id="first"&gt;&lt;&lt;link 'Say something comforting'&gt;&gt;&lt;&lt;replace "#first"&gt;&gt;
Text text text
&lt;&lt;/replace&gt;&gt;&lt;&lt;/link&gt;&gt;
&lt;&lt;link 'Say something callous'&gt;&gt;&lt;&lt;replace "#first"&gt;&gt;
Text text text
&lt;span id="second"&gt;&lt;&lt;link 'Apologize'&gt;&gt;&lt;&lt;replace "#second"&gt;&gt;
Text text text
&lt;&lt;/replace&gt;&gt;&lt;&lt;/link&gt;&gt;
&lt;&lt;link 'Double down'&gt;&gt;&lt;&lt;replace "#second&gt;&gt;
Text text text
&lt;&lt;/replace&gt;&gt;&lt;&lt;/link&gt;&gt;
&lt;/span&gt;
&lt;/span&gt;

Is there any way to make this work, or am I just being greedy and I should advance the passage with the nested choice?

reddit.com
u/TigerSauce2019 — 12 days ago

Combined sound effects

I would like to add some sound effects to my game. All on the short side of 5 seconds or less. Would it be possible to combine them all into one large sound file, and play them according to what time span they play at in the file. For instance, a doorbell would be slotted at :00 seconds to :05. A police siren would be slotted at :051 to :10 seconds. And so on....

I ask this because some of the online hosting sites (like itch) limit files of your game to 1000, and having each 4 second sound files seem wasteful.

reddit.com
u/Kinglex229 — 12 days ago
▲ 3 r/twinegames+1 crossposts

Assassin Game Demo

I just released the demo for a game I'm working on. Its called Assassin Game. Its a text based puzzle game. Its inspired by the Hitman games.
The game

u/WhyAm__I — 12 days ago