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

getting an error when running twine.

$
0
0
this happened when I tried to run twine today. I checked my chrome for that extension and I didn't have one with that ID. Other than that I don't know what to do.
Message: Cannot set property 'id' of undefined
File: unknown
Line: unknown
Column: unknown
Stack:
TypeError: Cannot set property 'id' of undefined at IMPORT_STORY (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:40:12189) at i.(anonymous function) (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:84:5845) at r.value (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:84:4841) at dispatch (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:84:4102) at importStory (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:9:14310) at chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:41:15776 at chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:41:15665 at Object.loadAll (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:41:15822) at chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:52:31866 at Object.init (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:53:101)

How can I send the player to a passage using an onclick Event?

$
0
0
I'm using Twine 2.1.3 and SugarCube 2.18.0.

I have created a div-element as a pop-up window and am allowing the player to close this div element with an ondblclick Event:
<script>
function closeThis() {
    document.getElementById("pop-up").style.visibility = "hidden";
}
</script>

<div id="pop-up" class="thumbs" ondblclick=closeThis()>
- Double-click to close -
</div>

How would I have to alter the code, if I also want to send the player to a specific passage upon double clicking the div element? I have found some topics talking about using JavaScript to jump to specific passages, but I can't seem to get this to work.

No auto passage creation in 2.1.3

$
0
0
When i write new passage name Twine should create new passage linked to first one, but it doesn't.
14329840.png

Downloaded 2.1.3 for Linux; no idea what to run

$
0
0
I'm an old, returning user, and Twine 2.0 told me to download a new version, so I did, and I get the following when I run ls -l in the directory it's in:
-rwxr-xr-x 1 xander xander  6873784 May  1 20:25 chromedriver
-rw-r--r-- 1 xander xander  1870210 May  1 20:25 credits.html
-rw-r--r-- 1 xander xander 10130464 May  1 20:25 icudtl.dat
drwxr-xr-x 2 xander xander     4096 May  1 20:25 lib
drwxr-xr-x 2 xander xander     4096 May  1 20:25 locales
-rwxr-xr-x 1 xander xander   704360 May  1 20:25 minidump_stackwalk
-rwxr-xr-x 1 xander xander 14177800 May  1 20:25 nacl_helper
-rwxr-xr-x 1 xander xander     9766 May  1 20:25 nacl_helper_bootstrap
-rwxr-xr-x 1 xander xander  3737136 May  1 20:25 nacl_irt_x86_64.nexe
-rw-r--r-- 1 xander xander   334730 May  1 20:25 natives_blob.bin
-rw-r--r-- 1 xander xander   517488 May  1 20:25 nw_100_percent.pak
-rw-r--r-- 1 xander xander   818862 May  1 20:25 nw_200_percent.pak
-rwxr-xr-x 1 xander xander 10384424 May  1 20:25 nwjc
-rwxr-xr-x 1 xander xander   211256 May  1 20:25 payload
-rw-r--r-- 1 xander xander     7248 Jun  8 18:02 payload.json
drwxr-xr-x 2 xander xander     4096 May  1 20:25 pnacl
-rw-r--r-- 1 xander xander 16963392 May  1 20:25 resources.pak
-rw-r--r-- 1 xander xander  1280916 May  1 20:25 snapshot_blob.bin
-rwxr-xr-x 1 xander xander  6970132 May  1 20:26 Twine

What am I supposed to execute? I tried clicking on everything and nothing started the application.

Can you use random events to change tags.

$
0
0
I was wondering if you would be able to say have a random number and then if the number was say, 1 then add tag happy.
I tried using the following code but it came up with this error: "Error: <<if>>: assignment operator found within <<if>> clause (perhaps you meant to use an equality operator: ==, ===, eq, is), invalid: $random="1" add tag happy"
<<print random(1,2)>>
<<if $random="1" add tag happy>><</if>>

Broken links that appear randomly and then disappear

$
0
0
Hello!

I have made a Twine (in the online Harlowe format) that is an interactive navigation of a journal section about participatory performance (niche! but hopefully interesting for people reading the journal). As part of this I've made a random link which looks like this (for instance):

[[Surprise me!->(either: "AHRpractice", "Adam theory", "Jamie theory", "Outi theory", "Emma practice", "Russell practice", "Will practice", "Sonia practice", "Matt practice")]]

However, what I've noticed has started happening is that sometimes when you see this link it works fine and sometimes it's broken. And if it is broken, you can click on a different link, then go back a page - and the link that was broken before then shows as working normally!

What can I do to fix this? Does it have anything to do with the fact that when I add a link with [[]] - it creates a little line with a red cross at the end?

Many thanks!!

Astrid

sugarcube 2: What is the difference between widgets and macros?

$
0
0
What is the difference (if any) between widgets and macros?

Thank you!

sugarcube 2: referencing widget args with javascript?

