1. weights of nested containers

I am writing a mud progam in Euphoria.  Currently I have each character with
a certain amount of strength.  Depending on their strength, they can pick up
a certain amount of weight.  They can even pick up other characters, if they
are strong enough to pick up the weight of the other character.

The way I currently do this is that the weight of the person being picked up
is evaluated.  If they are too heavy, a message is given.  If they are not
too heavy, the person picks them up.

However, here's the problem, what if you are trying to pick up a person, who
is carrying a person, who is carrying a person, who is carrying a person,
etc..etc..
I cannot get a logic in my head that would allow you to go through an
unspecificed number of  "carriers" and check the weight of everything they
are carrying.  This COULD be solved by just saying you can't carry someone
who is carrying someone else....However, I will have the problem again, when
I have to deal with things like....a backpack that contains a pouch, that
contains a bag...etc..etc...

Can someone help me figure out a logic for this.

There is a variable on every object in the mud that I call a "roomin"
variable.  I started it to tell which room a player or object was in.
However, each "thing" in the mud has a unique id. So, I've changed it so
that the "roomin" variable doesn't have to point to a room. This is how you
can be carried by another player.  Instead of your "roomin" variable having
the id number of a room, it has the id number of the person carrying you.
So, in theory, you are "inside" the person carrying you  (according to the
data structure, anyway)

So, here's how it would work.  To know if someone is carrying someone, I
have to check all players and see if their "roomin" variable is the id of
the person I am checking.  That's easy enough and I can add the weights of
...let's call them the "first generation of people being carried".  However,
it's when I start to check the roomin variables of everyone to see if they
are carried by the first generation carriers, that I start to run into
problems.  Sure, I can do that.  It's basically the same thing.

But, how do I tell the code to keep checking until I've gotten to the end of
everyone who's being carried (i.e.  the "last generation" of people being
carried)?

hmm...as I actually typed out an explanation..I'm getting a sort of a hazy
idea..so I may figure this out..but I'm still going to post the message,
just in case.

Michelle Rogers

new topic     » topic index » view message » categorize

2. Re: weights of nested containers

That was part of the problem.  I only have each thing being carried have a
number that marks what they are being carried by...  I don't have a sequence
that holds everyone/thing that is being carried.  Will I need to have it
like that?  I didn't WANT to do it that way.  But, am I going to have to?

Currently to find out what is being carried by a person, here is an
example....when the person enters the room, the message say "<Name> enters."
however I wanted it to say this if they were carrying someone........
"<name> enters, carring <othername> over their shoulder."  This is the
function that generates the part of that message from the comma on.....This
is how I check to see who's being carried.

function carrymessage(integer whichplayer)
sequence thecarrymessage,hisher
integer foundit


--This is just to determine gender of person entering the room
if mudthings[whichplayer][8][22]=1 then hisher="his" else hisher="her" end
if

--Foundit determines if they are carrying anyone at all, so as to finish the
message, if they are
foundit=0
thecarrymessage=""

--mudthings include players, mobiles, objects, and rooms
for x=1 to length(mudthings) do

    --mudthings[x][5] is what "room" this one is in
    --mudthings[whichplayer][1] is the id number of the person being
checked, which determines if the "room" is actually that person, which would
mean they are
carrying this person
     if mudthings[x][5]=mudthings[whichplayer][1] then
          if length(thecarmessage)<0 then
              thecarrymessage=thecarrymessage&", carrying
"&mudthings[whichplayer][2]
          else
              thecarrymessage=thecarrymessage&" and
"&mudthings[whichplayer][2]
          end if
          foundit=1
     end if
end for

if foundit=1 then
     thecarrymessage=thecarmessage&" over "&hisher&" shoulder"
end if

return thecarrymessage
end function


To be able to do nested weights...am I going to HAVE to put it into a
sequence, instead of checking each time?


