Page 1 of 2

PostPosted: Mon Oct 17, 2005 7:53 pm
by KFAdrift
Thought it would be goo to try and pull together some of thos e really useful features so that others can see and use them.

I will start off with:

Use the ALR to add quick depth to a game

Instead of using task to redefine how a command works use, if you are not really doing something, the ALR can quickly give the appearance of action.

* ALR is an ADRIFT Language Resource file, which is created in a text file and then imported into the game.

As an example:
Code: Select all
The bedroom
A smart bedroom with a comfortable bed in the middle.

> x bed
A large double bed with a deep luxurious mattress.  

> lie on bed
You lie down on the bed, luxuriating in its comfort, but quickly remember you have no time to sleep and get up again.


Here the bed is not set up so that the player can lie on it, instead the default response is trapped and changed by the ALR.

The text in the ALR file is:
Code: Select all
You can't lie on the bed.|You can't lie on the bed.|You lie down on the bed, luxuriating in its comfort, but quickly remember you have no time to sleep and get up again.


The default response of "You can't lie on the bed." doesn't help the game so it is changed to "You can't lie on the bed.|You lie down on the bed, luxuriating in its comfort, but quickly remember you have no time to sleep and get up again.".

The useful feature of this technique is that whatever object alias is used the output of the default response is the same, so "lie on mattress" would have worked too.

PostPosted: Mon Oct 17, 2005 8:04 pm
by David Whyld
You might want to add that you need to save the ALR with the alr extension, not the default notepad extension of txt, or it won't import into the game. Also, that you can't include blank lines in the ALR or it won't work.

PostPosted: Mon Oct 17, 2005 8:30 pm
by rotter
Using the ALR to change object descriptions

You can also use the ALR to add a little more information to an object. For example if you had an old fuel can you could use ALR to indicate whether it is full, empty or half full. In the ALR add -

Code: Select all
fuel0|empty
fuel1|half full of some kind of liquid
fuel2|full of some kind of liquid


Then create a variable called fuel-can which will be set to 0, 1 or 2. Create the description of the fuel can something along the lines of -

Code: Select all
The battered old fuel can appears fuel%fuel-can%.


So, examining the fuel can with the variable fuel-can set to 1 would result in -

Code: Select all
The battered old fuel can appears half full of some kind of liquid.

PostPosted: Mon Oct 17, 2005 9:23 pm
by KFAdrift
This wasn't intended just as an ALR thread, but another useful hint is to use the ALR for repetitive formatting of game text.

An expample would be if you wanted to format paragraphs then you could put:

Code: Select all
<p>|<br><br>


in the ALR which would insert to standard ADRIFT line breaks to replace the

, saving five keypresses for each use.

David Whyld uses:

Code: Select all
<a>|<br>  
<aa>|<br><br>


In the ALR where the first line gives a break followed by three spaces and is used to indent paragraphs. The second line is the same as my

example.

One thing you can do is create your own html style tags like for formatting a quote.

Code: Select all
<quote>|<i>"
</quote>|"</i>


Would mean <quote>This is something said</quote> would come out as "This is something said". The advantage of this is that, should you change your mind, changing the ALR will change all occurrences in the game.

PostPosted: Mon Oct 17, 2005 9:59 pm
by David Whyld
One thing I do sometimes is have lots of formatting taken care off with a few characters in the ALR:

<d1>|<B><U><font size=+5>
<d2>|</B></U><font size=-5>

Put <d1> before a block of text and <d2> after and the text between them comes out bold, underline and 5 points larger than the rest of the text.

PostPosted: Tue Oct 18, 2005 8:56 am
by Chenshaw
Wow, I never knew you could do that with paragraph formatting. Cool.

One thing I've had to work through alot in one of the games I'm working on is location descriptions. I started out using the if-then-else boxes on the room dialogue box, but found this became increasingly complicated and didn't always work if you wanted room descriptions to change depending on which direction you were coming from. After getting help on this forum, and testing it out, I started putting room descriptions into movement tasks. You do have to coordinate these specific descriptions with the basic description though, otherwise it's too obvious or odd-sounding.

So for example:

Basic room description (Large Room): Peering around, I can just make out how large this room is from the faint light of the window above me. It is dominated by a gigantic fireplace with smouldering coals and two large leather chairs facing it.


