Page 1 of 1

Possible bug in DoAsk

Posted: Mon Aug 08, 2011 1:14 pm
by Bainespal
I noticed this code in DoAsk:

Code: Select all

elseif xobject = player
	{
		if not object.after
			VMessage(&DoAsk, 3)     ! asking about yourself
	}
	elseif xobject = object
	{
		if not object.after
			VMessage(&DoAsk, 4)     ! asking about him/herself
	}
I hadn't known that default messages provide for the PC asking about himself or for the PC asking an NPC about that same NPC. I didn't test the second condition, but when I try asking an NPC about the player object, I just get a blank line. Note that if the NPC's after property has a default DoAsk response, that response is displayed. I get the blank line when asking an NPC that doesn't have a default condition.

The corresponding code in VMessage doesn't look like it should cause any problems:

Code: Select all

case 3:  print "Hopefully "; The(player); " know"; \
			MatchSubject(player); " as much as anyone."
case 4
{
  print CThe(object); " would probably rather not talk about "; object.pronoun #4; "."
}

Posted: Mon Aug 08, 2011 5:37 pm
by Roody_Yogurt
Yeah, it's not really a bug; it's just an all-or-nothing dealie. If you have any character.after code, you're going to have to add make DoAsk responses for every feasible subject (going the normal 'select xobject/ case [object name]' route). The DoAsk routine only prints those defaults if there is no character.after code at all.

Posted: Tue Aug 09, 2011 3:37 pm
by Roody_Yogurt
Actually, Johnny points out that you could just return false from asking about the player or character object, like:

Code: Select all

select xobject
      case player : return false
      case object : return false
So yeah.

Posted: Wed Aug 10, 2011 5:55 am
by Bainespal
Roody_Yogurt wrote:Yeah, it's not really a bug; it's just an all-or-nothing dealie. If you have any character.after code, you're going to have to add make DoAsk responses for every feasible subject (going the normal 'select xobject/ case [object name]' route). The DoAsk routine only prints those defaults if there is no character.after code at all.
Somebody should make a game some day with a bunch of Hugo-standard NPCs. Maybe if I get too frustrated, I'll do just that! ;)

But I think it's good to work with the defaults of an IF system, not against them, so I generally try to use the default library behavior when it's appropriate.