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

greyelf

Well-Known Member
Nov 16, 2016
1,078
790
I downloaded the "HTML only" file. I don't know if the others are different.
I see.

The author of X-Change Life has used a Scope Escalation hack in their project to expose Harlowe's internals, because window.Harlowe is not normally a thing in a Harlowe based project. Which is why I missed it when I looked at the project's source.
 

Tamarind69

New Member
Feb 4, 2019
2
0
Does anyone know how to modify the values on Firefox? Just installed firefox and the console opens up fine, sugarcube pulls the values, but you can't change the values.

Not sure what I'm missing.
 

thebumpinthenight

New Member
Jan 20, 2018
4
0
How do you update an array?

Example:
Sugarcube.State.variables.traits Array(3) ["big", "long", "wide"]
0: = "big"
1: = "long"
2: = "wide"
length: 3


I'm trying the search for Array and getting so many hits that don't show what I'm trying to do, I"m wondering if I"m searching for the right keyword?


What would I do to add a 4th entry, something like "bulbous"?
 
Last edited:

peterppp

Member
Mar 5, 2020
491
894
How do you update an array?

Example:
Sugarcube.State.variables.traits Array(3) ["big", "long", "wide"]
0: = "big"
1: = "long"
2: = "wide"
length: 3


I'm trying the search for Array and getting so many hits that don't show what I'm trying to do, I"m wondering if I"m searching for the right keyword?


What would I do to add a 4th entry, something like "bulbous"?
SugarCube.State.variables.traits.push("bulbous")

note the capital C in SugarCube
 
  • Like
Reactions: thebumpinthenight