I’m trying to solve a Library problem in which if the PC is nameless and then switches bodies, the new PC can no longer examine or interact with the former PC. If the original PC is given a name, then things work fine. I don’t want to introduce a default name of any kind because I’m sure authors want to retain the ability to have a nameless PC.
The writeup for my problem is here: inform7.com/mantis/view.php?id=1350. One tack I’m exploring is the idea of having a dummy scenery object called “my former self” follow around the former PC when the body swap is done. Then whatever I do to the dummy will be done to the former PC.
Now then, my question: How can I create an object that will reflect EVERYTHING onto some other object?
I could edit selfobj in parserm.h to look like this:
Object selfobj "(self object)"
with name 'my' 'former' 'self',
But that allows the player to refer to “my former self” at all times, even when in the original body. Having three dictionary words up there for the name property will prevent the author from allowing one to address the PC using a proper name.
You want any action on the dummy to be redirected to another object? I think you could do
before [; <<(action) (otherobj) (second)>>; ]
…but it’s been a while and that probably needs some refining.
Having a dummy scenery object follow the character around is a hacky solution. I wouldn’t recommend it for the standard library.
The I6 library has always assumed that you could write your own player object if you needed to. Or customize it without replacing it, to some extent. The 6/11 selfobj has space for a parse_name property; a game author could use this slot to have it recognize “my former self” when the player variable is switched to something else.
Also, the trick for providing a name property that’s a dummy (can be filled in by the author) is
I see. I think that problem is now solved. Knowing this, I can make some alterations in ChangePlayer() and have things work automagically.
Here’s something else somewhat related: I found myself using metaclass() to check if player.short_name is a routine or string in the CSubject functions in english.h. If I simply call it like player.short_name(), it appends a newline. Why? What would break if the Inform compiler were altered to not do that? It would seem to me that it would be advantageous to not have to worry if the property is a string or routine.