TLDR; "Why is my CollectiveGroup not being matched by the parser, unless PC is holding one? Also, how do I correctly set up a nounPhrase object?"
It is with some shame I report my WIP progress has stalled for over a month, run aground on the rocky shores of CollectiveGroup debug. My situation is I have two series of portable objects that should each be referred to collectively when more than one is present. When an Examine fails, instead of a CollectiveGroup description, I get individual descriptions of the objects as if responding to a plural ala
>x balls
green ball: A green ball.
blue ball: How it feels debugging this.
Obviously, what I want is
>x balls
Some well behaved balls colored blue and green.
In one case, if three are present, it seems to work as designed, but with only two does not, unless PC is holding one of them! In the other case, even three are not collected unless one is held.
It is clearly some code interaction in my WIP, as when I tried to construct a reduced example, everything worked as expected (two or more unheld objects collected just fine).
Through laborious debug print statements, I have determined that my CollectiveGroup objects are present me.connectionTable()
. I have further determined via print statements in the CollectiveGroup isCollectiveQuant()
function that when it fails, the CollectiveGroup filterResolveList()
is not invoked, which I interpret to mean action.resolveNouns()
does not match the CollectiveGroup for some reason. (But does if PC holds one!) I understand filterResolveList()
to be invoked on every object that matches as a possible target for the action, and is in fact how CollectiveGroup does its substitution for its constituents!
My current debug step is to try and use the individual objectâs filterResolveList()
(which I interpret to be matched, due to the plural descriptions when examined) to explicitly add the CollectiveGroup back to the list, but now I am stymied by not being able to reverse engineer a 'noun phrase' data object. I am trying to
class CollectionResisterObj : Thing 'collection resister/individual' 'thing that resists collection`
"Maddening bane of my existence. "
collectiveGroups = [impotentCollectionGroup]
filterResolveList(lst, action, whichObj, np, requiredNum) {
local collectiveRI = new ResolveInfo(
obj = collectiveGroups[1],
flags = 0, np = '???');
// only add it if not already in list
if (lst.indexWhich( {x: x.obj_.ofKind(collectiveGroups[1]) } ))
lst += collectiveRI;
inherited(lst, action, whichObj, np, requiredNum);
}
Which fails because I cannot suss out what to set flags and np params to. I tried directly setting the np from the function call, but that did not work. I have been deep in the Technical Manual but have not yet found the answer. Help much appreciated!
FWIW, this thread consulted much earlier, too late as it turned out. Linking because may be useful to future debuggers. Handling action with count via CollectiveGroup