0 votes
asked by (140 points)
I'm planning to release a game in multiple chapters, and was wondering if there's a way to carry certain information (endings, important choices, inventory, etc;) over. Can anyone help?

1 Answer

0 votes
answered by (970 points)
edited by
(EDIT: I just realized that you selected harlowe as a story format. I am not certain how well this would work in it. I have been using sugarcube)

I have been thinking about this too. For I will probably have to break mine up into chapters. What I have been thinking on is making an array that stores a numerical value.

<<set $gamecode = []>>

So if the player is a certain class then give each class a numerical value.

Mage Value of 1

Ranger Value of 2

Thief Value of 3

Warrior Value of 4

<<set $gamecode.push (2)>> // 2 for Ranger

 

Then later if they make a choice

Like help the old man defend against robbers.<<set $helpingHand = true>>

It could be given the value of 26 if $helpingHand is set to true.

The value would have to be unique to that point in time. And you would need to keep track of what action gets what value.

Then at the completion of the game it could print out the $gamecode. <<print $gamecode>>.

They would copy it. Then at the next game they would paste it in a text box in the new game and click to move forward.

<<textbox "$pastGamecode">>
When you're ready, click [[here|Character Creation]].

Those numbers could be entered into an array of $pastGamecode, then that array could be translated into variables.

<<print $pastGamecode [2,26,358,66,105]>>

<<if $pastGamecode.contains (2)>>

<<set $class = "Ranger">>

<<if $pastGamecode.contains (26)>>

<<set $helpingHand = true>>

 

Now the problems I forsee... I am not sure if the text box will translate into an array. I have not tested this and so I am not sure how well it would work. But by having a code at the end, it could give the player a chance to play several times and keep the codes to play a different way in the next chapter of your game.

 

If someone knows a better way please do not feel afraid of hurting my feelings. I would be interested in knowing since I am planning the same thing.
commented by (52.4k points)
I have a macro set for this for SugarCube. https://github.com/ChapelR/custom-macros-for-sugarcube-2/blob/master/docs/file-system-macros.md

Or you could use JSON (with base 64 if you want to prevent cheating to some extent) if you want to pass codes around instead of files.

It's possible to do this stuff in Harlowe, but not nearly as easy.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...