Quantcast
Channel: Twine Forum
Viewing all 3830 articles
Browse latest View live

Cycling between options using the Harlowe (click-replace) macro

$
0
0
Hey all. I'm trying to allow players to choose a gender. Basically, what I've got is something to the effect of:

You're a dude.(click-replace: "dude")[(set: $gender to 'woman')lady]

What I'd like to do, and what I can't figure out how to do, is allow players to click on "lady," and thereby set the gender to 'man.' Any ideas?

Auto cursor in textbox (sugarcube 2.11.0)

$
0
0
When using the <<textbox>> macro in a passage, is there any way to have the cursor already in there, as opposed to the player having to click in there manually?

fadeoverto macro issue in sugarcube 2.11.0

$
0
0
In my game I have a countdown triggered at the start to let the player know how long he has before the oxygen in his room runs out. I accompany this with a looped alarm sound called low_air.

If the player doesn't escape in time I send them to a 'death' passage, and in there I fade the text to nothing to simulate them losing consciousness.

I also want to fade the sound of the alarm out too, so I'm using:
<<audio "low_air" volume 1 fadeoverto 15 0>>
But when this passage is triggered, the alarm fades out almost immediately, instead of over the 15 seconds I've specified in the macro.

I suspect it has something to do with the fact that the same sound clip is still being looped when this command is triggered.

I suppose in that I know how long the player has before they die, I could tell the clip to fade out over that time from the beginning, but then I would have a gradual fade instead of it only fading when they actually die.

But I can't do this anyway, thinking about it, because the clip itself isn't long enough.

How to make your text appear into the original passage after you clicked a link and return back?

$
0
0
I don't really know how to phrase things probably, sorry.
So I kinda want the link to loop back and appear new texts for the story

Thursday, 9:30pm
You're at the [[Red Cherries]] on Carol street, right around the corner.
So after you clicked the link, it will direct you to a new passage, correct? So I'll put another link in that new passage, telling another bit of the story. Then put a link to loop it back to the start with the two sentences above with the new sentence below. Like, when you pressed the [[You feel nostalgic]], how do you make it connect to the first passage plus showing the new texts?

My solution for using scripted actors in Twine games

$
0
0
Required:

• Twine
• Internet connection
• Audacity with mp3 exporter addon installed.

Not suggesting for one second I'm the first to have this idea, but I've just spent a good few hours searching for a sound clip of a woman saying "Warning! Oxygen levels critical!"

As you might expect I drew a blank everywhere. And then the solution hit me.

This would work best if your game uses limited dialogue, but if you go here: text-to-speech you can type in your lines and have a variety of voices speak it out loud. The voices sound quite authentic and there's a variety of effects that can be added.

Imagine how good this could be if you're making a sci-fi game with an android as one of the characters?

Simply hit the record button in Audacity, run the text-to-speech, and then trim it up in Audacity before exporting as an mp3.

In my case it was perfect, as I needed an automated voice anyway. I added the reverb effect and it sounds very good indeed.

Add onBlur behavior to SC2 macro

$
0
0
I have some user input data (name, email, phone nr.), that I´d like to validate using an input field's onBlur behaviour.
In HTML, what I am looking for, would look something like this:
<fieldset>
  <label for="email">Email</label>
  <input type="text" name="email" id="email" onblur="validateEmail(value)" />
  <span id="emailError" style="display: none;">You must enter a valid email address</span>
  <label for="Name">Name</label>
  <input type="text" name="name" id="name" onblur="validateName(value)" />
  <span id="nameError" style="display: none;">Please enter your full name.</span>
  <label for="Name">Phone number</label>
  <input type="text" name="phone" id="phone" onblur="validatePhone(value)" />
  <span id="phoneError" style="display: none;">Please provide a valid phone number.</span>
</fieldset> 

Is there a way to put the functions in StoryJavascript and call them from within <<textbox>> macros?

Harlowe, save-game and actualisation - will variables stay?

$
0
0
Hi,
I'm slowly creating a massive story in Twine. I wanted to post is (first three chapters) and then add the next episodes as actualisations. Can I do this just by replacing the old .html file with the new one (with added new passages)?
If people use save-game macro (I'm using Harlowe because I thought I don't need anything more complex), will the variables be loaded in the new game version? (new .html file with the same name etc. but passages added) From the coding side this should work - the webpage adress won't change, the variables' names won't change. Am I right?

