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

CSS not working in most basic of scripts, even when copy-pasted from tutorials

$
0
0
<n00b question warning>

This is my first day using Twine, so I copy-pasted some CSS from tutorials just to see how it works on a sample script I drummed up. Screenshots of the CSS and the final product are attached. When I hit "Play" or save off an HTML file and open it, the CSS doesn't seem to have worked.

I've tried variations of the CSS (used hex codes instead of color names, taken out everything except a text color change, added link-specific color changes) and I can't seem to get any styling to change. What am I missing?

I'm using the web version of Twine, on a Mac (OSX Sierra), and testing in Chrome, Firefox and Safari.

Beginner Question About Switch Case

$
0
0
Hi Guys,

New to Twine and trying out the different builds. Decided to stick to Sugarcube and try to make it work. I got a little problem making Switch Case work.

So to start, I'm trying to implement a haunted mansion, with sanity being one of the ongoing stat of the reader.

I'm testing the switch functionality by putting it in the second passage of the story. At the start of the passage, sanity will drop. I will then go to a different room (passage) then back to this one.

This is the switch code.

<<switch $sanity>>
<<case lte 80>>
You feel slightly faint. Is it something in the air?
<<case lte 60>>
Your head starts to throb. There is a slight numbing pain in your brain.
<<case lte 40>>
The headache seems to be getting worse. You feel liquid oozing from your right nostril. You dab it with your fingertip. Is that blood?
<</switch>>

First of all, I know the code is wrong. It should go in ascending order. But the weird thing I realised was that each case only triggers one and then never again.

So sanity =
80 - slightly faint
70 - nothing happens
60 - numbing pain
50 - nothing happens
etc.

Is the function supposed to work this way?

Cached Sound not working when published online

$
0
0
Hi All! I am very new at all of this so forgive my ignorance.

I am making a story on Sugarcube and have been using the Cached in storyinit to get sounds. When I publish to file and play it the sound works. But when I publish it online on Philomela it does not work.

Currently the sound source is in my desktop. I saw posts where people upload the sounds on dropbox or somewhere along those lines but I am confused as to how to code this..

Here's what mine looks like (sources are local)

<<cacheaudio "officesound" "sound/220373__psnflute1984__copy-machine-at-work.mp3">>

How can i code this if I were to have my files on dropbox.. or zip them.. any help will be appreciated.

Thanks

Strange beginner question.

$
0
0
Hi! I've messed around a bit with Twine before, and decided to do it again now that 2.1 is available. After installing it and launching it I'm faced with this, however;

dd357aea7a.png

Yep, that's it. If I press "Twine" I can click on "Show library" or "Quit", though nothing happens if I do so. "Edit" just have options of cutting, pasting etc. I can't do anything, not even shut the program down except with the task manager. I've tried reinstalling it, and I'm using the correct version (the Win 64, as that is my OS. I've tried the Win 32 version as well, though).

[Twine 2] [Sugarcube 1] Creating and Calling a Function passage. Possible?

$
0
0
As I believe TheMadExile can attest, I have absolutely NO experience with JavaScript, so I was wanting to do this as a passage, because I can already see how the code should be shaped in Twine/Sugarcube.
I want to have some code that will check to see if certain variables are true (equipped inventory items in this case), and return a variable for the passage. This way, I can have events which will be able to check and describe equipped items, and possible react to them, without having a huge pile of If/Else statements clumping up EVERY SINGLE TIME I want to pull this off.

I wouldn't worry too much about a few extra If Trees, but since I will almost certainly add more equipable items as I work, it would be nice to have a single function somewhere to add them to, instead of having to go hunting through every passage that does a clothes check.

EDIT: Is there some perfectly simple method of doing this that I'm completely missing?

How do I shrink the margin, expand text area?

$
0
0
I'd really like to expand the viewing area for text, meaning shrink the sidebar or margin area. I removed the sidebar in the "Edit Story Stylesheet" section, but the margin seemed to stay the same width, at least to my eye. On my phone it looks like too much wasted space in both the right and left margins, i.e, the text area could be wider. I know it's default but I'd like to change it. Thanks.

Twine v. 2.0.11
Harlow v. 1.2.2

[Snowman] Minor Stylesheet Issue

$
0
0
Hello! It's been a long time since I last posted, I hope I'll still be able to find some help with this.

I'm having a minor visual stylesheet issue with Snowman. Everything works fine, but there is a size discrepancy between the Choice Button and the Name Input Button I'm using. (Shown below via Imgur.) The Top button is the Name Input button and the second is the Choice Button.

5rMk3Fq.png

I'd like to have the Stylesheet code for the Name Input button resemble the Choice button Stylesheet, but am unsure how to correct this. The Name Input button won't move any further left when I adjust the size, and the Stylesheet code for both buttons differs in how they're built; so it's harder to match their height and width.

Here's the Stylesheet for the Choice Button
#choices {
	list-style: none;
	padding: 0;
	border: 1px solid #bbb;
}
#choices li {
	margin: 0;
	padding: 0;
}
#choices li:not(:first-child) {
	border-top: 1px solid #bbb;
}
#choices li a {
	display: block;
	margin: 0;
	padding: 0.5em 0.8em;
	border: none;
	text-decoration: none;
	font-size: 75%;
}
#choices li a:hover {
	color: #fff;
	background-color: #718389;
}