Michelle Rogers
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: <EUforum at topica.com>
Sent: Monday, February 16, 2004 6:01 PM
Subject: RE: weights of nested containers
>
> How about something like this...
>
>   function CalcWeight( object pHolder)
>     atom lWeightSoFar
>
>     lWeightSoFar = pHolder[kWEIGHT]
>     for i = 1 to length(pHolder[kCarrying]) do
>        lWeightSoFar += CalcWeight( TheWorld[ pHolder[kCarrying][i] ] )
>     end for
>
>     return lWeightSoFar
>   end function
>
>   TotalWeight = CalcWeight ( theObject )
>
> This assumes you have a sequence that holds all the data for an entity,
and
> that sequence has a weight attribute and a list of things (an index into
the
> 'world') that the entity is carrying.
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: weights of nested containers

OH Wait!! I hadn't thought about it like that!

I think what you are saying is this..

If a player weighs 50 stones....
  He picks up an apple that weighs 1 stone...
   Now, his weight is reset to 51 stones

Is that what you are saying???  *rolls her eyes*  I ask because it was so
easy I'm slapping myself...*smirks*  I was trying to make it too hard.

And then you don't have to check through the nesting..because everytime you
pick something up your weight increases!

So if you try to pick up a person who normally weighs 50 stones...but he is
already carrying someone who weighs 50 stones...his weight already says 100
stones....So, all you have to do is check his weight!  *slaps her forehead
and goes "duh"*

*grins*  thanks..that might fix the whole thing

Michelle Rogers
----- Original Message -----
From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
To: <EUforum at topica.com>
Sent: Monday, February 16, 2004 6:08 PM
Subject: RE: weights of nested containers


>
>
> >From: Michelle Rogers <michellerogers at bellsouth.net>
> >Reply-To: EUforum at topica.com
> >To: EUforum at topica.com
> >Subject: weights of nested containers
> >Date: Mon, 16 Feb 2004 17:46:04 -0500
> >
> >I am writing a mud progam in Euphoria.  Currently I have each character
> >with
> >a certain amount of strength.  Depending on their strength, they can pick
> >up
> >a certain amount of weight.  They can even pick up other characters, if
> >they
> >are strong enough to pick up the weight of the other character.
> >
> >The way I currently do this is that the weight of the person being picked
> >up
> >is evaluated.  If they are too heavy, a message is given.  If they are
not
> >too heavy, the person picks them up.
> >
> <snip>
>
>    I think what you can do is, when a person picks up something, its
weight
> increases by the weight of the picked up thing. That way, you don't even
> need check any other objects. When you stop carrying the object, you just
> decrease the carrier's weight by the object's weight.
>
> >But, how do I tell the code to keep checking until I've gotten to the end
> >of
> >everyone who's being carried (i.e.  the "last generation" of people being
> >carried)?
> >
>
>   Well, you could possibly do some recursive thing, but some people find
it
> somewhat confusing.
>
> >hmm...as I actually typed out an explanation..I'm getting a sort of a
hazy
> >idea..so I may figure this out..but I'm still going to post the message,
> >just in case.
> >
> >Michelle Rogers
> >
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: weights of nested containers

*grins*  besides..now this way..I'm thinking of the fun possibilities of
things like bridges...or furniture..that only support a certain amount of
weight...so if you weigh a lot and are carrying everything but the kitchen
sink around with you everywhere you go..well...*waves goodbye*  hehe
Michelle Rogers
----- Original Message -----
From: "Michelle Rogers" <michellerogers at bellsouth.net>
To: <EUforum at topica.com>
Subject: Re: weights of nested containers


