ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

ADRIFT hints and tips - share your game writing secrets here

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

Postby KFAdrift » Mon Oct 17, 2005 7:53 pm

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.
KF
Staring harder at the screen doesn't give any more inspiration
User avatar
KFAdrift
Site Admin
 
Posts: 4882
Joined: Sun Jun 23, 2002 4:42 pm
Location: Surrey, southern England

Postby David Whyld » Mon Oct 17, 2005 8:04 pm

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.
David Whyld
 
Posts: 6566
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Postby rotter » Mon Oct 17, 2005 8:30 pm

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.
Currently working on "The Blank Wall" in ADRIFT 5 and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1283
Joined: Sat May 08, 2004 12:12 am
Location: UK

Postby KFAdrift » Mon Oct 17, 2005 9:23 pm

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.
KF
Staring harder at the screen doesn't give any more inspiration
User avatar
KFAdrift
Site Admin
 
Posts: 4882
Joined: Sun Jun 23, 2002 4:42 pm
Location: Surrey, southern England

Postby David Whyld » Mon Oct 17, 2005 9:59 pm

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.
David Whyld
 
Posts: 6566
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Postby Chenshaw » Tue Oct 18, 2005 8:56 am

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).
Beware, leonine fire dragon on the loose...
User avatar
Chenshaw
 
Posts: 927
Joined: Mon Feb 28, 2005 2:09 pm
Location: South-east England

Postby KFAdrift » Tue Oct 18, 2005 8:36 pm

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.
KF
Staring harder at the screen doesn't give any more inspiration
User avatar
KFAdrift
Site Admin
 
Posts: 4882
Joined: Sun Jun 23, 2002 4:42 pm
Location: Surrey, southern England

Postby NickyDude » Tue Nov 01, 2005 1:12 am

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
ImageI reject your reality and substitute my own...
User avatar
NickyDude
Moderator
 
Posts: 2466
Joined: Sun Jun 23, 2002 10:36 pm
Location: UK

Postby Basilisk » Tue Nov 01, 2005 4:01 am

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.
Basilisk
 
Posts: 11
Joined: Wed Oct 19, 2005 4:46 am

Postby ralphmerridew » Tue Nov 01, 2005 5:46 pm

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.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2504
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Postby NickyDude » Sat Nov 12, 2005 1:03 pm

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!
ImageI reject your reality and substitute my own...
User avatar
NickyDude
Moderator
 
Posts: 2466
Joined: Sun Jun 23, 2002 10:36 pm
Location: UK

Postby BgDaddy » Mon Feb 13, 2006 5:23 am

Does anyone know if can you change an objects attribute with a task?
BgDaddy
 
Posts: 2
Joined: Sun Feb 12, 2006 5:56 pm

Postby Sprite » Tue Apr 18, 2006 9:04 am

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.
Do you know who I am?!

I've forgotten...
User avatar
Sprite
 
Posts: 2432
Joined: Wed Jul 14, 2004 7:28 pm
Location: Cardiff

Postby David Whyld » Tue Apr 18, 2006 12:24 pm

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.
David Whyld
 
Posts: 6566
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Postby Sprite » Tue Apr 18, 2006 2:50 pm

Hrm good point, I'd forgotten about that.
Do you know who I am?!

I've forgotten...
User avatar
Sprite
 
Posts: 2432
Joined: Wed Jul 14, 2004 7:28 pm
Location: Cardiff

Next

Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 8 guests