Sorry to bring this up again, but could anyone please help me with making an object in my inventory invisible?
Do you mean that it won’t be listed after an ‘i’ or ‘x me’ command, or do you mean that it will be unreferrable-to? In the latter case, I’d say, put it somewhere else.
For the former case, I’d suggest looking at the discussion of the invent routine, on p. 197 of the DM4. I’ve never tried it, but that would be a starting point.
Hm. First, I want this object to be in the player because it’s needed for conversation support. If I don’t find a proper solution I’ll put it in scope. Then, invent [; rtrue;], works almost fine, with one flaw left: An empty line is printed. So, inventory looks like:
You are carrying:
Could probably also be worked around by constantly shuffling the inventory, but hey, there must be a way to get this darn thing so uberinvisible it doesn’t show up in the inventory at all, right?
The easiest way to do this is to have the object not be in the inventory – have it off-stage, but place it in scope all the time.
If that’s not sufficient, you’ll have to replace InvSub and invoke WriteListFrom() with custom arguments. The WORKFLAG_BIT argument and the workflag attribute allow you to control what gets listed.
Erm… Scope it is, then. Thanks!
Hm. Problem is that I use the object to parse “offer help to npc” with one specific npc. Now that I’ve moved the object from inventory to scope, if I offer help to anybody else, part of the reaction is “(taking the help_obj first)”.
How could I handle that?
That happens because the give/offer grammar is defined as
Verb 'give' 'feed' 'offer' 'pay' * held 'to' creature -> Give * creature held -> Give reverse * 'over' held 'to' creature -> Give;
You could extend-replace those lines with
Verb 'give' 'feed' 'offer' 'pay' * noun 'to' creature -> Give * creature noun -> Give reverse
(I dropped the third one because it’s weird and British.)
Thanks Zarf… Now that’s something I should have thought of myself - Extending “Offer”. Works like a charm!
'nother problem in that context: A dummy object in a container. Needs to be there (in there) for technical reasons. Doesn’t cause a problem except for when using the INV command. Setting the short_name to “” results in "a " being listed. I can’t believe there’s no solution how to hide an object within a container (while others are visible). How do I do it?
You could move it out before the inventory command and then move it back.
Or, use the “invent” property. Once again, you’ll have to use WriteListFrom and the workflag bit to write out the contents list while customizing what appears on it.