Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[TADS] Body Parts?

47 views
Skip to first unread message

Bastiaan Zapf

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to

I have a slight Problem with TADS. I want to define a class "body" that
stands for a human body. This body should have arms, legs, a head etc. (The
purpose is: If you lost an arm, you can't hold a bihander anymore etc.) Now
if I say:

body:item
sdesc="A human body."
legs=_legs
;

_legs:item
sdesc="A pair of legs."
;

joesbody:body
;

Joe's body doesn't have an instance of the _legs-Item, only a legs-Property
with value "nil". But that is what I want, because I only want to define
Joe's legs if they are special (tatooed maybe). How do I automagically
create a new _legs item when declaring joes body? I had an Idea to make a
list of body parts to save typing work:

bparts=[_joeslegs _arms _head]

but that kind of programming reminds me of my basic times. And it would make
the body-part-access far more difficult:

joesbody.kill(arms); (an unintuitive call that leads to a long, nasty method
that uses isclass and grovels through the whole bodyparts-list)

instead of

joesbody.arms.kill; (Moves self to nirvana or something like that)

--
Basti
___
ICQ #33404148 *** Last HP update: 16.03.99
SR Homepage: home.t-online.de/home/B.Zapf

T Raymond

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
In article <7cqnq6$26h$4...@news00.btx.dtag.de>, B.Z...@t-online.de (Bastiaan Zapf) admitted:

>I have a slight Problem with TADS. I want to define a class "body" that
>stands for a human body. This body should have arms, legs, a head etc. (The
>purpose is: If you lost an arm, you can't hold a bihander anymore etc.) Now
[snip]

>Joe's body doesn't have an instance of the _legs-Item, only a legs-Property
>with value "nil". But that is what I want, because I only want to define
>Joe's legs if they are special (tatooed maybe). How do I automagically
>create a new _legs item when declaring joes body? I had an Idea to make a
>list of body parts to save typing work:
>
>bparts=[_joeslegs _arms _head]
>

Body parts are next to rope in comlexity and difficulty to implement.
If you don't really need actual parts to refer to and manipulate your
list idea could work. Then you would only have to check if the part is
part of the list, and if it's been removed in combat or whatever you
could easily remove it from the list.

If you have multiple NPC's and player that you need to do these checks
on it's going to get complex anyway. What you might want to do is make
one set of standard parts and use dynamic objects (so that you can add
adjectives to determin whose parts you are refering to), and if they
are no longer usable dynamically destruct it.

Also, there is a code module in jeffslibs.zip on gmd which might let
you do what you want with more ease.

Of course I have no idea, I'm just trying to give a couple of ideas,
I'm still learning myself. Hope this helps.

Tom

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Tom Raymond adk @ usa.net
"All at once I knew that I knew nothing..."
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Bastiaan Zapf

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
T Raymond schrieb in Nachricht <7crgae$35t$2...@news.clarkson.edu>...

>Body parts are next to rope in comlexity and difficulty to implement.
Ah. Thanks for the warning. But if rope is neccesary for an adventure ("My
uncle Bilbo always said: never have an adventure without a rope!") what is
an adventure without a body? :-)

>If you don't really need actual parts to refer to and manipulate your
>list idea could work. Then you would only have to check if the part is
>part of the list, and if it's been removed in combat or whatever you
>could easily remove it from the list.

Yes, of course. But this is just the problem: with this list stuff there is
no easy way to do:

---
> x john's legs
There's nothing special about John's legs
> x joe's legs
Joe's legs are thin and white.
> x troll's legs
The Troll's are about as long as Joe.
---

At least not without a horrible init-function.

(Search all bodys, check what bodyparts are not in the list [that means:
check if there are two arms, two legs and one head], dynamically generate
new ones, append them)

And, as I said before, some function calls would be terribly non-intuitive.

joe.killofclass(arm);

bihander:weapon=
verDoWield(a)= {
if (not a.hasn(arm,2))
"%You% need%s% at least two arms!";
if (a.countnotoccupied(arm)<2)
"%You% need%s% two free arms.";
}
doWield(a)= {
a.occupyn(arm,2);
}
;

>Also, there is a code module in jeffslibs.zip on gmd which might let
>you do what you want with more ease.

I will look for it.

>Of course I have no idea, I'm just trying to give a couple of ideas,
>I'm still learning myself. Hope this helps.

In some way, we all are learning ;-)

0 new messages