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

[SugarCube 2.14 Twine 2.1] Creating a game log that shows up in every passage

$
0
0
Hi there,

I decided that I want to include a game log in the bottom of all of my passages.
So, if something happens to the character's stats, equipment, inventory or a quest is started or finished, the log in the bottom of the passage would show that.

The description of the area and the options the player's character has. These would be printed to that specific passage he or she is visiting currently and the game log below that would help me show text that is triggered if a status changes. I sometimes would like to display a passage in this log, which would send the player to a new passage to inform him/her of something and then using <<back>> the player could go back to the game.

Now, my problem is the length of the log. I don't want this to be too long. Maybe 8-10 lines. Before the text that was on the top would start to dissapear as new logging entries are being added by the game in the bottom of the log.

I already have a stowable right side and left side (default) UI and I would like to have this log to be stowable as well and slide into the bottom, when not needed.

My question is, how do I count the row of text that needs to be displayed and how do I present this logging screen in the bottom of my passages?

Thank you for your answers in advance!

How to make a time system?

$
0
0
Hi everyone, I'm having a lot of problems trying to make a time system for my game. I want a sturdy time system because I want to make a business managment simulator kind of game, so I have to keep track of the day of the week, the day of the month, the month and the year, so this are my variables.

$hour
$minute
$weekday
$monthday
$month
$year

I need the game to do the basic maths while you are playing, like not going over 59 minutes or over 23 hours. I tried setting up a conditinal.

<<if $minute > 59>>
<<set $hour += 1>>
<<set $minute -= 60>>
<<else>>
<</if>>

Its the only thing that I can think of. For days of the week, I think it would be cool to have like a string of the seven days of the week and that when $hour reaches more than 23, the hour should go down to 0 again and the day of the week and the day of the month should change.

I dont really know if this or something like this has been answered here, but i searched for a bit and didn't found anything useful.

Thank you for your time and I will be happy to listen to every piece of advice that you could give me.

[Sugarcube 2.13.0] Passing arguments and widgets calling widgets

$
0
0
Hey there,

I come to you with another problem that I ran into.
I'm running SugarCube 2.13.0 and Twine 2.1.0

The issue is the following, I'm trying to implement a way in which the player can interact with the inventory of other objects in the game, by placing and taking items from their containers. I'm basically listing the items inside the player's and the inspected container's contents (items) and then offer actions that can take place on the given object. Such as moving items back and forth, inspecting item properties, etc.

I'm trying to do this using a <<widget>> which calls another <<widget>>. I've tested and been using recursive <<widget>> which had no problems whatsoever (probably because of the same arguments that get passed to them).
In my case I fail to pass the _item object to <<putItemInContainer>>. Since the latter throws an error that .hasOwnProperty of an undefined variable made the whole thing crash and burn. This is very interesting to me since, the other widgets have never been complaining. I imagine the for loop and the temporary _i (iterator value) adds a complication. I'm trying to remedy this by setting up a temporary variable: _item and reference the indexed item ($player.inventory[_i]). This also doesn't seem to help in this case.

I tried to substitute the <<putItemIntoContainer>> widget by taking out the part that was important to me with the hasOwnProperty check and then the calling of other widgets such as unequip and JS function call to transfer the item into the new container. Now, this substitution kinda fails too since I only get the last item that is then put into the container after the second try, which I can't take out, since the wrong item gets put into the container.

There must be a way to call transfertItem() using the correct arguents (_item) I just have no idea how.

Can anyone explain to me what is going on here?
Am I missing something when passing arguments to another widget?
/% when clicked, shows the contents of the container and the actions that can be carried out on them %/
/%TODO: Add option for the player to put their items into the container <<putItemInHere _container _container[_i]>>%/
<<widget "openContainer">><<nobr>>
	  <<set _container to $args[0]>>
	  <<linkreplace "Open container">>
		  <<if _container.length > 0>>
			  The $args[1] holds the following items:
			  <<for _i = 0; _i < _container.length; _i++>>
			  	_container[_i].name X _container[_i].count
			  	<<showItem _container[_i]>>
				<<inspectItem _container[_i]>>
				<<debugItem _container[_i]>>
			  <</for>>
		  <<else>>
			  @@color:orange;This seems to be an empty $args[1]!@@
		  <</if>>
		  <<if $player.inventory.length > 0>>
		  <<for _i = 0; _i < $player.inventory.length; _i++>>
		  	<<set _item to $player.inventory[_i]>>
			_item.name X _item.count
			<<showItem _item>>
			<<inspectItem _item>>
			<<debugItem _item>>
			<<linkreplace "Put _item.name in here">>
				<<putItemIntoContainer $player.inventory _container _item>>
			<</linkreplace>>
		  <</for>>
		  <<else>>
		  	@@color:orange;The player's inventory is empty!@@
		  <</if>>
	<</linkreplace>>
