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

Browser back/forward history navigation

$
0
0
Using Harlowe 1.1.1 on Twine 2.0.8. Have a CYOA sort of story where I want to be able to use the browser back/forward button to navigate. It's not working for me by default in Chrome (Mac). Is history navigation with back/forward supposed to be enabled by default in Harlowe, or is there a config change I need to do to enable this? I tried Config.history.controls = true; but that gave an error (perhaps because it's specific to Sugarcube?)

Sorry for the newbie question. Maybe it's a quick fix?

Custom Javascript Functions and Key-Value Pair Dilemma.

$
0
0
As a precursor, I have been spending hours researching this, scouring the Twine forums, w3schools for Javascript, the Twine 2 wiki, and SugarCube 2 docs, so this is kinda my last resort.

Firstly, I have found next to no documentation on creating custom Javascript functions and using them. Everything I have learned is through looking at examples, and with my own knowledge of JS.

I set out trying to learn how to take an array of objects, such as:
[ { name: "Gold", value: 100 }, { name: "Silver", value: 10 }, { name: "Copper", value: 1 } ]

And pass it into a custom JS function to get the sum of all of "value" properties.

I created a function and attached it to "window" (a trick that doesn't seem to be explain anywhere) which looked like this:
window.SumValue = function (list) {
	var v=0;
	for(var i=0; i<=list.length; i++) {
		v+=list[i].value;
	}
	return v;
}
(I put this in my "Edit Story Javascript" area of my Twine project.)
Then, in attempted to use the function as follows:
<<set $list to [ { name: "Gold", value: 100 }, { name: "Silver", value: 10 }, { name: "Copper", value: 1 } ]>>

<<print SumValue($list)>>

The intended result was to print the number: 111 to the screen when the passage loaded (100 + 10 + 1), instead I get an error that reads, "Error: <<print>>: bad evaluation: Cannot read property 'value' of undefined".

If anyone has some answers for me, even if it's just pointing me in the direction of the documentation on how work with JS and Twine/Sugarcube, I would most appreciate it.

I am using Twine 2 (offline), SugarCube 2.12.1 (local/offline).

Lastly, I would prefer to not have to use widgets to accomplish this, as they are bulky, do not provide a return method, and generally aren't good for internal workings.

Is there a way to access information from the player's system clock in SugarCube?

$
0
0
I'm using Twine 2 and am using SugarCube as Harlowe didn't seem to offer an elegant way of allowing text input from the player (which is a feature I need).

In my game I want to access the current date year on the player's system clock, but can't find a way to do it. WIth Harlowe, there's a (current-date: ) macro, but there isn't an equivalent with SugarCube from what I can tell?

Can anyone help?

How do I add a sidebar in Harlowe?

$
0
0
I would like to be able to add a button that the user can click that will send them to the main menu, one so they can see acknowledgments, and maybe one to close the game.

How To Change Specific Text's Color

$
0
0
How would one go about changing the color of specific text?
Such as one character's text when speaking always being green, and another character's text always being red.

How to make text fade in using the live replace function?

$
0
0
Hi!

For dramatic effect, I'm having it display some text at first, then waiting a couple seconds before adding another paragraph using the live/replace functions. This is how the code looks: https://i.gyazo.com/8ea5d1f5f9262b8d596329cbd1a00b0d.png

It works fine, but I'd like the new text that appears to fade in like the first paragraph initially does, instead of just suddenly popping up. Any idea how this would be possible?

How do I add a sidebar in Harlowe?

$
0
0
I would like to be able to add a button that the user can click that will send them to the main menu.
I know no programming at all; everything I've done in my (first) story, so far, I've had to look up.

Twine 2/Harlowe - How do I give the text links a shadow during hover, rather than a color change?

$
0
0
I know hardly any programming at all; everything that I've done with my story so far, I've had to look up.

Is it possible to create different clickable points on a single image ?

$
0
0
Hello,

I just came across a game made with Twine :
https://banach-tarski.itch.io/8

I'm looking for a way to make an image with multiple clickable points, just as this game (see on page 2)
Could you help me with that ?
Thanks in advance !

[Harlowe] Need help with order of multiple (replace:) macros

$
0
0
I want to have a piece of text change to something else when clicked once, then change to a different thing when clicked again. I understand the basics of this, using hooks and (replace:), but I can't figure out how to control the order that multiple (replace:)s get replaced in. The code below first turns "heard" to "got her message" then to "heard the news", when it should become "heard the news" first and then "got her message".
That's what you first thought when you [heard]<how| last night.

(click: ?how)[ (replace: ?how)[heard the news]]
(click: ?how)[ (replace: ?how)[got her message]]

How do I add a local image file to my story?

$
0
0
I'm using Twine 2 - Harlowe. I know hardly anything about programming. Everything I've done with my story, so far, I've had to look up and copy/paste/edit.

Best way to proof each possible storyline? Harlowe, Twine 2

$
0
0
It's entirely possible that there is no good answer to this question, but I figured it was better to ask just in case.

I've finished a first draft of my choose-your-own-adventure story. It's 266 passages, with three POV characters and five endings. Obviously, there's a lot to proofread. Most of all, I want to make sure the story makes sense no matter which choice readers make, especially since readers can skip from one POV to another. The best way to do this would be to read each possible storyline by itself, to ensure that readers don't miss information even if they don't read every passage.

Is there a good way to read each storyline separately? Or do I just need to figure out all the possible configurations manually?

[Harlowe] Vertically aligning text.

$
0
0
I've been fiddling around with a random generator thing - since all the user does is click the link to generate a new result, I'd like to have that link in a fixed position on the screen, rather than moving about depending upon the length of the current result. Is this possible?

Format Data in Twine to on Mac OS X (Yosemite, 10.10.5)

$
0
0
It looks as if I have the same sort of problem this person did on Windows: https://twinery.org/forum/discussion/4875/cant-install-sugarcube-2-to-twine-2-help

SugarCube 2 was working. I'm not sure when it broke in Twine 2; I've been using Twine 1, and when I realized how to put SugarCube 2 on that, I did so and noticed there was an update. I went to install that on Twine 2 (while it was closed), and now I get "The story format “SugarCube 2 (local/offline)” could not be loaded ()."

I've tried to re-add the file, and I get "The story format at file:///Applications/_game_making/_game-making_applications/Twine/Twine_2/offline_formats/SugarCube-2/format.js could not be added ()."

And now that "The story format “SugarCube 2 (local/offline)” could not be loaded ()." appears in triplicate.

Where do I go to clear out that local formatting data? I suspect the problem is that I changed directories and now have conflicting data, but I'm not sure where to look to check. deleting preferences files and reloading a new copy of Twine 2 didn't help.

Thanks!

How to "Switch Equipment" in Surgarcube?! D:

$
0
0
Infinite, battle tower kind of game. I managed to finish most vital aspects such as stats you can increase in a style similar to Dark Souls and a combat system with not only skills, but also evasion and critical. Now, I'm trying to finally build a Shop where player can buy equipment that they can equip to enhance their stats even further. It's kind of hard to explain so I'll just leave a part of the code here and explain as I go.

This is the Inventory screen
<<if $basic_iron_sword is true>>Iron Sword(+5 Attack) <---It is automatically obtained and automatically equipped when game first start.
A cheap and dull iron sword you bought at a sale.<</if>>
<<if $equiped_basic_iron_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip basic_iron_sword]]<</if>>

