Here's the code that won't work in Sugarcane:
Twee (inside of StoryInit)
newFruit = ""
<<set $fruit = []>>
<<set $fruit.push("Apple")>>
<<set $fruit.push("Orange")>>
When I pop <<$fruit>> into a passage, it appropriately returns Apple,Orange ...So that part works. The next part, not so much.
Javascript (inside of a macro that otherwise works):
state.history[0].variables["newFruit"] = ["Grape","Plum"]; (Twee: <<$newFruit>> returns Grape,Plum)
var oldFruit = state.history[0].variables["fruit"];
state.history[0].variables["newFruit"] = oldFruit;
When I do <<$newFruit>> It now returns 0.
I even tried this:
state.history[0].variables["newFruit"] = state.history[0].variables["fruit"];
and <<$newFruit>> still returns 0
What am I doing wrong?

/Misty
Comments