Parse_name or "how to add 'yourself' as a name for an NPC when answering ORDERS? (solved?)

The parse_name routine is too much for me.

I want an NPC (JOHN) to understand JOHN, EXAMINE YOURSELF as JOHN, EXAMINE JOHN.
For many obvious reasons, I don’t want to add “with name ‘yourself’” as it would collide with the player (if I type EXAMINE YOURSELF you should read a player.description or whatever).

And yes, I’m coding another Computing Companion™. Wish me luck.

1 Like

I would create a single “yourself” object which is always in scope, and have any actions taken on that object change the noun (or second noun) to actor.

1 Like

What is a Computing Companion™ ?

A parse_name routine is the best way to handle this, even though it is a lot. The actor global should be set by the time parse_name is called, so you can use that to decide what 'yourself' means.

Thanks Andrew. Unfortunately I don’t understand very well how parse_name works. I’ve seen a lot of code but can’t understand how to tailor it for my needs. Any chance of a code somewhere with similar abilities? I will try and sort this out myself.

Hehe :slight_smile: It’s a computer that follows you in locations and comments on things, scans things, examines things, opens door, closes gates etc.

My first one was L.O.G.A.N. in Andromeda Apocalypse. The ™ is a joke.

1 Like

I’ve got this. It seems clumsy, but it works.

parse_name [ n;
	if (actor == self)
	{
		while (NextWord() == 'name1' or 'name2' or 'you' or 'yourself') n++;
    	        return n;
	}
	else
	{
		while (NextWord() == 'name1' or 'name2') n++;
    		return n;
	}
],

I suppose I can get rid of the name routine with this, right?

Yeah, I figured the ™ was joking around. But it was cute (and I do the same thing sometimes), so I was happy to repurpose it. Thanks for the explanation!