$
0
0
Is it possible to reference the args of a widget using javascript in that widget? How about if say, the first arg ($args[0]) is an array? I've been trying to figure out how to do this, but can't find anything explaining that.

Thank you!

A link that determines whether or not you make to a new passage.

$
0
0
How to enter new passage while in story mode but not before I must do something that will trigger this entering of the new passage?

e.g. Go through a certain door so the story can advance, but after I click a certain link so that I can be allowed to go through the door.

I'm having trouble with the usage of

$
0
0
Hi there.

I'm a complete newbie in twine 2 and SugarCube 2.18.0, and I've just begun using the arrays and <<for>>, so please understand my helplessness.

I've been trying to create a table associating the name of four characters with a color, which I've been successful at.
This is the code I've used:


<<set $name_stone to [
["Spring", "Summer", "Autumn", "Winter"],
["green", "yellow", "red", "blue"]
]>>


My problem starts here. At the beginning of the game I give the player the option of choosing one of the four names, which becomes immediately the variable $name1.
After that, I want to distribute the remaining three names to the NPC that appear during the game.
So, if you were to choose the name "Autumn", the other three would become "Spring", "Summer", and "Winter" (the order of which being unimportant).
Result: $name1 = Autumn, (and for example) $name2 = Summer, $name3 = Winter, $name4 = Spring

The thing is, I've been trying to do this with a for cycle that establishes these variables according to the player's name choice.
I tried with this code:


<<set $counter == 2>>
<<for _i to 0; _i lt $name_stone.length; _i++>>
<<capture _i>>
<<if $name1 == $name_stone[0][_i]>>
<<set $stone1 = $name_stone[1][_i]>>
<<set $flag = 0>>
<</if>>
<</capture>>

<<if $name1 !== $name_stone[0][_i] and $flag !== 0>>
<<capture _i>>
<<if $counter == 2>>
<<set $name2 = $name_stone[0][_i]>>
<<set $stone2 = $name_stone[1][_i]>>
<<set $flag = 1>><</if>><</capture>>

<<capture _i>>
<<if $counter == 3>>
<<set $name3 = $name_stone[0][_i]>>
<<set $stone3 = $name_stone[1][_i]>>
<<set $flag = 1>><</if>><</capture>>

<<capture _i>>
<<if $counter == 4>>
<<set $name4 = $name_stone[0][_i]>>
<<set $stone4 = $name_stone[1][_i]>>
<<set $flag = 1>><</if>><</capture>>

<</if>>
<<if $flag == 1>> <<set $counter++>><</if>>
<</for>>




Now, I know this is probably really rough, and there are a thousand better ways to do it, but I keep getting an error.

I try and print the variables after this section of the code, to see if it worked, so:
<<print $name1>> <<print $stone1>> <<print $name2>> <<print $stone2>> and on and on...

but I always get an error. It prints the $name1 correctly, and the everything else wrong.

Could anyone please help me out? Show me a better way, or explain what I did wrong?

Thanks! :)

Probably already answered: got a die/dice, want to display button depending on result

$
0
0
This is what I got, a friend helped me out so button could only be pressed once, I actually have no clue on html
Spoiler:
<!DOCTYPE html>
<html>
<body>
<h1 ALIGN=center>
<button id="boton" onclick="myFunction()">Try to hit</button>
<h2 ALIGN=center id="demo"></p ALIGN=center>
<script>
function myFunction() {
document.getElementById("boton").disabled = true;
var x = Math.floor((Math.random() * 20) + 1);
document.getElementById("demo").innerHTML =x;
if ( x <= 5 ) {
document.getElementById("demo").innerHTML += "<p>You fail your attack";
} else {
document.getElementById("demo").innerHTML += "<p>You hit";
}
}
</script>
</h1 ALIGN=center>
</body>
</html>
the text was something different but this is just fine for you guys to understand what I want to do :P
I tried replacing "You fail your attack" with "[[You fail your attack|Fail ]] but, as you can conclude, no result

It would be awesome too to keep the random number hidden, and yes, I know there are better ways to do this but, those were too hard for me, sorry.

So, if anyone is willing to kindly help me, thanks in advance :D

links are not created

$
0
0
I have used the program in the past about a year ago

I been using twine for the past few days using windows, 64 bit. and when I make a link it just shows a x, then I haft to manually create a link for it to connect. is this intentional or a bug

Create an interactive textbox using Harlowe?

$
0
0
It can be done with sugarcube, but I wonder if it is possible to create an interactive textbox with Harlowe in which the user enters values, and gets feedback - eg too low, too high, correct?

Sugarcube Dialog Box Abilities

$
0
0
Is it possible in Sugarcube 2.18 to use a <<link>> or <<click>> to open a dialogue box that then allows for further options? Such as clicking on a rock, which opens the dialog box and then having the options of examining the rock or placing it in your inventory? If so can that be placed within a script that then removes that option should a player return to that passage?

How to "hide" your HTML?

