[I6] Overlaying the description

Hi all,

under Inform 6, how can I overlay the description of an item? I have a sticker, and the player shall be able to stick it to any object which then shall have “A sticker is attached to it.” added to its description. I can handle the scope but I have no idea how to overlay a description that could be custom made. Could a “Class myobject” with a property work?

Thanks and kind regards,

It sounds like Exercise 104 in the Inform Designer’s Manual is the sort of thing you’re looking for. In short, you can InScope() to drag the sticker into scope whenever the object it’s attached (if any) to enters scope, along with react_before() and react_after() routines on the sticker to handle adding its description to the attached object’s.

That indeed looks like what I need. Thanks!

Damn. Execise 104 just covers the scope handling, so the sticker is correctly transported around and is examinable. But the sticker’s target object description is not changed. Any ideas on this? I assume it’s a tough task coz often the description of an object is not a simple string but a routine.

Apologies for having missed this earlier. I have an object like this in one of my games, and the solution I came up with was just to add a react_after routine on it like:

react_after [; Examine: if (noun ~= nothing && noun == self.parent_object) print "^There is a long ribbon tied to " (the) self.parent_object, "."; ];
Does that work for the object you have in mind?