ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Check if an object has a property expression problem

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Check if an object has a property expression problem

Postby DazaKiwi » Thu Nov 21, 2019 1:24 am

I am getting an error for an expression which should work as i have other expressions exactly like it for other object properties (but those are not text properties) but i get a 'bad expression' error for objects that do not have the property- however those which do there is no error. The whole point of this expression is to overlook objects that do not have the text property.

adrift Code: Select all
<#if(%object%.daz5ObjectHasA=1,"Desc:" &%object%.daz5ShortDesc&"","<del>")#>


Any ideas why this could be happening? the syntax seems correct, the property keys are correct. There is no issue if i give the object it references in the error a short custom description but this expression is designed as a filter as i do for other properties which the object the error references doesn't have but throws no errors for those expressions.

I can only conclude this expression doesn't work with text properties- but the property checked in the expression is a selectable type only, so i dont know.

Any ideas why this is happening?
User avatar
DazaKiwi
 
Posts: 757
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 61

Re: Check if an object has a property expression problem

Postby ralphmerridew » Thu Nov 21, 2019 2:47 pm

One quirk of ADRIFT is that "if" expressions don't short-circuit; it always evaluates all three parts and selects one value.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2594
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: Check if an object has a property expression problem

Postby DazaKiwi » Thu Nov 21, 2019 8:16 pm

Some of my other expressions on the same output/task was checking other properties which the object in question did not have but there was no error for those. So i guess this quirk pops up with text properties that objects do not have, had it been an integer property there wouldn't be a problem. Well at least i know now. I will use an alt desc for those text properties checks instead.
User avatar
DazaKiwi
 
Posts: 757
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 61


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 15 guests