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

[First time post] Adding a "max number" to variables?

$
0
0
Hi,

Long time forum searcher, first time poster. I'm working in Harlowe (version 2.0.8, if that matters). Forgive me if I've missed the following question get answered somewhere, but so far I haven't found it.

So, basically, I'm working on a kind of board game with die rolls. This is what I've been using so far to propel the players up the board:

(set: $event to (random: 1, 6))(if: $event is 1)[1! (set: $Player1 to $Player1+1)You're moving to Square $Player1.](if: $event is 2)[2! (set: $Player1 to $Player1+2)You're moving to Square $Player1.](if: $event is 3)[3! (set: $Player1 to $Player1+3)You're moving to Square $Player1.](if: $event is 4)[4! (set: $Player1 to $Player1+4)You're moving to Square $Player1.](if: $event is 5)[5! (set: $Player1 to $Player1+5)You're moving to Square $Player1.](if: $event is 6)[6! (set: $Player1 to $Player1+6)You're moving to Square $Player1.]

Works great. The game is completely playable as it is now, but there's an aesthetic issue I want to get rid of. So, the board is meant to have 100 squares and when you reach the end, you win. The way it is now though, the $Player1 number can go above 100, making for an inaccurate message. So, yeah, what do I add so that $Player1 doesn't go higher than 100?

Thanks!

Display a history of choices in each passage

$
0
0
Hi, I am looking for a way to create a 2 functions that will basicly do 2 things:
1) Displays the history of choices, example below:
I went through 5 different passages (Intro, Left, Left, Right, Jumped)

This would help create a nice history for me, to make sure everything is working in my dynamic story (many different endings).

2) Similar one (not sure if fully possible though), but with a coded "save state" that can later be decifred, for example each passage would have an ID (or would use tags), and it would add as youre going, so if you stop on one of them your code would be 2A5FAD, it would be easy to recreate for you. Maybe even with an input field to recreate all decisions?

Anyone got any clue how to approach this?

Setting a "max number" for variables.

$
0
0
Hi. Sporadic searcher, first time poster.

Ok, so I'm working on a board game with Twine 2 (Harlowe 1.1.1... I should probably update, shouldn't I?). Through "die rolls", the player needs to make it to the end of the board (Square 100). This is what I currently have in place to propel the player up the board:

(set: $event to (random: 1, 6))(if: $event is 1)[1! (set: $Player1 to $Player1+1)You're moving to Square $Player1.](if: $event is 2)[2! (set: $Player1 to $Player1+2)You're moving to Square $Player1.](if: $event is 3)[3! (set: $Player1 to $Player1+3)You're moving to Square $Player1.](if: $event is 4)[4! (set: $Player1 to $Player1+4)You're moving to Square $Player1.](if: $event is 5)[5! (set: $Player1 to $Player1+5)You're moving to Square $Player1.](if: $event is 6)[6! (set: $Player1 to $Player1+6)You're moving to Square $Player1.]

This all works fine, except for one little aesthetics problem. The user can currently get a result higher than 100, whereas I'd like to make it so that 100 is the max result. What do I need to add to make that so?

Thanks!

A vs An (Twine 2/Sugarcube)

Is it possible to render passages like a conversation?

$
0
0
Hi there, I am quite new to twine, I've just recently discovered it by playing Lifeline following a friend's advice. I decided to tinker with it for a while and I stumbled upon something that I can't figure out. If you have played Lifeline, you know that the story is rendered as if it was a conversation, meaning that all the passages are displayed in one page, as if you are having a chat in a program like whatsapp or similar apps. I was wondering, how can I do something like that? Edit:using Sugarcube 2 as a story format

Konami Code in Harlowe?

$
0
0
Is there any way I could track the player's keyboard inputs (specifically, those of the arrows, B, A, and Enter) to put a Konami Code easter egg in my game? I want it to do the following.

- Track the keyboard inputs of the player while they are in the game window and follow the sequence of keys pressed
- If the player presses "up, up, down, down, left, right, left, right, B, A, Enter" in that order, display a picture, show text reading "The Code" earned! and set variable $code to 1
- If the player presses anything other than the next key in the sequence (for example, up, up, down, down, G) reset the sequence so they have to start over

I'm assuming I'll have to use Javascript for this, because I don't see any Harlowe commands that make use of the keyboard. I'm not sure if this will be possible, seeing as how the only way to input text in Harlowe that I have found requires a lengthy and complicated block of code split into two parts. Any help with this would be greatly appreciated!

Generating random non-numerical values

$
0
0
I'm using Twine 2, SugarCube 2.

How can I set a variable to a random word out of a list?