>
>
> OH Wait!! I hadn't thought about it like that!
>
> I think what you are saying is this..
>
> If a player weighs 50 stones....
>   He picks up an apple that weighs 1 stone...
>    Now, his weight is reset to 51 stones
>
> Is that what you are saying???  *rolls her eyes*  I ask because it was so
> easy I'm slapping myself...*smirks*  I was trying to make it too hard.
>
> And then you don't have to check through the nesting..because everytime
you
> pick something up your weight increases!
>
> So if you try to pick up a person who normally weighs 50 stones...but he
is
> already carrying someone who weighs 50 stones...his weight already says
100
> stones....So, all you have to do is check his weight!  *slaps her forehead
> and goes "duh"*
>
> *grins*  thanks..that might fix the whole thing
>
> Michelle Rogers
> ----- Original Message -----
> From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
> To: <EUforum at topica.com>
> Sent: Monday, February 16, 2004 6:08 PM
> Subject: RE: weights of nested containers
>
>
> > >From: Michelle Rogers <michellerogers at bellsouth.net>
> > >Reply-To: EUforum at topica.com
> > >To: EUforum at topica.com
> > >Subject: weights of nested containers
> > >Date: Mon, 16 Feb 2004 17:46:04 -0500
> > >
> > >I am writing a mud progam in Euphoria.  Currently I have each character
> > >with
> > >a certain amount of strength.  Depending on their strength, they can
pick
> > >up
> > >a certain amount of weight.  They can even pick up other characters, if
> > >they
> > >are strong enough to pick up the weight of the other character.
> > >
> > >The way I currently do this is that the weight of the person being
picked
> > >up
> > >is evaluated.  If they are too heavy, a message is given.  If they are
> not
> > >too heavy, the person picks them up.
> > >
> > <snip>
> >
> >    I think what you can do is, when a person picks up something, its
> weight
> > increases by the weight of the picked up thing. That way, you don't even
> > need check any other objects. When you stop carrying the object, you
just
> > decrease the carrier's weight by the object's weight.
> >
> > >But, how do I tell the code to keep checking until I've gotten to the
end
> > >of
> > >everyone who's being carried (i.e.  the "last generation" of people
being
> > >carried)?
> > >
> >
> >   Well, you could possibly do some recursive thing, but some people find
> it
> > somewhat confusing.
> >
> > >hmm...as I actually typed out an explanation..I'm getting a sort of a
> hazy
> > >idea..so I may figure this out..but I'm still going to post the
message,
> > >just in case.
> > >
> > >Michelle Rogers
> > >
> >
> > TOPICA - Start your own email discussion group. FREE!
> >
> >
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: weights of nested containers

I've done this, only I was trying to push things.
I have it worked out in code.  I'll send it to you as soon as I find it.

         Lucius L. Hilley III - Unkmar

----- Original Message -----
From: "Michelle Rogers" <michellerogers at bellsouth.net>
To: <EUforum at topica.com>
Sent: Monday, February 16, 2004 05:46 PM
Subject: weights of nested containers




I am writing a mud progam in Euphoria.  Currently I have each character
with
a certain amount of strength.  Depending on their strength, they can pick
up
a certain amount of weight.  They can even pick up other characters, if
they
are strong enough to pick up the weight of the other character.

The way I currently do this is that the weight of the person being picked
up
is evaluated.  If they are too heavy, a message is given.  If they are not
too heavy, the person picks them up.

However, here's the problem, what if you are trying to pick up a person,
who
is carrying a person, who is carrying a person, who is carrying a person,
etc..etc..
I cannot get a logic in my head that would allow you to go through an
unspecificed number of  "carriers" and check the weight of everything they
are carrying.  This COULD be solved by just saying you can't carry someone
who is carrying someone else....However, I will have the problem again,
when
I have to deal with things like....a backpack that contains a pouch, that
contains a bag...etc..etc...

Can someone help me figure out a logic for this.

There is a variable on every object in the mud that I call a "roomin"
variable.  I started it to tell which room a player or object was in.
However, each "thing" in the mud has a unique id. So, I've changed it so
that the "roomin" variable doesn't have to point to a room. This is how
you
can be carried by another player.  Instead of your "roomin" variable
having
the id number of a room, it has the id number of the person carrying you.

So, in theory, you are "inside" the person carrying you  (according to the
data structure, anyway)

So, here's how it would work.  To know if someone is carrying someone, I
have to check all players and see if their "roomin" variable is the id of
the person I am checking.  That's easy enough and I can add the weights of
...let's call them the "first generation of people being carried".
However,
it's when I start to check the roomin variables of everyone to see if they
are carried by the first generation carriers, that I start to run into
problems.  Sure, I can do that.  It's basically the same thing.