<<if $golden_sword is true>>Golden Sword(+7 Attack, +3 Magic Effectiveness)<----Bought from shop
A golden sword you bought from the ghost merchant. He assured you that the thing is tougher than it looks.<</if>>
<<if $equiped_golden_sword is true>>You're already wielding this weapon.<<else>>[[Equip|Equip golden_sword]]<</if>>
[[Back to game|Base]]<----This button returns the player back to their base, the HUB basically. So no infinite <<return>> loop.

Now say, I want to equip the golden sword. So, I click on Equip which takes me to this passage, "Equip golden_sword"
<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<goto "Player Bag">><----This will equip the thing. Set all that stats and then immediately return player back to inventory.

With that example written, my question is. How do I get the Basic Iron Sword to auto-unequip when I switch to another item? I mean, I can obviously do

<<set $playerattack += 7>><<set $playermagicattack += 3>><<set $equiped_golden_sword to true>><<set $equiped_basic_iron_sword to false>><<if $equiped_basic_iron_sword is false>><<set $playerattack -= 5>><</if>><<goto "Player Bag">>

But if I use this method, then it will get out of control real quick if I were to have like 20+ swords. Does anyone know a more, reasonable effective way to accomplish this goal?

Help! And be prepared... (Twine in french)

$
0
0
Hello everyone, i have a BIG problem. Some of my box don't connect to the right box. And even more, when i want to start a debug run, sometimes it start at the wrong box. I try different type of connection like [[ToTheBox]] or (link:"some word")[(goto: "ToTheBox"). The parts who bug are the link to the box "Observer" and "Eliott Street". And the debug run applies to these part to