If I want a variable to be a random number from 1 to10, I do this:
<<set $variable = random(1, 10)>>

But what do I do if, say, I want the variable $pet to be chosen randomly from the following list: cat, dog, fish?

Storing different value than what appears in a cyclinglink macro. (Sugarcube 2.12.1)

$
0
0
I have a small question that I can't seem to find an answer to by searching the forum or checking the documentation.

I'm using Twine 2.011 with Sugarcube 2.12.1 and I want to have a cyclinglink that shows different values from what it stores. For exmaple, when asking the player whether they are male or female I have the following code
You are <<cyclinglink '$gender' "a Man" " a Woman" "Different">>

With those words as the links, I'd like the ability to store the values "male", "female", or "other" inside $gender instead of what is displayed. I would prefer to keep a cyclinglink as that is what I use throughout the rest of the project and CSS is styled after it. What would be the best way to go about this?

[SugarCube 2]Calling a macro or JavaScript inside an

$
0
0
Hey there!

Problem description:
I'm trying to return a value to SugarCube 2 by calling a macro that I made.
Let's see the code:

JS:
var weekdays = new Array();
weekdays[0] = "Sunday";
weekdays[1] = "Monday";
weekdays[2] = "Tuesday";
weekdays[3] = "Wednesday";
weekdays[4] = "Thursday";
weekdays[5] = "Friday";
weekdays[6] = "Saturday";
var date = new Date(2017,2,1,17,30,0);

Macro.add(
{
    "todayis", function()
    {
        return weekdays[time.getUTCDay()];
    }
})
;

Passage:
/% Kiosk Passage: %/
<<linkreplace "Find out the current date by looking at the date of a daily newspaper>>
    <<if <<todayis>> is "Wednesday">>
                Oh my, how is this possible? It's Wednesday. 
                But I thought today is Friday?
                Does that mean my machine worked? 
                I traveled through time?
    <</if>>
<</linkreplace>>

Unfortunately this fails with an error: saying there's an extra << symbol that shouldn't be there.
Help please?

Story Formats Not Working

$
0
0
I am using Harlowe for my game, but for some reason my game won't start. I checked the story format and it said that Harlowe can not be loaded. You can add story formats, but you need the format address. Does anyone know the address for Harlowe?

Goto Macro in Sugarcube 2.12.x & Twine 2.1.0

$
0
0
Okay. I was wondering - if there were a way to make a goto link to another passage via clicking - but to have the Passages not connected together in the Editor? Or am I missing something simple?

As it is, my Editor workspace is a big mess - and I was hoping to sort it by 'rooms' and have passages be linked to the rooms, but not every other passage.

For example, I'm in the Bar room, and I have a few links that can go to different 'rooms', but I would like to have them move the Player to those Room Passages without showing an arrowed connection in the Editor?

Does that make sense?

[twine 2 & sugarcube 2] Is it possible to pass an array of objects to a widget?

$
0
0
Hello there forum, I've been searching a while for an answer to the question: can I pass an array of objects to a widget?
To be clear, I mean passing an array variable to a widget, as in
/* define an array of people (objects) with names */
<<set $arr to [{name:'alice'}, {name:'bob'}, {name:'casey'}]>>
$arr[0].name
/* Outputs "alice" */

/* do something to the array */
<<arraywidget $arr>>

/* let's say the widget looks like */
<<widget "arraywidget">>
  <<for _i = 0; _i < $args.length; _i++>>
    <<print $args[_i].name>>
  <</for>>
<</widget>>

The above widget definition prints nothing. I tried to fix it by reading to a temporary variable first:
<<widget "wordywidget">>
  <<for _i = 0; _i < $args.length; _i++>>
    <<set _person to $args[_i]>>
    <<print _person.name>>
  <</for>>
<</widget>>

Which still prints nothing. During testing I accidentally left out the ".name" in the first widget and got
<<widget "borkedwidget">>
  <<for _i = 0; _i < $args.length; _i++>>
    <<print $args[_i]>>
  <</for>>
<</widget>>
which outputs "[object Object], [object Object], [object Object]", i.e. the entire array as one element of $args. (Since I didn't explicitly print the commas, I'm pretty sure this is the string representation of the outer array $arr.)

Is there any way to make this work? Currently I only know of one workaround: saving the array to a global variable used by the widget. I would much prefer passing the array as an argument though, passing through globals gives me nightmares of assembly coding.

Any tips or fixes would be greatly appreciated!

Problem switching to Twine 2.1 on Linux

