Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000376Core InformModel worldpublic2010-10-30 12:222014-05-07 07:33
Assigned Tograham 
Platformx86OSWindowsOS Version7
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000376: Enclosure doesn't work for "a room"
DescriptionSection 3.25 of the manual says rooms enclose their contents, but the code below will never print "Success."
Minimal Source Text To Reproduce
Home is a room. Closet is north of Home. A broom is in the closet.
Instead of waiting when something is enclosed by a room: say "Success."
Test me with "z".
Additional InformationThe generated code expects the enclosing object to be both a room and a thing, which is impossible:

! True or false?
! [ Exists x : thing(x) & Exists y : room(y) & thing(y) & encloses(y, x) ]
[ Prop_0 x x_ix y y_ix ;
    for (x=IK2_First: x: x=x.IK2_Link){
        for (y=IK2_First: y: y=y.IK2_Link){
            if ((y ofclass K1_room) && (IndirectlyContains(y,x))){

With a specific room ("enclosed by Closet") it works correctly.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0001046closedgraham Property verb doesn't work for "a room" 

-  Notes
jennyW (reporter)
2011-04-19 03:17

I've encountered this issue too, I think.

I've got this code:

repeat with item running through audible things
if item is enclosed by the location, place item in scope;
if item is enclosed by an adjacent room, place item in scope;
end repeat.

It works when it's "the location", but i7 completely skips the "adjacent room" line.

Right now I have to replace "enclosed by" with "in" and be tied to not having any sound devices enclosed in my rooms.

Sorry if this was obvious from the original report, but it might be a little different. I'm just learning, but this bug cost me about half an afternoon, just figuring out what "I" was doing wrong...
EmacsUser (manager)
2011-04-21 12:59

A workaround for now is to define an equivalent relation and verb, for example,

- - - -
Tweaked enclosure relates an object (called the vessel) to an object (called the contents) when the vessel encloses the contents. The verb to enclose with tweaks (it encloses with tweaks, they enclose with tweaks, it enclosed with tweaks, it is enclosed with tweaks, it is enclosing with tweaks) implies the tweaked enclosure relation.
- - - -

and then to use the new relation and verb in place of enclosure:

- - - -
A thing can be audible.
There is a room. Here is an audible thing called the buzzer. North is another room. North from another room is yet another room.

After deciding the scope of the player:
    repeat with the item running through audible things
        if the item is enclosed with tweaks by the location, place the item in scope;
        if the item is enclosed with tweaks by an adjacent room, place the item in scope;
    end repeat.
A rule for reaching inside an object when the current action is listening to something audible:
    allow access.

Test me with "listen to buzzer / n / listen to buzzer / n / listen to buzzer".
- - - -
jennyW (reporter)
2011-04-21 17:50

Oh thanks EmacsUser! :)

That's a much better work around than what I came up with. I'm going to add this to my game with a note to come back and restore it when this bug is solved. But, for now, at least I can go back to designing my story as I'd imagined it. Thanks.
zarf (developer)
2012-02-02 11:47

Very belatedly, I wonder if this is because "enclosure" is listed in the index as a relation from things to things? Rooms aren't things.
ChrisC (reporter)
2012-02-03 02:32

re 0001568 : I don't think that could be the problem, or at least not all of it, because the code works fine when a specific room (The Closet) is named.
graham (administrator)
2014-02-12 13:39


- Issue History
Date Modified Username Field Change
2010-10-30 12:22 jmcgrew New Issue
2010-10-30 12:25 jmcgrew Summary Enclosure doesn't work for rooms => Enclosure doesn't work for "a room"
2010-10-30 12:25 jmcgrew Description Updated View Revisions
2010-10-30 12:25 jmcgrew Additional Information Updated View Revisions
2010-10-30 21:38 jmcgrew Severity serious => mild
2010-10-30 21:38 jmcgrew Status new => acknowledged
2010-11-01 17:12 EmacsUser Status acknowledged => confirmed
2011-04-19 03:17 jennyW Note Added: 0001142
2011-04-21 12:59 EmacsUser Note Added: 0001144
2011-04-21 17:50 jennyW Note Added: 0001145
2012-02-02 11:47 zarf Note Added: 0001568
2012-02-03 02:32 ChrisC Note Added: 0001569
2012-11-07 17:13 zarf Relationship added related to 0001046
2014-02-12 13:39 graham Note Added: 0002481
2014-02-12 13:39 graham Status confirmed => resolved
2014-02-12 13:39 graham Resolution open => fixed
2014-02-12 13:39 graham Assigned To => graham
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker