Possible bug in DoAsk

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Possible bug in DoAsk

Post 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; "."
}

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post 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.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post 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.

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post 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.

Post Reply