Message-ID: <3C793A7D.9080401@notreally.sympatico.ca>
From: LoneCleric <lonecleric@notreally.sympatico.ca>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [HUGO] Is a conditional clause not allowed in an object definition?
References: <h29g7u0vqgppn23bcastsnbtvsajuhjk3a@4ax.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 34
Date: Sun, 24 Feb 2002 14:09:49 -0500
NNTP-Posting-Host: 64.230.117.228
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1014577867 64.230.117.228 (Sun, 24 Feb 2002 14:11:07 EST)
NNTP-Posting-Date: Sun, 24 Feb 2002 14:11:07 EST
Organization: Bell Sympatico
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!tor-nx1.netcom.ca!news1.tor.metronet.ca!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
Xref: news.duke.edu rec.arts.int-fiction:100635

Others have replied already, but hey, let's elaborate.

Dana Clarke wrote:

> I wish to put an if-else clause into an object definition - but it
> appears I cannot do that.


It should normally be possible. Normally.

>  Am I correct?  If so, how does one
> accomplish this?  For instance, I wish to make an object whose
> starting location depends upon the player's chosen sex (they will
> choose their sex at the beginning of the game).


Now think about this. The objects are all instanciated (that is, they're
all "created", on a metaphorical) at the very beginning of the game,
*before* the Init routine is called. So they have to know where they are
in the object tree at the very beginning of the game.

At this point in time, would it make sense to put conditions stating
where the object ends up. Of course not - no matter the kind of
conditions you define, you'll always get the same result, because the
variables haven't even been initialized.

That's a good enough reason for the compiler to refuse you code, isn't it?

So the correct solution, as Julian Fondren already stated, is to move
each object where you want it, *after* you've determined what the gender
  of the PC is.

LC

