Default errors
paul_one
01 May 2007, 16:51OK.. So I'm trying to alter the default quest errors to be 'nicer'.
When I don't have an object - or an object isn't present, it just displays "I can't see that." .. Which is really helpful if you type: "throw the spear at the dog" or "bounce the ball over the wall into the hole"...
My main grief is: WHAT isn't here?
I've got a command "hit #@object# with #@thing#" ..
How can I put that into an error message?
The only thing I can think of is using a function - which I plan to do... I think #quest.error.article# should be filled with the object causing the error - or something like that.
(I didn't think of the function way around this before starting this out - which is why I started this post: I couldn't think of a way around it.)
When I don't have an object - or an object isn't present, it just displays "I can't see that." .. Which is really helpful if you type: "throw the spear at the dog" or "bounce the ball over the wall into the hole"...
My main grief is: WHAT isn't here?
I've got a command "hit #@object# with #@thing#" ..
How can I put that into an error message?
The only thing I can think of is using a function - which I plan to do... I think #quest.error.article# should be filled with the object causing the error - or something like that.
(I didn't think of the function way around this before starting this out - which is why I started this post: I couldn't think of a way around it.)
Elexxorine
01 May 2007, 17:59In the custom command, you'd have ifs to check 'object' then 'thing' was there and available, etc. You can put elses and each to give error messages nicely, but you have to seperate all your ifs right out, no compound ifs allowed! *waggles finger*.
paul_one
01 May 2007, 19:16Erm, that means instead of one point to have the message, or using the easier method, I'd be putting checks in all over the place - plus automatic disambiguation wouldn't work (that's when two objects have the same name dear
).
At the moment I'm kinda stuck on this as I'm sure #quest.lastobject# doesn't actually get set, and I can't /really/ write a parser which will filter the #quest.originalcommand# to grab what the player actually typed.
For instance, it would be GREAT if quest put the last reference into a variable, or #&object# would be able to get back to what the player originally typed in the command:
'kill #@object# with #@thing#'
.. Or even if it was only the last one it's couldn't find.
Let's walk through an example to try and get out of my head what I want to say:
That's what I mean by the last object it couldn't find (quest.error.article perhaps!?).
Now if I could, I would like this:
And that I /could/ do with a:
#&object# #&thing#
.. Any ideas?

At the moment I'm kinda stuck on this as I'm sure #quest.lastobject# doesn't actually get set, and I can't /really/ write a parser which will filter the #quest.originalcommand# to grab what the player actually typed.
For instance, it would be GREAT if quest put the last reference into a variable, or #&object# would be able to get back to what the player originally typed in the command:
'kill #@object# with #@thing#'
.. Or even if it was only the last one it's couldn't find.
Let's walk through an example to try and get out of my head what I want to say:
> kill rabbbut with spaed
I can't see the spaed anywhere..
> kill rabbut with spade
I can't see the rabbut anywhere..
> kill rabbit with spade
You swing the spade with all the might you can muster, bringing it colliding with the asphalt and sending you shivering to the floor in a garbled heap...
The rabbit bounces over you cheerfully.
That's what I mean by the last object it couldn't find (quest.error.article perhaps!?).
Now if I could, I would like this:
> kill rabbut with spaed
I can't see a 'rabbut' or a 'spaed' anywhere..
> kill rebbit with spade
I can't see a 'rebbit' anywhere..
> kill rabbit with spade
//as before
And that I /could/ do with a:
#&object# #&thing#
.. Any ideas?
Elexxorine
01 May 2007, 21:27Talk to Alex.
davidw
01 May 2007, 23:07Damn, there's a lot of unnecessary rabbit bashing on this forum.
paul_one
02 May 2007, 09:29Haha, it's quite weird actually, I like rabbits!
I thought I'd try and get a general idea from the masses, and hopefully get Alex's attention too.
I thought I'd try and get a general idea from the masses, and hopefully get Alex's attention too.
paul_one
04 May 2007, 11:28OK, I give up on this.
Every turn I take for this is coming into brick walls.
You can't self-parse this as a player can type multiple things:
"hit the bat with the ball"
or
"hit bat with ball"
or
"throw the red ball at the green goblin" etc.
The only way I can see of doing this _sensibly_ is having:
I don't know where it will end with all that, not to mention having to create a validation function to validate all the various parts.
I'll just make do with "I think you've typed an object incorrectly. I can't tell you which one though." .
Every turn I take for this is coming into brick walls.
You can't self-parse this as a player can type multiple things:
"hit the bat with the ball"
or
"hit bat with ball"
or
"throw the red ball at the green goblin" etc.
The only way I can see of doing this _sensibly_ is having:
command <#action# #object# at the #object2#>
command <#action# #object# with the #object2#>
command <#action# the #object# ...
I don't know where it will end with all that, not to mention having to create a validation function to validate all the various parts.
I'll just make do with "I think you've typed an object incorrectly. I can't tell you which one though." .
paul_one
04 May 2007, 16:06#quest.error.article should be across the board... not sometimes quest.error.article, while others it's quest.error.gender..
that is all.
that is all.