Object Manipulation - adanter/Prairie GitHub Wiki

What is it?

This is a set of scripts created to help enable more interesting storytelling by allowing the player to interact and create changes within the game world itself. The options include creating or disabling objects, rotating objects, or moving objects. These can all be triggered in-game by left clicking. Note, if you would like to have one object make two different things enable, rotate, or transform by different amounts, you can attach two or more of these scripts targeting different objects.

Scripts:

Toggle Enable

When the object with the script is interacted with (left-clicked on), it toggles the enable property of the object or objects in the target list. This will disable the object in the scene, or add it back if it is currently disabled. Disabling an object removes its physical presence from the scene without deleting it. The object's properties can still be changed while disabled, but the player cannot see these changes and will be unable to interact with the disabled object directly.

Toggle Rotate

When the object with the script is interacted with (left-clicked on), it rotates all objects in the target list by the set amount (in degrees). Rotation amount set in editor.

Toggle Transform

When the object with the script is interacted with (left-clicked on), it transforms all objects in the target list by the set amount (in degrees). The transformation amount set in editor in terms of meters.

Toggling options:

There is another option for activating these scripts other than interacting directly with the object. These scripts can be activated through the Twine story, and the specifics can be set in the Twine node object menu, within the Twine story object. A Twine node can access all of the object manipulation functions detailed above, and a Twine node's object manipulation functions are called when that node is activated in the story.