Setting up the player...?

Am I missing something?

The Prison Cell is a room.

Robert is a man in the Prison Cell.

A prison tattoo is a kind of thing. A prison tattoo is part of every man.

When I play, everything goes as expected, just another person in the cell with Robert.

But if I have this instead:

The Prison Cell is a room.

Robert is a man in the Prison Cell. The player is Robert.

A prison tattoo is a kind of thing. A prison tattoo is part of every man.

Then the tattoo doesn’t appear in scope at all. It just disappears for some reason.

However if I define things like this:

The Prison Cell is a room.

Robert is a man in the Prison Cell. The player is Robert.

A tattoo is a kind of thing. A tattoo is part of every person.

Then suddenly the tattoo comes back into scope and everything is fine and dandy again.

But I don’t want to use the generic “person” for this at all. So… what’s happening here? Is it a bug that hasn’t been worked on yet? Can someone suggest a work around?

You see, I’m attempting to make a game with two possible protagonists, and a lot of things like this will be determined when the player chooses who to play. So, it’s rather important.

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]

  • Wade

Oh, thanks for the input, Wade.

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. :slight_smile:

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.

Yes, report that as a bug. “A tattoo is part of every man” ought to work in this case.

I submitted a bug report.

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. :slight_smile:

Thanks.

If the player changes more than once during the game, it might be safer to use a rule like this:

[code]Rule for printing the name of a prison tattoo which is part of the player:
say “your prison tattoo”

Understand “my” and “mine” as a thing when the item described is part of the player.[/code]

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::

If you type “showme robert” or “showme me” you get “yourself - man,” though. (“showme yourself” yields your former self, which is a person, but that shouldn’t obviously affect Robert’s properties.)

Hi again,

I’ve decided to incorporate capmikee’s ideas, since that’s a little more future proof, and the additional vocab seems to work very well.

I still have the problem of “yourself” referring to the off-stage “your former self” object though.

[code]The compiler won’t accept this:

Understand “yourself” as the player.[/code]

Is there a way to rewrite this to be valid?

Understand "yourself" as a thing when the item described is the player.

Is based off of what capmikee did, and it compiles and works (for what testing I’ve done with it), but I think it’s probably a hack-type piece of code (which I don’t really follow).

So… does anyone have any suggestions?

That last is in fact what I’d do, for a game with player-switching.

If the player is going to stay as the original (default) player object through the whole game, you can just say

Understand “foo” as yourself.