$
0
0
Hello, everyone, I'm creating a game on Twine2 with SugarCube2, I have plans for commercial use in the future but right now I'm hosting an early version of the game on Amazon Webservices. The problem is that if I download the HTML with a simple double click and save page as... I can open the file on twine.

Since this game will be commercial, I don't like the idea of someone downloading it and selling it.

How can I hide the HTML from the public version?

Thank you!

how do you add to the value of a random variable

$
0
0
I have a set of variables ( str dex con wis...). I want to have an event that adds to or subtracts from a random stat.

Best way how to create an inventory/stats page accesible from anywhere in the game?

$
0
0
Hello,

I am new to Twine and I really like it! I started learning the Sugarcube 2.18 version (current version of Twine) but I have hit a wall now and can’t find a good tutorial for what I want to do.

In the story I am writing I'd like the player to have the ability to move from any “room” to the inventory/stats screen. I thought of how to do it and the best would probably be some sort of use of <<goto>>? However no matter what I did it won’t work for me.

Could I get a good, working example of how to use goto macro to move to a room called Invetory?

Allternatively I thought that instead of putting up a link in every room I could create another panel on the left side of the window – under save and restart. Is that possible? I googled and looked everywhere but couldn’t find any information on how to do that.

Thank you in advance for any ideas and hints! 

Alfa

The (if:) command should be assigned to a variable or attached to a hook.► Macros like this should a

$
0
0
I have limited education on coding so bare with me on the lingo as I will probably use it incorrectly, but I get this error message all the time on what seems like very basic code statements involving if and else. Copied and pasted below is one of many pieces of code I have that gives the same error, feel free to let me know whats going on here and in general so I can apply to other code as well please.

I am basically trying to set up a (if your Wisdom score is 9 or higher, a link will be displayed to take you to the 'create a cleric' passage, else, text stating that the class is unavailable is displayed).

The error occurs after the line ...
Cleric ~ (if: $Wis>8)(set: $WisTemp1= "Available")(else:)(set:$WisTemp1= "Unavailable")

Code for whole passage is as follows:

{
(set: $Str=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $Int=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $Wis=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $Dex=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $Con=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $Cha=((random:1,6)+(random:1,6)+(random:1,6)))
(set: $StatArray=(a:$Str,$Int,$Wis,$Dex,$Con,$Cha))
(set: $PP=0)
(set: $GP=(((random:1,6)+(random:1,6)+(random:1,6))*10))
(set: $EP=0)
(set: $SP=0)
(set: $CP=0)
}
**CHARACTER SHEET**

**Attributes**
STRENGTH: (print:$Str)
INTELLIGENCE: (print:$Int)
WISDOM: (print:$Wis)
DEXTERITY: (print:$Dex)
CONSTITUTION: (print:$Con)
CHARISMA: (print:$Cha)

**Coins**
PP: (print: $PP)
GP: (print: $GP)
EP: (print: $EP)
SP: (print: $SP)
CP: (print: $CP)

**Class Choices**

Cleric ~ (if: $Wis>8)(set: $WisTemp1= "Available")(else:)(set:$WisTemp1= "Unavailable")

Elf ~
Dwarf ~
Fighter ~
Halfling ~
Magic-User ~
Thief ~

[[Reroll Character|Roll a Character]]

Restart and Save options in the Sidebar

$
0
0
Hello!

I'm working with Sugarcube 2.18, and I've been trying to work on the style of my sidebar, but I've come across some obstacles.
First of all, is it possible to remove the options of "Restart" and "Save" from the sidebar, without compromising any other information displayed there?

Also, is it possible to make the sidebar's background color transparent? So, if I had a background image for each passage, the text in the sidebar would just appear over it...

Sorry if these are stupid questions, I'm kind of new at this.
Thanks! :)

SugarCube 2 How to use variables from Sugarcube in JS functions?

$
0
0
Hello.
I want something like this:
::StoryInit
<<set $TRACKING["ENEMY_1"] = 40>>
<<set $TRACKING["ENEMY_2"] = 50>>

<<set $enemy["ROOM_1"] = "ENEMY_1">>

<<set $hero_stealth = 10>>
<<set $hero_location = "ROOM_1">>

::Main
You can <<link `"hide (" + get_hide_odds() + "%)"` "Hide"`>><</link>>.

::JS
window.get_hide_odds = function() {
  var odds = 0;
  stealth = 100 - $TRACKING[$enemy[$hero_location]] + $hero_stealth;
  return odds;
}
But "$TRACKING[$enemy[$hero_location]]" and "$hero_stealth" doesn't work in JS. They are not defined.
How can I use variables from SugarCube in JS? I need many small functions like get_hide_odds(). And I want use them without arguments like get_hide_odds(enemy,hero). Is it possible? Or I need big structure like "$game" with properties "enemies", "hero", "rooms" etc? And use it like get_hide_odds($game).
Maybe there is better organization of code for my problem (but without fanatism). Thank you.
Viewing all 1844 articles
Browse latest View live