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;
}
}
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.
–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.
, 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…
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’.