capitalize gender attribute at begining of sentence.

lelo14
22 Sept 2011, 06:45
I'm a total beginner at using this software and game design. I do have a degree in computer science so I have a clue about programming, variable names, strings, and such. But my degree is old, I haven't programmed in a long time, and I mostly used good old C so the object oriented stuff can confuse me but I do know a tab bit about java so I'm not totaly clueless.

I'm working through the Quest Tutorial.
I'm at: Intermediate -- #3 Custom commands --- #3 Adding a "Weigh" Command.

When I test the game, here is what I get if I weigh eggs:

> weigh eggs
It weighs 250 grams.

Okay, problem, it should say "They" instead of "It".
No problem, I'm not clueless. I change the expression to:

object.gender + " weighs " + object.weight + " grams."

but I'm worried because the gender attributes are lowercase.
So, test the game again and as expected, here is what I get:

> weigh eggs
they weighs 250 grams.

So, the question is, how to I get the darn thing to capitalize the first letter of the sentence in this case?

Furthermore, if anyone who can edit the tutorial is reading, you might want to fix these problems. At least fix the typo. The tutoral says:

Now go back to the lounge. What happens when you weigh Bob?
Quest responds with "He weighs grams." .....

But if you follow the tutorial instructions exactly, Quest will respond with "It weighs grams." ..... ("It" not "He")

-------Sorry for anything that sounds like a rant. I'm very excited about finding Quest. It seems like a great piece of software. I'm just trying to be helpful and get some help.

Thanks, lelo

The Pixie
22 Sept 2011, 07:24
Try this:
CapFirst(object.gender) + " weighs " + object.weight + " grams."

There are a lot of functions and script commands available; see this page on the Wiki
http://quest5.net/wiki/Category:All_Fun ... t_Commands

lelo14
22 Sept 2011, 07:40
The Pixie wrote:Try this:
CapFirst(object.gender) + " weighs " + object.weight + " grams."

There are a lot of functions and script commands available; see this page on the Wiki
http://quest5.net/wiki/Category:All_Fun ... t_Commands



Jackpot!

Pixie, thanks.

Have fun texting (that's "texting" [as in text adventure] not "txting" [as in txt msg]),
lelo

Alex
22 Sept 2011, 07:47
Everyone is free to edit the tutorial by the way! You just need to create an account on the wiki, then you can edit everything.

lelo14
22 Sept 2011, 08:17
Here is a related question from the same point in the tutorial.

Testing the tutorial game Quest gives:

> weigh bob
You can't weigh that!

But it seems like it should be "You can't weigh him!"
So I used:

"You can't weigh " + object.article + "."

But now if you try to weigh the sofa you get "You can't weigh it!" But "You can't weigh that!" is funny.
So how do I have my cake and eat it too? Furthermore, if you were to try to weigh some unweighable plural thing, it would be nice to say "You can't weigh those!"

I guess that I could make a new attribute for demonstrative pronoun but then I would need to set it for each object that I created and test exsistance before I used it just in case I forgot to set it for some object. Any Ideas?


P.S. In addition to my degree in Computer Science, I also have a Linguistics degree. (Hmmmm maybe that has something to do with my attraction to text+computer=text adventure.) So I feel like I really should get the grammer correct if I can.

Alex
22 Sept 2011, 08:47
Computer science and linguistics degrees - very useful! I often wish I'd done either of those (I have a degree in Physics, which is useless to me now).

I wasn't aware of the term "demonstrative pronouns", but it sounds like something that should be built-in to Quest - at least for English. Does the concept exist in other languages too?

You could make a new attribute for the demonstrative pronoun, but you wouldn't need to set it for every object - you could set it for the type instead. If you click Filter in the bottom left of the Editor, you can turn on "Show Library Elements". You can then find the types "defaultobject", "plural", "male", "female", "maleplural" and "femaleplural". If you click the Copy button in the top right, they will be copied from the library to your game so you can edit them. You could add a "demonstrativepronoun" attribute to each, and it will then exist for all objects in the game.

Pertex
22 Sept 2011, 10:43
Alex wrote:Does the concept exist in other languages too?

Yes, in german you have this, too. But in german you have this problem with several phrases so I can handle this easily with the function GetPrefix in german.aslx

lelo14
22 Sept 2011, 12:11
Alex wrote:Computer science and linguistics degrees - very useful! I often wish I'd done either of those (I have a degree in Physics, which is useless to me now).

I wasn't aware of the term "demonstrative pronouns", but it sounds like something that should be built-in to Quest - at least for English. Does the concept exist in other languages too?


Alex wrote:You could make a new attribute for the demonstrative pronoun, but you wouldn't need to set it for every object - you could set it for the type instead. If you click Filter in the bottom left of the Editor, you can turn on "Show Library Elements". You can then find the types "defaultobject", "plural", "male", "female", "maleplural" and "femaleplural". If you click the Copy button in the top right, they will be copied from the library to your game so you can edit them. You could add a "demonstrativepronoun" attribute to each, and it will then exist for all objects in the game.


Thanks, I wrote a long response but when I hit submit it made me login again (why?) and my whole message was lost.

Other languages have demonstrative pronouns. Definitly.

I'm out of time to spend composing the whole thing again. Maybe I'll share my thoughs some other time.
I'd be happy to help out with any computational linguistic question or problem to the best of my ability.

For now I recomend a book and some Wiki pages:
http://www.amazon.com/Plain-English-Han ... 085&sr=1-3
http://en.wikipedia.org/wiki/Demonstrat ... d_pronouns
http://en.wikipedia.org/wiki/English_personal_pronouns

Also a gripe or two. Your artical atribute has pronoun values but articals are not pronouns. The english articals are "a" "an" and "the".
You are using that atribute for accusative (aka objective) pronouns. Totaly confused me. Similarly your gender atribute also has pronoun values. You are using gender for the nominative (aka subjective) pronouns. Not so confusing but it's hard to remember which kind a atribute is which kind of pronoun because both sets of pronouns make a gender distinction and none of them are articals. FYI, the english genders (in grammer) are masculine, feminine, neuter (not masculine nor feminine), and generic (not neuter).

I'll brave the library the next time I can play around with Quest.

lelo14
22 Sept 2011, 12:23
Alex wrote:You could make a new attribute for the demonstrative pronoun, but you wouldn't need to set it for every object - you could set it for the type instead. If you click Filter in the bottom left of the Editor, you can turn on "Show Library Elements". You can then find the types "defaultobject", "plural", "male", "female", "maleplural" and "femaleplural". If you click the Copy button in the top right, they will be copied from the library to your game so you can edit them. You could add a "demonstrativepronoun" attribute to each, and it will then exist for all objects in the game.


Would I need to do that for every game I made? Or is there a way to create a personal library of stuff I want to use over and over?

Alex
22 Sept 2011, 12:33
You could copy your new types to a library file, then include that library file in each game.

A library file is simply a .aslx file with a <library> parent element instead of <asl>.

See http://quest5.net/wiki/Creating_Libraries

lelo14
23 Sept 2011, 19:20
Alex wrote:I wasn't aware of the term "demonstrative pronouns", but it sounds like something that should be built-in to Quest


I'm still thinking about it. The more I think about it, the less I think that it would be worth it to build it in. The use of demonstrative pronouns are highly dependent on pragmatics which is one of the harder things to get computers handle correctly. Unless it comes up a lot, I think that each programer would be best off handling each situation as a special case because they will know and undersand the pragmatic situation that the dialog is taking place in.

Even if you don't know the jargon "pragmatics" you use pragmatics everyday and as a human are very very good at it.