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

Harlowe, Twine 2.x Tricks and Tips

$
0
0
Hi all, first time poster and Twine newbie!

Long ago, I was the writer for a massive multi-ended game. The whole thing racked up to 400-500k words, so pretty much the Lord of the Rings trilogy. There were paths for people who wanted to persuade, lie, be jerks, be nice, and the story would branch and bottleneck a lot to compensate. There were companion NPCs, multiple endings, and a LOT of flags stitching things together.

Then, the game team fell apart, and I was left with a gigantic mass of CYOA text and no coder to put it into a workable format. But then, a few weeks ago, I realized there was Twine. Why not revive this game and put it into a playable format so it's not a total waste?

It's early days, but things are looking promising. Got a working combat system working using array variables entered in for each enemy, so I can keep all the combat stuff in one place. (If you're duplicating stuff a lot, you're probably doing it wrong, right?) But even at this early stage, I'm seeing potential problems in the number of passages and criss-crossing paths that are manageable now, but may become unwieldy in the future.

Tl;dr: I'm basically asking if anyone knows any time-saving tips and tricks for Harlowe for a big complicated project. Things like the (history:) and (display:) macros are already saving me a lot of time. I haven't figured out how to have a single passage contain multiple passages worth of story and rotate these on link-clicks, though.

So, what tricks have been life-safers for you guys?

Is there any way to pick highest values out of a Datamap?

$
0
0
A Harlowe 1.2.2 question.
So, I have a list of competitors for an election that I thought should be stored as a datamap of names, each name paired with a random value representing electability. Is there an easy way to get the name paired with the highest electability value, or better still (since Roman elections returned 2 winners) the names associated with the two highest electabily values? I've been throwing myself at it brute force without much luck. I'm pretty new to Harlowe but I've been hobby coding for a long time if that makes a difference. Any suggestions?

How Do I Change Variable Values in Harlowe?

$
0
0
I want to make a variable's value go up when you select certain passages. I can't use "set" for this because the player is able to go back on some passages that involve exploring objects in rooms, so for example you can explore a bathroom and if you click "Look in medicine cabinet" the variable $suspicion goes up, and then you go back to the main bathroom passage and can select other (but not all) objects to examine that also increase suspicion.

As you can see, if I used "set" things would get overcomplicated pretty fast. I tried using "(put: (value) into (variable)" but it just sets the variable to the value I just put in? Like I'll make a choice that increases suspicion by 2 and the value will be 2, but then when I make another choice that should increase suspicion by 1, and the variable will just change its value to 1? Am I using this incorrectly and is there some way of adding to or subtracting from variable values using Harlowe? Also how would I prevent these variables from going up if the player were to revisit one of the 'suspicious' passages?

Multi-step 'if' statements

$
0
0
I'm having trouble figuring out the syntax for multi-step 'if' statements in Harlowe that don't have a text output.
Basically, I have pre-declared a $character variable and a $bonus variable, and the mechanic of my game is that different character types should get a different bonus by selecting the same path. I basically want my syntax to say:
(if: $character is "A")(set $bonus to $bonus+1); there is no text output at this point as the result is not revealed to the player until later. However, I always get the error message "The (if:) command should be assigned to a variable or attached to a hook."

Is there a different syntax I should be using to accomplish this outcome? Am I missing something super simple? Thanks in advance!

Assigning values to an object from a list of random objects in sugarcube

$
0
0
Hi,

For my game I need to be able to assign commanders with pre determined stats to a specific location at random.
What I mean by this is: I have a commander spot (Commander1) which has to be filled from the StoryInit. This is an object with several keys, which are similar between all commanders but with different values.

Instead of assigning the same commander with the same stats to this at every game, I instead have a list of different commanders, each with their own stats.

What I now want is that I'm able to randomly pick a commander from that list (of about 150 commander types), then assign that commander with it's stats to the spot Commander1.

The only way I can think of would require about 150 if statements per spot, so with over 190 spots that would become a very long and slow process.
Is there a more efficient way to do this?

