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

Display "moving" string

$
0
0
Sooo, getting back to Twine, and I wanted to add some flair to my text.
I'm trying to substring a string, and increment the min & max values for the substring by one, and print the substring (Essentially it'd look like the text on car-stereos "Hello this"->"ello this "->"llo this i" etc)
Here's what I got so far
<span id="warning"></span>
<<silently>>
	<<set $min = 0, $max = 12>>
	<<repeat 100ms>>
		<<set $warn = $warnings.substr($min, $max)>>
		<<set $min++, $max++>>
		<<if $max gt 185>> //Hardcoded string-length
			<<set $max = 12, $min = 0>>
		<</if>>
		<<replace "#warning">>$warn<</replace>>
	<</repeat>>
<</silently>>
It works, buuut it behaves oddly. For some reason, the gap between min & max becomes larger, making the length of the substring longer, the longer it runs, until $max hits the if-statement, where the substring starts shrinking. Once the substring's length is 0, it repeats again.

Problem with qualified names

$
0
0
Hi, all!

I use Twine 2.1.3 and Sugarcube 2.18.0, and I have these two definitions:
<<set $spider = {
    name: "Araignee"
}>>
<<set $C01 = {
    opponent: $spider
}>>

I thought that <<print $C01.opponent.name>> would print "Araignee", but it doesn't. I'm told that opponent is undefined. How come?

Thanks in advance.

Insert audio src

Return to last passage from inventory in Sugarcube 2.18.0

$
0
0
Using Twine 2 and Sugarcube 2.18.
Currently I have an inventory and several other side tabs i'd like the players to be able to access at anytime. I have them all tagged as "Menu", I've tried several different solutions from the forums but none have been formatted correctly for this version of Sugarcube. I would like to have a button or simple return link on each of my sidebar pages that will return the player to the last passage that wasn't tagged "Menu". As of now the game is manageable with the use of the back and forward arrows, but i'd really like to remove those eventually, if at all possible.
Thanks in advance!

Unable to save as zip/html file

$
0
0
Hey guys,

I'm using twine online on a Macbook Pro and have finished my story, however when i click publish to file it just opens up a new window with what looks to be like lots of text coding. I have tried to save the page and upload it here.

How do I save it as an html/zip file? As you may have realised, I'm not the most tech-savvy person and I apologize.

Issue Converting from Harlowe 1.2.4 to Harlowe 2.0.1

$
0
0
Hi,

I have a simple but frustrating problem. I really like to use underscores in my passage names (for example, "introduction_1"), and this works just fine in Harlowe 1.2.4. I am trying to convert over to 2.0.1, but doing so makes Twine think all my references to passages are clumped temporary variables.

