objectlistprefix string

OurJud
The default wording for the defaultobjectprefix string in the defautobject library is "You can see".

I'm trying to work out how I can change this so that any room containing an object simply says, "There's a [object] here."

I also need to somehow account for when 'a' needs to be 'an', so that it doesn't result in grammatical errors such as, "There's a axe here."

lightwriter
Here's what I did:
1. import defaultobject into your game.
2. Add an attribute to defaultobject called suffix
3. put "here." as the value (without the "")
Quest automatically determines whether an article is an or a if you haven't changed that.

OurJud
Thanks for that, lightwriter, unfortunately it doesn't work.

I did as you say, but when I run the game, it still just says, "You can see a gun."

I want it to say, "There's a gun here."

lightwriter
Oh, did you change defaultobjectprefix to "There's" without the quotations?

The Pixie
As you want a suffix as well as a prefix, you will need to edit the ShowRoomDescription function. Just be aware that if the function gets modified in a later update to Quest, you could have problems, so it has a slight risk. Do show library elements and find the function, then copy it to your game. Go to code view, and look for this line:
      objects = FormatObjectList(game.pov.parent.objectslistprefix, GetNonTransparentParent(game.pov.parent), Template("And"), ".")

And change it to:
      objects = FormatObjectList("There's ", GetNonTransparentParent(game.pov.parent), Template("And"), " here.")

With regards to adding "a" and "an", Quest does that automatically (you can override it for a specific object by unticking Use default prefix and suffix).

OurJud
lightwriter, I've changed the prefix now, but the suffix doesn't get added. It just says, "There's a gun." instead of "There's a gun here.

TP, that works perfectly. Thank you. If I use it I'll just have to hope it's not something Alex changes in future updates.

It's still not ideal, because I prefer to describe objects and their location in more detail, but I suppose I'll have to compromise somewhere if I want object to be added to a description when they're dropped.

I just feel that, "You are in a shed. A rusty old knife is lying on a workbench in the corner."

Sounds so much better than, "You are in a shed. There's a knife here."

Ideally I'd have the colourful description for its original location, and the simple one if it gets dropped elsewhere. I know you can turn an object to 'scenery' so that it doesn't get auto listed, but I'd need to do that for individual rooms, wouldn't I, rather than the object on a global basis?

jaynabonne
One reason, I think, it was worded the way it was is that to handle multiple objects (correctly), you need to change the verb with the form you're going with. So it's

There is a knife here. (A knife is here. There's a knife here.)

but

There are a knife and apple here. (A knife and apple are here. There're a knife and apple here?)

Whereas "There's a knife and apple here" is not technically correct.

Something to keep in mind, if such things matter to you.

The Pixie
Okay...

So look in ShowRoomDescription for this:
    if (i = game.autodescription_youcansee) {
objects = FormatObjectList(game.pov.parent.objectslistprefix, GetNonTransparentParent(game.pov.parent), Template("And"), ".")
desc = AddDescriptionLine(desc, objects)
if (game.autodescription_youcansee_newline) {
msg (desc + "<br/>")
desc = ""
}
}

And replace it with this:
    if (i = game.autodescription_youcansee) {
ntp = GetNonTransparentParent(game.pov.parent)
list = RemoveSceneryObjects(GetDirectChildren(ntp))
if (not ListCount(list) = 0) {
if (not ListCount(list) = 1 or DoesInherit(ObjectListItem(list, 0), "plural")) {
prefix = "There are "
}
else {
prefix = "There is "
}
objects = FormatObjectList(prefix, ntp, Template("And"), " here.")
desc = AddDescriptionLine(desc, objects)
if (game.autodescription_youcansee_newline) {
msg (desc + "<br/>")
desc = ""
}
}
}

And it will use "is" or "are" correctly.

OurJud
Thanks, TP.

Jay, why isn't "There's a knife and apple here" technically correct?

Do you mean because of the 'a' and 'an' conflict?

The Pixie
There is more than one thing, so it should be "There are a knife and an apple here", which sounds wrong, but is the correct way to do it.

OurJud
The Pixie wrote:There is more than one thing, so it should be "There are a knife and an apple here", which sounds wrong, but is the correct way to do it.

That does sound wrong :shock:

I think it must be because in normal conversation we'd never have reason to say 'There are...' when naming a group of objects. We'd say, "You'll find..."

But I'm still not sure. Maybe because knife is singular?? You can't have 'are' before a singular, can you?

The Pixie
Hence, people use "You can see"

XanMag
There's a knife here... and an apple. :lol:

jaynabonne
What's funny is that my ear tends to hear the other way, in terms of *correctness*. I am not saying people don't often use "There's" for all sorts of situations when speaking, but the written language can be a different thing. Basically, the subject is not "there"; it's the other words (collectively). I did some looking, and it seems to be a bit muddy. It might depend on whether you're viewing them collectively or not. But here's food for thought: if you make a question from it (which is typically done by rearranging words), which would you go for:

Is there a knife and an apple? There is!

or

Are there a knife and an apple? There are!

That might help you decide. :) Or maybe I should just go away now and let you do what you want. lol To be honest, it doesn't matter to me so much. I just raised the issue in case you hadn't considered it, given your examples were all singular.

More info: http://www.indiesunlimited.com/2015/06/ ... there-are/

OurJud
jaynabonne wrote:if you make a question from it (which is typically done by rearranging words), which would you go for:

Is there a knife and an apple? There is!

or

Are there a knife and an apple? There are!

The first, without hesitation.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums