Okay, so I’m trying to create an action that allows the player to change which character they control at will. I need the action to apply to the named person, even if that person is not visible or touchable (since most puzzles will probably require the characters being in separate places). Here is the code I have so far.
[code]Defense Solicitor is a man. He is in Defense Solicitor’s Office.
Pompous Barrister is a man. He is in Pompous Barrister’s Office.
Studious Intern is a man. He is in Studious Intern’s Office.
The Wind is a person. It is in the precarious brick ledge.
Being is an action applying to one thing.
Understand “Be [something]” as being.
Check being something: if the noun is not a person, say “How often have you dreamed of being [the noun], but alas it cannot be.” instead.
Check being something: if the noun is the player, say “You are already yourself. It’s part of being you!” instead.
Carry out being Defense Solicitor: now the player is the noun; now the command prompt is "DS: ".
Carry out being Pompous Barrister: now the player is the noun; now the command prompt is "PB: ".
Carry out being Studious Intern: now the player is the noun; now the command prompt is "SI: ".
Carry out being The Wind: now the player is the noun; now the command prompt is "TW: ".
Report being something: say “You are now [the noun].”[/code]
I know the code isn’t perfect or especially elegant, but I’m not worried about that. I’m just want it to work so that regardless of the player’s location, they can become the Pompous Barrister by typing in “Be Pompous Barrister”.
Right now, the key issue is in this line:
Being is an action applying to one thing.
I just don’t know how to go about making the action able to apply to an untouchable, non-visible thing such as a person in another room.
When two characters are in the same room, this code works perfect for what I need.
I also have this little problem about getting rid of the “former self” generated by:
When play begins: now the command prompt is "DS: "; now the player is Defense Solicitor.
But that is less of an issue at the moment.
Oh, and this bit isn’t working either
Report being something: say "You are now [the noun]."
But again, less important than the problem of performing the action.