Add "echo" CON command which allows the user to print a quote only to the console and log file, for debugging or informational purposes. EVENT_INIT can finally be put to use!

git-svn-id: https://svn.eduke32.com/eduke32@2419 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-03-05 07:24:04 +00:00
parent 5b76b7dbba
commit 1c2ea1e96e
3 changed files with 27 additions and 2 deletions

View file

@ -85,6 +85,7 @@ static struct { uint32_t keyw; uint32_t date; } g_keywdate[] =
{ CON_CLIPMOVENOSLIDE, 20101009 },
{ CON_INCLUDEDEFAULT, 20110615 },
{ CON_SETACTORSOUNDPITCH, 20111102 },
{ CON_ECHO, 20120304 },
};
char g_szScriptFileName[BMAX_PATH] = "(none)"; // file we're currently compiling
@ -565,6 +566,7 @@ const char *keyw[] =
"clipmovenoslide", // 359
"includedefault", // 360
"setactorsoundpitch", // 361
"echo", // 362
"<null>"
};
@ -3645,6 +3647,7 @@ static int32_t C_ParseCommand(int32_t loop)
case CON_SAVEGAMEVAR:
case CON_READGAMEVAR:
case CON_USERQUOTE:
case CON_ECHO:
case CON_STARTTRACKVAR:
case CON_CLEARMAPSTATE:
case CON_ACTIVATECHEAT:

View file

@ -951,7 +951,8 @@ enum ScriptKeywords_t
CON_CALCHYPOTENUSE, // 358
CON_CLIPMOVENOSLIDE, // 359
CON_INCLUDEDEFAULT, // 360
CON_SETACTORSOUNDPITCH, // 361
CON_SETACTORSOUNDPITCH, // 361
CON_ECHO, // 362
CON_END
};
#endif

View file

@ -1369,7 +1369,7 @@ skip_check:
case CON_DEBUG:
insptr++;
initprintf("%"PRIdPTR"\n",*insptr++);
initprintf("%" PRIdPTR "\n",*insptr++);
continue;
case CON_ENDOFGAME:
@ -4793,6 +4793,27 @@ nullquote:
}
continue;
case CON_ECHO:
insptr++;
{
int32_t i=Gv_GetVarX(*insptr++);
if ((unsigned)i >= MAXQUOTES)
{
OSD_Printf(CON_ERROR "invalid quote ID %d\n",g_errorLineNum,keyw[g_tw],i);
insptr++;
continue;
}
if ((ScriptQuotes[i] == NULL))
{
OSD_Printf(CON_ERROR "null quote %d\n",g_errorLineNum,keyw[g_tw],i);
continue;
}
OSD_Printf("%s\n",ScriptQuotes[i]);
}
continue;
case CON_IFINOUTERSPACE:
VM_CONDITIONAL(G_CheckForSpaceFloor(vm.g_sp->sectnum));
continue;