One more quirk: routine CalculateHolding

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

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

One more quirk: routine CalculateHolding

Post by Merk »

"mobile" is an alias attribute for "worn". If you are carrying something which is mobile (i.e, you could drag it with a rope, but maybe you can carry it too), then its size isn't going to be added to player.holding in the CalculateHolding routine.

It looks like it would be easy enough to fix by adding a check to see if the "worn" item is also "clothing":

Code: Select all

if i is not worn or i is not clothing or obj ~= player

Kent
Posts: 119
Joined: Fri Jun 27, 2003 12:10 pm

Post by Kent »

Again, I'll have to look through the logic of this, but if it stands up, it should probably become a fix.

Thanks.

--Kent

Merk
Posts: 192
Joined: Mon Nov 22, 2004 3:19 pm
Location: Wichita, KS
Contact:

Post by Merk »

The only thing I can see it breaking is if somebody was flagged something as "worn" even though it wasn't wearable, and was counting on it to not be calculated in the player's holding value. But (a) that's probably unlikely, since it has to be "clothing" unless it's forced to "worn" in code (grammar def wouldn't allow it), and (b) it's really only an issue if you're managing inventory, which is unpopular anyway. :)

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

Post by Roody_Yogurt »

In case anyone see this topic while forum spelunking, we have since decided the line should be:

Code: Select all

if not (i is worn and i is clothing and obj = player)

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

Post by Roody_Yogurt »

Nevermind, the original code up there also works fine. I just copied it wrong for Roodylib.

Post Reply