Newsgroups: rec.arts.int-fiction
Path: gmd.de!Germany.EU.net!EU.net!uunet!destroyer!nntp.cs.ubc.ca!newsserver.sfu.ca!sfu.ca!neilg
From: neilg@fraser.sfu.ca (Neil K. Guy)
Subject: Re: TADS Coding problem
Message-ID: <neilg.759988792@sfu.ca>
Sender: news@sfu.ca (seymour news)
Organization: Simon Fraser University, Burnaby, B.C., Canada
References: <2ihr10$prl@nntp2.Stanford.EDU>
Date: Mon, 31 Jan 1994 03:59:52 GMT
Lines: 50

jreese@leland.Stanford.EDU (james reese) notes that this code breaks:

>parseAskobj: function(v, ...)
>{
>	"What do you want to <<v.desc>>";
>	if(argcount = 2)
>	{
>		local p := getarg(2);
>		" it <<p ? p.sdesc : "to" >>";
>	}
>	"?";
>}

 Apparently this is a problem with the ? operator. I just avoid it,
doing this:

		if ( p )
			p.sdesc;
		" to ";
		// etc.

 and it works fine for me.

>idphoto: decoration
>	locationOK = true
>	location = 
>	{
>		return(id.location);
>	}
>	...

 You have to make the object a floatingItem as well. Define it as
"decoration, floatingItem" and then it'll be added to the floating
item list during the preinit() section of compilation. If you don't
the game doesn't know it's a floating item (ie: doesn't have a fixed
location). Alternatively you could simply make the idphoto a fixed
item (as a decoration it already is) and then simply say location =
idcard or whatever. Since the photo can't be removed from the ID card
it's a lot simpler to implement it that way.

>works perfectly fine. Now, my methods for these objects (idphoto, etc)
>worked without a hitch in v. 1.xxx, but obviously something different
>occurs with v 2.1.2.2. Any clues?

 If you look at adv.t you'll see that the ground has the class
floatingItem as well as beditem. I think this floating item business
is documented in the TADSVER file that came with your copy of the TADS
compiler.

 - Neil K.
