r/twinegames

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 — 10 hours 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 — 4 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- — 4 days ago

I'm having trouble getting this to work. I've tried so many different ways to get it to work and ARGGH. I wrote this six months ago and gave up when I couldn't figure it out and now I'm back wasting too much time on it AGAIN.

Basically what I want to happen is on the 4th tug, the $brokenlock is set to true (that works when tested) and the option to open the door pops up (that DOESN'T friggin' work).

ISTG if its a simple solution I'm gonna freak. Out. I'm new to coding and understand barely anything. Maybe I'm doing this in a convoluted way. I just wanna be over and done with this and move on...

(set:_tug to 0)
You're bones creak when you sit up to look at the lock.

Like the rest of the room, it looks worn. It's rusted and seems weak enough that you could probably open it with enough blunt force.

[|Tug1)[Nothing happened.] |Tug2)[The rust stains the bandages of your palm red but the lock remains firm.] |Tug3)[The lock creaks in your tight hold.] |Tug4)[The lock breaks with a crack and crumbles to bits in your hands.]]

(if: $rustedlockkey is true)[
  [[Break the lock with the... lock.|Antag Entrance]]]

[[Great.|Wakey, wakey.]]

{
(link-repeat: "Tug on it.")[
  (set:_tug to it +1)
  (if:_tug is 1)[(show: ?Tug1)(hide: ?Tug0)]
  (if:_tug is 2)[(show: ?Tug2)(hide: ?Tug1)]
  (if:_tug is 3)[(show: ?Tug3)(hide: ?Tug2)]
  (if:_tug is 4)[(show: ?Tug4)(hide: ?Tug3)(set: $brokenlock to true)]
 ]
}

(if: $brokenlock is true)[
  [[Open the cage door.|Antag Entrance]]]
reddit.com
u/ASinForASin — 8 days ago
▲ 21 r/twinegames+2 crossposts

I uploaded it to itch.io in March and it hasn't gotten a single download :(

The Chronicle of M.O.D.U.L.E.

It's about the AI that destroyed mankind creating a consciousness (you) after the universe reaches its final state of entropy.

It has some other really cool concepts too and I just want to know what people think of it!

You can play it in about 15 minutes depending on how fast you read, so give it a try, will ya?

u/Great_Professor_2905 — 9 days ago

Twine help

Trying to create an assignment for creative writing. I think I have a good idea about the zombie apocalypse, but before it breaks out I want seemingly irrelevant decisions to become relevant. So for the beginning of the story it’s going to be fairly linear until the zombie apocalypse breaks out.

So for example, you pick what your having for lunch, and depending on what you pick you’ll have a steak knife, but that only becomes important later, regardless of what you pick in that, you’re still going to be prompted to walk or drive to work.

How can i keep all these decisions working at once?

reddit.com
u/Kammullska — 7 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 — 4 days ago

Hey all! First time posting, looking for some help creating custom classes in SugarCube 2. I've referenced the documentation, and I think everything should be fine, but I keep getting errors. Code is pasted below:

window.Stat = class Stat {
  constructor(config) {
    this.name = '(none)';
    this.value = 1;
    this.xp = 0;
    this.isFlagged = false;
        
    Object.keys(config).forEach(prop =&gt; {
      this[prop] = clone(config[prop]);
    });
  }
    
    clone() {
      return new this.constructor(this);
  }

  toJSON() {
    var ownData = {};
    Object.keys(this).forEach(prop =&gt; {
      ownData[prop] = clone(this[prop]);
    });
    return Serial.createReviver(`new ${this.constructor.name}($ReviveData$)`, ownData);
  }
};

Specifically, I am getting the following errors:

  • When code is used as is: "Error: Serial is not defined."
  • When attempting to import serial at the top of my Story JavaScript: "Error [tw-user-script-0]: import declarations may only appear at top level of a module."
  • When trying to load a save after commenting out the Serial.createReviver line: "Can't access property "value", patched is undefined."

Any help is appreciated!

reddit.com
u/TigerSauce2019 — 9 days ago

Hello! This is my first time posting on reddit, but I've been fiddling with this Twine game for weeks trying to get music to play. I've tried the <audio src="link" autoplay> and that didn't work. Maybe I'm doing it wrong? I was adding YouTube links into that portion of it. Should I be adding something else? Someone please help me. This is driving me insane.

reddit.com
u/Willing_Thought7695 — 10 days ago

Hi guys. i use tweego in vscode with sugarcube 2.37.3. I can wrap the whole passage with <<nobr>> macro, and it works great; but the <br> that's added right after the passage title remains whatever i do, and it messes up the spacing of other stuff in the passage. It looks like:

:: Logic Test

&lt;&lt;nobr&gt;&gt;
my code here
&lt;&lt;/nobr&gt;&gt;

i can't wrap the ":: Logic Test" part, and can't add anything on the same line either. how do i remove it?

reddit.com
u/estarabimm — 14 days ago