Implicit trouble

I’ll be surprised but grateful if someone can crack this nut.
Here’s the situation: a smithy, where once you’ve used the tongs explicitly, they will be implicitly used to grab objects out of the fire. The problem is, the explicitly requested action is getting cut off after the tongs are taken.

<>> take tongs
  You take the tongs. 

<>> put blanks in forge
  You grab a set of four horseshoes from the bin. 

  You place the horseshoes into the coals. However, only a few small coals are lit, and they aren't doing more than warming up the horseshoes. 

<>> z
  Time passes... 

  The horseshoes have grown red-hot in the coals. 

<>> take shoes
  You can't just take a hot metal object out of the midst of flaming coals, unless your objective is to get rid of the flesh on your hand. 

<>> take shoes with tongs
  With the tongs, you grab hold of the horseshoes. 

<>> put shoes in forge
(putting the horseshoes in the coals)
  You place the horseshoes into the coals. 

<>> put shoes on anvil
(first taking the horseshoes)
  With the tongs, you grab hold of the horseshoes. 
  The coals in the forge cool from white-hot down to red-hot.

Notice that on the last command, the shoes are implicitly taken with the tongs but then the command doesn’t complete ‘put shoes on anvil’. Anybody know why it would short-circuit there?

1 Like

Can you post some code, in particular the action handlers (dobjFor, iobjFor) for the various objects?

3 Likes

Thanks, Jim! I figured it out, though. Here’s the sequence, for anyone that encounters a similar problem.
All I needed to tweak was meetsObjHeld on the forgeable objects. Let’s say that the horseshoes are in the fire, and the player’s command is ‘put shoes on anvil’. The objHeld precondition for PutAction will try an implicit Take action before putting. But actionDobjTake was modified in the Forgeable class so that a TakeWith (tongs) action will be performed if the forgeable is red-hot at the moment.
After this implicit take, the shoes will be located in the tongs which are located in the PC, but objHeld will throw an exit signal if the implicitly taken object doesn’t end up isDirectlyIn(player). That’s what threw me, is that I always expected an error message if a precondition didn’t follow through, but in this case it was still happily reporting that you picked up the object with the tongs, but not finishing.
After the Forgeable class was tweaked to meetsObjHeld when they’re in held tongs, everything worked.

3 Likes