It seems like the player’s command gets truncated after 20 words (yet the character count can go much higher). Is this a bug?
"Word Limit" by MattD
Test is a room.
After reading a command:
say "player's command ([number of characters in player's command] characters, [number of words in player's command] words) is:-[line break]'[player's command]'."
test me with "w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23".
I’ve had a look into the I6 templates (specifically Glulx.i6t), and it is the constant MAX_BUFFER_WORDS that sets the limit to 20 words. I’m not sure of the the relationship between INPUT_BUFFER_LEN, MAX_BUFFER_WORDS and PARSE_BUFFER_LEN, but if I double each of these, then this allows more words to be present in the player’s command:
[code]“Word Limit” by MattD
Include (-
Array gg_event → 4;
Array gg_arguments buffer 28;
Global gg_mainwin = 0;
Global gg_statuswin = 0;
Global gg_quotewin = 0;
Global gg_scriptfref = 0;
Global gg_scriptstr = 0;
Global gg_savestr = 0;
Global gg_commandstr = 0;
Global gg_command_reading = 0; ! true if gg_commandstr is being replayed
Global gg_foregroundchan = 0;
Global gg_backgroundchan = 0;
Constant GLK_NULL 0;
Constant INPUT_BUFFER_LEN = 520; ! was 260 ! No extra byte necessary
Constant MAX_BUFFER_WORDS = 40; ! was 20
Constant PARSE_BUFFER_LEN = 122; ! was 61
Array buffer buffer INPUT_BUFFER_LEN;
Array buffer2 buffer INPUT_BUFFER_LEN;
Array buffer3 buffer INPUT_BUFFER_LEN;
Array parse → PARSE_BUFFER_LEN;
Array parse2 → PARSE_BUFFER_LEN;
-) instead of “Variables and Arrays” in “Glulx.i6t”.
Test is a room.
After reading a command:
say “player’s command ([number of characters in player’s command] characters, [number of words in player’s command] words) is:-[line break]‘[player’s command]’.”
test me with “w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23”.
[/code]
I believe you’re wrong, and, sadly, Inform agrees with me on this point.
Template-hacking is the only option.
INPUT_BUFFER_LEN is in characters. MAX_BUFFER_WORDS must be less than 1/3 of PARSE_BUFFER_LEN. (We could knock out one of those constants out of the template by using a bit of math, but it’s never come up.)