You're you.

I’m trying to get this to work:

Understand "[player's forename]" and "[player's full name]" as yourself.

But it doesn’t take. I also tried:

Understand player's forename and player's full name as yourself.

But that didn’t take either.

What I want is for the player to be able to examine their custom character not just with “examine me” but also with “examine Miles” (where Miles is the usual test name i’m using in between altering code - full name, Miles Long. Yes, that’s a porn name. Yes, I think that’s hysterical. Yes, that’s kinda sad.)

Any help is welcome! :slight_smile:

… you guys are sure I really should just post every question i have in a separate thread? really? because if someone’s as new and stupid as me that’s gonna lead to a looooooot of short threads.

I was going to start spouting gibberish about creating a person called Miles Long and have the player become that person, but in fact it turns out to be very simple.

Understand "Miles/Long" and "Miles/Mr Long" as yourself.

Edit the slashes according to your needs. The reasoning is: you can’t talk about “forenames” and “full names”; they’re not things that already exist in Inform. You have to create them, as variables, if you’re going to use them. For this particular case, that’s unnecessary - if the PC is always going to be Miles, you can define that directly.

And yes, a new question in a new thread is best. Don’t worry about it, just ask away, that’s what this board is here for.

Problem is, if you fill in “Pieter Piers” and you go “x peter” then you’re gonna get one of my snarky error messages and that might hurt your feelings.

Ah, then it’s customisable. I see your problem.

To this I’ll defer to the expertise of the gurus in this place; I haven’t much time, and my own attempts came to naught. I think I’ll learn something from this too.

EDIT - Sometimes searching the documentation can be really difficult. I’m sure there’s an example there where one names a pet, similar to Beyond Zork, or similar to inscribing a white cube in Spellbreaker, and I wanted to take the information I needed from there, but I just can’t find that thing!

Hang on, I got it. The example was Fido. Stay tuned.

Success, I think. :slight_smile: Here’s the slightly modified code you’ll want to use for collecting the player’s name.

[code]Yourself has some text called full name. The full name of yourself is “nothing much”. Understand the full name property as describing yourself.

Yourself has some text called forename. The forename of yourself is “nothing”. Understand the forename property as describing yourself.

When play begins:
now the command prompt is "What is your name? > ".

To decide whether collecting names:
if the command prompt is "What is your name? > ", yes;
no.

After reading a command when collecting names:
if the number of words in the player’s command is greater than 5:
say “[paragraph break]Who are you, a member of the British royal family? No one has that many names. Let’s try this again.”;
reject the player’s command;
now the full name of yourself is the player’s command;
now forename of yourself is word number 1 in the player’s command;
now the command prompt is “>”;
say “Hi, [forename of yourself]![paragraph break]”;
say “[banner text]”;
move the player to the location;
reject the player’s command.

Instead of looking when collecting names: do nothing.

Rule for printing the banner text when collecting names: do nothing.

Rule for constructing the status line when collecting names: do nothing.[/code]

The key, of course, is “Understand the forename property as describing yourself”. To do that we had to actually assign the text to the player, instead of it being a variable floating around. That also meant tweaking how we set the variable: no longer “forename” but “forename of yourself”, which reads wonky but makes perfect sense when you understand what Inform actually means.

This will correctly catch " " and " ", but fail with " " and " ", like “x Mr. Piers”, but I don’t think you want that level of complexity. :wink:

Hey, this was fun! :slight_smile:

Glad you had fun but I’ve had a lot of stuff already down using “player’s full name” and “player’s forename” and “player’s last name” … any way to include it like that, because to me the start there is quite alien.

or maybe a way to patch it in?

like this? understand the player's forename as describing yourself. because i just tried that and it didn’t work :frowning:

I’m afraid not. But hey, Ctrl-H (in the Windows IDE) allows you to replace things. Just replace

player’s forename

…with…

forename of yourself

…(once you’ve renamed that property, of course) and you shouldn’t have any problems. If you do, you’ll find they’ll be easy to fix on an individual basis.

Don’t worry about the lines…

Yourself has some text called full name. The full name of yourself is “nothing much”. Understand the full name property as describing yourself.
Yourself has some text called forename. The forename of yourself is “nothing”. Understand the forename property as describing yourself.

…being alien to you. They are exactly what you need: it’s attaching the name variables directly to the player character (internally known as “yourself”), which is the only (well, by far the very easiest) way to achieve the effect you want, which is guaranteed by the Understand lines. As they say on the tin, they allow you to understand the full name/forename property, whatever they are (and that’s the key), as describing the player character, a.k.a. yourself. Don’t be afraid to include these in your code.

Also… you’re using “player’s last name” as well? :stuck_out_tongue: Well, the logic should be the same. Add a new line like…

Yourself has some text called surname. The surname of yourself is “much”. Understand the surname property as describing yourself.

…and debug as it becomes appropriate. Just be sure to put the FULL NAME definition and understand line FIRST; when I had the forename first, the full name interactions weren’t triggering properly.

EDIT - You know, I think Identity Theft should be updated to accomodate this. It’s the sensible thing.

EDIT 2 - The thing is, you can’t use Understand directly with a variable like that. I also kept trying, in all sorts of different ways, and it wouldn’t work. I suppose it needs something a lot more stable, like a property. So what we do is, we replace our variable with a property - and hey presto.

okay i got it to work, thanks Peter! ^^