How to display variables with consistent decimal places and also do math on them?

$
0
0
I've got a game with a wallet that keeps track of how much money the player has, and players can buy things in increments of 25 cents. However, I can't get the wallet to consistently display to two decimal places, so when the player has $1.50 it displays as $1.5.

I've tried using .toFixed(2):
(set: $money to (it-1.75).toFixed(2))

but then when the player tries to buy things they get an "undefined" error and the $money variable doesn't change. It seems that these variables are being interpreted as strings instead of numbers, and that's why the math isn't working, so I tried using Number:
(set: $money to Number((it-1.75).toFixed(2)))

This does the math, but then it goes back to dropping the zeros on numbers like 1.50 (so I'm back to my original problem).

I'm working in Harlowe, and most of the discussion on decimal points seems to be in Sugarcube. Any folks working with decimal places in Harlowe have any advice?

How to display variables with consistent decimal places and also do math on them?

$
0
0
I've got a game with a wallet that keeps track of how much money the player has, and players can buy things in increments of 25 cents. However, I can't get the wallet to consistently display to two decimal places, so when the player has $1.50 it displays as $1.5.

I've tried using .toFixed(2):
(set: $money to (it-1.75).toFixed(2))

but then when the player tries to buy things they get an "undefined" error and the wall. It seems that these variables are being interpreted as strings instead of numbers, and that's why the math isn't working, so I tried using Number:
(set: $money to Number((it-1.75).toFixed(2)))

This does the math, but then it goes back to dropping the zeros on numbers like 1.50 (so I'm back to my original problem).

I'm working in Harlowe, and most of the discussion on decimal points seems to be in Sugarcube. Any folks working with decimal places in Harlowe have any advice?

How do I change the color of the text links when I hover over them?

$
0
0
I'm using Harlowe and Twine 2. This is what I have in the stylesheet for hovering colour:
tw-link:hover {
	color: 990000
}

But, when I hover over the text, the color changes to that cold, light blue.

I know hardly anything about programming. I'm musician/writer, mostly.

How do I format a link tag to take the reader to a web page in a new tab?

$
0
0
This might be kind of confusing. I want a link (already done) that takes the user to a specific webpage (http://www.patreon.com/amolith) but it always opens in the same tab and when it does that, the user loses all their progress with the story so far. This is what I have in the passage:
(link:"here.")[(gotoURL:"http://www.patreon.com/amolith&quot
;)]
I'm using Harlowe and Twine 2
Viewing all 1844 articles
Browse latest View live