<</nobr>><</widget>>
/%
Places an item from on inventory into the other
$args[0] - source inventory
$args[1] - destination inventory
$args[2] - item, this needs to be already inside the source inventory
so that it can be moved into the destination inventory
%/
<<widget "putItemIntoContainer">><<nobr>>
	<<if $args.length < 3>>
		@@color:red:There aren't enough parameters passed to transfer an item.@@
	<<else>>
		<<set _item to $args[2]>>
		<<set _src_container $args[0]>>
		<<set _dest_container $args[1]>>
		<<if typeof _item !== undefined>>
			<<if typeof _item !== "string">>
			  <<set _item to getItemById(_src_container, _item)>>
			<</if>>
			<<if _item.hasOwnProperty("isEquipped")>>
				<<if not _item.isEquipped>>
				  @@color:purple;You place _item.name into a container!@@
				  <<transferItem _src_container _dest_container _item>>
				<<else>>
					<<if _item.hasOwnProperty('clothingType')>>
					  @@color:orange;We un-equipped your item and moved it!@@
					  <<unequip $player.clothing _item.clothingType>>
					<<else>>
					  @@color:red;no clothingType property on passed item (3rd argument).@@
					<</if>>
				<</if>>
			<<else>>
			  @@color:purple;you put _item.name into a container!@@
			  <<transferItem _src_container _dest_container _item>>
			<</if>>
		<<else>>
			@@color:red;[Error]putItemIntoContainer arg[0] or item is undefined@@
		<</if>>
	<</if>>
<</nobr>><</widget>>

And all of a sudden, TWINE don't want to start (on LINUX)

$
0
0
Hello there !
My computer is under Linux Mint (64bits). I decided to try Twine, and I had fun.
When I decided to close the program, it didn't work. So, after lots of tries, I did a "top / killall Twine". It worked (of course).
And I could re-launch Twine later. Great.
And now, I can't start Twine at all. Through command line, it says :
"[5553:5554:0313/185310:ERROR:channel.cc(507)] Invalid message size: 527475992
Instruction non permise"
I tried trashing my cache (.cache/Twine) and the Story files in Documents, but nothing changed...
Anyone ?

Twine 2 fails to start: causes?

$
0
0
As of this morning, my Twine 2.0 refuses to start. This is a Windows 10 machine running 64-bit, archiving in the hard drive rather than the web service. No error message appears, but I do not get a display of an open program even after a wait of 10 minutes or more.

Windows Task Manager shows 4 files are running, including one that takes up a steadily-increasing amount of memory (see screenshot).

