# conflicting content lists for same container

My ATM, debit card, and wallet now appear to be working in harmony.

When I put the card in the machine, the machine automatically dispenses cash and the debit card is automatically retrieved and placed in the wallet.

Sort of.

I put the card in the ATM, the game says…

put debit card in machine
(first taking the debit card)
When Harry inserts the debit card into the machine, it becomes operational. Harry enters his PIN and withdraws \$100 in 20s, retrieves the card, and puts it back into his wallet.

I then look around, and the game reports what I see, including the contents of the wallet, which contains the debit card…

look
Street Corner
Corner of the street.
Harry sees an ATM here. In the wallet, Harry sees a credit card, five 20 dollar bills, and a debit card.

I then take the debit card out and put it back…

take debit card
Taken.
look in wallet
The wallet contains a credit card and five 20 dollar bills.

put debit card in wallet
Done.
look in wallet
The wallet contains a credit card, five 20 dollar bills, and a debit card.

But when I do a general look around and the game reports the contents of the wallet, the debit card is not shown…

l
Street Corner
Corner of the street.
Harry sees an ATM here. In the wallet, Harry sees a credit card and five 20 dollar bills.

To double check I examine the wallet, and there it is…

look in wallet
The wallet contains a credit card, five 20 dollar bills, and a debit card.

In the debugger, wallet object shows contents as…