But, how do I tell the code to keep checking until I've gotten to the end
of
everyone who's being carried (i.e.  the "last generation" of people being
carried)?

hmm...as I actually typed out an explanation..I'm getting a sort of a hazy
idea..so I may figure this out..but I'm still going to post the message,
just in case.

Michelle Rogers



TOPICA - Start your own email discussion group. FREE!

new topic     » goto parent     » topic index » view message » categorize

6. Re: weights of nested containers

>From: Michelle Rogers <michellerogers at bellsouth.net>
>Subject: Re: weights of nested containers
>
>OH Wait!! I hadn't thought about it like that!
>
>I think what you are saying is this..
>
>If a player weighs 50 stones....
>   He picks up an apple that weighs 1 stone...
>    Now, his weight is reset to 51 stones
>
>Is that what you are saying???  *rolls her eyes*  I ask because it was so
>easy I'm slapping myself...*smirks*  I was trying to make it too hard.
>

  Yep, that's exactly what I meant.

>And then you don't have to check through the nesting..because everytime you
>pick something up your weight increases!
>
>So if you try to pick up a person who normally weighs 50 stones...but he is
>already carrying someone who weighs 50 stones...his weight already says 100
>stones....So, all you have to do is check his weight!  *slaps her forehead
>and goes "duh"*
>
>*grins*  thanks..that might fix the whole thing
>
>Michelle Rogers
>From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
>To: <EUforum at topica.com>
>Sent: Monday, February 16, 2004 6:08 PM
>Subject: RE: weights of nested containers
>
> > >From: Michelle Rogers <michellerogers at bellsouth.net>
> > >Reply-To: EUforum at topica.com
> > >To: EUforum at topica.com
> > >Subject: weights of nested containers
> > >Date: Mon, 16 Feb 2004 17:46:04 -0500
> > >
> > >I am writing a mud progam in Euphoria.  Currently I have each character
> > >with
> > >a certain amount of strength.  Depending on their strength, they can 
>pick
> > >up
> > >a certain amount of weight.  They can even pick up other characters, if
> > >they
> > >are strong enough to pick up the weight of the other character.
> > >
> > >The way I currently do this is that the weight of the person being 
>picked
> > >up
> > >is evaluated.  If they are too heavy, a message is given.  If they are
>not
> > >too heavy, the person picks them up.
> > >
> > <snip>
> >
> >    I think what you can do is, when a person picks up something, its
>weight
> > increases by the weight of the picked up thing. That way, you don't even
> > need check any other objects. When you stop carrying the object, you 
>just
> > decrease the carrier's weight by the object's weight.
> >
> > >But, how do I tell the code to keep checking until I've gotten to the 
>end
> > >of
> > >everyone who's being carried (i.e.  the "last generation" of people 
>being
> > >carried)?
> > >
> >
> >   Well, you could possibly do some recursive thing, but some people find
>it
> > somewhat confusing.
> >
> > >hmm...as I actually typed out an explanation..I'm getting a sort of a
>hazy
> > >idea..so I may figure this out..but I'm still going to post the 
>message,
> > >just in case.
> > >
> > >Michelle Rogers
> >
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: weights of nested containers

Michelle,

This could be dangerous, but if you keep on your toes then it could be fine.

Say for instance that I'm playing the MOO, and I create an object of my 
own. Then, I manually set the roomin value to the ID of some person's 
character. They see that they have this object they don't know about in 
their inventory, so they drop it. Now, suddenly, their weight goes down, 
perhaps into negative numbers (perhaps crashing the program in that 
case?). I guess the only way to prevent this is to prevent the roomin 
value from being manually modified, but that's sort of a silly 
restriction to put on programmers. It could prevent some very 
interesting and cool custom spells, etc.

Just food for thought.

I'm still interested in helping out with the coding of this, by the way.

~ Isaac

