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

random goto (Sugarcube 2)

$
0
0
One easy thing for a programmer.
One difficult thing for me. I would like to make a random goto.

I tried this one, but it doesn't work:
<<goto either("kitchen", "garden", "cellar")>>
(This way twine wants to send me to a passage called "either". )

Help me, please!

trying to get a transition to work on a link - Harlow

$
0
0
Hi

I'm trying to get something like this:

(live: 1000ms)[
(stop:)
(t8n: "dissolve")[This text appears with a delay and a dissolve transition]
]

to work on a passage link but with no success...
I don't think I'm quite getting how macro's work.
Any suggestions?

many thanks,
Theo

[Sugarcube 2] %chance (not random) for goto different routes

$
0
0
Hi guys,
i'm total noob, so i asking about someting what i don't know "how to make".

First i was started go with tutorials, documentations and forums solutions with all past problems [maybe somewhere this is but i wasn't find this problem], and in all go i find moment when i have silly problem :)
i try solve it a few times and every times this doesn't work like i need.

i have a little more complicated problem becouse in single route i don't have problems but i was want making something harder and find this problem:

go to city -> and in city i get: %chance"goto GotRobed1/2/3/4" and rest%"goto Street1,2,3,4[random]".
somethink like i have:
example: 15.5% chance goto either("Robed 1/2/3/4") and rest% <<elseif goto either("Street1"...)>>

because i want use this in diffrent actions, so i was started thinking about set variable and i was ended in place where i have stat like this:

<<set $chrobed to 50/(($str+$agi+$int+$lucky+$hp)-($badLucky*$badFame+($gold*0.0005)))>>
<<if $chrobed gte 95 set $chrobed to 95>>

i add this for block chance to break game and make 150% chamce on get robed :) and i know this isn't best and i will go to remaking but is for example of this situation

but i don't know how to add/make it in form what i needed for this situation.
Because i need that dignit in stat $chrobed example "15.5" is as % of chance for go to route of get robed, and rest is go to Street.
Because statistic $chrobed is dynamic to the rest of game stats so this is main % chance for goto to bad route.

so we look on what we have to use:
Room "Home"
Room "City"
Room "Street1", "Street2", "Street3", "Street4"
Room "Robed1", "Robed2", "Robed3"
and a few stats with main chance to got robed -> $chrobed

i was started thinking i must use <<if>> and <<elseif>> but doesn't know how to make go to where [%$robed is a chance to "goto Robed1/2/3" and rest is for goto Street1/2/3/4], so started with add room for a'la "rulete machine" but it wasn't what i needed :|



Somebody can help?

BTW: please don't go with Java because i dosn't know, how to go with this xD

im working in Twine with sugarcube 2.12.0 of a 1 month.



P.S. sorry for my teriffied english but this isn't my native language :)

[Sugarcube] remove macro not working

$
0
0
Hello everyone,

I'm trying to get Sugarcube's remove macro to work. Even if I use the example code in Sugarcube's documentation, which is
I'd like a <span id="huge-cupcake">humongous </span>cupcake, please.

<<remove "#huge-cupcake">>

on a fresh Twine story, I keep on getting the same error:

Error: <<remove>>: no elements matched the selector "#huge-cupcake"

What am I doing wrong? Is there any 2.0 syntax that I'm missing?

Thanks!


Extracting a saved file from the game?

$
0
0
I have 2 weird questions (I am using Twine 2.0.11 and Sugarcube 2.12):

1.) Is it possible to retrieve a saved file from the twine game on its own?

