Sentence rewriting (or prefiltering of input) seems impossible with local event blocks (on_command, etc).
What I have:
locations {
cliffside_east: location "..." {
on_command {
:match "x vine; x vines" {
:print "As thick as your arm.";
}
}
}
on_command {
:gosub "sentence_rewriting";
:if (inputs() > 2) {
:print "This game requires only two word inputs.";
:done;
}
Someone types: look the vines
What I expect:
This game requires only two word inputs.
What I see instead:
As thick as your arm.
This game requires only two word inputs.
Suggestion
It feels like there should be a pre_on_command block that allows analyzing/modifying input BEFORE it hits any on_command handers at all... I tried this using on_describe and on_pre_describe but those don't seem to allow handling input for some reason.
A magic subroutine might also do the trick... (but need good docs)... like say if there was a adv_rewrite it would also be called first, automatically. And it could be used for validation, rewriting, etc...
Sentence rewriting (or prefiltering of input) seems impossible with local event blocks (on_command, etc).
What I have:
Someone types:
look the vines
What I expect:
This game requires only two word inputs.
What I see instead:
Suggestion
It feels like there should be a
pre_on_command
block that allows analyzing/modifying input BEFORE it hits any on_command handers at all... I tried this usingon_describe
andon_pre_describe
but those don't seem to allow handling input for some reason.A magic subroutine might also do the trick... (but need good docs)... like say if there was a
adv_rewrite
it would also be called first, automatically. And it could be used for validation, rewriting, etc...