And here's the Stylesheet for the Name Input button.
#nameinput button {
  display: block;
	width: 100%;
	border: 1px solid #bbb;
	background-color: inherit;
	line-height: inherit;
  	padding: 0.5em 0.8em;
	text-align: left;
  	font-size: 85%;
  
}
#nameinput button:hover {
	color: #fff;
	background-color: #718389;
}

I'd appreciate any help offered on this little problem. Thanks! If you need any more information, I'd be happy to provide it.

Option list sugarcube 2?

$
0
0
Hi,
I have used the online version of Sugarcube 1 for a while, and it has been great. Recently, Sugarcube 2 was released for the online version, which was even better, and I have used that since. However, in Sugarcube 2 there is no optionlist macro. I looked this up on the forum, and I heard something about a "setting API"? I was a little confused on this- can someone walk me through how to use this, or at least point me towards a source of how to use it? Thanks!

"display" question

$
0
0
Hi,

I work with Twine 2.1.1 and sugarcube 2.14

To make some passage lighter, I made a "display passage".

The purpose of this "display passage" is to show some image depending of a rand.
Here is the code :
<<if $Woman>><<if $WS2==1>>[img[Pics/NPC/Random/NW1.jpg]]<<set $Woman to false>><<elseif $WS2==2>>[img[Pics/NPC/Random/NW2.jpg]]<<set $Woman to false>><<elseif $WS2==3>>[img[Pics/NPC/Random/NW3.jpg]]<<set $Woman to false>><</if>><<else>>[img[Pics/Town/Streets/Main Street.jpg]]<</if>>

<<if $Schoolgirl>><<if $SG2==1>>[img[Pics/NPC/Random/NSG1.jpg][$Schoolgirl to false]]<<elseif $SG2==2>>[img[Pics/NPC/Random/NSG2.jpg][$Schoolgirl to false]]<<elseif $SG2==3>>[img[Pics/NPC/Random/NSG3.jpg][$Schoolgirl to false]]<</if>><<else>>[img[Pics/Town/Streets/School street.jpg]]<</if>>

The fact is that "$Woman" is in a different passage than "Schoolgirl". So if I call the "display passage", I see two pics.

So my question is : Is there a way to call only a part of a "display passage"?
I look in the sugarcube documentation, and I don't find it.

Thanks.

[SugarCube 2.14 Twine 2.1] Printing a widget into a passage using a macro defined in JS.

$
0
0
Hey there,

I'm using:

Twine 2.1
SugarCube 2.14

I'm trying to call a widget inside my JS function to print out actions that would apply to transferable game items (basically moving an item from one container to the other). This would solve a problem to which I find no work around at the moment in sugarcube and it would allow me to stream line moving items from containers to other containers and between NPC characters and the player (later on I would want to turn my containers into objects with their own names, inventory, size, etc.).
var $list = $(document.createDocumentFragment());
$list.append('<<transferContainerItemToPlayer' +' $' + container_name + '\"' + item.id + '\"' + ">>").append('<br>');

Widget code that I'm trying to call from "InventoryManagmentWidgets" passage ("widget" tag has been defined in this passage).
$args[0] - source inventory
$args[1] - item ID (item.id)
%/
<<widget "transferContainerItemToPlayer">>\
	<<set $passItem to getItemById($args[1])>>
	<<if Array.isArray($args[0])>>\
		<<if isItem($passItem) is true>>\
	  		<<linkreplace "Take $passItem.name from container">>\
	  			@@color:green;you take $passItem.name from the container!@@\
				<<transferItem $args[0] $player.inventory $passItem>>\
	  		<</linkreplace>>\
		<<else>>
			@@color:red;transferContainerItemToPlayer: 2nd argument does not describe an existing item's Id, therefore it cannot be taken from this container!@@
		<</if>>\
	<<else>>\
		@@color:red;transferContainerItemToPlayer: the first argument is not a container!@@
	<</if>>\
<</widget>>\

Now, what I get is something like this:
<>
When I tried escaping the '<' character and '>' character respectively I ended up with the same results.

Is there any way to call widgets defined in a passage and calling it somehow with arguments?

Thank you for your help in advance!

Cannot Run Twine.exe after installing version twine_2.1.1_win32.exe

$
0
0
The install completes with no errors but when I run Twine.exe an error occurs. See Image for details.
gQRpe

Note: I have no problems running Twine.exe with version twine_2.0.11_win32.exe

Pulling data into a downloadable txt file?

$
0
0
New to Twine. Using Sugarcube 2.14.0

I'm a teacher creating a game where the student answers a series of writing prompts in <textarea> boxes throughout a story spread over multiple tiles. What I'd like to do is be able to have them be able to save or download the entry they made into the <textarea> as a .txt document so that I can view what they wrote while playing later on for grading.

Ideally, I'd like them to be able to answer a few writing prompts spread out over a series of tiles. If these multiple <textarea> boxes could be compiled and put into a final .txt file automatically upon completion of the game for a single download, so that I can review the answers later, that'd be amazing.

I hope this makes sense.

Thanks!

Conditional Story with saves

$
0
0
Hi guys,

I'm trying to create a system in which you have "lockers" that can be given out for a certain period of time. When said "locker" is given out I would like a visual represnation of the ''locker'' to change color. Now my issue is, is their anyway of creating such system that will retain information when hosted.

Cheers

Can I link stories together? Cut and paste? and story length questions

$
0
0
Hi all,

I'm working on a couple of projects in Twine 2 Sugarcube, using the Bookish format.

I've read that there is no limit on story length, but I'm at around 12,000 words on one project, and am just starting the 2nd chapter of an IF book that will have probably 10 - 12 "chapters." It's being retooled from a conventional book manuscript, and that is around 45,000 words at the half way point. So this project will probably end up in the 100,00 - 120,000 word range in Twine.

At this length I'm already starting to have issues...for example, when I try to duplicate the story, it takes over 10 minutes (if it even works--half the time it locks up my computer. Windows 8, 4 year old model)

I'd also like to be able to offer this as a serial until it's finished. So you can buy/read the first chapter, and then the other chapters would be added as they are finished. Is it possible to write each chapter as a separate story, and then somehow link those into a single "file" later on? This would make everything easier because the story interface would not be so complicated!

And also, is there a way to cut and paste an entire story at once? So far it looks like only one passage at a time, which is out of the question with hundreds of passages!

Thanks!

how to increase passage editor width

$
0
0
here what i mean

2db2n95.jpg

anyone know how to increase the passage editor width ? thx before

Going back to the very last passage with Harlowe

$
0
0
I'm trying to make a large document which has many index pages. Because the document is supposed to be rather sprawling, many mentions of certain topics will then link to those topics so that you don't have to go hunting for them elsewhere if you want clarification.

