go climb up stairs

psymann
04 May 2013, 21:28Hello all,
I'm having a problem with alternative names for exits.
Take the stairs for example. I'm at the bottom of some stairs, and I have an "up" exit that goes up the stairs to the room above.
The exit's ALIAS attribute is "up"...
...so "up" will work and take me up the stairs.
...and "go up" will work and take me up the stairs.
The exit's ALT attribute is "u"...
...and it does appear that "u" will work, and take me up the stairs.
...and "go u" will also work, and take me up the stairs.
So I edited the ALT attribute, to have additional items on the stringlist:
u
climb stairs
climb up stairs
climb the stairs
climb up the stairs
ascend stairs
Fine, I thought. I tried the game again:
I try going up and down the stairs a few times:
"u" - I go up.
But...
"climb up stairs" ... it doesn't work.
But then...
"go climb up stairs" ... and that works!
How can I set it so that I don't _need_ to use the word "go" before the ALT name of my exit? Clearly it defaults to that setting when using the ALT 'u', but for some reason it doesn't work for anything else I add.
And just to make it more complicated, I do still want to be able to type the "go" if I want - indeed I want to be able to add an ALT called "up stairs", so I could type either "up stairs", "go up stairs", "climb up stairs" or (if I was so mad) "go climb up stairs" and they would all work.
Is that possible? Does the question make sense?
I can see a workaround being to create an object called stairs, and then have a verb with the climb names which moves the player to the room in question... but this seems an imperfect and fiddly solution that I think should be avoidable
Any assistance gratefully received!
psy
I'm having a problem with alternative names for exits.
Take the stairs for example. I'm at the bottom of some stairs, and I have an "up" exit that goes up the stairs to the room above.
The exit's ALIAS attribute is "up"...
...so "up" will work and take me up the stairs.
...and "go up" will work and take me up the stairs.
The exit's ALT attribute is "u"...
...and it does appear that "u" will work, and take me up the stairs.
...and "go u" will also work, and take me up the stairs.
So I edited the ALT attribute, to have additional items on the stringlist:
u
climb stairs
climb up stairs
climb the stairs
climb up the stairs
ascend stairs
Fine, I thought. I tried the game again:
I try going up and down the stairs a few times:
"u" - I go up.
But...
"climb up stairs" ... it doesn't work.
But then...
"go climb up stairs" ... and that works!
How can I set it so that I don't _need_ to use the word "go" before the ALT name of my exit? Clearly it defaults to that setting when using the ALT 'u', but for some reason it doesn't work for anything else I add.
And just to make it more complicated, I do still want to be able to type the "go" if I want - indeed I want to be able to add an ALT called "up stairs", so I could type either "up stairs", "go up stairs", "climb up stairs" or (if I was so mad) "go climb up stairs" and they would all work.
Is that possible? Does the question make sense?

I can see a workaround being to create an object called stairs, and then have a verb with the climb names which moves the player to the room in question... but this seems an imperfect and fiddly solution that I think should be avoidable

Any assistance gratefully received!

psy

jaynabonne
04 May 2013, 22:33Even if you could get the alt-names to work, It still won't work with "climb XXX" because "climb" is already a verb. So if you type "climb up stairs", it will say something about not being able to find "up stairs". You're also mixing verbs in with your alt names, which doesn't make sense conceptually. Verbs are things you do; names and alt names are what you do things to. It might work in some cases, but it smells like a hack. 
What I would do is create a command to cover the cases you want, and then put it in the room where the exit is. That way, it will only happen in the that room, and you can make the text what you want. (It's similar to your "add a verb" approach", but allows you to specify exactly what you want.) Here is a sample:
MyExit is the name assigned to that "up" exit.

What I would do is create a command to cover the cases you want, and then put it in the room where the exit is. That way, it will only happen in the that room, and you can make the text what you want. (It's similar to your "add a verb" approach", but allows you to specify exactly what you want.) Here is a sample:
<command name="climbstairs">
<pattern>climb stairs; climb up stairs; ascend stairs</pattern>
<script>
params = NewDictionary()
dictionary add (params, "exit", MyExit)
do (go, "script", params)
</script>
</command>
MyExit is the name assigned to that "up" exit.

psymann
04 May 2013, 22:51
I can put a command *in a room* ?

Erm...
I knew that already.

Anyway, you're right, that I'm muddling the verbs and objects a bit... although in my defence, the existing "ALT" name is "u", which clearly is an abbreviation of "up", which is not an object (noun) either... it's really a preposition... or an adverb... or something... our generation didn't get taught grammar at school. So I'll claim that Quest confused me first and that's why I started trying to add verbs in as well

Ok, I'm going to try putting a command in a room. Or go try putting a command in a room. Or something

Thanks once again, jay, you're getting top billing on my game's acknowledgements note

psy