Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all 1844 articles
Browse latest View live

Harlowe save, load game system for more than one session?

$
0
0
If I'm using Harlowe, how do I create a save game system so a user can come back even days later, open their browser and visit the game url, and have the option to load game and kick off from the passage/variables they were at?

My game is lengthy and it's unlikely anyone can finish it in one sitting so this is critical. Help!

[Harlowe] Can't escape a single quote

$
0
0
I have code similar to this:
(set: $a to (datamap: "A", ""))
(set: $b to "(set: $a's 'A' to it +       ' Don't! '      )")
(print: $b)
(print: $a's A)

The single quote in 'Don't' needs escaping, or Harlowe will think it's the closing quote of the string and all will break.

But surrounding that single quote with tildes doesn't work. The engine says: Unterminated template literal

Using double quotes is not an option since all that is already inside the double quotes that define $b.

Is there any solution to this? Right now, I have to write "do not" and "does not" all along my game, since practically all the content is defined in blocks like these (yes, my game is stupidly complex).

How do I make text appear individually and not all at once?

$
0
0
I mean that the whole passage won't appear at once, but rather it'll appear line by line. I want it to be slower so that the story can be digested better but I'm having some trouble doing that.

[Harlowe] Doing a loop with Javascript?

$
0
0
There are a number of questions asking how to do a for loop in Harlowe, since no macro is provided for that: this, and this, and also this bug report. Some workarounds that are proposed include using the (live:) macro or embedding (display:) within itself. I have used extensively the (live:) trick and I know its issues (mainly, that the content under the macro gets printed before the loop has finished running).

But I didn't have this idea until today: is there any way to directly use Javascript loops within Harlowe?

Please forgive that I don't provide any experiment or test, but I can't speak Javascript (and I tried to learn, believe me). But if this can be done it could be a major improvement for the game I'm writing (I need use (live:) loops all over the place). Thanks!

Having trouble with no break and display tags

$
0
0
This is a strange issue I can't wrap my head around.
I am using Twine 2 with Sugarcube 2

What I am trying to do (and actually have accomplished) is to take away the page break between my <<display tags>>. I have passages that display different health bars depending on my health variables. So in my first example here I have the code that actually worked and took away the page breaks, placing the passages right next to eachother.
<center>\
<<display "health">>\
<<display "Mental">>\
<<display "DHEALTH">>\
</center>\

Now, I go to use this EXACT code in a different passage and cannot get the page breaks to go away. I have even substituted the "\" with <<nobr>> tags with no luck. I can't figure out why it works with one passage and not another. I went into the passages that I am displaying with the <<display>> tags and made sure everything was tight and that there were no spaces or page breaks. Any ideas on what is happening here?

How can I create a NEW sidebar (right side)?

$
0
0
I wanted to ask you all how can I create a NEW (custom) right side sidebar for general purpose like inventory, cell phone, and "wrist watch". I kinda have the ideia it can (and must) be done with CSS, but I wanted some help I'm kinda new to CSS and I don't know it's strengths yet :) Thank you for your help.

How to vertically align (bottom) images in passages? (Harlowe)

$
0
0
Hey all,

I'm working on a game called REFT in Twine 2.0 (Harlowe) as a final project for an experimental narratives course and have made a ton of progress with the mechanics. Now I'm trying to improve the aesthetics.

I use right and left arrow images to move forward and backward through passages, and these appear at the end of the text in each passage. A big part of the game is moving left and right through passages quickly, so I would like to make these arrow buttons stationary at the bottom of each passage. This would allow players to keep their cursor in one place and spam the buttons to quickly travel through passages.

I'm having trouble fixing these buttons in place at the bottom of the passages, though. I've tried adding align="bottom" (and other variations) inside the <img> code but this does nothing. I've also tried to create tables with <table><tr></tr></table> but these also don't show up. Any thoughts on how I can stick these buttons down there?

If you want, you can play the current prototype of REFT here to see what I'm working with.

Thanks!

Importing story from 1.4.2 desktop to 2.0.2 on-line

$
0
0
Help!

Is there any way I can import story created in Windows desktop version (1.4.2) into Twine on-line version?
I need my students to be able to see story map as well and not just to "play" the story. For that I need to run it in browser without installing desktop version.
Is this possible?
If not, is it possible to copy created content into browser version??

Export to twee?

$
0
0
Is there a way to export a twine story to twee in the latest version (2.011) of twine? I feel like I'm missing something obvious since I keep seeing references to this being possible.

Click again in Harlow

$
0
0
Hi there:

I've written something like this:
(if: $Wama is not 0)[Waschmaschine aus dem Weg räumen. (click: "räumen")[(set: $Zeit to $Zeit +5)(if:$Meister is 1)[(set: $Wama to $Wama - 10)](else:)[(set: $Wama to $Wama - 5)]]]

Problem is, I can only click "räumen" ONCE. I want to click it multiple times untill $Wama has reached 0. But how?

I could do all this with a seperate passage, sure. But I want to make it nice and slim.

right way to trigger the page to re-evaluate (from Javascript)

$
0
0
(First: I apologize if there is an obvious answer, I'm new to hacking Twine)

Hi. As background, I'm planning on using Twine for a two-week high-school class I'm helping teach and my kids school. I'm still a bit of a twine novice, so I'm attempting to learn twine, learn the style (I'm planning on SugarCube 2.6), collect resources for the kids to learn this, and create some samples. (I have lots of technical experience, just not with these tools)

What I want to do is do some outdoor, location-based stories by leveraging the location api's in mobile Safari on an iPad. My thought about the right way to do this is to create a new SugarCube macro (like some of the examples such as the Shake ones) that accesses the location, and create a few variants (e.g., tell me if the location is within X meters of this long, lat). These are things I know how to do (dealing with location in javascript, etc).

BUT, given this, I was wondering what the best way might be to deal with updating the page when the player moves around. I was thinking of polling the location in Javascript, using a timer or requestAnimationFrame, etc. If the result of a location macro changes, it would seem the best thing to do would be to "re-evaluate" the whole page so that if an author creates a passage with a lot of dependencies on the location, things will work as expected. If I was just changing CSS or the DOM, I realize I can just make the change. I don't understand enough of the internals of twinejs to know if I need to do something else to cause twine to re-evaluate everything or if there's an obvious macro or function to call.

Thanks!

Can I use click macro and passagedone or something else other than replace to update variables?

$
0
0
So I have question about updating variables with click and making new text appear without having to do replace. So I have a decently sized game right now and many passages have multiple choices that lead to different outcomes and different text on the same passage. So far I have been doing this by using replace to make new text appear, but i was kinda hoping i could skip that and just have a click that updates a variable making an if statement true and showing the text under that if statement without having to leave the passage and come back. Or replacing.

Sorry if this is unreable i'm on an ipad right now. Also i'm writing in the newest version of sugarcube 2.

How do I copy an object properly in sugarcube?

$
0
0
Essentially, I want to achieve something like this:
<<set $activePerson to { name : "David" }>>
<<set $secondPerson to $activePerson>>
<<set $activePerson.name to "Jane">>
<<print $secondPerson.name>>
where the print statement prints "David" and not "Jane".
However, it is my understanding that until the passage exits, the variable "secondPerson" is treated as a reference to "activePerson" instead of its own object, which leads me to believe that I'm doing it wrong.
So how do I copy an object properly within a single passage?

Quick question (I hope.) SugarCube 2 ver 2.5 twine 2. an if statment not showing up in debugger

$
0
0
So I'm trying to figure out why an if won't even show up. when I activate debugging mode.

This is how I intended the if to look, but I have tested different <<if>> statements and none of them show up. So is there something to keep an eye for out that might cause this?
<<if $RacePrint isnot $StartRace>>

[Snowman] (goto:) equivalent?

$
0
0
Having big problems with the speed of my story, I'm experimentally trying to port it from Harlowe to Snowman. Something funny to do for someone who doesn't know Javascript. However, although my Harlowe code is long and elaborate, it's actually made of very few different macros, so I kind of trust I can get it done in Snowman.

One thing that I have no idea how to do, since Javascript documentation can't help and I can't find it about Snowman, is how to move from one passage to another indirectly: not with a standard Twine link like [this->this], but using the equivalent of a (goto:) macro from Harlowe.

What I need is creating a link that, when clicked, first sets some variables, and then jumps to the next passage.

Thanks!

Publish To File Doesn't Work

$
0
0
I am trying to learn twine 2, so I started with an existing twine-based game to make simple edits. My problem is that using the web-based twine, when I hit the "Publish to File" button nothing happens. No file gets saved to my computer, and nothing happens in the browser. I can save the game and re-open it using the Archive function, but that doesn't save it in a playable form.
I tried downloading the twine offline program to see if that worked. The program will publish to file, but the resulting game always just gives a blank tab (in both Firefox and Chrome). It also saves as a much smaller HTML file. The original is ~5MB, while the saved file is ~3MB.

Harlowe CSS style: smart font size for mobile vs desktop?

$
0
0
On iPhone Safari, Harlowe's CSS is rendering the text too small to comfortably read and navigate. On passages that have multiple links close to each other, the small font makes it difficult to select the desired option by touch without accidentally touching the wrong link.

I've noticed some Twine authors working around this by double-spacing a list of link options at the bottom of the passage instead of single-spacing, and trying not to have links too close to each other within a paragraph...

Any tips or ideas on how to make a Harlowe Twine story detect the browser or screen size and adjust the CSS accordingly? I'd like for it to remain as-is for desktop/tablet browsers but use a larger default font size for mobile browsers with smaller screens.

How to compare two objects?

$
0
0
So let's say we have object "foo":
<<set $foo to { favouriteGame : "Asteroids" }>>
And we also have an object "bar":
<<set $bar to { favouriteGame : "Asteroids" }>>
Is there a function or method (like .equals()?) that I can use that compares two objects and returns true/false based on whether or not their contents are equal?
If there is and I just couldn't find it, does it compare sub-objects, too?

Separating out choices for multiple characters

$
0
0
Hi all, sorry I'm only just dipping my toe into the world of all this coding stuff, but before I sink hours into figuring out how to operate this system I was hoping someone could tell me if it's even possible to do what I'm attempting.

Basically what I want is a story where the player picks one of four characters at the start, and from then on they can only see the choices available to their character, but I want to have all the characters' stories within the same narrative, (so it splits out and then comes back to shared events and experiences over and over.)

I was imagining that this would work like, say Player A chooses Bob and Player B chooses Gary, if I write a scene where Gary and Bob walk into a room, Player A will see Bob's options to say - open a chest, and Player B will see Gary's options - say to talk to an NPC, but neither will see both.

Does that make sense? Sorry if this is a dumb question, I tried doing this in inklewriter and I had to keep making the player re-choose what character they were before I could give them separate choices (see below image) and it was really clunky.

Thanks heaps in advance!

example%20choices_1.png

How do I add quotation marks to a link?

$
0
0
I'm using Harlowe. I use the following code kind of code in my story (thanks to GreyElf).

(link: "Yes" )[(set: $KnowHobbes to "Yes")(goto: "Hobbes Description")]
(link: "No" )[(set: $KnowHobbes to "No")(goto: "Hobbes Description")]

I want "Yes" and "No" to be possible dialogue options for the player. That is, when the player sees "Yes" and "No" as links I want them to see quotation marks around the links so that it's clear that the option is dialogue.

I've tried using two sets of quotation marks, but that doesn't seem to work.

Thank you so much to anyone who reads this.
Viewing all 1844 articles
Browse latest View live