Then for the tasks:
[e/east] description: nothing in the first box
set 'then show description for room' to Large Room
in second box: As I enter from the west, a shaggy-haired man turns in one of the chairs and stares at me.


Now whenever you enter this room from the west, you will get this:
Peering around, I can just make out how large this room is from the faint light of the window above me. It is dominated by a gigantic fireplace with smouldering coals and two large leather chairs facing it.

As I enter from the west, a shaggy-haired man turns in one of the chairs and stares at me.


But when you type look you will only get:
Peering around, I can just make out how large this room is from the faint light of the window above me. It is dominated by a gigantic fireplace with smouldering coals and two large leather chairs facing it.


Of course you can do a specific description for all directions. I find this works particularly well if you are travelling along a path or road. Using the ALR you can also have changing descriptions for a single task (where the description changes each time you enter from a particular direction).

PostPosted: Tue Oct 18, 2005 8:36 pm
by KFAdrift
A quick tip I find useful is to make "a", "an" and "the" synonyms for a space. This will remove them from any input and simplify your task commands.

PostPosted: Tue Nov 01, 2005 1:12 am
by NickyDude
Always put descriptions in anything you describe in your room, e.g:

<span style='font-family:verdana'>"It seems like this porch has been in disrepair for some time, rotten planks, boards missing, moss everywhere, whoever lives here obviously doesn't expect visitors or doesn't have the time for repairs. Eyeing the door in front of you the north, you notice it is large and forboding, made of solid oak with intricate carvings, a bit different from the unrepaired porch. A large brass knocker in the shape of a dragon's head holding a ring stares at you, daring you to grasp it. What looks like a frayed bell-pull dangles to one side."</span>

The things you'd put descriptions for here would be:

Porch
planks / boards
moss
front door
carvings
brass knocker / knocker / dragon's head / ring
frayed bell-pull / bell-pull / bell pull

There's nothing worse than typing: "examine <whatever>" only to be greeted with "You see no such thing." when it's clearly described in the description.




Edited By NickyDude on 1130807561

PostPosted: Tue Nov 01, 2005 4:01 am
by Basilisk
Here's a useful trick for when you are trying to find an obscure output or debug statement that you just can't seem to locate.

Since ADRIFT doesn't have support for searching strings in descriptions or tasks, use taf2inf to convert the .taf to an inform file. Then open the two output files in notepad and search for the string you want to find. Look around for a bit there and you should be able to figure out what task/restriction/etc has that string, and then you know exactly where in Adrift to fix it.

PostPosted: Tue Nov 01, 2005 5:46 pm
by ralphmerridew
It's probably quicker to use the module output than to use taf2inf, unless the target string is in one of the parts the modules don't use.

PostPosted: Sat Nov 12, 2005 1:03 pm
by NickyDude
SOUNDS
If you're going to use sound in your adventure and you know some sounds will overlap, like having a background tune and then sound effects over the top, place each sound effect in a task of it's own otherwise the second sound effect will immediately cut off the first.

Let's say you had the following as tasks and added sound effects to each one using the Add Sound button, E.g:

#Horn honking
#Scray Effect 1
#Car pass by

Then in the actions of the task where you want the sound effects to take place, just

Execute task #Car pass by
Execute task #Horn honking


Both will start at the same time, thus overlapping the sound!

PostPosted: Mon Feb 13, 2006 5:23 am
by BgDaddy
Does anyone know if can you change an objects attribute with a task?

PostPosted: Tue Apr 18, 2006 9:04 am
by Sprite
Oops sorry! Didn't find this until now. If you're still around: no, attributes can't be changed with a task, your best bet is to replace it with an almost identical one, e.g. move table to room hidden, move broken table to room 1.

PostPosted: Tue Apr 18, 2006 12:24 pm
by David Whyld
Depends what you mean by attributes. If you define various states for an object under the Attributes tab and "Object starts off in state", you can use a task to change the state of the object. You could have a drawer that was 'fine', 'broken' or 'battered' and change the state of it with the task.

PostPosted: Tue Apr 18, 2006 2:50 pm
by Sprite
Hrm good point, I'd forgotten about that.