Michelle Rogers wrote:

>
>
>OH Wait!! I hadn't thought about it like that!
>
>I think what you are saying is this..
>
>If a player weighs 50 stones....
>  He picks up an apple that weighs 1 stone...
>   Now, his weight is reset to 51 stones
>
>Is that what you are saying???  *rolls her eyes*  I ask because it was so
>easy I'm slapping myself...*smirks*  I was trying to make it too hard.
>
>And then you don't have to check through the nesting..because everytime you
>pick something up your weight increases!
>
>So if you try to pick up a person who normally weighs 50 stones...but he is
>already carrying someone who weighs 50 stones...his weight already says 100
>stones....So, all you have to do is check his weight!  *slaps her forehead
>and goes "duh"*
>
>*grins*  thanks..that might fix the whole thing
>
>Michelle Rogers
>----- Original Message -----
>From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
>To: <EUforum at topica.com>
>Sent: Monday, February 16, 2004 6:08 PM
>Subject: RE: weights of nested containers
>
>
>>>From: Michelle Rogers <michellerogers at bellsouth.net>
>>>Reply-To: EUforum at topica.com
>>>To: EUforum at topica.com
>>>Subject: weights of nested containers
>>>Date: Mon, 16 Feb 2004 17:46:04 -0500
>>>
>>>I am writing a mud progam in Euphoria.  Currently I have each character
>>>with
>>>a certain amount of strength.  Depending on their strength, they can pick
>>>up
>>>a certain amount of weight.  They can even pick up other characters, if
>>>they
>>>are strong enough to pick up the weight of the other character.
>>>
>>>The way I currently do this is that the weight of the person being picked
>>>up
>>>is evaluated.  If they are too heavy, a message is given.  If they are
>>>      
>>>
>not
>  
>
>>>too heavy, the person picks them up.
>>>
>>>      
>><snip>
>>
>>   I think what you can do is, when a person picks up something, its
>>    
>>
>weight
>  
>
>>increases by the weight of the picked up thing. That way, you don't even
>>need check any other objects. When you stop carrying the object, you just
>>decrease the carrier's weight by the object's weight.
>>
>>    
>>>But, how do I tell the code to keep checking until I've gotten to the end
>>>of
>>>everyone who's being carried (i.e.  the "last generation" of people being
>>>carried)?
>>>
>>>      
>>  Well, you could possibly do some recursive thing, but some people find
>>    
>>
>it
>  
>
>>somewhat confusing.
>>
>>    
>>>hmm...as I actually typed out an explanation..I'm getting a sort of a
>>>      
>>>
>hazy
>  
>
>>>idea..so I may figure this out..but I'm still going to post the message,
>>>just in case.
>>>
<snip>

>
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: weights of nested containers

What would you like to do to help with coding?

And, by the way ..that's a valid point...
what about...everytime a roomin id is manually changed...you check to see if
it is being changed to a player or mobile or object (as in a backpack), in
which case you need to add the weight then, just like you would if the
player, mobile, etc. had picked it up?

Michelle
Michelle Rogers
----- Original Message -----
From: "Isaac Raway" <isaac-topica at blueapples.org>
To: <EUforum at topica.com>
Sent: Monday, February 23, 2004 1:54 PM
Subject: Re: weights of nested containers