Another way (which I tried but didn't work) would use a sort of variable in a variable. Like this:
<<set $random to random(10)>>
<<set $object1 ={Attack: $commander[$random].Attack, Defence: $commander[$random].Defence}>>

Thanks in advance

New Game Plus in Harlowe / History Erasure

$
0
0
Hi all,

I'm currently using the (history:) macro to track if players have interacted with NPCs in the story I'm writing. It's a lot more convenient than setting flags for every event. However, I'm aware that I want to do a new game plus once the game is over, and restore the players to the start with a fresh slate, sans a few variables. Basically, I want to remember the endings they've seen and tick them off on a list, so they can see which ones they've already achieved. Also, I might potentially want to carry over their money.

If I just loop them back to the beginning, though, I'm pretty sure all the (history:) and ticked macros will be the same... which means it's going to cause all sorts of chaos on a second playthrough. Is there a way to erase mostly everything without losing a few key variables? Right now it seems to be either 1) Keep everything or 2) Lose everything.

I can see resetting every variable tracked on a new game and just not using (history:) as an option, but resetting that many variables is going to be a serious headache.

Would really love some help on this. Using Harlowe & Twine 2.0

Puzzles/Problems Inspiration

$
0
0
I'm approaching the time when I need to be thinking about the ending of my game and I would obviously like something that feels quite 'big'.

I've tried to make my gamebook feel as much like a parser game as possible, which not only means making sure most of the player's choices matter, but conveying this to them before they make that decision. For that reason you'll not see any of this kind of nonsense that plagues most gamebooks.
Get out of bed.
Turn the alarm off and go back to sleep

I've done most of the traditional puzzles (needing a light source, needing bullets for a gun, needing to fix something before its usable, etc) but I'm fast running out of puzzles to set the player.

Does anyone more familiar with gamebooks than me, have any suggestions for puzzles/problems which might inspire me to the finish?

Thanks in advance.

Harlowe 2.0.0 beta

$
0
0
The beta for Twine 2.1.0 contains a beta for Harlowe 2.0.0, which can be enabled by selecting it in the story formats menu. (It should be default for new stories, but…?) I'd appreciate it if anyone could check it for bugs or confirm that the new features work correctly, and as expected.

Please consult this page for a thorough list of changes over 1.2.3, and this (95% complete) manual for in-depth descriptions of the new features.

Thank you again for using Harlowe, if you do.

How to set arrays and datamaps in SugarCube...

$
0
0
I am currently learning how to use SugarCube (and trying to port my Harlowe story into SugarCube) and can't find information on how to set a datamap.

I understand that to set an array in SugarCube, you use the following syntax:
<<set $array= ["zero", "one", "two", "three"]>>

How do you set a datamap?

Increasing variable value on button click.

$
0
0
Sorry if my description doesn't make sense, I'll try my best to explain.

I'm using Twine to make a "Pick a choice" kind of game. Each option adds a point into one section before moving onto a random passage. I wish to increase the point when a choice is made and go straight to the next "choose an option card".

I know that increasing variables is, set: $Name to $name + 1, and that it is usually done within a new passage.

Is it possible to increase the variable when clicking a button that links to a new passage. Like [[Take a drink | ((set: $Name to $name + 1)) ]]? Or do I need a to have a passage inbetween that'll increase the value?

Thanks

Blogging my game?

$
0
0
When the blurb for Twine says that because games are saved as html files and can be uploaded anywhere, what does this mean exactly?

Could I, for instance, use a blogging platform and provide a link which would launch the game directly from there, rather than simply linking to an external host?

I guess for this to happen I'd need somewhere that allows the uploading of file types other than images, and I admit I can't think of any.

I'm asking this because all the places I've visited that host IF games (IFDB, textadventures.co.uk) are... let's just say less than pretty, and I like the idea of having some control over how my launch screen looks.

Other than having my own webspace, is there any scope for doing this somehow?

Audio only mistake (sugarcube 2.11.0)

$
0
0
I've made a bit of a mistake at one of my passages, where I'm wrongly relying on the audio to tell the player what's going on.

All this works as it should, but I need to trigger two lines of text - one for when the car starts, another for when it fails, but I have real problems with (if) nesting and don't know how to insert them into all this.
\ <<if visited() is 1>>The car's been ransacked, no doubt several times and a thorough search reveals nothing of value.
\ <<if $hasGas and $hasPlug>><<link "Two wires">><<audio "out_side" volume 0.1>><<audio "car_start" volume 100 fadeoverto 11 0.0>><<timed 10s>><<goto "village">><</timed>><</link>> hang from the broken plastic under the steering wheel.
\ <<else>>
\ <<link "Two wires">><<audio "car_fail" play>><</link>> hang from the broken plastic under the steering wheel. 

