https://wiki.adrift.co/api.php?action=feedcontributions&user=Lazzah&feedformat=atomADRIFT 5 Manual Wiki - User contributions [en]2024-03-28T20:29:53ZUser contributionsMediaWiki 1.25.1https://wiki.adrift.co/index.php?title=%22How_do_I...%3F%22&diff=1134"How do I...?"2012-12-09T11:25:09Z<p>Lazzah: </p>
<hr />
<div>== Create a locked door that can be opened with a key? ==<br />
<br />
* Make sure the two rooms that will be connected by the door are created and connected.<br />
* Create a '''group''' of type '''location''' and make the two rooms part of this group. This will allow you to make the door visible from the locations at each side of the door.<br />
* Create a '''new object''' of type '''dynamic''' - This is your key.<br />
* Create a '''new object''' of type '''static''' - This is your door.<br />
** Select '''Location Group''' from the '''Location of Object''' dropdown.<br />
** Select the door location group from the '''At Location Group''' dropdown.<br />
** Select the following properties for your door:<br />
*** '''Object can be opened and closed''' (Selecting this allows you to select the next two dependant properties).<br />
*** '''Open status''' - Leave as open for now.<br />
*** '''Object can be locked''' (This adds ''Locked'' to the ''Open Status'' selections, and the ''Key for lock'' property).<br />
*** Change '''Open status''' to locked.<br />
*** Select your '''key''' object from the '''Key for lock''' dropdown.<br />
* Edit one of your door locations and select the '''Directions''' tab.<br />
* Add a new [[Restrictions|restriction]] to the direction that leads to the otherside of the door. Make this restriction:<br />
** '''Object - your door - must - be in state - open'''<br />
** Depending on your settings this restriction may be copied to the second location. If not duplicate the restriction in the second location.<br />
* The door will now block progress unless it is open.<br />
* '''Note:''' As of version 5.0.16 there is no '''Lock''' command in the standard library. You will need to create this yourself.<br />
<br />
== Create a torch that will run out of batteries? ==<br />
This really needs integer properties to work, so will do a writeup once that's done. It could be done using a variable of course...<br />
<br />
== Create a dark room that the player needs a light source to see? ==<br />
Add any rooms that would be dark without a light source to the location group '''Dark Locations'''.<br />
<br />
Add any objects that are light sources to the object group '''Light Sources'''.<br />
<br />
The Dark Locations group should override the short location description, and the tasks should prevent looking and examining things whilst in a dark location without a light source.<br />
<br />
== Make a lift platform rise up out of reach when i pull a lever ==<br />
* Create a static object in a room to represent the platform or elevator, and make it a container or surface so it can hold other objects. <br />
** Press the 'Add new property' button to create an Object Property and make it a state list with two states, eg. 'up' and 'down' and give the property a name eg. 'Lift Position'.<br />
** Make sure its selected for the lift object and set it to 'down'.<br />
* Create a Lever as a static object (either in the same room or another location).<br />
* Create a specific task that overrides 'pull' for your Lever object.<br />
** If the lever and lift are in the same room then write some text describing the lift going up, otherwise just say 'You hear the sound of machinery operating for a few seconds'<br />
** Give it a restriction 'Property Lift Position for Object Lift must be Down' and a failure message 'The Lever is already in the pulled position - you could try pushing it'<br />
** Create an action 'Set Property Lift Position of Object Lift to up'.<br />
* Do the opposite for a 'push lever' specific task, so when lift is up push lever will bring it down.<br />
Now we need to describe the lift being in two different places, floor level and high in the air, in both the room description and the lift description.<br />
In both cases use the default description in the [[Text Boxes|text box]] to describe the rest of the room, then add two [[Alternate Descriptions]], one with the [[Restrictions|Restriction]] 'Property Lift Position for Object Lift must be Down' and describing the lift at ground level, and the other with 'Lift must be up' describing it high in the air and out of reach.<br />
<br />
Now we just need to make sure that anything placed on (or in) the lift is out of reach when its raised.<br />
* Create a new location thats not connected to anywhere else.<br />
* In the pull lever task add an action to move everything on (or in) the lift to the new location.<br />
* In the push lever task add an action to move everything in the new location to on (or in) the lift. <br />
<br />
== Use a button to toggle between two different states ==<br />
Using the previous example of a lift, rename the Lever to a Button, then change both the push and pull lever tasks to 'press button' tasks.<br />
Remove the text from the restrictions on both tasks.<br />
When the lift is down, only the task that raises the lift will pass its restriction.<br />
When the lift is up, only the task that lowers the lift will pass its restriction.<br />
<br />
== Create a notebook that the player can write in ==<br />
*Create a readable object (both "This object is readable" and "and description when read" selected).<br />
*Create a text variable called 'T1'<br />
*Use a "write %text%" general task to add lines to it, with the actions:<br />
<br />
<B>Set variable T1 to %PropertyValue[Object1,ReadText]%&"<&thinsp;br&thinsp;>"&%text%</b><br />
<br />
(Where Object1 is the key of the notebook object)<br />
<br />
and<br />
<br />
<b>Set property '... and description when read' of object 'notebook' to '%T1%</b><br />
<br />
Example: [http://forum.adrift.co/download/file.php?id=84 Notepad.taf]<br />
<br />
You could also add a restriction that the player must be carrying the notebook to be able to write in it.<br />
<br />
== Ask the player to enter their gender when the game starts ==<br />
Set the Player's gender property to "Male", and create a text variable called "NewGender"<br />
<br />
Create a system task called "SetGender" that has the restriction [ Variable ][ NewGender ][ must be ][ equal to ][ "female" ]<br />
<br />
Add the action [ Set property ][ The Player Character ][ Gender ] to [ Female ]<br />
<br />
<br />
Create another system task "AutoRun" set to execute "Immediately" with two actions:<br />
<br />
[ Set Variable ] [ NewGender ] to [ %PopUpChoice["Are you of the Female gender?", "female", "male"]% ]<br />
<br />
[ Execute task ] [ SetGender ]<br />
<br />
[http://forum.adrift.co/download/file.php?id=87 PopupChoice.taf]<br />
<br />
<br />
== Switch the player point-of-view between different characters ==<br />
The player does not need to always control the same character in the game, but can easily be switched to a different character using the following action:<br />
<br />
[ Move ] [ Character ] [ The Player Character ] [ to switch places with ] [<i>Character to play as</i>]. <br />
<br />
Note that '''[ The Player Character ]''' (or '''%Player%''' if used in a function) will always return the character currently being controlled by the player, whereas '''Player''' is just the default name given to the character the player starts off controlling. So these will be one and the same in most cases, until a switch places action is run.<br />
<br />
== Display on screen the text that the player has typed in? ==<br />
<br />
Say for example when we ASK a character ABOUT a subject, e.g. ASK FRED ABOUT BUSES, if what the player types in does not match the referenced text BUSES, e.g. if the player types in ASK FRED ABOUT CARS, unless the programmer has created a conversation topic with keywords that match that input, the default response from ADRIFT is "Fred doesn't appear to understand you."<br />
<br />
At the present moment we are unable to directly edit the default message, however we can use a text override and the %text% function to change the message to one that will display what the player typed in, i.e. "CARS".<br />
<br />
The first thing you need to do is open the Text Overrides folder which you will find in the main folders window. Right-click anywhere in the text overrides folder and a menu will appear, left-click on "Add Text Override" at the top and a new text override dialogue box will open. In the top dialogue box you type the text to be replaced, in this case "doesn't appear to understand you." (without the quotes!). Note that we do not specify the character name as we want to use this for all characters. In the bottom dialogue box we will type the text that you want to replace the default text with, e.g. "doesn't know anything about %text%." (again, without the quotes.) You will note that %text% will change colour to green. Lastly, click on the OK button to save the text override.<br />
<br />
Now, when the player types in ASK FRED ABOUT CARS, the message that appears will be "Fred doesn't know anything about cars." You can use the %text% function in other ways to display the players input in messages.<br />
<br />
== Give commands to characters using format "Karen, get me a coffee" ==<br />
Create a general task as follows:<br />
<br />
Command: %character%{,} %text%<br />
<br />
Restrictions: The player must have seen referenced character AND The player must be in the same location as referenced character.<br />
<br />
Action: Say %text% to referenced character.<br />
<br />
Task is repeatable.<br />
<br />
To create commands for npc's to follow, you will need to make conversation items for them. Check the box for general commands and leave the rest unchecked. In the command field, type the syntax of the instruction as the player would type it.<br />
<br />
For example, "take crate" would be in the command field and in game the player could tell the npc to take the crate by typing "say take crate to robot" or "robot, take crate". While both would work, the latter is more natural and follows the syntax for giving commands to npc's that are used in other games.<br />
<br />
== Allow for a Screen Display which Refreshes for each New Location? ==<br />
<br />
When anyone is playing your adventure, the default screen display is set so that the screen will scroll up as the Player Character (PC) moves around. However, some players prefer that the location text should refresh when moving into a new location. If you want to allow the player the option to do this in your game, this is one way that you should do it:<br />
<br />
First of all, define a new variable. You can call this what you like, in my games I just call it "scroll" but you should put an underscore in front (i.e. "_scroll") so that it will always be at the top of the variable list when you need to put it into a restriction or an action. This variable will be initally 0 and will be set to 1 when the player choses the "SCROFF" option we will be programming later.<br />
<br />
You will also need a "keypress" message for when the location text changes as a result of an action by the player. You want the player to be able to read any messages that a task will display before the screen refreshes with the new location description. In my adventures I have a message that appears in green under the text like so:<br />
<br />
<br />
<b><centre><font color = green>Press the Space Bar to Continue.....</font></center><br><br />
<waitkey></b><br />
<br />
<br />
The <waitkey> line will pause the Runner until a key is pressed. As you will be inserting this message in lots of tasks, you do not want to have to type the whole message every time. The easiest way of doing this is to define a text override with something like <mytext> as the original text and the replacement text as the "keypress" message as above. <br />
<br />
Now, whenever the player moves to another location, the LOOK task is activated to display the location description, so if we want the screen to refresh when the PC moves to another room, we must redefine this task. The Look task is in the "Look and Examine" folder within the Standard Library folder in the Folders window on the left of the screen, as below.<br />
<br />
<br />
[[File:LookTask.jpg]]<br />
<br />
<br />
When you open this task you will see in the default message box <b>DisplayLocation[%LocationOf[%Player%]%]%</b> in blue, plus an alternate description which is displayed if the location is dark and the PC is not carrying a light source. What is useful at this stage is if you rename this alternate description, so just right-click on the "alternate description" tab and rename it to something like "Dark Locations".<br />
<br />
Next you should open a new alternate description, so either right-click on the task and select "Add Alternate Description" or move your cursor to the right of the "Dark Locations" tab and you will see a tab appear which when you click on it will add and open an alternate description. Rename the tab for this description as (for example) "Scroll On". What you should do now is go back to the default description and highlight <b>%DisplayLocation[%LocationOf[%Player%]%]%</b>. You need to copy this then delete it from the default description window. Now open the new "Scroll On" tab and paste what you have just copied into the message box. In the restriction box above the message window you should define the restriction as "Variable _scroll must be equal to 0" then "Start Description with". After you have done this click on the "Apply" button to save the changes without closing the task.<br />
<br />
Now you repeat the above step to create a second alternate description, calling this one (e.g.) "Scroll Off". However, before you paste the completion message into the box type <cls> first then paste the message immediately after this so that it reads:<br />
<br />
<br />
<b><cls>%DisplayLocation[%LocationOf[%Player%]%]%</b><br />
<br />
<br />
The restriction for this message must be "Variable _scroll must be equal to 1" then "Start Description with". Now open the Actions tab and add the action "Set variable _scroll to 1". Click apply to save what you have done,<br />
<br />
The final step before we save and close the re-defined task is to move the "Dark Locations" tab to the right so that it is after the two new tabs, so just click on it and while holding the mouse button down drag it to the right. You will see two red arrows above and below the bar which indicate where it is to be placed, so when these are visible to the right of the "Scroll On" and "Scroll Off" tabs, release the mouse button.You can now click on OK to save and close the task.<br />
<br />
Now we need to create the two tasks which will either turn the screen scrolling off or on again. You will have to decide what commands you want the player to use, I myself use SCROFF (for Scroll Off) and SCRON (to turn screen scrolling back on again). So in the folder that you want these tasks to reside, right-click and choose NEW TASK. Call the first one Scroll Off (as screen scrolling is on by default) and in the command line box you just type scroff, and in the message box underneath type your completion message, e.g. "Screen Scrolling is now turned off, as below:<br />
<br />
<br />
[[File:Scroff.jpg]]<br />
<br />
<br />
" Click "Apply" to save what you have just done. Now click on the Restrictions tab and add the restriction "Variable _scroll must be equal to 0". In the message box for this restriction you should type "Screen Scrolling is already turned off." in case the player types "Scroff" when it is already off. Next you should click on the Actions tab and enter the action "Set variable _scroll to 1", then click on OK to save and close this new task.<br />
<br />
To create the task for "Scroll On" you can do it the proper way and create a new task. However, one shortcut I frequently use is to copy and paste the first task you created and alter it accordingly. So right-click on the "Scroll Off" task and paste it into the same folder. Open the copied task and make the following changes: Change the title from "Scroll Off" to "Scroll On", the command line to "scron" and the completion message to "Screen Scrolling has now been turned back on." On the Restrictions tab alter the restriction to "Variable _scroll must be equal to 1" and the default message to "Screen Scrolling is already turned on." On the Actions tab change the action to "Set variable _scroll to 0". You can now click OK to save and close the task.<br />
<br />
We will of course need to tell the player about the new options that are available to them and the simplest way of doing this can be a couple of lines At the bottom of the title page for your adventure, e.g. "To turn Screen Scrolling Off, type SCROFF and press Enter." and below that "To turn Screen Scrolling On again, type SCRON and press Enter." <br />
<br />
Now you have given the player the option to turn screen scrolling off, you must allow for this when creating any task which alters the location text in any way with a LOOK action, for example if a previously hidden object is found by the PC and appears in the current location. What you need to do is make sure there is at least one blank line after the completion message for any such task, then create an alternate description. This is where we type the shortcut <mytext> into the message box for the alternate description so that the "keypress" message is substituted by the text override we created. Set the restriction for this message to "variable _scroll must be equal to 1 then display after default".<br />
<br />
Now, if the player has chosen to turn screen scrolling off, when he or she performs an action which alters the location text, the screen will look like the image on the left and when any key is pressed the screen will refresh to the image on the right with the updated location text:<br />
<br />
<br />
[[File:Game Screen.jpg]]<br />
<br />
<br />
<br />
[[Category:Intermediate Tutorials]]</div>Lazzahhttps://wiki.adrift.co/index.php?title=File:Game_Screen.jpg&diff=1133File:Game Screen.jpg2012-12-09T11:21:06Z<p>Lazzah: uploaded a new version of &quot;File:Game Screen.jpg&quot;</p>
<hr />
<div></div>Lazzahhttps://wiki.adrift.co/index.php?title=File:LookTask.jpg&diff=1132File:LookTask.jpg2012-12-09T10:59:19Z<p>Lazzah: </p>
<hr />
<div></div>Lazzahhttps://wiki.adrift.co/index.php?title=File:Scroff.jpg&diff=1131File:Scroff.jpg2012-12-09T10:58:58Z<p>Lazzah: </p>
<hr />
<div></div>Lazzahhttps://wiki.adrift.co/index.php?title=File:Game_Screen.jpg&diff=1130File:Game Screen.jpg2012-12-09T10:58:02Z<p>Lazzah: </p>
<hr />
<div></div>Lazzahhttps://wiki.adrift.co/index.php?title=%22How_do_I...%3F%22&diff=1129"How do I...?"2012-12-09T10:57:04Z<p>Lazzah: </p>
<hr />
<div>== Create a locked door that can be opened with a key? ==<br />
<br />
* Make sure the two rooms that will be connected by the door are created and connected.<br />
* Create a '''group''' of type '''location''' and make the two rooms part of this group. This will allow you to make the door visible from the locations at each side of the door.<br />
* Create a '''new object''' of type '''dynamic''' - This is your key.<br />
* Create a '''new object''' of type '''static''' - This is your door.<br />
** Select '''Location Group''' from the '''Location of Object''' dropdown.<br />
** Select the door location group from the '''At Location Group''' dropdown.<br />
** Select the following properties for your door:<br />
*** '''Object can be opened and closed''' (Selecting this allows you to select the next two dependant properties).<br />
*** '''Open status''' - Leave as open for now.<br />
*** '''Object can be locked''' (This adds ''Locked'' to the ''Open Status'' selections, and the ''Key for lock'' property).<br />
*** Change '''Open status''' to locked.<br />
*** Select your '''key''' object from the '''Key for lock''' dropdown.<br />
* Edit one of your door locations and select the '''Directions''' tab.<br />
* Add a new [[Restrictions|restriction]] to the direction that leads to the otherside of the door. Make this restriction:<br />
** '''Object - your door - must - be in state - open'''<br />
** Depending on your settings this restriction may be copied to the second location. If not duplicate the restriction in the second location.<br />
* The door will now block progress unless it is open.<br />
* '''Note:''' As of version 5.0.16 there is no '''Lock''' command in the standard library. You will need to create this yourself.<br />
<br />
== Create a torch that will run out of batteries? ==<br />
This really needs integer properties to work, so will do a writeup once that's done. It could be done using a variable of course...<br />
<br />
== Create a dark room that the player needs a light source to see? ==<br />
Add any rooms that would be dark without a light source to the location group '''Dark Locations'''.<br />
<br />
Add any objects that are light sources to the object group '''Light Sources'''.<br />
<br />
The Dark Locations group should override the short location description, and the tasks should prevent looking and examining things whilst in a dark location without a light source.<br />
<br />
== Make a lift platform rise up out of reach when i pull a lever ==<br />
* Create a static object in a room to represent the platform or elevator, and make it a container or surface so it can hold other objects. <br />
** Press the 'Add new property' button to create an Object Property and make it a state list with two states, eg. 'up' and 'down' and give the property a name eg. 'Lift Position'.<br />
** Make sure its selected for the lift object and set it to 'down'.<br />
* Create a Lever as a static object (either in the same room or another location).<br />
* Create a specific task that overrides 'pull' for your Lever object.<br />
** If the lever and lift are in the same room then write some text describing the lift going up, otherwise just say 'You hear the sound of machinery operating for a few seconds'<br />
** Give it a restriction 'Property Lift Position for Object Lift must be Down' and a failure message 'The Lever is already in the pulled position - you could try pushing it'<br />
** Create an action 'Set Property Lift Position of Object Lift to up'.<br />
* Do the opposite for a 'push lever' specific task, so when lift is up push lever will bring it down.<br />
Now we need to describe the lift being in two different places, floor level and high in the air, in both the room description and the lift description.<br />
In both cases use the default description in the [[Text Boxes|text box]] to describe the rest of the room, then add two [[Alternate Descriptions]], one with the [[Restrictions|Restriction]] 'Property Lift Position for Object Lift must be Down' and describing the lift at ground level, and the other with 'Lift must be up' describing it high in the air and out of reach.<br />
<br />
Now we just need to make sure that anything placed on (or in) the lift is out of reach when its raised.<br />
* Create a new location thats not connected to anywhere else.<br />
* In the pull lever task add an action to move everything on (or in) the lift to the new location.<br />
* In the push lever task add an action to move everything in the new location to on (or in) the lift. <br />
<br />
== Use a button to toggle between two different states ==<br />
Using the previous example of a lift, rename the Lever to a Button, then change both the push and pull lever tasks to 'press button' tasks.<br />
Remove the text from the restrictions on both tasks.<br />
When the lift is down, only the task that raises the lift will pass its restriction.<br />
When the lift is up, only the task that lowers the lift will pass its restriction.<br />
<br />
== Create a notebook that the player can write in ==<br />
*Create a readable object (both "This object is readable" and "and description when read" selected).<br />
*Create a text variable called 'T1'<br />
*Use a "write %text%" general task to add lines to it, with the actions:<br />
<br />
<B>Set variable T1 to %PropertyValue[Object1,ReadText]%&"<&thinsp;br&thinsp;>"&%text%</b><br />
<br />
(Where Object1 is the key of the notebook object)<br />
<br />
and<br />
<br />
<b>Set property '... and description when read' of object 'notebook' to '%T1%</b><br />
<br />
Example: [http://forum.adrift.co/download/file.php?id=84 Notepad.taf]<br />
<br />
You could also add a restriction that the player must be carrying the notebook to be able to write in it.<br />
<br />
== Ask the player to enter their gender when the game starts ==<br />
Set the Player's gender property to "Male", and create a text variable called "NewGender"<br />
<br />
Create a system task called "SetGender" that has the restriction [ Variable ][ NewGender ][ must be ][ equal to ][ "female" ]<br />
<br />
Add the action [ Set property ][ The Player Character ][ Gender ] to [ Female ]<br />
<br />
<br />
Create another system task "AutoRun" set to execute "Immediately" with two actions:<br />
<br />
[ Set Variable ] [ NewGender ] to [ %PopUpChoice["Are you of the Female gender?", "female", "male"]% ]<br />
<br />
[ Execute task ] [ SetGender ]<br />
<br />
[http://forum.adrift.co/download/file.php?id=87 PopupChoice.taf]<br />
<br />
<br />
== Switch the player point-of-view between different characters ==<br />
The player does not need to always control the same character in the game, but can easily be switched to a different character using the following action:<br />
<br />
[ Move ] [ Character ] [ The Player Character ] [ to switch places with ] [<i>Character to play as</i>]. <br />
<br />
Note that '''[ The Player Character ]''' (or '''%Player%''' if used in a function) will always return the character currently being controlled by the player, whereas '''Player''' is just the default name given to the character the player starts off controlling. So these will be one and the same in most cases, until a switch places action is run.<br />
<br />
== Display on screen the text that the player has typed in? ==<br />
<br />
Say for example when we ASK a character ABOUT a subject, e.g. ASK FRED ABOUT BUSES, if what the player types in does not match the referenced text BUSES, e.g. if the player types in ASK FRED ABOUT CARS, unless the programmer has created a conversation topic with keywords that match that input, the default response from ADRIFT is "Fred doesn't appear to understand you."<br />
<br />
At the present moment we are unable to directly edit the default message, however we can use a text override and the %text% function to change the message to one that will display what the player typed in, i.e. "CARS".<br />
<br />
The first thing you need to do is open the Text Overrides folder which you will find in the main folders window. Right-click anywhere in the text overrides folder and a menu will appear, left-click on "Add Text Override" at the top and a new text override dialogue box will open. In the top dialogue box you type the text to be replaced, in this case "doesn't appear to understand you." (without the quotes!). Note that we do not specify the character name as we want to use this for all characters. In the bottom dialogue box we will type the text that you want to replace the default text with, e.g. "doesn't know anything about %text%." (again, without the quotes.) You will note that %text% will change colour to green. Lastly, click on the OK button to save the text override.<br />
<br />
Now, when the player types in ASK FRED ABOUT CARS, the message that appears will be "Fred doesn't know anything about cars." You can use the %text% function in other ways to display the players input in messages.<br />
<br />
== Give commands to characters using format "Karen, get me a coffee" ==<br />
Create a general task as follows:<br />
<br />
Command: %character%{,} %text%<br />
<br />
Restrictions: The player must have seen referenced character AND The player must be in the same location as referenced character.<br />
<br />
Action: Say %text% to referenced character.<br />
<br />
Task is repeatable.<br />
<br />
To create commands for npc's to follow, you will need to make conversation items for them. Check the box for general commands and leave the rest unchecked. In the command field, type the syntax of the instruction as the player would type it.<br />
<br />
For example, "take crate" would be in the command field and in game the player could tell the npc to take the crate by typing "say take crate to robot" or "robot, take crate". While both would work, the latter is more natural and follows the syntax for giving commands to npc's that are used in other games.<br />
<br />
== Allow for a Screen Display which Refreshes for each New Location? ==<br />
<br />
When anyone is playing your adventure, the default screen display is set so that the screen will scroll up as the Player Character (PC) moves around. However, some players prefer that the location text should refresh when moving into a new location. If you want to allow the player the option to do this in your game, this is one way that you should do it:<br />
<br />
First of all, define a new variable. You can call this what you like, in my games I just call it "scroll" but you should put an underscore in front (i.e. "_scroll") so that it will always be at the top of the variable list when you need to put it into a restriction or an action. This variable will be initally 0 and will be set to 1 when the player choses the "SCROFF" option we will be programming later.<br />
<br />
You will also need a "keypress" message for when the location text changes as a result of an action by the player. You want the player to be able to read any messages that a task will display before the screen refreshes with the new location description. In my adventures I have a message that appears in green under the text like so:<br />
<br />
<br />
<b><centre><font color = green>Press the Space Bar to Continue.....</font></center><br><br />
<waitkey></b><br />
<br />
<br />
The <waitkey> line will pause the Runner until a key is pressed. As you will be inserting this message in lots of tasks, you do not want to have to type the whole message every time. The easiest way of doing this is to define a text override with something like <mytext> as the original text and the replacement text as the "keypress" message as above. <br />
<br />
Now, whenever the player moves to another location, the LOOK task is activated to display the location description, so if we want the screen to refresh when the PC moves to another room, we must redefine this task. The Look task is in the "Look and Examine" folder within the Standard Library folder in the Folders window on the left of the screen, as below.<br />
<br />
<br />
[[File:LookTask.jpg]]<br />
<br />
<br />
When you open this task you will see in the default message box <b>DisplayLocation[%LocationOf[%Player%]%]%</b> in blue, plus an alternate description which is displayed if the location is dark and the PC is not carrying a light source. What is useful at this stage is if you rename this alternate description, so just right-click on the "alternate description" tab and rename it to something like "Dark Locations".<br />
<br />
Next you should open a new alternate description, so either right-click on the task and select "Add Alternate Description" or move your cursor to the right of the "Dark Locations" tab and you will see a tab appear which when you click on it will add and open an alternate description. Rename the tab for this description as (for example) "Scroll On". What you should do now is go back to the default description and highlight <b>%DisplayLocation[%LocationOf[%Player%]%]%</b>. You need to copy this then delete it from the default description window. Now open the new "Scroll On" tab and paste what you have just copied into the message box. In the restriction box above the message window you should define the restriction as "Variable _scroll must be equal to 0" then "Start Description with". After you have done this click on the "Apply" button to save the changes without closing the task.<br />
<br />
Now you repeat the above step to create a second alternate description, calling this one (e.g.) "Scroll Off". However, before you paste the completion message into the box type <cls> first then paste the message immediately after this so that it reads:<br />
<br />
<br />
<b><cls>%DisplayLocation[%LocationOf[%Player%]%]%</b><br />
<br />
<br />
The restriction for this message must be "Variable _scroll must be equal to 1" then "Start Description with". Now open the Actions tab and add the action "Set variable _scroll to 1". Click apply to save what you have done,<br />
<br />
The final step before we save and close the re-defined task is to move the "Dark Locations" tab to the right so that it is after the two new tabs, so just click on it and while holding the mouse button down drag it to the right. You will see two red arrows above and below the bar which indicate where it is to be placed, so when these are visible to the right of the "Scroll On" and "Scroll Off" tabs, release the mouse button.You can now click on OK to save and close the task.<br />
<br />
Now we need to create the two tasks which will either turn the screen scrolling off or on again. You will have to decide what commands you want the player to use, I myself use SCROFF (for Scroll Off) and SCRON (to turn screen scrolling back on again). So in the folder that you want these tasks to reside, right-click and choose NEW TASK. Call the first one Scroll Off (as screen scrolling is on by default) and in the command line box you just type scroff, and in the message box underneath type your completion message, e.g. "Screen Scrolling is now turned off, as below:<br />
<br />
<br />
[[File:Scroff.jpg]]<br />
<br />
<br />
" Click "Apply" to save what you have just done. Now click on the Restrictions tab and add the restriction "Variable _scroll must be equal to 0". In the message box for this restriction you should type "Screen Scrolling is already turned off." in case the player types "Scroff" when it is already off. Next you should click on the Actions tab and enter the action "Set variable _scroll to 1", then click on OK to save and close this new task.<br />
<br />
To create the task for "Scroll On" you can do it the proper way and create a new task. However, one shortcut I frequently use is to copy and paste the first task you created and alter it accordingly. So right-click on the "Scroll Off" task and paste it into the same folder. Open the copied task and make the following changes: Change the title from "Scroll Off" to "Scroll On", the command line to "scron" and the completion message to "Screen Scrolling has now been turned back on." On the Restrictions tab alter the restriction to "Variable _scroll must be equal to 1" and the default message to "Screen Scrolling is already turned on." On the Actions tab change the action to "Set variable _scroll to 0". You can now click OK to save and close the task.<br />
<br />
We will of course need to tell the player about the new options that are available to them and the simplest way of doing this can be a couple of lines At the bottom of the title page for your adventure, e.g. "To turn Screen Scrolling Off, type SCROFF and press Enter." and below that "To turn Screen Scrolling On again, type SCRON and press Enter." <br />
<br />
Now you have given the player the option to turn screen scrolling off, you must allow for this when creating any task which alters the location text in any way with a LOOK action, for example if a previously hidden object is found by the PC and appears in the current location. What you need to do is make sure there is at least one blank line after the completion message for any such task, then create an alternate description. This is where we type the shortcut <mytext> into the message box for the alternate description so that the "keypress" message is substituted by the text override we created. Set the restriction for this message to "variable _scroll must be equal to 1 then display after default".<br />
<br />
Now, if the player has chosen to turn screen scrolling off, when he or she performs an action which alters the location text, the screen will look like this:<br />
<br />
<br />
[[File:Game Screen.jpg]]<br />
<br />
<br />
<br />
[[Category:Intermediate Tutorials]]</div>Lazzahhttps://wiki.adrift.co/index.php?title=Text_Overrides&diff=1128Text Overrides2012-12-05T08:17:28Z<p>Lazzah: </p>
<hr />
<div>Text Overrides are the new name for the v4 ADRIFT Language Resource (ALR). Rather than being edited externally and imported as in v4, v5 Text Overrides are edited within the application.<br />
<br />
Text Overrides simply replace the final text before it is displayed to the end user. This provides a convenient way of globally changing particular output without having to modify each individual item. It is also useful for changing any "fixed" text, i.e. anything output by the application that is not stored as part of the library. (NB. I am working to reduce this all the time, and hope to eventually store ''all'' text within the library.)<br />
<br />
Text Overrides can also be a useful tool to use for the ALR's original purpose; a language resource to convert any English output to other languages. This shouldn't be such an issue with v5 as different libraries can be created for each language.<br />
<br />
Text Overrides are applied in order of length. This ensures an override that is a subset of a longer one does not prevent the longer one from overriding. For example, if you had the following overrides:<br />
<br />
You take => You pick up<br />
pick => select<br />
<br />
If the shorter override applied first, "You take the ball." would be output as "You select the ball." rather than "You pick up the ball."<br />
<br />
The Text Override editing window looks like this:<br />
<br />
[[File:TextOverride.jpg]]<br />
<br />
The original text is typed at the top and the text you want to replace it with at the bottom. If you do not want the original text to be displayed at all, just leave the bottom window blank.<br />
<br />
Note that you can use an [[Alternate Descriptions|alternate description]] in the lower text box to alter the Replacement text using restrictions.<br />
<br />
An example of this is that you can, if you wish, define a text override that will apply, for example, in only one location. Let's say you have an object (a rowing boat) that you want the normal description ("Here you see a rowing boat.") to display in one location, but in another location you want the description to read "Tied up at the jetty is a rowing boat." To do this you should leave the default description blank and first of all define an alternate description that is the same as the original text, i.e. "Here you see a rowing boat." Set the restriction for the location that this description applies to and set it to "Start description with". Then you define a second alternate description, "Tied up at the jetty is a rowing boat." Set the restriction as the location you want this description displayed in and also set this as "Start description with".<br />
<br />
It is also possible to have a sound play, or show an image, when the replacement text is shown.</div>Lazzahhttps://wiki.adrift.co/index.php?title=Getting_Started&diff=1127Getting Started2012-12-04T15:05:16Z<p>Lazzah: /* Introduction & End of Game */</p>
<hr />
<div>You've installed ADRIFT, played a few games, and now your ready to write your first ADRIFT game.<br />
So where do you start?<br />
== The ADRIFT 5 Developer ==<br />
When you open the ADRIFT developer (dev500.exe for version 5.0) you are greeted with the following screen:<br />
<br />
[[File:MainWindowSimple.jpg]]<br />
<br />
There are 4 main areas on the screen, toolbars & menu's at the top, a hierarchical list of [[Folders]] down the left side, a blank window titled 'Map' in the middle, and five small list boxes ([[Locations]], [[Objects]], [[Tasks]], [[Characters]] & [[Events]]) along the bottom that show the contents of open folders.<br />
Only one of these has anything in it, the Characters folder contains the entry 'Player'.<br />
<br />
[[File:CharactersPlayer.jpg]]<br />
<br />
This represents the player character in the game.<br />
<br />
We will need to create any other characters needed in the game, all of the rooms that your Adventure will be set in, and all of the objects that the player can interact with.<br />
<br />
In the Folders window you will notice a small triangle to the left of 'Standard Library': <br />
[[File:FoldersLib.jpg]]<br />
<br />
When you click on it the folders contained within this folder will be shown or hidden.<br />
Double-clicking the name 'Standard Library' does the same.<br />
Leave it closed for the rest of this tutorial.<br />
<br />
Close the 5 list-box windows using the red X in their top-right corner. Now double-click on the 'Locations' folder.<br />
The locations folder list-box has opened again. A folder can contain other folders, like the Standard Library folder, or it contains ADRIFT items, in which case it opens as a list box at the bottom of the screen.<br />
<br />
== Your first room == <br />
Near the top of the screen is the main toolbar ribbon:<br />
<br />
[[File:HomeRibbonSimple.jpg]]<br />
<br />
Click the "Location" button in the "Add Items" section, with the picture of a house on it.<br />
This will open the New Location editing window (shown below) where you describe a room or outdoor location for your interactive story.<br />
In the short Description field give the room a name, and in the Long Description describe what the room looks like, including any furniture or decorations that the player wont be able to pick up or move.<br />
Make sure you include something with a surface like a table, and something to sit on, as we will be using them in this tutorial.<br />
I use a simple desk & chair in the example:<br />
<br />
[[File:NewLocationSimple.jpg]]<br />
<br />
When you click the "OK" button, you will see a yellow rectangle marked "Study" appear in the centre of the map, and in the "Location" folder there will now be an entry with a smaller version of the house icon next to the name of the room.<br />
<br />
== Introduction & End of Game ==<br />
Click on the circular button at the very top left corner of the screen to open the main menu, then select "Introduction & End of Game".<br />
<br />
[[File:Main_Menu.JPG]]<br />
<br />
The following dialog will open:<br />
<br />
[[File:TuturialIntro.jpg]]<br />
<br />
This is where you enter the introduction to your game. It is the first thing that the player will read.<br />
You should indicate the goal of the game here, and any special information they need to play the game.<br />
We want the player to start in the Study, so select this room in the drop-down list labeled "Start the adventure at location"<br />
Also tick the "Display first room description" box, so that the description of the study is given immediately after the introduction.<br />
<br />
Did you notice the squigly red line under the word "tommorrow"? This is ADRIFT's automatic spell-checker telling us that we have made a spelling mistake.<br />
Right-click on the offending word and select the correct spelling from the list provided.<br />
<br />
If you have typed a word correctly, but the spell-checker still doesn't recognise it and puts a red line under it, Right-click on the word and you will see in the list the option to "Add to Dictionary". Click on this and the word will be added to the User Dictionary.<br />
<br />
Note: the spell-checker will sometimes not recognise a word that has an apostrophe in it, i.e. water's (as in water's edge). Right-clicking on the word in this instance will not give you the option to "Add to Dictionary". In this case you can open the User Dictionary using a basic word processor such as Notepad or Wordpad then type the word into the dictionary and save it afterwards.<br />
<br />
If you select the "End of Game" tab you can also enter a message to be displayed after the game finishes.<br />
<br />
== Saving ==<br />
Choose "Save As" from the main menu to create a new .taf file and save your work so far.<br />
You should save your game whenever you add more to it than you would like to loose if there is an unexpected power failure.<br />
As well as "Save" on the main menu there is a small save button [[File:IconSave.jpg]] next to the main menu button, and you can also save by pressing Ctrl+S on the keyboard.<br />
<br />
== Objects ==<br />
The person playing your game will expect to be able to examine every object that you mentioned in your room description, so we need to create objects for the desk, and chair.<br />
Click on the "Object" button on the toolbar with the picture of a treasure chest on it.<br />
This will open the "New Object" editing window.<br />
Create a new object to represent the desk:<br />
<br />
[[File:New Object.jpg]]<br />
<br />
The "Article" field usually contains "a" or "an" for common objects, and "the" for a unique object.<br />
The "Prefix/Adjective" field contains descriptive words about the object, such as its color, weight, size, or the material it is made out of.<br />
The "Name/Noun(s)" field should contain a single word that identifies what the object is (desk, chair, telephone, cat, mat etc.)<br />
* When the player refers to the object in the game they must use the noun, but the adjectives are optional unless there is more than one object of the same type at the players location. Hence the desk may be refered to as "desk", "wooden desk", "small desk" or "small wooden desk".<br />
The "Description" field is the message that is shown when the player types "examine desk".<br />
<br />
Click on the properties tab:<br />
<br />
[[File:ObjectProperties.jpg]]<br />
<br />
This is where you specify characteristics of the object, including its location.<br />
The first entry lets you select the Object Type, Static or Dynamic.<br />
Static objects are objects that remain part of a room (such as furniture) or are parts of other objects or characters. <br />
<br />
Dynamic objects are things that can be picked up by the player, such as books, swords, food, bats, balls and bags.<br />
<br />
Our desk will not be picked up by the player so we leave it as static.<br />
<br />
The "Location of object" is given as "Hidden", but we want it to be in our study, so select "Single Location" from the drop-down list.<br />
* Selecting or altering properties can make other properties available, in this case an "At Location" property.<br />
Select "Study" from the drop-down list to put the desk into our room.<br />
A desk has a flat surface that we can put things on. This is done by selecting the "Object is a supporter" property.<br />
<br />
When you click the "OK" button "a small wooden desk" will appear in the "Objects" folder, with the palm-tree icon next to it to indicate that it is a "static" object.<br />
<br />
A quicker way to add an object to a location is to right click on the location in the "Locations" folder and select the "Add object to location" option.<br />
Do this and create a static object to represent the chair, filling in adjectives and a description for whatever type of chair you want it to be. <br />
On the properties tab you will notice that the "At Location" property has already been set to "study" by using this method to create the object.<br />
<br />
Select the "Object is a supporter" property as we did for the table.<br />
<br />
This makes the "Characters can sit on this object" property available. Select it as well (as that's what chairs are for) and click "OK".<br />
<br />
But the object appears in the "Locations" folder instead of the "Objects" folder?<br />
ADRIFT actually lets you organise objects into folders any way you want to, so you can either put all the objects in the Objects folder or put them directly under the room that they are located in.<br />
<br />
Drag one of the objects to the other folder.<br />
<br />
== Moving between Locations ==<br />
You can create a new location simply by double clicking on the map. This has the advantage that you can position it in the correct location relative to your other locations.<br />
Like all maps, north is at the top and west is to the left.<br />
<br />
We want our new room to be west of the study, so double click on the map directly left of the study.<br />
<br />
[[File:MapNewLocation.jpg]]<br />
<br />
A location called "New Location" will appear on the map and also in the "Locations" folder.<br />
<br />
Drag the location on the map with the mouse to adjust its position so that it is square with the study, and with a gap between them, then double-click on it to open the location editor.<br />
<br />
Change its short description to "Bedroom" and enter a long description that describes a room with a bed in it.<br />
<br />
Select the Contents tab.<br />
<br />
[[File:NewLocationContents.jpg]]<br />
<br />
At the bottom left of this page you will see a button marked "Add Static Object" with an icon like a small palm tree.[[File:IconStaticObject.jpg]]<br />
<br />
This button is used to create new static objects in this room.<br />
<br />
When you click on it the 'New Object' window will open. Type "Bed" in the name/noun field, and enter a Description for it.<br />
<br />
Select the properties tab.<br />
<br />
An object created by pressing the button on the location window will already have its location property set, so we only need to set the properties that control how the player can interact with it. <br />
<br />
Select these 4 properties: (The last 3 will not be visible until the first property has been selected)<br />
* Object is a supporter <br />
* Characters can lie on this object<br />
* Characters can sit on this object<br />
* Characters can stand on this object<br />
Press OK and return to the Location editor. Press the "Add Static Object" button again to create another object.<br />
<br />
This time make a book.<br />
<br />
Unlike our previous objects, a book is something that the player can pick up and carry around, so on the properties page select "Dynamic".<br />
<br />
We want to leave the book on the bed, so set "Location of the object" to "On Object" and "On What?" to "a bed".<br />
<br />
Because its a book we want to be able to read it, so scroll down until you find the "This object is readable" property and select it.<br />
<br />
Below this also select "and description when read" and enter the contents of your book into the text box.<br />
<br />
Press OK, and back in the Location editor select the Directions tab:<br />
<br />
[[File:LocationDirectionsSimple.jpg]]<br />
<br />
The study is east of this room, so on the "Move east to" line select "Study" from the drop-down list.<br />
<br />
Press the OK button. ADRIFT will ask you if you want to also connect west from the study to the bedroom. Choose Yes.<br />
<br />
On the map there will now be a line shown linking the two rooms:<br />
<br />
[[File:MapLinkedRooms.jpg]]<br />
<br />
Save the game and press the "Run Adventure" button (either the one at the right of the "Home" toolbar or the green triangle next to the save button at the top of the screen). <br />
<br />
Try moving between the rooms, getting the book from the bed and putting it on the desk, reading it, laying on the bed and sitting on the chair.<br />
<br />
== Tasks ==<br />
We still dont have any way to win the game, so we will override the standard library "Read" [[Tasks|task]] to end the game if certain conditions are met.<br />
<br />
Click the Task button with the big red tick on the home toolbar. This will open the new task dialog:<br />
<br />
[[File:NewGeneralTaskSimple.jpg]]<br />
<br />
Give the task a name (eg. "Read Book") and click on "Specific" to change it from a general task to a specific task.<br />
<br />
This will change the section below the button to:<br />
<br />
[[File:SpecificTask.jpg]]<br />
<br />
We want to keep the existing behaviour which reads the book, and then run our new task to end the game, so change the 'run before' drop-down to 'run after' and select the 'Read objects' task from the next drop-down.<br />
* This is a long list, but if you press the 'R' key it will jump to tasks starting with 'R'<br />
'Read object' appears on the next line with the word 'object' highlighted.<br />
Click on it and select 'a book' from the list.<br />
<br />
[[File:SpecificTaskRead.jpg]]<br />
<br />
The line will now show: 'read a book'.<br />
<br />
* In the 'Message to display on completion' [[Text Boxes|text box]] enter "You have successfully studied algebra."<br />
* Click on the [[Restrictions list|Restrictions]] tab. This is where we will specify the conditions that must be met before this specific task will be executed.<br />
* Press the 'Add' button to open the [[Restrictions|Restriction]] editing dialog.<br />
* Select the 'Character' tab.<br />
* Using the drop-down lists, enter the following restriction:<br />
<br />
[[File:RestrictionSitOnChair.jpg]]<br />
<br />
The general 'Read object' task in the standard library already checks that the book is visible to the player and is readable.<br />
If the player is not sitting on the chair when they try to read the book then they can still read it but they wont win the game.<br />
If they are on the chair then the action we are about to create will be executed. <br />
<br />
* Press OK<br />
* Select the '[[Actions]]' tab of the task and press the 'Add' button to create a new action.<br />
* Select the 'End Game' tab and choose 'in Victory' from the drop-down list<br />
<br />
[[File:ActionEndGame.jpg]]<br />
<br />
* Press OK, then OK on the Task dialog<br />
* Save and run the game<br />
Now when you play the game you can still read the book anywhere, but you will only win the game if you take the book from the bed and sit on the desk chair to read it.<br />
<br />
<br />
<br />
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[ADRIFT 5 fundamentals|<<< ADRIFT 5 fundamentals]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[ADRIFT_5_Wiki_Manual|Main Page]]</TD><TD ALIGN=CENTER>[[The command parser|The command parser >>>]]</TD></TABLE><br />
[[Category:Introductory Tutorials]]</div>Lazzahhttps://wiki.adrift.co/index.php?title=Text_Overrides&diff=1126Text Overrides2012-12-04T11:26:06Z<p>Lazzah: </p>
<hr />
<div>Text Overrides are the new name for the v4 ADRIFT Language Resource (ALR). Rather than being edited externally and imported as in v4, v5 Text Overrides are edited within the application.<br />
<br />
Text Overrides simply replace the final text before it is displayed to the end user. This provides a convenient way of globally changing particular output without having to modify each individual item. It is also useful for changing any "fixed" text, i.e. anything output by the application that is not stored as part of the library. (NB. I am working to reduce this all the time, and hope to eventually store ''all'' text within the library.)<br />
<br />
Text Overrides can also be a useful tool to use for the ALR's original purpose; a language resource to convert any English output to other languages. This shouldn't be such an issue with v5 as different libraries can be created for each language.<br />
<br />
Text Overrides are applied in order of length. This ensures an override that is a subset of a longer one does not prevent the longer one from overriding. For example, if you had the following overrides:<br />
<br />
You take => You pick up<br />
pick => select<br />
<br />
If the shorter override applied first, "You take the ball." would be output as "You select the ball." rather than "You pick up the ball."<br />
<br />
The Text Override editing window looks like this:<br />
<br />
[[File:TextOverride.jpg]]<br />
<br />
The original text is typed at the top and the text you want to replace it with at the bottom. If you do not want the original text to be displayed at all, just leave the bottom window blank.<br />
<br />
Note that you can use an [[Alternate Descriptions|alternate description]] in the lower text box to alter the Replacement text using restrictions.<br />
<br />
It is also possible to have a sound play, or show an image, when the replacement text is shown.</div>Lazzahhttps://wiki.adrift.co/index.php?title=Macros&diff=1113Macros2012-11-24T07:04:26Z<p>Lazzah: /* How to do */</p>
<hr />
<div>== What it is ==<br />
As defined in the Runner Menus and Toolbars page, a macro is essentially a bunch of things that can be done with the press of a key.<br />
<br><br />
<br />
== How to do ==<br />
First, click the Macro menu and click on '''Edit Macro'''.<br />
The '''Edit Macro''' window will open. Then, click '''Add''', type the name in the textbox and click '''OK'''. Our first macro is partially created. Now, here comes the fun part:<br />
You should see that there is a huge textbox on the right side of the Edit Macro window. It's in that textbox that all in-macro commands will be typed. Click the textbox and type direction commands, each on one line. Then click the drop-down menu Shortcut and select a key.<br />
Once everything is done, press the macro shortcut key and all commands will be executed.<br />
<br />
Note: You can insert comments in a macro to remind you what happens by inserting a line starting with the hash symbol: #<br />
<br />
'''WARNING: Macros are normally used for testing. Any use of macros in finished games is considered cheating!'''</div>Lazzahhttps://wiki.adrift.co/index.php?title=%22How_do_I...%3F%22&diff=660"How do I...?"2012-05-19T10:42:39Z<p>Lazzah: </p>
<hr />
<div>== Create a locked door that can be opened with a key? ==<br />
<br />
* Make sure the two rooms that will be connected by the door are created and connected.<br />
* Create a '''group''' of type '''location''' and make the two rooms part of this group. This will allow you to make the door visible from the locations at each side of the door.<br />
* Create a '''new object''' of type '''dynamic''' - This is your key.<br />
* Create a '''new object''' of type '''static''' - This is your door.<br />
** Select '''Location Group''' from the '''Location of Object''' dropdown.<br />
** Select the door location group from the '''At Location Group''' dropdown.<br />
** Select the following properties for your door:<br />
*** '''Object can be opened and closed''' (Selecting this allows you to select the next two dependant properties).<br />
*** '''Open status''' - Leave as open for now.<br />
*** '''Object can be locked''' (This adds ''Locked'' to the ''Open Status'' selections, and the ''Key for lock'' property).<br />
*** Change '''Open status''' to locked.<br />
*** Select your '''key''' object from the '''Key for lock''' dropdown.<br />
* Edit one of your door locations and select the '''Directions''' tab.<br />
* Add a new [[Restrictions|restriction]] to the direction that leads to the otherside of the door. Make this restriction:<br />
** '''Object - your door - must - be in state - open'''<br />
** Depending on your settings this restriction may be copied to the second location. If not duplicate the restriction in the second location.<br />
* The door will now block progress unless it is open.<br />
* '''Note:''' As of version 5.0.16 there is no '''Lock''' command in the standard library. You will need to create this yourself.<br />
<br />
== Create a torch that will run out of batteries? ==<br />
This really needs integer properties to work, so will do a writeup once that's done. It could be done using a variable of course...<br />
<br />
== Create a dark room that the player needs a light source to see? ==<br />
Add any rooms that would be dark without a light source to the location group '''Dark Locations'''.<br />
<br />
Add any objects that are light sources to the object group '''Light Sources'''.<br />
<br />
The Dark Locations group should override the short location description, and the tasks should prevent looking and examining things whilst in a dark location without a light source.<br />
<br />
== Make a lift platform rise up out of reach when i pull a lever ==<br />
* Create a static object in a room to represent the platform or elevator, and make it a container or surface so it can hold other objects. <br />
** Press the 'Add new property' button to create an Object Property and make it a state list with two states, eg. 'up' and 'down' and give the property a name eg. 'Lift Position'.<br />
** Make sure its selected for the lift object and set it to 'down'.<br />
* Create a Lever as a static object (either in the same room or another location).<br />
* Create a specific task that overrides 'pull' for your Lever object.<br />
** If the lever and lift are in the same room then write some text describing the lift going up, otherwise just say 'You hear the sound of machinery operating for a few seconds'<br />
** Give it a restriction 'Property Lift Position for Object Lift must be Down' and a failure message 'The Lever is already in the pulled position - you could try pushing it'<br />
** Create an action 'Set Property Lift Position of Object Lift to up'.<br />
* Do the opposite for a 'push lever' specific task, so when lift is up push lever will bring it down.<br />
Now we need to describe the lift being in two different places, floor level and high in the air, in both the room description and the lift description.<br />
In both cases use the default description in the [[Text Boxes|text box]] to describe the rest of the room, then add two [[Alternate Descriptions]], one with the [[Restrictions|Restriction]] 'Property Lift Position for Object Lift must be Down' and describing the lift at ground level, and the other with 'Lift must be up' describing it high in the air and out of reach.<br />
<br />
Now we just need to make sure that anything placed on (or in) the lift is out of reach when its raised.<br />
* Create a new location thats not connected to anywhere else.<br />
* In the pull lever task add an action to move everything on (or in) the lift to the new location.<br />
* In the push lever task add an action to move everything in the new location to on (or in) the lift. <br />
<br />
== Use a button to toggle between two different states ==<br />
Using the previous example of a lift, rename the Lever to a Button, then change both the push and pull lever tasks to 'press button' tasks.<br />
Remove the text from the restrictions on both tasks.<br />
When the lift is down, only the task that raises the lift will pass its restriction.<br />
When the lift is up, only the task that lowers the lift will pass its restriction.<br />
<br />
== Create a notebook that the player can write in ==<br />
*Create a readable object (both "This object is readable" and "and description when read" selected).<br />
*Create a text variable called 'T1'<br />
*Use a "write %text%" general task to add lines to it, with the actions:<br />
<br />
<B>Set variable T1 to %PropertyValue[Object1,ReadText]%&"<&thinsp;br&thinsp;>"&%text%</b><br />
<br />
(Where Object1 is the key of the notebook object)<br />
<br />
and<br />
<br />
<b>Set property '... and description when read' of object 'notebook' to '%T1%</b><br />
<br />
Example: [http://forum.adrift.co/download/file.php?id=84 Notepad.taf]<br />
<br />
You could also add a restriction that the player must be carrying the notebook to be able to write in it.<br />
<br />
== Ask the player to enter their gender when the game starts ==<br />
Set the Player's gender property to "Male", and create a text variable called "NewGender"<br />
<br />
Create a system task called "SetGender" that has the restriction [ Variable ][ NewGender ][ must be ][ equal to ][ "female" ]<br />
<br />
Add the action [ Set property ][ The Player Character ][ Gender ] to [ Female ]<br />
<br />
<br />
Create another system task "AutoRun" set to execute "Immediately" with two actions:<br />
<br />
[ Set Variable ] [ NewGender ] to [ %PopUpChoice["Are you of the Female gender?", "female", "male"]% ]<br />
<br />
[ Execute task ] [ SetGender ]<br />
<br />
[http://forum.adrift.co/download/file.php?id=87 PopupChoice.taf]<br />
<br />
<br />
== Switch the player point-of-view between different characters ==<br />
The player does not need to always control the same character in the game, but can easily be switched to a different character using the following action:<br />
<br />
[ move ] [ character ] [ the player character ] [ to switch places with ] [(<i>Character to play as</i>)]. <br />
<br />
Note that the key "Player" used in a function or selected from a character list will always refer to the default "Player" character, while the function "%Player%" or selecting "[ The Player Character ]" from a character list will refer to the character currently being controlled by the player, as set by the action above.<br />
<br />
== How do I display on screen the text that the player has typed in? ==<br />
<br />
Say for example when we ASK a character ABOUT a subject, e.g. ASK FRED ABOUT BUSES, if what the player types in does not match the referenced text BUSES, e.g. if the player types in ASK FRED ABOUT CARS, unless the programmer has created a task to cover that input, the default response from ADRIFT is "Fred doesn't appear to understand you."<br />
<br />
At the present moment we are unable to directly edit the default message, however we can use a text override and the %text% function to change the message to one that will display what the player typed in, i.e. "CARS".<br />
<br />
The first thing you need to do is open the Text Overrides folder which you will find in the main folders window. Right-click anywhere in the text overrides folder and a menu will appear, left-click on "Add Text Override" at the top and a new text override dialogue box will open. In the top dialogue box you type the text to be replaced, in this case "doesn't appear to understand you." (without the quotes!). Note that we do not specify the character name as we want to use this for all characters. In the bottom dialogue box we will type the text that you want to replace the default text with, e.g. "doesn't know anything about %text%." (again, without the quotes.) You will note that %text% will change colour to green. Lastly, click on the OK button to save the text override.<br />
<br />
Now, when the player types in ASK FRED ABOUT CARS, the message that appears will be "Fred doesn't know anything about cars." You can use the %text% function in other ways to display the players input in messages.</div>Lazzahhttps://wiki.adrift.co/index.php?title=Modules&diff=96Modules2011-08-01T09:56:43Z<p>Lazzah: </p>
<hr />
<div>ADRIFT 5 Modules are simply the same data that is stored in a TAF, but in an uncompressed text format. The data format used to encode modules is XML, so modules can be viewed or edited with an appropriate XML editor or viewer such as Notepad or Internet Explorer.<br />
<br />
Modules can also be used as Libraries, by simply selecting them in the Libraries list in Settings. However, before doing so it is necessary to remove a few sections, otherwise they will interfere with your adventure. These are the '''Title''', '''Author''' and '''ShowExits''' tags at the start of the file, and the '''Map''' section at the end.<br />
<br />
At present, when you export a module it will save the entire game, you cannot select individual items or folders for export into other games files. Campbell is developing the facility to select individual folders for export and this will be implemented at a future date.</div>Lazzah