ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

The length of the commands - How long

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 jankupila » Mon Feb 14, 2011 1:23 pm

I have a situation where a player should write

[take/get] {the} 5 gold pieces from {the} mid sized barrel

but I cant get it to work. Is there a limit about a length how long the commands are allowed to be? The reason why I have so lengthy commands, is that I have many barrels and many other things in my game.




Edited By Icefall on 1297690007
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while
the Universe is trying to create bigger and better idiots. So far the Universe is winning.
User avatar
jankupila
 
Posts: 177
Joined: Sun Jan 30, 2011 10:58 am
Location: Helsinki, Finland

Postby David Whyld » Mon Feb 14, 2011 1:33 pm

Wouldn't it be easier as

get * gold * barrel*


with a synonym for get/take. Much easier to type that way and saves wasting time with curly brackets.
David Whyld
 
Posts: 6748
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom
Points: 25

Postby jankupila » Mon Feb 14, 2011 1:42 pm

But I have:

blue barrel
red barrel
small barrel
mid sized barrel

If I do the way you showed to me, the barrels get mixed with each others.

I don't take possibility that player carries a barrel to other room and when he type's get money from barrel and the game doesn't know which barrel he means. And I don't have problem with curly brackets.




Edited By Icefall on 1297695130
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while
the Universe is trying to create bigger and better idiots. So far the Universe is winning.
User avatar
jankupila
 
Posts: 177
Joined: Sun Jan 30, 2011 10:58 am
Location: Helsinki, Finland

Postby David Whyld » Mon Feb 14, 2011 5:25 pm

Then

get * gold * blue barrel *
get * gold * red barrel *
get * gold * small barrel *
get * gold * mid sized barrel *

would work.
David Whyld
 
Posts: 6748
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom
Points: 25

Postby jankupila » Mon Feb 14, 2011 6:10 pm

But I have objects

5 gold pieces
3 gold pieces
4 gold pieces

When player takes a object, the object vanishes and variable gold_pieces will be updated.
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while
the Universe is trying to create bigger and better idiots. So far the Universe is winning.
User avatar
jankupila
 
Posts: 177
Joined: Sun Jan 30, 2011 10:58 am
Location: Helsinki, Finland

Postby phkb » Tue Feb 15, 2011 12:07 am

First of all, add a synonym for "the", replacing it with the system command "" (ie. blank). That will avoid having to do all the {the} stuff.

Secondly, you'll need to work hard in your task to consider all the ways you can phrase "mid size barrel" and "5 gold pieces". You could type "mid barrel", "middle barrel", "middle sized barrel", "5 gold", "5 pieces of gold".

Also, your command doesn't handle "TAKE FROM THE MID SIZED BARREL 5 GOLD PIECES"

What's important to note is that ADRIFT doesn't look for object references in your command. It doesn't see "5 gold pieces" and think, "Ah! that's the object '5 gold pieces' - I must look for any alias of that object here.' It's looking at the raw text, and matching up with raw text.

If you aren't able to go with David's suggestion of using the "*" wildcard, I would try something like this:
Code: Select all
[get/take/pick {up}] 5 [gold {pieces}/pieces {of gold}] from [mid/middle/medium] {sized} barrel
[get/take/pick {up}] from [mid/middle/medium] {sized} barrel 5 [gold {pieces}/pieces {of gold}]

You could, as David suggests, add a synonym for "take", for the system command "get". I'd recommend not doing this because it means commands like "take off shirt" would not work (at least, without adding more synonyms). I'd definitely not recommend doing the opposite, of replacing "get" with "take", because then commands like "get on bike" wouldn't work (again, without adding even more synonyms). Synonyms are a fairly blunt instrument in ADRIFT and should be used with care.
My IF-related stuff can be found here
User avatar
phkb
 
Posts: 376
Joined: Thu Jan 06, 2005 3:27 am
Location: Sydney, Australia

Postby ralphmerridew » Tue Feb 15, 2011 12:22 am

Consider using ADRIFT 5. It's better at dealing with ambiguities like the various barrels. You might even be able to create a "three gold pieces" object, a "four gold pieces" object, and so on, and override the various take methods.

(The latter would certainly work in Inform or TADS; you could even use classes to create individual coin objects and allow the player to split the coins up without creating any tasks.)
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: 2548
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10


Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 7 guests