Cryonix

$
0
0
I have new (very short) game out.

Comments welcome.

Thank you to all the board members who helped with those horrible <<if>> macros and other codes. A special thank you to The Mad Exile.

Cryonix

SugarCube — any way to CSS-style "initialising" and assorted screens?

$
0
0
Is there any particular way to style the "initialising" and assorted screens so I can differentiate them a bit in my project from a stock SugarCube-based twine game? I recognise that the screen appears for just a split second, but the ability to change how it appears would help me as I've put a lot of work in making my project look as little like a twine title as possible, but that screen keeps stymieing my efforts.

Because the screen appears for so little I haven't been able to use CSS inspection tools to figure out what it's bound in or what I can use to override its appearance.

Threads and not stating which Story Format

$
0
0
First off let me say that when I first started posting here I used to forget to state what Story Format I was using almost every post I made, so this isn't a criticism of those who do likewise, but could a second drop-down not be added below the Category one, for Story Format, which unless selected prevents the post from being submitted, in the same way failing to choose a category does?

SugarCube releases

$
0
0
I figured that I might as well post a note that I've just published a new release of SugarCube for those of you using it.

Highlights:
  • Added dynamic updating to several of the page elements within the UI bar (sidebar) when passages are displayed, which is configured via the config.updatePageElements property (default: true). The affected elements are the story: banner, subtitle, author, caption, and menu. Note: Since SugarCube uses the story's title as the basis for the key used to store and load data used when playing the story and for saves, it is not included in updates and it is strongly recommended that you do not add any kind of dynamic code to it.
  • Added a seedable PRNG which integrates with the story history (incl. saves), which is configured via the History.initPRNG() static method.
  • Changed the saves menu so that the delete and purge buttons no longer close the menu. This should make it more convenient for players to reuse save slots, since they can now delete and then immediately save without having to reopen the menu.
  • Updated the <<if>> macro to emit an error if an expression is supplied to the <<else>> clause. This is primarily to flag improper <<else if>> usage for authors.
  • Updated the <<optionbar>> macro's output to reflect the changes to UISystem.
  • Updated UISystem:
    • Added the new static method UISystem.alert(), which opens a window.alert()-style message box.
    • Added the new static method UISystem.show(), which opens the UI dialog window and is now the basic method by which all dialogs are opened.
    • Made various improvements to UISystem.
    • Updated the UI CSS styles.
  • Updated the default CSS @media query for mobile devices.
  • Updated the feature detection logic a bit and the feature polyfills.
  • Updated the embedded jQuery library (to v2.1.0).
  • Embedded the seedrandom.js library.
  • Moved the history (un)marshaling code out of SaveSystem and into History. This was spurred on in large part by the integration of the seedable PRNG into History. This also necessitated save format changes.
  • Moved several internal utility functions into the Util object for namespacing.

Is it possible to display the passages chosen by the player?

$
0
0
Hi!
I'd like to make some kind of game where you build the story by yourself and you can see your past choices (passages) written in a list. Like, if you chose "I went to the forest" and then you chose "I went to the farm" the next passage contains:
I went to the forest
I went to the farm
While prompting you to make another choice. Would Twine allow that?

I'm using Harlowe, if that can help.

JQuery Issues

$
0
0
Hi. I'm back again with another stupid question.

I'm trying to incorporate a slider bar into my Twine story, but due to on incompetence or inexperience, I am unable to actually get the darn thing working. I'm pretty sure I have the jQuery code placed in the correct place (the Stylesheet), I just cannot for the life of me figure out how to get it to show up in my passages.

This is the code I am using.
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>slider demo</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css">
  <style>#slider { margin: 10px; }	</style>
  <script src="//code.jquery.com/jquery-1.12.4.js"></script>
  <script src="//code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
</head>
<body>
 
<div id="slider"></div>
 
<script>
$( "#slider" ).slider();
max: 50
</script>
 
</body>
</html>

Also, how do I ensure that this sets a variable.

Many thanks.

Clicker game ala Kittens Game/Candy Box help

