adv3Lite -- Disambiguation best practice


(I have tried several approaches with little success so either I’m over complicating this or have a mental block on this issue.)

Consider the following code to allow both in and enter igloo to work:[code]iglooRoom : Room ‘Frozen Igloo’
"A frozen igloo, replete with an igloo door. "
in = iglooDoorOutside

  • igloo: Enterable ‘igloo; frozen’
    connector = iglooDoorOutside
    dobjFor(Examine) { verify() { logicalRank(120); } }
    isListed = nil

  • iglooDoorOutside : Door ‘door; igloo’
    isListed = nil
    otherSide = iglooDoorInside

insideIglooRoom : Room ‘Inside Igloo’
"Inside of igloo. "
out = iglooDoorInside

  • iglooDoorInside : Door ‘door; igloo’
    otherSide = iglooDoorOutside
    ;[/code]Which produces this simple script: [code]Frozen Igloo
    A frozen igloo, replete with an igloo door.

x igloo
A frozen igloo, replete with an igloo door. ** This works because of the logicalRank increase in the Examine method of the igloo object

touch igloo
Which do you mean, the igloo or the frozen igloo?

enter igloo
(first opening the door)

Inside Igloo
Inside of igloo.[/code]Now, for this example I could simply add another logicalRank increase for the Feel action in the igloo object: dobjFor(Feel) { verify() { logicalRank(120); } } but this can lead to missing a player’s action that isn’t coded for (ie, Kick igloo).

My question is:

What is the best approach to catch all of the actions and give the igloo object the bump up in logicalRank so that it gets parsed out instead of the parser asking the player?

Thanks for any help!

– Mike

The vocabLikelihood property is designed for this circumstance, where you want to prefer one object over another in all circumstances. Try setting vocabLikelihood = 10 on the igloo object, to make it more likely than the igloo room.

Thanks Emily, that worked.

Eric does mention this in his “Learning TADS 3 with adv3Lite” reference book (my main source for now), but I obviously missed it!

– Mike