I did notice when I last visited the bug tracker site (inform7.com/mantis/my_view_page.php) that there are some bugs in existence to do with setting up characters and making the player a particular character, as opposed to just setting up an entity called ‘the player’.
And just now I noticed that your 2nd example, which doesn’t work as you gave it, does work if you reorder the lines like this:
[code]The Prison Cell is a room.
A prison tattoo is a kind of thing. A prison tattoo is part of every man.
Robert is a man in the Prison Cell. The player is Robert.[/code]
I can’t explain why exactly, but what I can say is I’m also working on a game where you have a choice of characters, and I haven’t hit any show-stopping bugs even though I’m using the same method you are (create characters, then make the player one of those characters), and I’m well into programming. So what you experienced may be a bug, or some subtlety I don’t understand.
Also note that if you are giving a choice of characters in your game, after the player chooses, you will need to use the phrase ‘now the player is (character)’ during run-time to effect the change.
I have a feeling the bug here may grow out of saying ‘the player is Robert’ and its ordering in the code. Because another rewording of your 2nd example which also works to make the tattoo is this:
[code]The Prison Cell is a room.
Robert is a man in the Prison Cell.
When play begins: Now the player is Robert.
A prison tattoo is a kind of thing. A prison tattoo is part of every man.[/code]
There’s a page in the manual (4.14) that talks about slight variation you get when the order of those lines are reversed, namely “your prison tattoo” becomes “Robert’s prison tattoo”. So, that’s why I ended up defining things like that.
And, I strangely get… “your former self” when I test your second suggestion. So, that’s a bit weird.
What I’ve been thinking of doing is to just define these things on the actual characters, rather than giving them out to everyone with one line. I’m not sure if that will make it more or less efficient, but I’m pretty sure I’ll be able to avoid this issue that way.
I’m still going through the manual, testing this and that, and right now my “game” is filled with experiments, to test if ideas work.
I’m hoping to whip things into shape and start the actual story once I’m a bit more familiar with i7.
Thanks again, and I’ll probably have some more questions at some point, so we’ll maybe talk later.
On the first point, you can change the printed name of Robert’s prison tattoo to “your prison tattoo.”
By default (that is, if you don’t have a line like “The player is Robert” in your source code) Inform defines a “yourself” object as the player – your typical undefined IF protagonist. If you then say “Now the player is Robert” the “yourself” object is still hanging around. The solution is to remove the yourself object from play after turning the player into Robert – I forget the exact formulation I used to test it, but I think “Now yourself is off-stage” works, or maybe “Remove yourself from play.”
So I’d do this:
When play begins:
now the player is Robert;
now the printed name of Robert's prison tattoo is "your prison tattoo";
now yourself is off-stage.
Oh, and given the advice in 4.14 to define the player as early as possible, I think the behavior of your original code should probably be reported as a bug.
Also, the last version of code does exactly what I was wanting, so I’m going to use it as is. I didn’t think to manually correct things like that. But I’ll definitely keep it in mind when I come across similar things.
Isn’t the “yourself” object declared as a Person, rather than the more specific Man, hence the scope problem in the original post? “People” don’t have tattoos, only men do, and the player isn’t a man. This was the first thing that popped into my head, anyway. ::shrug::