Quantcast
Channel: Help! with 2.0 - Twine Forum
Viewing all articles
Browse latest Browse all 1844

How do I copy an object properly in sugarcube?

$
0
0
Essentially, I want to achieve something like this:
<<set $activePerson to { name : "David" }>>
<<set $secondPerson to $activePerson>>
<<set $activePerson.name to "Jane">>
<<print $secondPerson.name>>
where the print statement prints "David" and not "Jane".
However, it is my understanding that until the passage exits, the variable "secondPerson" is treated as a reference to "activePerson" instead of its own object, which leads me to believe that I'm doing it wrong.
So how do I copy an object properly within a single passage?

Viewing all articles
Browse latest Browse all 1844

Trending Articles