(So if I reference that passage, "introduction_1" in a (goto:) macro, it thinks I am trying to reference a temp variable called "_1" which I guess just resolves to null.

Do I have to go through my whole story and add little apostrophes before every single underscore? Or is there an easier way to avoid this problem?

Thanks!
Lily

HELP! I can't center my choices from the css stylesheet.

Twine 2.1.1 closed suddenly

$
0
0
Hello, everyone. Well, it's my first time post here. Actually, each time I want to open my Twine, that just upgraded to 2.1.1, the program would appear for few second, then unexpectedly crushed. That never happened to me in previous Twine 2 version. Even I changed the windows compatibility, it's not working. Any solution? Thanks.

Btw, I am using Windows 10 Pro Edition 64 bit.

[Harlowe][Twine2] Is it possible to set a value in a Datamap to a reference to a different Variable?

$
0
0
I'm starting to learn Twine, and I thought I'd go about making a small framework to familiarize myself with the system.
What I'm trying to do is set up a Datamap called "Door" that has a key/value pair of "openCondition",$doorUnlocked.
Now what this does is set "openCondition" to whatever $doorUnlocked was when "Door" was created. That's fine, but what I need is "openCondition" to be a reference to $doorUnlocked so that when $doorUnlocked changes, "openCondition" changes as well.

Is this something that can even be done in Harlowe? If so how?
If not, does it work in Sugarcube or any other format?

Thank you for your time.

Twine 2.1.3 not working

$
0
0
Hi all,
I've just downloaded the new Twine, 2.1.3 but when I open it I get a blank application (see attached file)
Any ideas?

Help!! i can't share!

$
0
0
when i click 'publish to file' it creates a new tab with the game but it won't work on other computers! also, this is on version 2.1.3

Can i 'replace' a link with another link?

$
0
0
I'm trying to make something where students can match a word and its definition. I have it so that they can click on a word (= a link) and this makes the word appear somewhere else. The idea is that after that they will be able click on the right definition. But I want to give them the option to 'take back' the word, because maybe the want to start with another one or made a mistake.

The problem is finding a way to make the word appear in its initial place. I'm not sure how i can tell Twine which span (the words are in spans) to target.

This is my code so far:

<<set $word = [ "First word", "Second word" ]>>

<span id="choice"><<print " ">></span>
<<nobr>>
<<link "take back">>
<<replace "#choice">>
<<print " ">>
<</replace>>
<<replace "#word0">>
<<link "$word[0]">>
<<replace "#word0">>
<<print " ">>
<</replace>>
<<replace "#choice">>
<<print "$word[0]">>
<</replace>>
<</link>>
<</replace>>
<</link>>
<</nobr>>

<div id="word">
<span id="word0"><<link "$word[0]">><<replace "#word0">><<print " ">><</replace>><<replace "#choice">><<print "$word[0]">><</replace>><</link>><<set $temp = 0>></span>
<span id="word1"><<link "$word[1]">><<replace "#word1">><<print " ">><</replace>><<replace "#choice">><<print "$word[1]">><</replace>><</link>><<set $temp = 1>></span>

Can you help me?

I thought i could solve the problem by adding if statements. I tried saying that <<if $temp === 0>> the link would replace the word0 span with the original word (word0) and if $temp === 1 it would replace the word1 span with word1 etc, but that produced an error (child tag <</link>> was found outside of a call to its parents macro <<link>>.

I also tried substitution the 0 in $word[0] with $temp. That worked, but i can't replace the 0 in #word0 by a variable.

Can you use Twine on iPads?

Harlowe Fname macro

$
0
0
I can't seem to find out what Fname does or what it is, no matter how hard i try. S ive turned to the Forum. Can any of explain to me what Fname does? P.S Im just learning code

Unexpected Token True?!?

$
0
0
I tried looking it up like five times, but Google always takes 'unexpected token' and finds things about 'unexpected token illegal,' which is not my problem.
Let's say I have a passage that says:
(set: $variable to false)(set: $othervariable to false)(set: $anothervariable to true)``Blah blah blah story stuff.``
Then I click Play because I need to check if something works...
Why would the "Unexpected Token True" error show up? I'm trying to solve a different problem and it's incredibly irritating to keep coming across this. I can't think of anything that I could have messed up.

Change colour of visited link Harlowe 2.0.1

$
0
0
I'm an absolute newbie to Twine, and also CSS in general. I'm cobbling together how to use Stylesheets from guides all over.
Currently, this is what my stylesheet contains:

<code css>
body { background-color: #f5fff0; } tw-passage { color: #17cc5a; } tw-link { color: #0bec5e; } tw-link:visited { color: #08963d; }
</code>

While the text colour of the passage does change according to values entered, and so does the link colour, the
tw-link:visited { color: #08963d; } AND { background-color: #f5fff0; } statements have no effect.

Can anyone tell me what's wrong with the syntax? Or where I'm going wrong and what to do about it?

Apologies if the mistakes happen to be very stupid, I'll do my best not to repeat them

It seems to have a bug with the Brazilian Portuguese translation

$
0
0
Hello! When I create two links from an initial location, only the first one shows up. The other doesn't appear as a link and never creates a room, appearing only as a red x. As it doesn't happen with the English language chosen I suppose the problem is with the translation. Have anyone noticed something like that already? Am I doing something wrong? Thanks.

How do you add text to another passage with a link within a different passage?

$
0
0
I'm using Twine 2.0 and Harlowe.

In my game the character "downloads" a link onto their tablet giving them diagnostic information. I was wondering how to write text or better yet make a new link appear on the tablet by the user clicking a button within the passage they're on.

typed.js - typewriter how to remove the cursor?

$
0
0
Hello!

I'm using Twine 2, sugarcube 2.18.0 and I'm using "typed.js integration module [ZIP archive]" to display a type-writing-like appearance for my passages. The complete JS and CSS can be found in the spoiler below...

JS
!function(){"use strict";function getInlineOptions(classNames){var match,options={},typedRe=/^typed(?:-(\w+))+\b$/,parseRe=/-(speed|delay)(\d+)\b/g;if("typed"!==classNames){classNames=classNames.toLowerCase().split(/\s+/);for(var i=0;i<classNames.length;i++)if(typedRe.test(classNames)){for(;null!==(match=parseRe.exec(classNames));)switch(match[1]){case"speed":options.typeSpeed=+match[2];break;case"delay":options.startDelay=+match[2]}break}}return options}function typedCallbackFactory(el,callback){return function(){var $outer=jQuery(el),$inner=jQuery('<div class="typedjs-text-wrapper" style="display:block;position:absolute;left:0;top:0;"><span class="typed"></span></div>'),$source=$outer.children('[class|="typed"]'),options=jQuery.extend({typeSpeed:40,startDelay:400},getInlineOptions($source.attr("class")),{strings:[$source.html()]});"function"==typeof callback&&(options.callback=callback),$outer.append($inner),$inner.children().typed(options)}}postrender.typedSetupHandler=function(content){jQuery('[class|="typed"]',content).addClass("typed").css("visibility","hidden").wrap('<div class="typedjs-outer-wrapper" style="display:block;position:relative;"></div>')},postdisplay.typedAnimationHandler=function(){for(var $elements=jQuery("#passages .typedjs-outer-wrapper"),callback=null,i=$elements.length-1;i>=0;--i)callback=typedCallbackFactory($elements,callback);"function"==typeof callback&&callback()}}();
/*! Typed.js | (c) 2014 Matt Boldt | MIT License */
!function(t){"use strict";var s=function(s,e){this.el=t(s),this.options=t.extend({},t.fn.typed.defaults,e),this.isInput=this.el.is("input"),this.attr=this.options.attr,this.showCursor=this.isInput?!1:this.options.showCursor,this.elContent=this.attr?this.el.attr(this.attr):this.el.text(),this.contentType=this.options.contentType,this.typeSpeed=this.options.typeSpeed,this.startDelay=this.options.startDelay,this.backSpeed=this.options.backSpeed,this.backDelay=this.options.backDelay,this.stringsElement=this.options.stringsElement,this.strings=this.options.strings,this.strPos=0,this.arrayPos=0,this.stopNum=0,this.loop=this.options.loop,this.loopCount=this.options.loopCount,this.curLoop=0,this.stop=!1,this.cursorChar=this.options.cursorChar,this.shuffle=this.options.shuffle,this.sequence=[],this.build()};s.prototype={constructor:s,init:function(){var t=this;t.timeout=setTimeout(function(){for(var s=0;s<t.strings.length;++s)t.sequence[ s ]=s;t.shuffle&&(t.sequence=t.shuffleArray(t.sequence)),t.typewrite(t.strings[t.sequence[t.arrayPos]],t.strPos)},t.startDelay)},build:function(){var s=this;if(this.showCursor===!0&&(this.cursor=t('<span class="typed-cursor">'+this.cursorChar+"</span>"),this.el.after(this.cursor)),this.stringsElement){s.strings=[],this.stringsElement.hide();var e=this.stringsElement.find("p");t.each(e,function(e,i){s.strings.push(t(i).html())})}this.init()},typewrite:function(t,s){if(this.stop!==!0){var e=Math.round(70*Math.random())+this.typeSpeed,i=this;i.timeout=setTimeout(function(){var e=0,r=t.substr(s);if("^"===r.charAt(0)){var o=1;/^\^\d+/.test(r)&&(r=/\d+/.exec(r)[0],o+=r.length,e=parseInt(r)),t=t.substring(0,s)+t.substring(s+o)}if("html"===i.contentType){var n=t.substr(s).charAt(0);if("<"===n||"&"===n){var a="",h="";for(h="<"===n?">":";";t.substr(s).charAt(0)!==h;)a+=t.substr(s).charAt(0),s++;s++,a+=h}}i.timeout=setTimeout(function(){if(s===t.length){if(i.options.onStringTyped(i.arrayPos),i.arrayPos===i.strings.length-1&&(i.options.callback(),i.curLoop++,i.loop===!1||i.curLoop===i.loopCount))return;i.timeout=setTimeout(function(){i.backspace(t,s)},i.backDelay)}else{0===s&&i.options.preStringTyped(i.arrayPos);var e=t.substr(0,s+1);i.attr?i.el.attr(i.attr,e):i.isInput?i.el.val(e):"html"===i.contentType?i.el.html(e):i.el.text(e),s++,i.typewrite(t,s)}},e)},e)}},backspace:function(t,s){if(this.stop!==!0){var e=Math.round(70*Math.random())+this.backSpeed,i=this;i.timeout=setTimeout(function(){if("html"===i.contentType&&">"===t.substr(s).charAt(0)){for(var e="";"<"!==t.substr(s).charAt(0);)e-=t.substr(s).charAt(0),s--;s--,e+="<"}var r=t.substr(0,s);i.attr?i.el.attr(i.attr,r):i.isInput?i.el.val(r):"html"===i.contentType?i.el.html(r):i.el.text(r),s>i.stopNum?(s--,i.backspace(t,s)):s<=i.stopNum&&(i.arrayPos++,i.arrayPos===i.strings.length?(i.arrayPos=0,i.shuffle&&(i.sequence=i.shuffleArray(i.sequence)),i.init()):i.typewrite(i.strings[i.sequence[i.arrayPos]],s))},e)}},shuffleArray:function(t){var s,e,i=t.length;if(i)for(;--i;)e=Math.floor(Math.random()*(i+1)),s=t[e],t[e]=t,t=s;return t},reset:function(){var t=this;clearInterval(t.timeout);var s=this.el.attr("id");this.el.after('<span id="'+s+'"/>'),this.el.remove(),"undefined"!=typeof this.cursor&&this.cursor.remove(),t.options.resetCallback()}},t.fn.typed=function(e){return this.each(function(){var i=t(this),r=i.data("typed"),o="object"==typeof e&&e;r||i.data("typed",r=new s(this,o)),"string"==typeof e&&r[e]()})},t.fn.typed.defaults={strings:["These are the default values...","You know what you should do?","Use your own!","Have a great day!"],stringsElement:null,typeSpeed:0,startDelay:0,backSpeed:0,shuffle:!1,backDelay:500,loop:!1,loopCount:!1,showCursor:!0,cursorChar:"|",attr:null,contentType:"html",callback:function(){},preStringTyped:function(){},onStringTyped:function(){},resetCallback:function(){}}}(window.jQuery);
(I know that was a lot)




CSS

.typed, .typed-cursor {
font-family: monospace, monospace;
color: white;
}
.typed-cursor {
opacity: 1;
-webkit-animation: blink 0.7s infinite;
-moz-animation: blink 0.7s infinite;
animation: blink 0.7s infinite;
}
@keyframes blink {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
@-webkit-keyframes blink {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
@-moz-keyframes blink {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}

My problem is that when trying to utilize the different speed-rates at which the typing goes, the cursors don't disappear after it's finished. I was wondering how I could stop the cursor manually?

Pictures -
https://puu.sh/w1pFn/3ac206cf1e.png
https://puu.sh/w1pHH/20633079df.png

Typerwriter Transition - help needed

$
0
0
Hello!

I've been trying to do some research on figuring out the typerwriter transition for my twinery story, in order to ad the special effect needed to carry out the plot. I've looked into numerous websites and forum posts, such as (https://www.glorioustrainwrecks.com/node/5161), (http://lea.verou.me/2011/09/pure-css3-typing-animation-with-steps/), and (https://drafts.csswg.org/css-animations-1/#animation-timing-function)... however, the only thing that worked with twine 2 on sugarcube 2, has seemed to be only glorioustrainwrecks but I keep receiving a fatal error message. I was wondering if anyone knew the answer to the problem? Thanks!!


Here's some pictures.

The format used: https://puu.sh/vZEl4/7c51391627.png
The error: https://puu.sh/vZEl4/7c51391627.png
Viewing all 1844 articles
Browse latest View live