<<set $DL = {
objects: [
"rat1=cow NEAR FARLEFT lookleft",
"rat2=cow MID FARRIGHT LOOKLEFT",
"RAT VERYFAR FARLEFT LOOKLEFT",
"RAT VERYFAR LEFT LOOKLEFT",
"RAT VERYFAR CENTER LOOKLEFT",
"RAT VERYFAR RIGHT LOOKLEFT",
"RAT VERYFAR FARRIGHT LOOKLEFT",
"RAT FAR FARLEFT LOOKLEFT",
"RAT FAR LEFT LOOKLEFT",
"RAT FAR CENTER LOOKLEFT",
"RAT FAR RIGHT LOOKLEFT",
"RAT FAR FARRIGHT LOOKLEFT",
"RAT MID FARLEFT LOOKLEFT",
"RAT MID LEFT LOOKLEFT",
"RAT MID CENTER LOOKLEFT",
"RAT MID RIGHT LOOKLEFT",
"RAT NEAR LEFT LOOKLEFT",
"RAT NEAR CENTER LOOKLEFT",
"RAT NEAR RIGHT LOOKLEFT",
"RAT NEAR FARRIGHT LOOKLEFT",
"RAT VERYNEAR FARLEFT LOOKLEFT",
"RAT VERYNEAR LEFT LOOKLEFT",
"RAT VERYNEAR CENTER LOOKLEFT",
"rat3=RAT VERYNEAR RIGHT LOOKLEFT",
"rat4=RAT VERYNEAR FARRIGHT LOOKLEFT"
], background: "beach", shot: "full rat1 rat2"
}>>
rat1:: My name is "rat1"
rat1:: I'm defined with the string
rat2::"rat1 = RAT NEAR FARLEFT LOOKFRONT."
rat1:: Each rat is defined with a string value that includes the specified model, depth in scene, placement in scene, and looking direction.
rat2:: I'm "rat2", and I'm defined with the string "rat2 = RAT MID FARRIGHT LOOKLEFT" in the list DL.objects.
rat3:: I'm rat3.
rat4:: I'm rat4.
This text is Twine narration or dialogue text of your choice combined with custom and Twine code.
%%%
[[Show a scene with two rats and a cow.|Add another rat.][$scene = [$cat]]]
[[Show a scene with a deer.|Now add a deer.]]
<<set $DL.objects = [$rat1,$rat2,$cow]>><<set $DL.background = "tennis court">>
Here's that. The scene is defined by the variable $$DL with the field $$DL.objects, an array.
cow:: I'm a cow.
This array contains 3 strings. "RAT NEAR LEFT LOOKLEFT", "RAT VERYNEAR FARLEFT LOOKRIGHT", and "COW VERYNEAR RIGHT LOOKBACK". These strings could also be stored in variables such as $$rat1, $$rat2, and $$cow, then placed in the array.
%%%
[[Show a cat.|Now add a cat.]]
[[Show a deer, which ends the story.|Now add a deer.]]
Bye! You have $<<print $test>>.
%%%
<<return>><<set $test -=1>>\
That's not very nice. You have $<<print $test>>
%%%
[[Let's try again|start2]]<<set $test += 1>>\
Wonderful. You have $<<print $test>>.
%%%
[[Goodbye]]
[[Hi?|Add another rat.]]Hi there! You have $<<print $test>>
%%%
[[Add another rat.]]
[[Goodbye]]
<<set $rat1 = "RAT NEAR LEFT LOOKLEFT">>
<<set $rat2 = "RAT VERYNEAR FARLEFT LOOKRIGHT">>
<<set $cow = "cow=COW VERYNEAR RIGHT LOOKBACK">>
<<set $cat = "CAT MID FAR LOOKFRONT">>
<<set $deer = "DEER VERYFAR FARRIGHT LOOKFRONT">><<set $DL = {
objects: [$cat],
}>>\
Cat has been added.
%%%
[[Go back to the start.|start]]<<set $DL = {
objects: [$deer],
}>>\
Deer has been added. THE END! Press r to restart, or press the button in the corner.