$
0
0
Hello again, forums. So, I'm working on my next big thing. Title and theming is all a WIP, of course, but for now I'm trying to figure out the coding.
Enclosed is my work in progress, and I have a few issues I'd like help with! Sorry if anything's like, super obvious, it could be I'm just being a dingus.
- You don't really collect the $cheese, it just like. Resets itself to however much you got on your last cheese adventure.
- Cheese is the only working variable for some reason? No error messages get displayed for your other options, but it doesn't actually add anything and still displays 0.
- Fight is so broken. How do I fight. I'm just an eel

Uploading my twine story on a website?

$
0
0
I've made a twine story with SugarCube 2 2.10.0
I would like to get it online.

I have a website that I use tumblr as a host, which I understand limits things.

Is there a way to get this twine story on my website?
I'm not good with this kind of stuff at all.
I could link to another site where the twine story is.
Whatever kind of janky setup I need to get, I'll do it, I just need to have the story accessible to people through the interwebs.

Another wrinkle is that the story uses/refrences music files.
I need those to work.

I've found that I can upload to philome.la, but this method doesn't permit the music files to exist.

Would wordpress work for this?

Please and thank you, all.

End credits

$
0
0
I'm looking for the CSS that will give me a fade in / fade out on the text, for the closing credits to my game.

I need the credit to fade in, hang around for a second or so, then fade out before the next one fades in at the same spot.

I have CSS doing a similar thing for my intro, but this just fades in and stays until the player clicks it. I wouldn't know how to have it hang around, then fade out and be replaced by the next credit.

Any help much appreciated.

Random name (Sugarcube 2)

$
0
0
Simple stuff for you (but not for me): I would like to give my character a random name out of a list of names. I'm really not sure how to do this. I read the sugarcube2-doc and tried it, but I'm doing something wrong. Please help me!

Modifying state of array element in Harlowe 2.0.11

$
0
0
So I've declared
(set: $foo to (a: false, false, false))

For some reason, I can
(set: $foo's 1st to true)
but I can't
(set: $foo[0] to true)

The latter keeps saying unexpected identifier. I'm trying to do something kind of complicated but in order to isolate the problem I wrote this simple code:
(set: $foo's 1st to true)
(if: $foo's 1st is true)[bar]
That works. This doesn't??
(set: $foo[0] to true)
(if: $foo[0] is true)[bar]

I want to use a variable in the $foo array so I don't have to repeat code. Am I doing something wrong...?

the macro not working

$
0
0
I was having trouble using the click macro in a story, so I made a little test and it still didn't work, I have no idea what I'm doing wrong.
A goblin attacks you. <<click "fight back">><<append>> You stab the goblin<</append>><</click>>

then I get this notification

Apologies! A technical problem has occurred. You may be able to continue, but some parts may not work properly.

Error: Uncaught Error: <<append>>: no selector specified.

Stack Trace:
Error: <<append>>: no selector specified
at Function.Object.defineProperties.wikifyEval.value (<anonymous>:41:10936)
at HTMLAnchorElement.<anonymous> (<anonymous>:38:6442)
at HTMLAnchorElement.n.event.dispatch (<anonymous>:7:6444)
at HTMLAnchorElement.r.handle (<anonymous>:7:3219)

CSS - and Display in Sugarcube

$
0
0
Okay. My new question is -

I recently have been reading the Interactive FIction with TWINE book - and it mentioned stuff about exploratory 'hyperlinks' and using <<display>> to output the main description, so you can keep exploring before you move on.

Anyway - I was curious - I want to output the exploratory info on the same page and then display the main passage again - but - I'm finding it difficult to distinguish between the two since they look identical and there's no difference between the two outputs.

I was thinking at first, "Okay, tag the exploratory Passages" with a CSS selector to adjust the look of them - but the problem is when you output the <<display>> Passage below these - it borrows from that same CSS, rather than the default CSS.

I'm not sure if people need code for this, or not ? I guess I'd like to somehow get ... batches of smaller passages inside the main passage having a different appearance, showing that "Oh, this is what you were checking out."

I've tried various methods - the easiest is to have smaller passages display the main passage again on that Passage, but I want to do it in reverse. On a link 'click'.
Viewing all 3830 articles
Browse latest View live