>
>
> Michelle,
>
> This could be dangerous, but if you keep on your toes then it could be
fine.
>
> Say for instance that I'm playing the MOO, and I create an object of my
> own. Then, I manually set the roomin value to the ID of some person's
> character. They see that they have this object they don't know about in
> their inventory, so they drop it. Now, suddenly, their weight goes down,
> perhaps into negative numbers (perhaps crashing the program in that
> case?). I guess the only way to prevent this is to prevent the roomin
> value from being manually modified, but that's sort of a silly
> restriction to put on programmers. It could prevent some very
> interesting and cool custom spells, etc.
>
> Just food for thought.
>
> I'm still interested in helping out with the coding of this, by the way.
>
> ~ Isaac
>
> Michelle Rogers wrote:
>
> >
> >OH Wait!! I hadn't thought about it like that!
> >
> >I think what you are saying is this..
> >
> >If a player weighs 50 stones....
> >  He picks up an apple that weighs 1 stone...
> >   Now, his weight is reset to 51 stones
> >
> >Is that what you are saying???  *rolls her eyes*  I ask because it was so
> >easy I'm slapping myself...*smirks*  I was trying to make it too hard.
> >
> >And then you don't have to check through the nesting..because everytime
you
> >pick something up your weight increases!
> >
> >So if you try to pick up a person who normally weighs 50 stones...but he
is
> >already carrying someone who weighs 50 stones...his weight already says
100
> >stones....So, all you have to do is check his weight!  *slaps her
forehead
> >and goes "duh"*
> >
> >*grins*  thanks..that might fix the whole thing
> >
> >Michelle Rogers
> >----- Original Message -----
> >From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
> >To: <EUforum at topica.com>
> >Sent: Monday, February 16, 2004 6:08 PM
> >Subject: RE: weights of nested containers
> >
> >
> >>>From: Michelle Rogers <michellerogers at bellsouth.net>
> >>>Reply-To: EUforum at topica.com
> >>>To: EUforum at topica.com
> >>>Subject: weights of nested containers
> >>>Date: Mon, 16 Feb 2004 17:46:04 -0500
> >>>
> >>>I am writing a mud progam in Euphoria.  Currently I have each character
> >>>with
> >>>a certain amount of strength.  Depending on their strength, they can
pick
> >>>up
> >>>a certain amount of weight.  They can even pick up other characters, if
> >>>they
> >>>are strong enough to pick up the weight of the other character.
> >>>
> >>>The way I currently do this is that the weight of the person being
picked
> >>>up
> >>>is evaluated.  If they are too heavy, a message is given.  If they are
> >>>
> >>>
> >not
> >
> >
> >>>too heavy, the person picks them up.
> >>>
> >>>
> >><snip>
> >>
> >>   I think what you can do is, when a person picks up something, its
> >>
> >>
> >weight
> >
> >
> >>increases by the weight of the picked up thing. That way, you don't even
> >>need check any other objects. When you stop carrying the object, you
just
> >>decrease the carrier's weight by the object's weight.
> >>
> >>
> >>>But, how do I tell the code to keep checking until I've gotten to the
end
> >>>of
> >>>everyone who's being carried (i.e.  the "last generation" of people
being
> >>>carried)?
> >>>
> >>>
> >>  Well, you could possibly do some recursive thing, but some people find
> >>
> >>
> >it
> >
> >
> >>somewhat confusing.
> >>
> >>
> >>>hmm...as I actually typed out an explanation..I'm getting a sort of a
> >>>
> >>>
> >hazy
> >
> >
> >>>idea..so I may figure this out..but I'm still going to post the
message,
> >>>just in case.
> >>>
> <snip>
>
> >
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

9. Re: weights of nested containers

Oops..sorry..I clicked the wrong place, everyone..meant to send that as a
private email.

Michelle Rogers
----- Original Message -----
From: "Michelle Rogers" <michellerogers at bellsouth.net>
To: <EUforum at topica.com>
Subject: Re: weights of nested containers


