El grupo al cual envías entradas es un grupo Usenet. Si envías mensajes a este grupo, cualquier usuario de Internet podrá ver tu dirección de correo electrónico
Is there a way to tie lists to single instances of objects? I want a particular object to be listed differently before and after an action when it appears in a room, but I can't see how to modify the generic list suffix/prefix in such a way that it doesn't affect all objects in a room's content list. Not sure if this just is a syntax issue for me, or if I'm overlooking some functionality, somewhere.
> Is there a way to tie lists to single instances of objects? I want a > particular object to be listed differently before and after an action when > it appears in a room
Please define "differently". An transcript example would probably be best.
Not sure what you mean by transcript example, but this is the effect that I want:
Upon entering the room <roomdesc here> + a cloak ob's initSpecialDesc as follows:
"An old cloak lies on the floor, partly covering an old boot, apparently having slipped off its peg."
Then taking the boot (the cloak desc changes accordingly) and dropping it, should make the boot show up in the room list as: An old boot sits forlornly on the floor.
This should appear every time the boot appears in the rooms content list, after either the cloak has been removed, or the boot has been picked up and then dropped. So, it should not appear in the room list before it is picked up the first time (and I handle that with the isListed prop), but it should appear with this unique flavor desc every time it appears in a room after that, and not with the generic "An old boot is here".
> On 02/09/2010 11:17 PM, Kathrel wrote: >> Is there a way to tie lists to single instances of objects? I want a >> particular object to be listed differently before and after an action >> when >> it appears in a room
> Please define "differently". An transcript example would probably be > best.
> Not sure what you mean by transcript example, but this is the effect that I > want:
> Upon entering the room > <roomdesc here> + a cloak ob's initSpecialDesc as follows:
> "An old cloak lies on the floor, partly covering an old boot, apparently > having slipped off its peg."
> Then taking the boot (the cloak desc changes accordingly) and dropping it, > should make the boot show up in the room list as: > An old boot sits forlornly on the floor.
> This should appear every time the boot appears in the rooms content list, > after either the cloak has been removed, or the boot has been picked up and > then dropped. So, it should not appear in the room list before it is picked > up the first time (and I handle that with the isListed prop), but it should > appear with this unique flavor desc every time it appears in a room after > that, and not with the generic "An old boot is here".
> And I'm stuck :)
> Kathrel
> "Nikos Chantziaras"<rea...@arcor.de> skrev i melding > news:hkska8$20k$1@news.grnet.gr... >> On 02/09/2010 11:17 PM, Kathrel wrote: >>> Is there a way to tie lists to single instances of objects? I want a >>> particular object to be listed differently before and after an action >>> when >>> it appears in a room
>> Please define "differently". An transcript example would probably be >> best.
I just figured my previous example is wrong (and also has a syntax error, I forgot to close the if statement :P) It will result in empty output if you pick up the boot and drop it before moving the cloak. So an additional check is needed to see whether exactly this condition occurs.
Here's the code that should work (note that I didn't actually try it, but I'm confident it works :P)
specialDesc() { if (cloak.useInitSpecialDesc() && self.useInitSpecialDesc()) { // Neither the cloak nor the boot have been moved yet. Don't // display anything. return; }
// If we got here, the cloak was moved. "An old boot sits forlornly on the floor. ";
> You can check in the boot's specialDesc whether the cloak was moved:
> specialDesc() > { > if (cloak.useInitSpecialDesc()) { > // The cloak has not been moved yet. Don't display anything. > return;
> // If we got here, the cloak was moved. > "An old boot sits forlornly on the floor. "; > }
> On 02/10/2010 12:02 AM, Kathrel wrote: >> Not sure what you mean by transcript example, but this is the effect >> that I >> want:
>> Upon entering the room >> <roomdesc here> + a cloak ob's initSpecialDesc as follows:
>> "An old cloak lies on the floor, partly covering an old boot, apparently >> having slipped off its peg."
>> Then taking the boot (the cloak desc changes accordingly) and dropping >> it, >> should make the boot show up in the room list as: >> An old boot sits forlornly on the floor.
>> This should appear every time the boot appears in the rooms content list, >> after either the cloak has been removed, or the boot has been picked >> up and >> then dropped. So, it should not appear in the room list before it is >> picked >> up the first time (and I handle that with the isListed prop), but it >> should >> appear with this unique flavor desc every time it appears in a room after >> that, and not with the generic "An old boot is here".
>> And I'm stuck :)
>> Kathrel
>> "Nikos Chantziaras"<rea...@arcor.de> skrev i melding >> news:hkska8$20k$1@news.grnet.gr... >>> On 02/09/2010 11:17 PM, Kathrel wrote: >>>> Is there a way to tie lists to single instances of objects? I want a >>>> particular object to be listed differently before and after an action >>>> when >>>> it appears in a room
>>> Please define "differently". An transcript example would probably be >>> best.
Thanks, Nikos, but I still have my issue :) Checking for useInitSpecialDesc() on the cloak and the room the way you suggest for some reason doesn't make away with the room content list when I initially look around the room, so I now got two references to the boot, both in its special desc and in the cloaks initSpecialDesc. I can't think of a reason why it should behave like this, but it does :(
My question about manipulating the lists for instances single objects also regards my desire to refine the references to the boot and the cloak after the initial move, and rathern than having:
An old boot sits forlornly on the floor.
An old cloak lies on the floor, apparently having slipped off its peg.
combine them into:
An old boot sits forlornly on the floor while an old cloak lies there, apparently having slipped off its peg.
>I just figured my previous example is wrong (and also has a syntax error, I >forgot to close the if statement :P) It will result in empty output if you >pick up the boot and drop it before moving the cloak. So an additional >check is needed to see whether exactly this condition occurs.
> Here's the code that should work (note that I didn't actually try it, but > I'm confident it works :P)
> specialDesc() > { > if (cloak.useInitSpecialDesc() && self.useInitSpecialDesc()) { > // Neither the cloak nor the boot have been moved yet. Don't > // display anything. > return; > }
> // If we got here, the cloak was moved. > "An old boot sits forlornly on the floor. "; > }
> On 02/10/2010 12:47 AM, Nikos Chantziaras wrote: >> You can check in the boot's specialDesc whether the cloak was moved:
>> specialDesc() >> { >> if (cloak.useInitSpecialDesc()) { >> // The cloak has not been moved yet. Don't display anything. >> return;
>> // If we got here, the cloak was moved. >> "An old boot sits forlornly on the floor. "; >> }
>> On 02/10/2010 12:02 AM, Kathrel wrote: >>> Not sure what you mean by transcript example, but this is the effect >>> that I >>> want:
>>> Upon entering the room >>> <roomdesc here> + a cloak ob's initSpecialDesc as follows:
>>> "An old cloak lies on the floor, partly covering an old boot, apparently >>> having slipped off its peg."
>>> Then taking the boot (the cloak desc changes accordingly) and dropping >>> it, >>> should make the boot show up in the room list as: >>> An old boot sits forlornly on the floor.
>>> This should appear every time the boot appears in the rooms content >>> list, >>> after either the cloak has been removed, or the boot has been picked >>> up and >>> then dropped. So, it should not appear in the room list before it is >>> picked >>> up the first time (and I handle that with the isListed prop), but it >>> should >>> appear with this unique flavor desc every time it appears in a room >>> after >>> that, and not with the generic "An old boot is here".
>>> And I'm stuck :)
>>> Kathrel
>>> "Nikos Chantziaras"<rea...@arcor.de> skrev i melding >>> news:hkska8$20k$1@news.grnet.gr... >>>> On 02/09/2010 11:17 PM, Kathrel wrote: >>>>> Is there a way to tie lists to single instances of objects? I want a >>>>> particular object to be listed differently before and after an action >>>>> when >>>>> it appears in a room
>>>> Please define "differently". An transcript example would probably be >>>> best.
> Thanks, Nikos, but I still have my issue :) Checking for > useInitSpecialDesc() on the cloak and the room the way you suggest
On the cloak and boot, not the cloak and room.
> for some > reason doesn't make away with the room content list when I initially look > around the room, so I now got two references to the boot, both in its > special desc and in the cloaks initSpecialDesc. I can't think of a reason > why it should behave like this, but it does :(
Instead of:
if (cloak.useInitSpecialDesc() && self.useInitSpecialDesc())
try:
if (cloak.useInitSpecialDesc() && self.isInInitState)
It was a mistake to use the boot's useInitSpecialDesc() since its initSpecialDesc is nil.
> On 02/10/2010 04:17 AM, Kathrel wrote: >> Thanks, Nikos, but I still have my issue :) Checking for >> useInitSpecialDesc() on the cloak and the room the way you suggest
> On the cloak and boot, not the cloak and room.
>> for some >> reason doesn't make away with the room content list when I initially look >> around the room, so I now got two references to the boot, both in its >> special desc and in the cloaks initSpecialDesc. I can't think of a reason >> why it should behave like this, but it does :(
> Instead of:
> if (cloak.useInitSpecialDesc() && self.useInitSpecialDesc())
> try:
> if (cloak.useInitSpecialDesc() && self.isInInitState)
> It was a mistake to use the boot's useInitSpecialDesc() since its > initSpecialDesc is nil.