Normally, you could simply make a 'back' button by making a link which goes to the last passage, but that becomes more complex when there can be more than one possible passage that you came from. I've looked around, and previous() came up, but that's obviously for Sugarcube, and I'm using Harlowe.

So; how would I make a button which goes to the last passage the user was on?

[Snowman] Printing to screen after passage render

$
0
0
First things first: my deepest thanks to the whole forum and specially @greyelf and @TheMadExile who have helped me again and again. I've just ported 100% of my Harlowe game to Snowman, despite not knowing Javascript, and it works all right.

Now, one of those stupid questions related to not knowing Javascript.

Sometimes instead of using <%= %> to print a variable I use <% print() %>, if it's in the middle of another block of code (an if for example). However, I don't know how to create a link that prints something after the passage has been rendered. Something like this:
<a id="link">Link</a>
<% 	
	$(function () { 
		$('#link').click(function () { 
			variable = 1;
			print(variable);
		});
	});
%>

When I click this link, statements like variable=1 are executed, but print() does nothing. I have some fuzzy notion that this is because the passage has already finished rendering, but I have zero understanding of why and how to go forward. Any suggestion?

Thanks!

PS: porting the game to Snowman has been more than worth it. The Harlowe version literally killed my mobile browser, while the Snowman version feels like a snappy web app. Now I hope that I get to finally end writing the story and release it, and people can reuse my code if they like.

Convert Sugarcube variable to html variable?

$
0
0
First, I am absolutely new to Twine, HTML and CSS so I am not sure if I am even asking the right question :) I am using Twine 2.1.1 and Sugarcube v2.14.0.

I have this code in my Story Stylesheet.
.div2 {
    position: absolute;
    top: 45px;
    left: 100px;
    width: 823px;
    height: 585px;    
    padding: 1px;
    border: 4px  solid peru;
    box-sizing: border-box;
    background-image: url("snowstorm.png");
    Background-color: green;
}

This makes a box with a background image at a fixed point on the passage screen. This seems to be working wonderfully.

I have the following code in a passage.
<div class="div2">

<div style="position:relative; height:25px;">
<img src="picture2.png" width="25" height="25"
style="position:absolute; top:200px; left:200px; width:25px; height:25px; border:none;"
/>
</div>

This works well too and places a small picture on top of the backround image that was set in the stylesheet.

My question is as follows, I can change the position:absolute values for top and left manually in the code and move the small picture created in the passage any place over the background image. I am trying to figure out how to use variables in the place of the manually entered numbers for top and left. I need to take <<set $value = some number>> and use that value as the top or left numbers. Nothing I have tried works.

To better understand I am using the background image set in the stylesheet as a map. I want to use the small image set in the passage as an icon the moves across the map based on the players location. Everything would work well if I could set the position:absolute numbers from the passage variables.

Any help would be greatly appreciated :)

nth-child on Twine 2.0 ?

$
0
0
Hello,
I'm currently writing my first interactive novel thanks to Twine 2.0 (Harlowe), which is a pretty cool thing to do of my evenings.

I tried to stylized a bit my story with a bit of CSS, but I encountered a problem with a CSS option.
I want my links to appear one by one, not in the same time, you know ?

So I tried first to select my 2nd link :
tw-link:nth-child(2){color:red !important;}

But this ins't working, and I don't understand why ! Do you have any idea why ? Maybe you have a solution for me ?

Thank you !
E.

[Sugarcube] Split StoryInit across multiple files

$
0
0
As I build up my inventory system and other "reference" data my StoryInit file is getting unwieldly large, is there a way to have it source from multiple files so I can split things up for better organization (and it'd be really nice if it also helped with narrowing down errors, but I accept that might be a pipe dream).

There's also the possibility I am doing things very wrong and there's some other preferred way to include data that will be used throughout the story other than the StoryInit file.

On a similar note - can I split up the Javascript file? It, too is beginning to get excessively large.
Viewing all 1844 articles
Browse latest View live