Capitalizing things when needed. -RESOLVED- Thanks folks.

So… I have replaced the “me” actors name iwth a function that returns one of several options. (Becky, she, the young woman etc.) so that when the main character is refered to, there is some variety. Sometimes “Becky can’t go that way” and sometimes “the young woman can’t go that way.” So far it works really well. Except that it doesn’t want to capitalize things at the beginning of a sentence. It’s fine when “The door closes behind the young woman.” But it looks bad when “the young woman looks at the house.”

I’m still reading though all these manuals and tutorials but I’m lost. (…again.)

Is there a function or substitution parameter I can use to detect the beginnning of a sentence or have the processor check or something?

Thanks in advance for any help with this.


  • Selva

Heya, again this might not be much help but looking through actor.t I think I may have found something for you, you can change the perspective of the player character but whether it works as you want is another matter

[code] /* refer to the player character with my player character referral
* person, and refer to all other characters in the third person
referralPerson { return isPlayerChar() ? pcReferralPerson : ThirdPerson; }

/* by default, refer to the player character in the second person */
pcReferralPerson = SecondPerson
 *   The referral person of the current command targeting the actor.
 *   This is meaningful only when a command is being directed to this
 *   actor, and this actor is an NPC.
 *   The referral person depends on the specifics of the language.  In
 *   English, a command like "bob, go north" is a second-person
 *   command, while "tell bob to go north" is a third-person command.
 *   The only reason this is important is in interpreting what "you"
 *   means if it's used as an object in the command.  "tell bob to hit
 *   you" probably means that Bob should hit the player character,
 *   while "bob, hit you" probably means that Bob should hit himself.  
commandReferralPerson = nil[/code]

As for capitalizing, I’m guessing you’ve already tried changing it to ‘The young woman’ etc, which would look equally bad if it didn’t convert to lower case…

I’m sure I’ve seen something somewhere but this may work since when the program makes up a sentance it would tend to word it like “{You/she} look in mirror and see another {you/she} looking back” or words to that effect (I haven’t done much with changing sentances but I’ve looked through them), “you” is usually capitalized when it should be so I don’t see why it isn’t changing it for you too. I’d like to say I could help more but I’m sure one of the pros here will have another (better and working) solution for you :slight_smile:

The substitution parameters normally handle this for you. It’s best to avoid putting articles in names for this reason.

One issue with not including the article is that you have to deal with the case of proper names. The library will retrieve the actor’s name during the course of the action, and won’t get around to asking if it’s proper until just before it prints it to output. That controls whether or not it prints an article.

So ideally you would use only one random name per turn and you would keep track of which name you handed out.

me: Person
	// all the vocab words for all the names
	vocabWords = 'handsome young Bob/man/self/devil'

	// each name, proper name first
	namesList = ['Bob', 'young man', 'handsome devil']

	// the starting name
	nameIndex = 1

	// need third person for the names to be used
	referralPerson = ThirdPerson

	// returns the current name from the list
	name() {
		return namesList[nameIndex];

	// only the first name is proper
	isProperName() {
		return nameIndex == 1;

	// rename the player every turn before prompt
	nameDaemon = static new PromptDaemon(me, &shuffleName)

	// pick a random name
	shuffleName() {
		nameIndex = rand(namesList.length) + 1;

	// starting location
	location = bedroom

You might give the character randomName and randomCapName methods. Then you could easily use them as "<<janice.randomCapName>> looks at you askance. "; or "You can’t see <<janice.randomName>> at the moment. ";

Thank you all for the help and input. I have to admit the method of having a capital and a normal case method separately is appealing since it is simple. (That had not occurred to me…)

  • Selva