CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Tutorial HTML How To Debug(Or Cheat) Twine{SugarCube} Variables

Jul 29, 2019
115
35
The instructions you followed are meant to be used on Twine based project's built with the Harlowe Story Format, and Accidental Woman isn't such a project.

Accidental Woman by ThaumX is built using a custom variation of the SugarCube Story Format (named SugarCubeAW), that has modified so its variant of the undocumented debug interface no longer exposes the . This is why the Story & Temporary variables can't be accessed using like SugarCube.State.variables or SugarCube.State.temporary.

It's also why a Twee Notation compiler like TweeGo can't be easily used to "decompile" the Accidental Woman Story HTML file.
I mostly wanna find a good way to kinda change the way arousal builds up, micromanage some stuff, and make it so clothes are generated with higher attractiveness. Among other things.
 
Jul 29, 2019
115
35
The instructions you followed are meant to be used on Twine based project's built with the Harlowe Story Format, and Accidental Woman isn't such a project.

Accidental Woman by ThaumX is built using a custom variation of the SugarCube Story Format (named SugarCubeAW), that has modified so its variant of the undocumented debug interface no longer exposes the . This is why the Story & Temporary variables can't be accessed using like SugarCube.State.variables or SugarCube.State.temporary.

It's also why a Twee Notation compiler like TweeGo can't be easily used to "decompile" the Accidental Woman Story HTML file.
Could it be modified so it does show up, just like I did with Harlowe? Or not really, cause it might actually need a key or advanced editing?
 

Daenerys5539

Newbie
Aug 17, 2016
70
15
Is there a way to make a variable static? eg. Make hunger/cash/energy etc variable reset itself automatically to full?
 

greyelf

Well-Known Member
Nov 16, 2016
1,088
817
Is there a way to make a variable static? eg. Make hunger/cash/energy etc variable reset itself automatically to full?
Technically it could be possible to use the Web-browser's Console to add an event handler to a released project, that monitors for the custom event that gets triggered before the current state of all known Story Variables is persisted to Progress History during the Passage Transition process, and that event handler could then "reset" the value of the relevant Story Variable(s) before they are persisted to History.

But there is no built-in event that is triggered at the point in time that a variable's value is actually changed.
 

AllenDeez

Newbie
Dec 9, 2023
49
11
Can i have some help with the console command SugarCube.State.variables

because whenever i change a variable it won't reflect on the game Currently trying it on "a hard pill to swallow"

i write it like this SugarCube.State.variables.cash = 20000 or like this SugarCube.State.variables.cash=20000 but it won't reflect on the game so is there an option i have to allow first
 

greyelf

Well-Known Member
Nov 16, 2016
1,088
817
because whenever i change a variable it won't reflect on the game
Any variable change you do in the web-browser's Console won't take affect until you use one of the blue link on the page to preform a Passage Transition.

eg. If you are currently viewing the "Business Floor" passage of the "A Hard Pill to Swallow" project, and you use the Console to execute SugarCube.State.variables.cash = 20000, then the amount of Cash shown in the Left Sidebar won't change until you've select one of the blue links (like "Go To Your Office" or "Go to the Lab") on the page.
 
  • Like
Reactions: AllenDeez

Lure of Chaos

Member
Apr 21, 2020
122
118
then the amount of Cash shown in the Left Sidebar won't change until you've select one of the blue links (like "Go To Your Office" or "Go to the Lab") on the page.
That's true. Also changes would be reset if you getting "back" from any "help" screen: history navigation links from left sidebar, character info, any informational one (probably any link clicked from the left sidebar menu). Popup dialogues do not revert those changes.
So: make console changes, progress in the game and you'll see the effect, if any.
P.S. for such trivial changes I recommend my SugarMelt tool.
 
Last edited:
  • Like
Reactions: AllenDeez

AllenDeez

Newbie
Dec 9, 2023
49
11
Any variable change you do in the web-browser's Console won't take affect until you use one of the blue link on the page to preform a Passage Transition.

eg. If you are currently viewing the "Business Floor" passage of the "A Hard Pill to Swallow" project, and you use the Console to execute SugarCube.State.variables.cash = 20000, then the amount of Cash shown in the Left Sidebar won't change until you've select one of the blue links (like "Go To Your Office" or "Go to the Lab") on the page.

Thank you very much
 

teken0

Newbie
May 26, 2018
22
12
does anyone know how to use it in x-change life? i tried both the SugarCube.State.active.variables and the TwineHacker and did not worked
 

greyelf

Well-Known Member
Nov 16, 2016
1,088
817
note: There are multiple Story Formats an Author can choose from when building a "Twine" based project, one is SugarCube and another is Harlowe. And each of these Story Formats is a self contained engine, that defines its own core functionality.
This specific thread is dedicated to how to debug (or cheat in) a SugarCube based project. And while the name of the TwineHacker tool implies it's for any "Twine" based project, in reality it would be better named as SugarCubeHacker.

does anyone know how to use it in x-change life?
If you mean X-Change Life by Aphrodite, then according to the information stored in the <tw-storydata> element of its X-Change Life.html file, that project is Harlowe based.

And unfortunately that Story Format's developer has decided not to provide a means for an Author to debug a Harlowe based Story HTML file using a web-browser's Console.
eg. there is no Harlowe equivalent of the undocumented SugarCube debug interface.

However, according to the information accessible from the Extras section this thread's original post, the project does include a built-in cheat menu.
 

teken0

Newbie
May 26, 2018
22
12
However, according to the information accessible from the Extras section this thread's original post, the project does include a built-in cheat menu.
yes i know of the build in cheats but they sadly dont have a variable for most of the nps at work and only have for the father and sister
 

greyelf

Well-Known Member
Nov 16, 2016
1,088
817
yes i know of the build in cheats but they sadly dont have a variable for most of the nps at work and only have for the father and sister
You would have to manually edit the generated Story HTML file (1) to add some Scope Escalation code to the JavaScript area, to make the normally Private scoped Harlowe State object accessible to the web-browser's Console.

(1) or use the Twine 2.x application, or a Twee Notation compiler, to decompile the HTML file into a project. And then regenerate the Story HTML file again after the JavaScript code change as been made.
 

Satori6

Game Developer
Aug 29, 2023
503
1,119
You would have to manually edit the generated Story HTML file (1) to add some Scope Escalation code to the JavaScript area, to make the normally Private scoped Harlowe State object accessible to the web-browser's Console.

(1) or use the Twine 2.x application, or a Twee Notation compiler, to decompile the HTML file into a project. And then regenerate the Story HTML file again after the JavaScript code change as been made.
They are accessible through the console without the need of any witchcraft. I've added an example to cheat the money on the thread on my signature.
 

greyelf

Well-Known Member
Nov 16, 2016
1,088
817
They are accessible through the console without the need of any witchcraft. I've added an example to cheat the money on the thread on my signature.
I used the By Member option of this forum's Search - Thread feature to searched the X-Change Life thread for posts submitted using your UserID, and didn't find any.

I'd be interested in seeing that Condole code, because the Harlowe Story doesn't add any properties to the web-browser's window object.
 

Satori6

Game Developer
Aug 29, 2023
503
1,119
I used the By Member option of this forum's Search - Thread feature to searched the X-Change Life thread for posts submitted using your UserID, and didn't find any.

I'd be interested in seeing that Condole code, because the Harlowe Story doesn't add any properties to the web-browser's window object.
It's the link on my signature: https://f95zone.to/threads/cheat-code-list-for-html-games-short-tutorial.209154/

Untitled.png

I downloaded the "HTML only" file. I don't know if the others are different.