$
0
0
I'm trying to get Twine 2.1 running on my computer, but it's not running properly. I'm running Linux Mint 18 MATE ("Sarah").
I had no problems with Twine 2.0, and I can still run it fine.

When I run 2.1, however, I get this error:
Spoiler:
ERROR:desktop_window_tree_host_x11.cc(1131)] Not implemented reached in virtual void views::DesktopWindowTreeHostX11::InitModalType(ui::ModalType)

It still opens the program and I can make and import stories, but:
1. Selecting "Show Library" does nothing.
2. Quitting/Exiting doesn't work. I have to manually shut it down from the terminal (and nothing saves when I do this).
3. When I open the imported story (the one I made in 2.0), I get the following error in the terminal:
Spoiler:
var o=t.staggerAnchor;o||(o=t.staggerAnchor=yt("stagger-anchor"),o.__v_frag=t),it(o,n);var a=t.staggerCb=k(function(){t.staggerCb=null,t.before(o),ot(o)});setTimeout(a,i)}else{var s=n.nextSibling;s||(it(this.end,n),s=this.end),t.before(s)}},remove:function(t,e,n,r){if(t.staggerCb)return t.staggerCb.cancel(),void(t.staggerCb=null);var i=this.getStagger(t,e,n,"leave");if(r&&i){var o=t.staggerCb=k(function(){t.staggerCb=null,t.remove()});setTimeout(o,i)}else t.remove()},move:function(t,e){e.nextSibling||this.end.parentNode.appendChild(this.end),t.before(e.nextSibling,!1)},cacheFrag:function(t,n,r,o){var a,s=this.params.trackBy,u=this.cache,l=!y(t);o||s||l?(a=ke(r,o,t,s),u[a]?"$index"!==s&&"production"!==e.env.NODE_ENV&&this.warnDuplicate(t):u[a]=n):(a=this.id,i(t,a)?null===t[a]?t[a]=n:"production"!==e.env.NODE_ENV&&this.warnDuplicate(t):Object.isExtensible(t)?b(t,a,n):"production"!==e.env.NODE_ENV&&Ur("Frozen v-for objects cannot be automatically t

TypeError: Cannot read property 'major' of null
at VueComponent.loadFormat (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:9:28014)
at VueComponent.<anonymous> (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:91:1885)
at VueComponent.loadFormat (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:7:1149)
at VueComponent.ready (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:60:28233)
at VueComponent.En.t._callHook (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:4283)
at VueComponent.n (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:11547)
at VueComponent.n (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:10239)
at VueComponent.Hn.t.$emit (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:10933)
at VueComponent.En.t._callHook (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:4299)
at e (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:8994)

and again, no changes save.

The program itself is in my /opt folder, while the stories are stored in ~/Dokumente/Twine/Geschichten (my OS is in German).

I can continue to use 2.0, but I would like to know if anyone can figure out what's going wrong. Thanks for your help.


Side question:
Whenever I open Twine 2.0, it sets the permissions of my ~/Dokumente/Twine/Geschichten folder to 'dr-xr-xr-x 2'
Even if I change it with 'chmod 755 Geschichten' to 'drwxr-xr-x 2' it switches back whenever I open the program. Is this normal/necessary?

Problem switching to Twine 2.1 on Linux

$
0
0
I'm trying to get Twine 2.1 running on my computer, but it's not running properly. I'm running Linux Mint 18 MATE ("Sarah").
I had no problems with Twine 2.0, and I can still run it fine.

When I run 2.1, however, I get this error:
Spoiler:
ERROR:desktop_window_tree_host_x11.cc(1131)] Not implemented reached in virtual void views::DesktopWindowTreeHostX11::InitModalType(ui::ModalType)

It still opens the program and I can make and import stories, but:
1. Selecting "Show Library" does nothing.
2. Quitting/Exiting doesn't work. I have to manually shut it down from the terminal (and nothing saves when I do this).
3. When I open the imported story (the one I made in 2.0), I get the following error in the terminal:
Spoiler:
var o=t.staggerAnchor;o||(o=t.staggerAnchor=yt("stagger-anchor"),o.__v_frag=t),it(o,n);var a=t.staggerCb=k(function(){t.staggerCb=null,t.before(o),ot(o)});setTimeout(a,i)}else{var s=n.nextSibling;s||(it(this.end,n),s=this.end),t.before(s)}},remove:function(t,e,n,r){if(t.staggerCb)return t.staggerCb.cancel(),void(t.staggerCb=null);var i=this.getStagger(t,e,n,"leave");if(r&&i){var o=t.staggerCb=k(function(){t.staggerCb=null,t.remove()});setTimeout(o,i)}else t.remove()},move:function(t,e){e.nextSibling||this.end.parentNode.appendChild(this.end),t.before(e.nextSibling,!1)},cacheFrag:function(t,n,r,o){var a,s=this.params.trackBy,u=this.cache,l=!y(t);o||s||l?(a=ke(r,o,t,s),u[a]?"$index"!==s&&"production"!==e.env.NODE_ENV&&this.warnDuplicate(t):u[a]=n):(a=this.id,i(t,a)?null===t[a]?t[a]=n:"production"!==e.env.NODE_ENV&&this.warnDuplicate(t):Object.isExtensible(t)?b(t,a,n):"production"!==e.env.NODE_ENV&&Ur("Frozen v-for objects cannot be automatically t

TypeError: Cannot read property 'major' of null
at VueComponent.loadFormat (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:9:28014)
at VueComponent.<anonymous> (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:91:1885)
at VueComponent.loadFormat (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:7:1149)
at VueComponent.ready (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:60:28233)
at VueComponent.En.t._callHook (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:4283)
at VueComponent.n (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:11547)
at VueComponent.n (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:10239)
at VueComponent.Hn.t.$emit (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:10933)
at VueComponent.En.t._callHook (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:4299)
at e (chrome-extension://jbeclgngiacjdjjokiegbkjcpibcdcic/twine.js:8:8994)

and again, no changes save.

The program itself is in my /opt folder, while the stories are stored in ~/Dokumente/Twine/Geschichten (my OS is in German).

I can continue to use 2.0, but I would like to know if anyone can figure out what's going wrong. Thanks for your help.


Side question:
Whenever I open Twine 2.0, it sets the permissions of my ~/Dokumente/Twine/Geschichten folder to 'dr-xr-xr-x 2'
Even if I change it with 'chmod 755 Geschichten' to 'drwxr-xr-x 2' it switches back whenever I open the program. Is this normal/necessary?

Choices not working

$
0
0
I'm using Twine 2 and the story style is SugarCube 2.12.1
I'm using the choices function but they are not disappearing after being clicked and can be clicked over and over

Here is what I have.
<<choice[[Ask who they are]]>>
<<choice [[...]]>>
<<choice [[Ask the mysterious voice for its name]]>>

Please help, thanks!

(Twine 2/Sugarcube 2) When linking passages, how do I remove the [[link]] before the link?

$
0
0
I have limited experience with Harlowe and I'm trying to figure out how to use Sugarcube so I can make a game with background music.

Coming from 1.4.1 - a couple questions

$
0
0
I haven't used Twine since then, so the new version is quite the change. Going to stick with Sugarcube.

What I would like to have back is a way to edit the sidebar. More than just the game's title, previously I could put links, ads, etc.

Remove the save option or have one save state only.

And remove the ability to go back to the previous passage when playing the game.

thanks

Counting passed tags? (Harlowe online 2.0?)

$
0
0
Hi,
I am looking to count amount of times the person passed through a passage with a certain tag in it throughout the whole story and adds +1 if passed through.

If I pass through a tag A once, it should display: You've been in A 1 time
If I pass through it twice: You've been in A 2 times

I've tried to make it work with passage history tags contains:
(if: ( (passage: (history:)'s last)'s tags contains "A") )[You've been in A once]
(else:)[No A passages]

But have no idea how to make it work for multiple passages to add +1... Can anyone help me move forward with this?

Thanks!

Windows Twine 2.1 startup - no stories shown, can't use, help

$
0
0
Hi All,
I just installed Twine 2.1 for Windows and read the release notes. When I start Twine now the main screen for selecting an existing story or creating a new one shows up, but the screen is blank. I cannot see any of my existing stories or create a new one -- essentially, I'm stuck. I can select "open library" from the file menu and the proper library opens up in Windows Explorer, but I can't actually do anything in Twine -- load a story, create a story, what have you. What am I missing?

Help on Timers in Sugarcube? (Offline version)

$
0
0
So I'm INCREDIBLY new to sugarcube, and I've been poking about the tutorials like a mad woman for a little while now- the issue is I'm getting a whole string of pieces of code; But I haven't the slightest idea on how to string them together to get them to do what I want. And I'd very much appreciate any help on the matter.

Here's the concept I'd like to do. When a player selects a choice using THIS

<span id="message">
<<click "Click this to see a message!">>
<<replace "#message">><<print "A message!">><</replace>>
<</click>>
</span>

I would like the 'A message!' to use the transition pulse (that's the code (t8n: "pulse")[This text will pulse] ) and when the pulse animation has finished, transfer the player to another page.

Is this even possible?
Viewing all 1844 articles
Browse latest View live