more Reindeer Gaems (than just rps) - 2-obj VERB rule needed

I’m once again out of my depth, this time in creating a two-object PLAY verb that’ll take RPS as one possible gaem to play.

This requires that the dObj (the Gaem instantiation) and the iObj (the (N)PC) each qualify themselves for reference via check(), and that they coordinate with each other somehow to get the gaem code going.

It also requires that the gaem object have some kind of vocabwords or topic part, that talks to the parser, and that the verb rule somehow hook into the code there. – I don’t know how to begin this process.

I’m pretty confident I can handle it once I know how to structure it. I don’t have an approach. Any thoughts?

Conrad.

PS - this is the code I’ve got so far.

[rant][code]
DefineTIAction(playGaem);

VerbRule(play)
‘play’ singleDobj ‘with’ singleIobj // <-- I don’t know what singleDobj should hook into!
: playGaemAction
verbPhrase = ‘play/playing (what) (with whom)’
;

/////////////////////////////////////////////////////////////////////////////////////////////

modify Thing
iobjFor(playGaem) {
verify() { illogical(’{The iobj/he} would be a pretty dull counterpart. '); }
}
;

modify Person

// ... various Person jazz

iobjFor(playGaem) {
  verify() {}

  check() {
      // ... all that jazz, for which we'll now say
     return (true);
     }
  }
   
  action() {
        dObj.p1 = gActor;     //<-- as you can see, I tried bluffing and it didn't work
        dObj.p2 = self;
        dObj.mainLoop;
   }
    
}

[/code][/rant]

I have no idea what the symbol dObj is. If it’s the object that actually does the game-playing, then what you’re doing appears, at first glance, to be fairly sensible.

On the other hand, it’s possible that what you mean is gDobj, not dObj.

Ok, that’s fair…

But even before that, how do I create a parser word for an abstract object like a gaem?

There’s nothing for gDobj to hook into.

Conrad.

–I’ve just realized this can be considered the same problem that Jim helped me to solve, in creating the THINK command (where I created Unthing objects that were always in scope). I’m going to try to apply that approach.

Conrad.

–and in the end I’m having the same problem with this I had with THINK: I can’t adjust scope.

DefineTIAction(playGaem) objInScope(obj) { return true } ; ;

Returns “You don’t see that here.”

Nor does

DefineTIAction(playGaem) return ( ( obj.ofKind(GaemThing) ) && obj == gDobj ) || ( obj.ofKind(Actor) )) && obj == gIobj ) ) ; ;

, which tries to put game objects in scope if they’re the dobj, and actors if they’re the iobj. Actors would need to be further specified to be in sensory range, but I’m not even able to get these objects in scope anywhere…

(Maybe I should build them into the Actor class?)

Conrad.

The code below works. Perhaps you could start with it and refine it.

[code]boudoir: Room ‘The Boudoir’
"Wow, look at that red plush wallpaper! You can go north. "
north = porch
;

  • me: Actor
    ;

porch: Room ‘The Porch’
"Ah, the spacious porch! You can go south. "
south = boudoir
;

  • bob: Person ‘bob/guy/man’ ‘Bob’
    "He looks quite intelligent. "
    isHim = true
    isProperName = true
    iobjFor(PlayWith) {
    verify() {}
    check() {}
    action() {
    ““Okay, dude. Ready when you are. Got the board with you?”” ;
    }
    }
    ;

boardGame: Thing ‘checkers/chess/monopoly/go/game’ ‘board game’
dobjFor(PlayWith) {
verify() {}
check() {}
}
;

DefineTIAction(PlayWith)
objInScope(obj) { return true; }
;
VerbRule(PlayWith)
‘play’ singleDobj ‘with’ singleIobj
: PlayWithAction
verbPhrase = ‘play/playing (what) (with what)’
;
[/code]

Note that the boardGame object is not anywhere in the game world; it’s placed in scope by objInScope. (Bob, however, isn’t. You have to be in the room with him to play a game.)

You can test it with ‘play chess with bob / n / play chess with bob’.

Sweet – Thank you, Jim!

Conrad.