Can't get changes to twine games to stick.

RazzleDazzle

Member
Donor
Apr 29, 2017
113
120
So I downloaded an extension from a user in the fresh start game's page, also have tried using the chrome F12 developer console to try to edit sugarcube variables in twine games, however any time I make a change/cheat the game stats, they immediately revert to their original states after I have edited them whenever I take literally any action or switch any screen. They're just not wanting to stay edited. Is there any way I can force them to stay cheated? Am I not taking another important step to force my changes to stick in the game?
 

TCMS

Quote my posts if you want an answer
Donor
Former Staff
Aug 5, 2016
5,797
30,411
Twine? Edit the html file
 

RazzleDazzle

Member
Donor
Apr 29, 2017
113
120
The HTML file when pulled up into notepad++ is just a clusterfuck of numbers, variables, etc. I have zero idea where to even begin to look to change a stat for the beginning of the game. I've hit ctrl+f and searched the document for "beauty" or "corruption" etc, it's all looking for calls and references in there. To me it's like trying to find the hay straw in a stack of needles.
 

RazzleDazzle

Member
Donor
Apr 29, 2017
113
120
Have you tried using TwineHacker?
Yes, that is the plugin I mentioned. Any time I make a change to the game with that, then if I click in the game to the stat menu or try to leave an area all of the stats revert to the original state.
 

Eoin

The Bug Hunter
Moderator
Donor
Feb 21, 2017
1,233
4,880
Yes, that is the plugin I mentioned. Any time I make a change to the game with that, then if I click in the game to the stat menu or try to leave an area all of the stats revert to the original state.
I can't help you there, mate. Sorry.
 

greyelf

Well-Known Member
Nov 16, 2016
1,081
801
Fresh Start is a Twine 2.x game built using the SugarCube 2.x story format, this story format comes with a built in Debugging feature.

You have three basic choices when it comes to cheating/modifying a game built using these tools.

1. Open the HTML file within a text editor and edit the code directly:
This can be difficult because the contents of each passage has been HTML escaped, which can make finding the correct code harder.

2. Import the HTML file into the Twine 2 application and create you're own personalised version.
You can use either the web-browser based release or the install-able release to do this, once you have modified the game as you want you simply use the Publish to File option to create your new version of the HTML file.

3. Use your web-browser's built-in Developer Tools Console to access the story format's debug object.
The Javascript object containing the current values of all know variables at the time the current active passage was rendered can be accessed in the console using:
Code:
SugarCube.State.variables
Each variable is a property on the object returned by the above code, you can use code like the following to either see the current value of the related variable or change it's value:
Code:
SugarCube.State.variables["money"]

SugarCube.State.variables["money"] = 1000
NOTE: Changes to a variable's value will not take effect until after the next passage transition, which basically means you wont see an effect until after you select a link within the current active passage.

eg. If you open the game and view the first passage then use the Console to execute the money changing example show above, the amount of money shown in the side bar won't change until you click on a link like the Play Game (one which causes a passage transition to the next passage).
 

konabwo

Engaged Member
Sep 19, 2020
2,480
716
and notepad++ option... i remember i tweaked some cash in some game but dont remember how... i tried with another game...and got texitsh file without ability to change...

---
that TwineHacker...
ah... i needed to swtich to developer mode or something...otherwise failed to see how to import that directory