Things I have tried include:
* Restarting the computer
* Uninstalling 64-bit and reinstalling it
* Uninstalling 64-bit and reinstalling 32-bit (Red Rackham here on the Twine forums mentioned this, so I tried it -- that's why the screenshot says I have 32-bit. I do now.)
* Switching my antivirus (AVG) to interactive mode to approve or disapprove of any functions. I get no prompt when trying to start Twine that indicates it's trying anything with an Internet connection.

Up until this point, Twine 2.0 has been working on my machine for about 3 weeks. The only thing that makes today's program different from yesterday's is that my antivirus went through an update. (That's why I switched it to interactive mode.) Windows 10 has not updated me any time recently.

Thanks.

Header/Footers and Graphic Overlays

$
0
0
So I'm working on some UI elements for Sugarcube 2. I know how to do this in Harlowe, but now I've switched formats, my old code doesn't work.

What I'm generally trying to achieve:

1. A rather thin header or footer that sticks to the top or bottom of the window respectively, to populate with values. E.g. Current HP, and whatnot.

2. How to create a graphic in a corner that shifts on a variable, and exists in every passage. E.g. A sun or moon in the corner to indicate day/night cycle.

I kind of feel like these would probably use the similar kind of logic. Preferably I'm looking to do something mobile friendly, but this isn't a must.

If anyone's got any advice or a link to direct me to, I'd be thankful.

Probably a Dumb Question (about exporting a story)

$
0
0
I am a teacher and I have assigned my students to create simple stories using Twine. I did the same thing last year (with Twine 1.0) and am hoping that with Twine 2.0 there are no problems.

However! Whenever either I or my students "publish a story," we try to open the HTML file and are met with a blank, empty screen. I have tried this on multiple computers (all to no avail); I have also tried simplifying the file name (removing spaces), also with no successful results. I am not very good with computers, so maybe there is an obvious solution, but I don't know what it is.

Any suggestions? We were able to use Twine just fine, but after publishing to file, we were met with blank pages of white nothingness.

Many thanks!

Problem to add a new format


[sugarcube] Disable footer passage in certain passages.

$
0
0
Is there a way that I can disable the footer render for just a couple of passages? The footer will house player stats but there is the intro passages like the intro where this is not needed.

Something I don't understand with += and -=

$
0
0
Hi, I use Twine 2.1.1 and sugarcube 2.14

I work on a textbox for a bank system (withdraw and deposit).

Here what I've got on the passage called "Bank" :
Withdraw : <<textbox "$Withdraw" "">>[[euros|Bank]]
Deposit : <<textbox "$Deposit" "">>[[euros|Bank]]

and here what I've got in the display :
\<<if passage() is "Bank">><<if $Withdraw>><<set $Money+=$Withdraw; $Baccount-=$Withdraw>><</if>><<if $Deposit>><<set $Money-=$Deposit; $Baccount+=$Deposit>><</if>><</if>>

The result for the -= is always good.

BUT, the result for the += set something weird.

For example :

$Money is 10
$Baccount is 1000

I withdraw 200, the result would be 210 and 800. No the result are 10200 and 800
Then I deposit 200, the result would be 10000 and 1000. No the result are 10000 and 800200

So maybe my setting is wrong, but I don't understand the result.

Named Hook / Stylesheet / Harlowe 1.2.2

$
0
0
"tw-link" changes the styling of links but not named hooks. What's the rule that would?

(Sorry to ask such a basic question but I can't for the life of me find a post that directly gives the rule.)

Images as links/ Clickable images

$
0
0
Dear Twine fam,
I am new to this software, but so far it looks incredible.

I want to build a multi narrative, image-based project.
I know with Twine 1 one could import images or create "code" to make an image clickable.
I have been unable to figure it out with Twine 2.

So:
can this be done?
Or is it

Local Save

$
0
0
Hello!
(first of all, I'm really sorry about my english skills, so I hope I'm understandable >.>)
I recently "downloaded" the last version of twine 2.
I lost (I assume so) my last story...

Is it completely impossible to save directly your project as a local file ?

I think that so... absurd and strange, so, that's why I ask the question >.>
Are you forced to save your story in HTML ?
Plus, I think that a technical bug, but when I tried to close the software, twine refused to obey T.T
I don't know if you have the same problems, but, I used to use the previous version and I'm little bit lost with this new update.

Thanks :D

Basic Syntax Problems

$
0
0
Twine Version: 2.1.1
Story Style: Harlow 2.0

So I'm just learning and picking up Twine, and I've been following VegetarianZombie's videos on Youtube. I'm on the If section, which I understand just fine but there seems to be a syntax error when using an if statement with passage links.

Code Below:
Passage 1
You dream of being weightless.

[[Open your eyes | Wake Up]]
[[Sleep]]

(set: $hourSleep to 8)

Passage 2
You roll over and refuse to awaken.

(if $hourSleep < 12) [[[Sleep]]]
[[Open your eyes | Wake Up]]

(set: $hourSleep to $hourSleep + 1)

Passage 3
(if: $hourSleep is 8) [Your eyes open suddenly.]

(if: $hourSleep > 8) [You startle awake after a solid $hourSleep hours of sleep.]

This gives me the following error:
68bd17de51e0301810ecee5ec9f2290d.png

Anchor linking within a passage sugarcube2 and in general

$
0
0
I'm trying to do a back to the top link.
I did manage to do it by saying [[Back to the top|first passage]].
However when I switched to another story format(protagonist) it didn't work.
I'm wondering if there's a general type of scripting that might work across most story format.

Ctrl+c/ctrl+v no longer working in Twine 2.1.1? (Never mind, suddenly it works...)

$
0
0
So I just made the switch to the newer version - had some trouble getting it to work, but I managed to sort everything out. Gotta say I really dig the new dark theme, btw. Anyway, one little thing I noticed that could prove to be annoying is that I can no longer copy text by using ctrl+c/ctrl+v, I have to right click+copy/right click+paste every single time. Is this intentional or is there something I can do to fix it? It's hardly program-breaking but workflow would be a lot smoother if this very standard thing worked the way it used to...
Edit: Okay, I don't know what happenned or what the problem was but it inexplicably works now, so disregard this question...

Twine (Sugarcube 2) has stopped creating new passages with new links. Is there a simple solution?

$
0
0
Basically, when I type standard links into a passage eg [[linkylinky]] and [[linky2]], twine sometimes will only creae one passage, and sometimes will create neither. If I manually create the passage, it then links them. Have I done something weird with a setting somewhere? Should I uninstall and reinstall? Would love some advice if anyone recognises this problem.

Twine 2, Sugarcube 2, Linux version (running on Mint).

And all of a sudden, TWINE don't want to start (on LINUX)

$
0
0
Hello there !
My computer is under Linux Mint (64bits). I decided to try Twine, and I had fun.
When I decided to close the program, it didn't work. So, after lots of tries, I did a "top / killall Twine". It worked (of course).
And I could re-launch Twine later. Great.
And now, I can't start Twine at all. Through command line, it says :
"[5553:5554:0313/185310:ERROR:channel.cc(507)] Invalid message size: 527475992
Instruction non permise"
I tried trashing my cache (.cache/Twine) and the Story files in Documents, but nothing changed...
Anyone ?

Blank screen on debug/play -- how do I avoid? Sugarcube 2

$
0
0
Hi, I'm new to Twine (and loving it) but I am having a lot of problems intitialising the game either in debug or play mode. Most frequent problems are:

On debug/play, it returns to a story screen with only 1st version of my story saved (???)
On debug/play, it loads a blank white screen and nothing happens

Currently, I am struggling with the blank white screen. In the past, if I reloaded Twine a few times, it would work, but now there isn't anything I can do and it provides no information about what is wrong.

Would love it if anyone has any ideas as to how to get past this!

Using Sugarcube 2 on desktop version

SugarCube: How to erase previous searched locations from probability.

$
0
0
I'm relatively new to the programming side but do have some basic idea on html, css and Javascript. I'm currently making a bit of a RPG on SugarCube. As I mentioned, I'd like to have multiple events that could happen as part of a passage you can revisit. I was able to make the basic idea work with if/else conditionals:

Exploring...
<<set $explore = random(99)>>Debug: $explore

<<if !$foundLocationA && !$foundLocationB>>
<<if $explore < 50>> [[Random Event]]
<<elseif $explore < 80>> [[Location A]]
<<else>> [[Location B]]
<</if>>
<<elseif $foundLocationA && !$foundLocationB>>
<<if $explore < 80>> [[Random Event]]
<<else>> [[Location B]]
<</if>>
<<elseif !$foundLocationA && $foundLocationB>>
<<if $explore < 70>> [[Random Event]]
<<else>> [[Location A]]
<</if>>
<<elseif $foundLocationA && $foundLocationB>>
[[Random Event]]
<</if>>

Basically if I wanted such that there are multiple events more than Random Event, B, C here; if I found A or B I will no longer be able to find it again (I have another passage for old locations). Going to location A and B will set the foundlocationA/B to true which unlocks it for old locations. Is there some easier way to do this? (someone mentioned me used nodes not sure how) This would drive me insane if I have to repeat this for Location A-Z.
Viewing all 1844 articles
Browse latest View live