Once again I have encountered a problem that can be resolved using the StringPreParser, and once again I am hoping to find a different solution.
The trouble arises when I enter commands of the form GIVE X TO Y’S Z. Here is my code:
[rant][code]room: Room ‘room’ ‘Room’
;
me: Actor
location = room
;
- key: Thing ‘key’ ‘key’
;
monster: Actor ‘two-headed monster’ ‘two-headed monster’
location = room
;
-
leftHead: Head ‘left head’ ‘left head’
; -
rightHead: Head ‘right head’ ‘right head’
;
Head: Component
iobjFor(GiveTo)
{
verify() { }
action()
{
replaceAction(GiveTo,gDobj,monster);
}
}
;[/code][/rant]
And here is my transcript:
[rant]Room
The two-headed monster is standing here.
give key to right head
The two-headed monster does not appear interested.
put key on monster’s right head
There’s no good surface on the right head.
give key to monster’s right head
[At this point I receive an error: “nil object reference”][/rant]
Any thoughts?