When Harry gets up from his bed, he needs to put on his clothes. There are three individual items of clothing available—pants, shirt, and shoes. He can put each on individually, or either of the following commands results in his putting on all of them: wear all or put on clothes.
I have also added a new verb rule for get dressed, which also results in Harry putting on all three items of clothing.
But the text displayed in the game window is awkward…
I want to suppress that parenthetical first taking… text that comes after the first two items are put on.
In fact, just to get that required some gymnastics in the code.
I thought at first I could just redirect the command to one of the commands that already works…
doInstead(Wear, 'all')
…but that doesn’t work. Tracking progress in the debugger shows it doing the redirect but then failing when it can’t do anything with ‘all’.
So, I now do three individual redirects…
// get dressed
VerbRule(GetDressed)
'get' 'dressed'
: VerbProduction
action = GetDressed
verbPhrase = 'get dressed/getting dressed'
;
DefineIAction(GetDressed)
execAction(c)
{
if(runningShoes.isWornBy(harry) &&
hoodie.isWornBy(harry) &&
cargoPants.isWornBy(harry))
"Harry was already wearing his pants, shirt and shoes. There was
nothing else to put on. <.p>";
else
{
doInstead(Wear, runningShoes);
if(runningShoes.isWornBy(harry))
"Harry put on the shoes. <.p>";
doInstead(Wear, hoodie);
if(hoodie.isWornBy(harry))
"Harry put on the hoodie. <.p>";
doInstead(Wear, cargoPants);
}
}
;
Without the if statements, I get…
He ends up wearing all items, but the game window only acknowledges the last one, the pants.
With my if statements, I get all three items acknowledged, but the parenthetical test—the game generated first taking text—is in the wrong position.
So, my question is, can I suppress that parenthetical text? More generally, can I intercept the game’s output stream? How? Where is it? I’ve looked and can’t find it, not just for this command, but other places as well; the system text is fine for some things, but other times it’s in the way.
Thanks.
Jerry