The road continues [[north.]]<</if>>
<<else>>
\The car's still here.
\ <<if $hasGas and $hasPlug>><<link "Two wires">><<audio "out_side" volume 0.1>><<audio "car_start" volume 100 fadeoverto 11 0.0>><<timed 10s>><<goto "village">><</timed>><</link>> hang from the broken plastic under the steering wheel.
\ <<else>>
\ <<link "two wires">><<audio "car_fail" play>><</link>> hang from the broken plastic under the steering wheel. 

The road continues [[north.]]<</if>>
<</if>>
As is stands, the player won't know what's going on if he has his speakers off or has disabled the sound from my options.

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.

Conversations like in a chat(sugarcube 2)

$
0
0
Hello nice people!
I'm using sugarcube 2 and I would like to do something like this, but in a clever way. Can anybody help me, please?

<<replacelink>>Me: "Hi!"
<<becomes>>Me: "Hi!"
She: "Hallo!"
<<becomes>>Me: "Hi!"
She: "Hallo!"
Me: "What's going on here?"
<<becomes>>Me: "Hi!"
She: "Hallo!"
Me: "What's going on here?"
She: "I don't know!"
<<becomes>>Me: "Hi!"
She: "Hallo!"
Me: "What's going on here?"
She: "I don't know!"
Me: "Everything what we are talking about is looking... like in a chat..."
<<becomes>>Me: "Hi!"
She: "Hallo!"
Me: "What's going on here?"
She: "I don't know!"
Me: "Everything what we are talking about looks like in a chat..."
She:"Yes... that 's mysterious!"
<<becomes>>Me: "Hi!"
She: "Hallo!"
Me: "What's going on here?"
She: "I don't know!"
Me: "Everything what we are talking about looks like in a chat..."
She:"That 's mysterious!"
Me: "LOOK THERE IS A UFO landing!!!!!!!!!!!!!!!!11eleven!!!111!!"
<</replacelink>>

I don't want to c&p every sentence again and again. The last sentence should be the link to the next sentence. If this somehow works.

Passages randomly disappearing?

$
0
0
I've checked the known errors logs but didn't see anything on this. Towards the end of my game's completion I had a couple of passages disappear from the grid. One of these instances must have happened just before I zipped up my game before uploading it to itch.io, as I play-tested thoroughly beforehand without any problems, and yet one of the first responses I got from a player was telling me they were getting a 'passage doesn't exist' error message. Sure enough when I checked, it was completely gone.

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?

Sidebar Harlowe Twne 2 Images

$
0
0
Hi there,

First time posting here - am wondering how best to include an image in the sidebar of a Harlowe styled Twine game. I want the image to change as the game evolves so putting the image as a background to the sidebar doesn't seem to be a straightforward option!.

Help would be much appreciated

Import over-right?

$
0
0
I have a vague recollection of a brief discussion sometime about this little quirk of Twine's, but why exactly does importing a game with a different file name, over-right the one that's already loaded, so that you end up with two copies of the game you've just imported?

And doesn't this produce a huge risk to any game that you've not published yet?

Creating random items

$
0
0
Hello everyone!
Currently I'm working on creating a small game and I am rather fond of random things but I am currently running into a problem.

I try to create random things, let's say like this:

Weapon - can be a spear, a sword, an axe
made out of - wood, iron, bronze
with a random crystal attached - namely sapphire, ruby, etc.

so it would look like this:
<<set $Weapon to ["Sword", "Spear", "Bow", "Axe", "Staff"]>>
<<set $Material to ["Stone", "Bronze", "Silver", "Iron", "Wood"]
<<set $Gem to ["Ruby", "Emerald", "Saphire"]>>

These would allow for randomly created items with one characteristic from each of these three categories. Now I only need to know on how to incorporate all of these into a single item.

I think I have to work with arrays to get this done, which actually isn't such a problem to set up - I just need to understand how these randomly generated items can be added into the game. It might be necessary to use the .push - thingy, but I am still puzzled on how to do it right.

Oh, I am using sugarcube by the way but don't let that stop you.

How to run a function when any variable changes?

$
0
0
How can I be notified when a variable is set? In any of the languages. (Preferably Harlowe, but if I have to switch language I could)

I dug into the Harlowe code, and found that VarRef contains exactly what I want, because there's a hook that lets you do like:

VarRef.on('set', (obj, name, value) => {
if (obj === State.variables) {
// You know that variable $name has just been set to $value
}
})

But I can't find a way to get access to this VarRef object. Any ideas?

Thanks
Viewing all 1844 articles
Browse latest View live