[obj#723 (creditCard),obj#3a1a (TwentyDollarBill),obj#39c3 (TwentyDollarBill),obj#396d (TwentyDollarBill),obj#3917 (TwentyDollarBill),obj#38c1 (TwentyDollarBill),obj#724 (debitCard)]

So why isn’t the debit card showing up in the general look-around descripton, that does itemize wallet contents?

If I take the credit card out and return it, it also disappears from the general look-around text, though it is present in the itemization when the wallet is examined.

Jerry

I’m thinking we’ll need to see more code before the answer can come to light. Can you show us the basics of the ATM and Credit cards? Any inheritance relationships as well as very overrides for sure.

Also, when I have a problem with something weird like this, I use the visual debugger. In this case, since it’s not showing up when you think it should, I would change the name property to be a function that returns a string with the name, and the drop a break point on that return. You’ll find that it gets called a lot more often than you would expect But, one of those times will probably be the portion of the code where the library decides not to display the item. It’s probably not 100% reliable, but I’ve found answers to a lot of crazy behavior with that trick.

Sure, my code is attached.

I have been stepping through the code in the debugger, but as you noted sometimes the same library code gets called over and over again. The message report for the Look command gets built up word by word by period by paragraph marker—once cycle through the library for each of those components. Single stepping through it all is a bit of a chore and so far hasn’t provided me with an obvious solution.

But…if it were easy they’d all be doing it, right?
money_supply.zip (2.33 KB)

OK, I’m going to suggest a full recompile. Maybe you had something that wasn’t quite right mixed into the compilation? Because, it works fine for me:(

Street Corner

Corner of the street. There is an ATM in the building’s wall.

Harry sees an ATM here. In the wallet, Harry sees a credit card and a debit card.

put debut card in machine
The word “debut” is not necessary in this story.

(If this was an accidental misspelling, you can correct it by typing OOPS followed by the corrected word now. Any time the story points out an unknown word, you can correct a misspelling using OOPS as your next command.)

put debit card in machine

(first taking the debit card)
When Harry inserts the debit card into the machine, it becomes operational. Harry enters his PIN and withdraws \$100 in 20s, retrieves the card, and puts it back into his wallet.

l
Street Corner

Corner of the street.

Harry sees an ATM here. In the wallet, Harry sees a credit card, five 20 dollar bills, and a debit card.

l
Street Corner

Corner of the street.

Harry sees an ATM here. In the wallet, Harry sees a credit card, five 20 dollar bills, and a debit card.

put debit card in machine

(first taking the debit card)
When Harry inserts the debit card into the machine, it becomes operational. Harry enters his PIN and withdraws \$100 in 20s, retrieves the card, and puts it back into his wallet.

l
Street Corner

Corner of the street.

Harry sees an ATM here. In the wallet, Harry sees a credit card, ten 20 dollar bills, and a debit card.

Just a quick suggestion, I make a file called game.h in which I put any enums, #defines and common includes, such as your #charset and #include . This way, I can lazily use only #include “game.h” This also allows me to make sure that ll of my enums and defines are recognized by all of my .t files without having to bother with typing the same stuff over and over again.

And…you can also do:

+creditCard: Thing ‘stuff’ ‘stuff’
(lots of interesting stuff)

instead of defining a separate class and then an instance. I think the end results are exactly the same as far as TADS is concerned.

Just one less line of typing as well. Yeah, I’m lazy;)

Mignon:

Thanks. I get the same results you get, when I do the same steps you did. But your walkthrough missed a step.

If you take either the debit or credit card out of the wallet and put it back then do another Look from the street corner, the debit card is not listed (but is, if you look in the wallet). After you put the card in the machine and get your first five 20s, do this…

take debit card
Taken.

put debit card in wallet
Done.

look
Street Corner
Corner of the street.
Harry sees an ATM here. In the wallet, Harry sees a credit card and five 20 dollar bills.

Jerry

I didn’t have time last night to look too deeply, but I do see what you see. It happens with the credit card too. I think you’ve got something wrong with your wallet, because when I tried “close wallet” it threw an exception. I would look at the documentation for the details on handling direct+indirect objects and make sure there isn’t something you need to be doing with the wallet. Or, maybe there is something you are doing elsewhere that is just putting stuff into an invalid state…unfortunately, this could take some time to diagnose.

I think the problem is that you have the wallet in the code twice. You also have the credit and debit cards in the code twice. This causes the game to get confused. What you want is something more like this:

[code]harry: Actor ‘harry’ ‘Harry’
“”
isProperName = true
pcReferralPerson = ThirdPerson
location = streetCorner
;

• pocket: Container ‘pocket’ ‘pocket’
“Harry’s pockect.”
;

// harry’s wallet

• wallet: OpenableContainer /, Dispenser/ ‘wallet’ ‘wallet’
"A worn leather bifold wallet. "
initiallyOpen = true
material = ‘worn leather’
canReturnItem = true
;
++ creditCard: Thing ‘credit cardcards’ ‘credit card’
“A credit card”
;
++ debitCard: Thing 'debit card
cards’ ‘debit card’
“A bank-issued debit card”
dobjFor(PutIn)
{
action()
{ //… etc.
[/code]
If you take an inventory while running your version, you’ll see that the player is carrying two wallets. At least, that’s what I saw.

T3 is not the easiest system to learn, but you’re off to a good start. There are other issues in this code that you’ll want to address at some point. At present, the player can drop the pocket, which is not what you want. The wallet should perhaps be in the pocket. You need vocabulary synonyms (which are easier to add when writing a description of the object, in my experience – going back and adding them afterward is more work).

Well, it pays to ask questions.

Multiple wallets seems to have been a problem, not to mention not putting the wallet(s) in the pocket.

I have moved the definition of the wallet to the same place where it is added to Harry’s pocket, and did the same for the credit and debit cards, and I’m getting better results.

Much better.

In fact, it solved a nagging problem that I was ignoring until I resolved the main issue—I was unhappy that the wallet got described in the room description in the first place (for the street corner) since it shouldn’t be visible at that level. Harry’s carrying it.

Now I get much better results all around…

Street Corner
Corner of the street. There is an ATM in the building’s wall.

inventory
Harry is carrying a pocket (which contains a wallet).

put debit card in atm
(first taking the debit card from the wallet)
When Harry inserts the debit card into the machine, it becomes operational. Harry enters his PIN and withdraws \$100 in 20s, retrieves the card, and puts it back into his wallet.

look
Street Corner

Corner of the street.

examine wallet
A worn leather bifold wallet. It’s open, and contains a credit card, five 20 dollar bills, and a debit card.

take debit card
Taken.

put debit card in wallet
Done.

examine wallet
A worn leather bifold wallet. It’s open, and contains a credit card, five 20 dollar bills, and a debit card.

look
Street Corner
Corner of the street.

Jim, yes, it’s complicated. But that’s part of the allure, isn’t it? If it were easy, it wouldn’t be as much fun.

For the record, here’s my new arrangement (yes, still have some work to do on it, thanks for the tips, but at least it’s more structurally sound than it was)…

[code]// harry, main character
harry: Actor ‘harry’ ‘Harry’
“”
isProperName = true
pcReferralPerson = ThirdPerson
location = streetCorner
;

• pocket: Container ‘pocket’ ‘pocket’
“Harry’s pocket.”
;

// harry’s wallet
++ wallet: OpenableContainer ‘wallet’ ‘wallet’
"A worn leather bifold wallet. "
initiallyOpen = true
material = ‘worn leather’
contentsListed = nil
;
+++ creditCard: Thing ‘credit cardcards’ ‘credit card’
“A credit card”
;
+++ debitCard: Thing 'debit card
cards’ ‘debit card’
“A bank-issued debit card”
dobjFor(PutIn)
{
action()
{
if(gIobj.ofKind(atm))
{
…etc.
[/code]