The same way that we handled the note in our previous discussion. The item is defined to be nowhere (think of it as offstage) and is moved to the appropriate location once the asking or giving action happens.
You’re headed in the right direction, but there are a few issues with your code:
- You say “now the player has tamed woman” without ever defining a tamed woman object. You need a statement that defines the tamed woman and places her nowhere. “A woman called a tamed woman is nowhere.” or simply “The tamed woman is a woman.” would do the trick. Edit: after posting this, I see that you have “The tamed woman is a woman in Grassy Field” outside of the code tags in your post, so, it’s not that she’s undefined, but that she’s in the same location as the wild woman instead of being offstage. Another problem is that I7’s type system won’t allow the woman to be both a woman and a weapon (if we define weapon as its own kind). You could circumvent this by including some I6 code, but I think that the whole approach of companion as inventory item is broken – see below.
- You say “now the player has tamed woman”, but “has” can only be used for testing the current state of the world, not changing the state of the world. “has” means “carries or wears”, so you want to say “now the player carries the tamed woman” instead. See §13.4 of the manual.
- The wild woman is called “wild woman” rather than “a wild woman”, which may not be what you want, because Inform is more literal about what follows “called” in the definition of an object. See §3.18.
- Since the wild woman and the tamed woman are meant to represent the same woman, you don’t want both of them in the same place at the same time, so you want to remove the wild woman when bringing the tamed woman into play.
- Moving the package of chicken to the wild woman is fine, but, since you’re going to remove the wild woman anyway, you can just remove the chicken also.
- The default behavior after completing a before rule is to continue with the action (in this case, giving the chicken to the woman). As written, once your rule runs, the action processing will go on to try to give the chicken to the woman, but it will fail, because either the woman now holds the chicken (as you originally wrote it) or the chicken and the wild woman have been removed (as I suggested). Since you’re handling everything here in your before rule, you need to stop the action processing, either by saying “stop the action” or by modifying your “say” to be an “instead say”. Another option would be to change the before rule to an instead rule, where the default behavior is not to continue with the action.
- If you acquire the tamed woman and drop her, you can’t pick her up again, because people can’t be taken by default.
Putting that all together:
The tamed woman is a woman.
The player carries a package of chicken.
Grassy Field is a room.
A woman called a wild woman is here.
Instead of taking wild woman:
say "[one of]Best not to approach this strange creature, it looks hungry.[or]You should really think about every decision before you make it.[or]Come back later, when you are appropriately equipped.[at random]".
Before giving package of chicken to wild woman:
now the package of chicken is nowhere;
now the wild woman is nowhere;
now the player carries the tamed woman;
instead say "You hand over the chicken, keeping it a sensible distance from the rest of your body. As soon as the creature has hold of the chicken, you let go. The wild woman swallows it in one go. 'Ah, very nice. Right on, ta,' says the wild woman. 'I might as well come with you.' You allow the creature to accompany you, but are unconvinced that it has bonded to you because of your kindness."
Instead of dropping tamed woman:
say "The tamed woman refuses to leave."
I think that this is a broken way of modeling the situation. It would be better to let her be an NPC that follows and fights alongside the PC. See exercise 39 (Van Helsing) for an example of a character that follows the player around the map.