I found that MAX_BUFFER_WORDS set the limit count of words that the Gmachine could receive.
I need to extend that limit (now in 20 til, says 50) not for parse-process but for the “say” command (for use it in multiplayer context).
MAX_BUFFER_WORDS = 50
but, in tests, when I write a long text-command I get this git fail:
[** Programming error: tried to read from –>65 in the array “parse”>
It seems that there is a relation between MAX_BUFFER_WORDS and PARSE_BUFFER_LEN.
According to my notes, PARSE_BUFFER_LEN should be (MAX_BUFFER_WORDS*3)+1.
Is it possible to just define the constant that way? I know the C preprocessor collapses arithmetic like that in macros, but I don’t know if Inform 6 does.
It does. Probably that’s what should have been done.
many thanx Zarf.
I did the fixes and works fine!
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 INPUT_BUFFER_LEN = 260; ! No extra byte necessary
!Constant MAX_BUFFER_WORDS = 20;
!Constant PARSE_BUFFER_LEN = 61;
! increase buffer -------------------------------
Constant INPUT_BUFFER_LEN = 560; ! No extra byte necessary
Constant MAX_BUFFER_WORDS = 60;!sarganar, test aumentar max cant de palabras del texto de entrada
Constant PARSE_BUFFER_LEN = 181;!(MAX_BUFFER_WORDS*3)+1
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”.[/spoiler]
but, there is another ‘obstacle’: my WIP use the “change the text of the player’s command to…” (SetPlayersCommand sub in IndexedText.i6t) after change the player (that makes sense in multiplayer context) .
The case is that SetPlayersCommand truncates the buffer in 118 max chars, and then the player “tell something long-verbose-text…” command produces a truncated text. I disabled that limit and it seems work fine.
Is there any side effect?
I don’t know why SetPlayersCommand uses a hardwired limit. You shouldn’t remove the limit entirely, but it should be based on the array size, which for Glulx is (INPUT_BUFFER_LEN-WORDSIZE)-1.
Also be sure that you change the “120” farther down the function to the same length limit. (Filling the buffer with spaces shouldn’t be necessary, but as long as the function does it, it should do it sensibly.)