>
>
> What would you like to do to help with coding?
>
> And, by the way ..that's a valid point...
> what about...everytime a roomin id is manually changed...you check to see
if
> it is being changed to a player or mobile or object (as in a backpack), in
> which case you need to add the weight then, just like you would if the
> player, mobile, etc. had picked it up?
>
> Michelle
> Michelle Rogers
> ----- Original Message -----
> From: "Isaac Raway" <isaac-topica at blueapples.org>
> To: <EUforum at topica.com>
> Sent: Monday, February 23, 2004 1:54 PM
> Subject: Re: weights of nested containers
>
>
> > Michelle,
> >
> > This could be dangerous, but if you keep on your toes then it could be
> fine.
> >
> > Say for instance that I'm playing the MOO, and I create an object of my
> > own. Then, I manually set the roomin value to the ID of some person's
> > character. They see that they have this object they don't know about in
> > their inventory, so they drop it. Now, suddenly, their weight goes down,
> > perhaps into negative numbers (perhaps crashing the program in that
> > case?). I guess the only way to prevent this is to prevent the roomin
> > value from being manually modified, but that's sort of a silly
> > restriction to put on programmers. It could prevent some very
> > interesting and cool custom spells, etc.
> >
> > Just food for thought.
> >
> > I'm still interested in helping out with the coding of this, by the way.
> >
> > ~ Isaac
> >
> > Michelle Rogers wrote:
> >
> > >
> > >OH Wait!! I hadn't thought about it like that!
> > >
> > >I think what you are saying is this..
> > >
> > >If a player weighs 50 stones....
> > >  He picks up an apple that weighs 1 stone...
> > >   Now, his weight is reset to 51 stones
> > >
> > >Is that what you are saying???  *rolls her eyes*  I ask because it was
so
> > >easy I'm slapping myself...*smirks*  I was trying to make it too hard.
> > >
> > >And then you don't have to check through the nesting..because everytime
> you
> > >pick something up your weight increases!
> > >
> > >So if you try to pick up a person who normally weighs 50 stones...but
he
> is
> > >already carrying someone who weighs 50 stones...his weight already says
> 100
> > >stones....So, all you have to do is check his weight!  *slaps her
> forehead
> > >and goes "duh"*
> > >
> > >*grins*  thanks..that might fix the whole thing
> > >
> > >Michelle Rogers
> > >----- Original Message -----
> > >From: "Elliott Sales de Andrade" <quantum_analyst at hotmail.com>
> > >To: <EUforum at topica.com>
> > >Sent: Monday, February 16, 2004 6:08 PM
> > >Subject: RE: weights of nested containers
> > >
> > >
> > >>>From: Michelle Rogers <michellerogers at bellsouth.net>
> > >>>Reply-To: EUforum at topica.com
> > >>>To: EUforum at topica.com
> > >>>Subject: weights of nested containers
> > >>>Date: Mon, 16 Feb 2004 17:46:04 -0500
> > >>>
> > >>>I am writing a mud progam in Euphoria.  Currently I have each
character
> > >>>with
> > >>>a certain amount of strength.  Depending on their strength, they can
> pick
> > >>>up
> > >>>a certain amount of weight.  They can even pick up other characters,
if
> > >>>they
> > >>>are strong enough to pick up the weight of the other character.
> > >>>
> > >>>The way I currently do this is that the weight of the person being
> picked
> > >>>up
> > >>>is evaluated.  If they are too heavy, a message is given.  If they
are
> > >>>
> > >>>
> > >not
> > >
> > >
> > >>>too heavy, the person picks them up.
> > >>>
> > >>>
> > >><snip>
> > >>
> > >>   I think what you can do is, when a person picks up something, its
> > >>
> > >>
> > >weight
> > >
> > >
> > >>increases by the weight of the picked up thing. That way, you don't
even
> > >>need check any other objects. When you stop carrying the object, you
> just
> > >>decrease the carrier's weight by the object's weight.
> > >>
> > >>
> > >>>But, how do I tell the code to keep checking until I've gotten to the
> end
> > >>>of
> > >>>everyone who's being carried (i.e.  the "last generation" of people
> being
> > >>>carried)?
> > >>>
> > >>>
> > >>  Well, you could possibly do some recursive thing, but some people
find
> > >>
> > >>
> > >it
> > >
> > >
> > >>somewhat confusing.
> > >>
> > >>
> > >>>hmm...as I actually typed out an explanation..I'm getting a sort of a
> > >>>
> > >>>
> > >hazy
> > >
> > >
> > >>>idea..so I may figure this out..but I'm still going to post the
> message,
> > >>>just in case.
> > >>>
> > <snip>
> >
> > >
> > TOPICA - Start your own email discussion group. FREE!
> >
> >
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu