Restrictions are the basis of most of the if-then-else logic in an ADRIFT game. Tasks use restrictions to determine if their Actions are performed and their completion message shown. Locations use restrictions to prevent the player travelling in a certain direction until certain conditions are met. Characters can have restrictions on conversation topics and Text Boxes use restrictions to control the compositing of Alternate Descriptions.
Creating a restriction
Restrictions can be created by pressing an 'Add a new restriction' button on an Alternate Descriptions page or the directions page of a location, or by pressing the 'Add' button on a restrictions list.
The Restriction form looks like this:
At the top is a series of restriction categories: Location, Object, Task, Character, Variable and Property. When one of these is selected it reconfigures the available options that can be selected for the restriction. The example is for the restriction "[Referenced Object][must][be held by][The Player Character]". This restriction is commonly used by General Tasks for commands that allow the player to do something with an object that they are carrying, such as "Drop %object%". If the player is in fact carrying the object that they try to drop, then the Actions of the task are executed, in this case moving the object from the player to the players current location.
- Some restrictions can be specified either way around, for example the above restriction could also have been the Character restriction "[The Player Character][must][be holding][Referenced Object]", BUT this is not always the case, so if the restriction you want does not seem to exist, try it the other way around.
Below these is a text box where you can enter a message to be displayed if this restriction FAILS.
- This text box is disabled for restrictions on Alternate Descriptions.
- You can create Alternate Descriptions for this text box to vary the failure message for different circumstances.
For the referenced location, the players current location, or any specific location, you can check if:
- The location is a member of a specific Location Group
- The referenced location or the players location is a specific location
- The referenced location exists
- The location has been seen by the Player, a specific character, or any character
- The location has a particular property
For the referenced object, a particular object, or any object, you can check if:
- Its at a particular location
- Its being held by a particular character
- Its hidden
- Its in a particular state (eg. Open/Closed for containers)
- Its inside of a particular container object, any object, or a referenced object
- The referenced object is a particular object
- Its sitting on top of an object with a surface
- Its a part of a character (nose, mouth, leg etc.)
- Its part of another object
- Its visible to a particular character (or any character)
- Its a member of an object group (eg. the "Light sources" group)
- Its currently being worn by a particular character
- The referenced object is an object that exists in this game
- It has been seen by a particular character
- It has a particular property defined for it
There is only one task restriction, and it checks if a particular task has been completed or not.
A task is "Completed" if:
- It does NOT have it's "Task is Repeatable" box ticked.
- It has been executed at least once.
- The unset task action has not been used to clear it's "Completed" flag.
A task which is completed will not be executed again, unless the unset task action is used to clear the flag.
- If it is a general command then it will be ignored when trying to match the players input to a command.
- If it is a specific task then it will not be able to override its general task.
- If it is a system task triggered by entering a location, then it will not be executed again when the player re-enters that location.
- It can however still be executed using an execute-task action.
The character restrictions include a whole host of options pertaining to where a particular character is located, what they are doing, who they are with, what they are wearing, their personal characteristics, and what objects, locations and characters they have previously encountered.
This lets you select a variable and compare its value with the value of another variable, with a constant, or with the result of a mathematical expression.
This allows you to select a specific property of a location, object or character and check if its value is equal to a particular state or to the result of an expression.
- Expressions can only be used with integer and text properties.
This allows you to enter an expression that evaluates to a boolean true/false result.
If the expression evaluates to true then the restriction passes.
|<<< Introduction & End of Game||Main Page||Restrictions list >>>|