I’d like to know if there is a way to actually display something other than what the player input after they enter a command.
for example if there’s some kind of status effect where they can only clap their hands for a while so any command they give displays as “>Clap hands”. I’ve already used the preparser to make this action happen, but it still displays the command that they actually typed in. So I wonder if it’s possible to manipulate it.
I can’t give you the answer, but it seems to me there are probably two ways for this to happen (if it can happen at all).
The first way would be character by character. The user types “n”, but the text “c” appears instead. The user types “get lamp” but the text “clap han” appears instead. This is probably dependent on the interpreter. Also, it’s liable to make your users think there’s a terrible bug.
The other method would be, no matter what they type, when they hit Return their input line disappears and is replaced with “clap hands.” This is more polite to the user, and perhaps easier to manage, but again, I don’t know if the interpreter will allow it.
The latter is more what I’m looking for, yeah. I’ve looked pretty deep into the interpreter’s files, but I haven’t even found an ugly way to do it properly. An output filter seems to be the closest I got, but I’m not sure how to make it apply only to the command and nothing else.
I’m afraid it’s not possible. I’ve checked webui session with firebug and the command line is not painted by engine, it is in responsibility of the frontend. And although I didn’t checked traditional UI in traditional interpreter, I think it will be modeled in the same way that command line is responsibility of interpreter. It would be necessary to read the sources of the interpreter to know for sure or maybe Nikos could tell us.
From the little I understand, tomasb is right: to directly alter the player-input, you’d have to modify the interpreter itself.
Apart from the technical difficulty, whats your ‘game design’ reason to change the input? From a Player perspective, this (the “just clapping hands”-example you gave) may be funny the first three turns, but gets annoying shortly after.
edit: would an output like “you try to …, but instead can only clap your hands.” not be sufficient?