2.) I tried checking the saved file for my twine game using the javascript console on my Chrome browser (with localstorage.getItem) and found some Chinese characters. Now, I DO live in Asia so this could be something on my end (although I don't use Chinese on my PC) so I just want to verify if anyone know what this means before I look for other explanations for it. Here's a screencap of it: http://i68.tinypic.com/2a9b5fd.jpg

Thanks a lot!

clickable "Hint"-button in almost every passage (SugarCube 2)

$
0
0
Hey everybody,

I am in need for orientation for the following problem:

I want to have a "hint" button in almost every passage which opens a <div> with a hint on how to solve the passage's task. The text for the hint is different for each passage and will be stored in a string within each passage.

I figured the PassageHeader-passage in combination with some <<button>> and <<replace>> macros within a custom widget would do the job. But isn't there a more elegant, maybe pure CSS/jQuery solution?

Thanks!

How to add music to story in sugarcube?

$
0
0
Hi, I'm new here. I've never used Twine before. I want to add music to my story. But I don't have any idea how to do that. Can you please help me?

Linking Twine to email server

$
0
0
Hi - I've been using Twine for a little while.

My skills are very limited, but I'm a fast learner - however, I do have a situation that has left me stumped.

I've created a decision tree using the passages and at the very end I want the final passage saved and emailed to me for review.

For example, the passage would read something like this

'You've told me that you are a XXXXXX

And that you XXXX

If you would like for me to contact you, please CLICK HERE'

The idea would be for them to CLICK HERE and that would bring up a few fields for them to enter their name, email address and phone number. Once this is submitted, the information in the passage and their contact details is forwarded to the inbox of an email account, and this information can be gauged to see what their needs are, who they are and how to contact them.

To me, this is a massive task, and it likely is to a lot of other people. I would appreciate any guidance anyone could offer me - even links to similar queries (I've had no luck finding any) so that I may be able to infer a solution and lash something together myself.

Further to this the ideal scenario would be that, in addition to a final passage, there would be a text box they can complete if they want to add any further information themselves - this information would also be saved along with their selections & contact details and forwarded on to the email address.

I am using Harlowe, Twine 2.0.

Not sure if any of this is possible, or even if I'm making sense!

If you need me to elaborate on anything, please let me know.

Best Regards,

N88

Goto a new passage with JavaScript

$
0
0
Twine 2.0.11 - Harlowe 1.2.2.
I'm using JavaScript to score points in a multiple choice test. I want to go to a PASS passage if the score is high enough and to a FAIL passage if it isn't, and I'm not sure how to use a JavsScript variable to determine which passage to go to. Please help. Thank you in advance.

DOS >_ symbol for inputs

$
0
0
Sugarcube 12.0

Would it be possible to style the text input field to look like the old DOS style, i.e >_ - where the underscore is blinking? I already know how to hide the borders/background for the input field and how to use autofocus, but the symbols are a bit beyond me.

I found this, but wouldn't know how to adapt it for Twine: stackoverflow

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

$
0
0
Hello,i was trying to replicate the code in this video but i keep getting "The (if:) command should be assigned to a variable or attached to a hook but i checked all the code like 3-4 times to see if it was the same and it is

SugarCube 2.12.0 — "seek to X seconds" in audio macro not working, possible bug?

$
0
0
I think I have encountered a bug with the audio macro. I am attempting to use the code

audio "Track" time 60 loop play

(obviously with brackets) and it isn't beginning playback 60 seconds into the track, but at the very beginning. I have tried several different audio files, with and without the loop variable, and every single one begins playback at the start. Not sure if I am doing something wrong or what, but it's not doing what it should from what I gathered from the documentation.

Is there a way to force the sidebar to update via click/link/timed macros?

$
0
0
I'm using StoryCaption to display some character stats such as $PC.strength and have a clock variable in StoryBanner.
I want to make it so that those update when I make changes that don't trigger a passage transition. (such as via <<replace>>)

What I have is something like this
<<click|link|timed "do push ups">> /% obviously timed wouldn't apply to pushups but you get the idea %/
 <<set $PC.strength += 1>>
 <<replace>> ... /% the section of multiple passages that show you what exercises you can do %/ ... <</replace>>
 <<clockAdvance 15>> /% adds 15 minutes to the clock and thus triggers various hourly/daily/weekly changes as appropriate %/
<</click|link|timed>>

The replacements work fine, but the clock and stats in StoryBanner and StoryCaption don't update until I do something that changes passages.

In my searching the closest I've found to an answer was part of something 'Liz England' posted over on intfiction.org:
In order to have separate panes within the tool, I've always hijacked the StoryTitle and used it to display in-game information. You can put variables in the StoryTitle passage, but since that area doesn't refresh each time you click a link you also need to add <<update>> to your passages every time you want it to update.

But as far as I can tell <<update>> does not seem to be an actual thing? or atleast adding it to my code threw a macro does not exist error. Maybe I just used it incorrectly?

What I've seen of State.??? while implementing keypress listeners seemed promising, but I can only seem to get changes to affect the main passage.

Does anyone know how to do this? I'm sort of expecting it to either be forehead slappingly simple, or the sort of thing that gets answered with lots of links to various coding wikis (either is fine)

Twine 2 Harlowe save file location

$
0
0
I used the save function in one of the passages and now the game starts from that particular passage and not from the beginning. Its obviously reading the saved file and loading the passage from it. Is there any method to reset it? (Deleting the save file will work, but I couldn't find the save location)

Reduce Harlowe's default margin

$
0
0
Hey folks, sorry if this question has been asked elsewhere, Twine Forum search isn't helping.
Is it possible to alter Harlowe's margin (margin, not alignment) to the extreme left end of the screen like Snowman ? Harlowe's Default margin takes a lot of empty space in mobile screens. I deleted the sidebar with the 'display:none' CSS alteration, but the margin isn't reducing. Please help.

Harlowe if syntax with link

$
0
0
Hi,

The action I'm trying to crests is a point-of-view character has a choice to pick up an object in one room, and then in another room (a separate passage) if the object is in hand, another link is available. I'm using a string variable to indicate if the object (a tube of toothpaste) is has been picked up.

At the top of the game (first passage) there's a definition:

<!-- Inventory setup below here: -->
set: $inv_tootpaste is "none"

In a later passage:

Maybe I should take the toothpaste? (click-append: " toothpaste?")[ This is great! It's a full tube! You never know when you might need this. (set: $inv_toothpaste to "full")]

And then a further-on passage has this if statement:

(if: $inv_toothpaste is not "none" [[You could throw the toothpaste at her. ->ThrowToothpaste]])

But a trial of this doesn't seem to be working. How can I debug this further? Is there something obvious I am doing wrong?

Thanks -

[Harlow]How to Update a variable without loading the whole page again

$
0
0
i'v made a game who is full of interactives things but it need to refresh the page again and again every times and the position of the scroll is not even saved , the easyest way to resolve my problem will be to update the specific code who need to be refresh... for exemple , when i take an item , the page need to reload to take it in my hand , and then , when i click in the slot , it need to reload AGAIN to put it down ...

(im french , sorry for my bad english)

Is there a way to make a command in a passage to quit the game?

$
0
0
Hi, I am trying to create my own story using Twine, and would like to provide my users with an option to terminate the game (this is because i am attempting to do this for a school project that has that requirement), yet i am not very well versed in the types of coding that Twine uses. If anyone could instruct me as to where i can find the proper information, as a couple hours scouring the internet did nothing for me, or if you could simply just provide me with the coding (for which i will gladly give you credit for your contribution), it would help me out a lot. Thanks in advance.

Can't change link text-decoration in Sugarcube

$
0
0
***UPDATE***
Okay, I figured it out on my own. First I was using the wrong header and then the wrong tag on the font-weight. Everything is good now!

[Sugarcube 2.12.0] How to access settings through if macro (or any macro, for that matter)?

$
0
0
Ok, before I begin, I'll warn that I have only beginner levels of experience with twine, so you'll have to bear with me. I'm attempting to create a setting to toggle tutorial for a game that I am creating. Basically, I wish to display a separate dialog on certain pages through an <<if>> macro that would explain the stats and give the player some pointers on what's what. This I can do just fine with regular story variables and the <<if>> macro, and I can create the dialog. The problem I am facing is getting it to work with the Settings API. I want the player to be able to toggle tutorial and have it saved between sessions and save files. So I went and created a toggleable setting called "tutorial", but now, I don't know how to call it in the <<if>> macro. The API itself details how to do it with javascript, but I am crap at that so I sort of failed to adapt the code to my needs.

Here's a mock example of what I want:
<<if tutorial is on>>
<<load dialog through script>>
<<else do nothing>>
<</if>>

And here's the setting in question:
Setting.addToggle("tutorial", {
    label   : "Tutorial",
		default  : true,
});

I'd be glad if someone could help me do this or possibly provide an alternative method.
Viewing all 1844 articles
Browse latest View live