I’m attempting to have the player able to put something Under something else, using a pre-generated project in the Workbench with adv3Lite. With the below code, I get the reponse: “You can’t put the item under itself.” I cannot for the life of me figure out why this is occurring.
#charset "us-ascii"
#include <tads.h>
#include "advlite.h"
versionInfo: GameID
name = 'TEST'
;
gameMain: GameMainDef
initialPlayerChar = me
;
startroom: Room 'The Starting Location'
"Add your description here. "
;
+ me: Thing 'you'
isFixed = true
person = 2 // change to 1 for a first-person game
contType = Carrier
;
+ table: Thing 'table'
contType = Under
canPutUnderMe = true
;
++ item: Thing 'item';
Typing “put item under table” generates the response. Making the contType In presents no problems.
I followed the logic through to the implementation of the dobjFor(PutUnder) method in thing.t in the library and noticed that within the verify function, if(gVerifyIobj == gIobj)
is the check for self actions, which is elsewhere gVerifyIobj == self
- although I cannot say I know enough how any of this works to allege that anything might be wrong there!
Would appreciate any help in how to correctly structure an Under containment relationship.