I wish I could even begin to help with this but sounds like an intriguing project. I would suggest asking Spike or SHAMBLERNAUT on the Quake Mapping Discord QuakeC channel. https://discordapp.com/invite/j5xh8QT
I would recommend avoiding to alter an engine. If you must, I would rather increase the verbosity of the game/mod you are running! Check out gnounc’s achievements mod, I think that would be a good base.
Then just pipe the output of the engine’s stdout to a tool that will act on it. For example a bash or Python script.
import sys
from collections import defaultdict
from pprint import pprint
collected = defaultdict(int)
for line in sys.stdin:
print(line, end='')
#print(repr(line)) # to see control characters etc
line = line.strip("\n")
if line == "You got the Double-barrelled Shotgun":
collected'ssg'] += 1
collected'shells'] += 5
pprint(dict(collected))
elif line == "You get 5 shells":
collected'shells'] += 5
pprint(dict(collected))
elif line == "You got the shells":
collected'shells'] += 40
pprint(dict(collected))
elif line == "\x02the Slipgate Complex":
print("wagga wagga")
pprint(dict(collected))
would give you
$ unbuffer quakespasm-svn | python act_on_engine_output.py
Command line: quakespasm-svn
Found SDL version 2.0.9
Detected 4 CPUs.
Quake 1.09 (c) id Software
GLQuake 1.00 (c) id Software
FitzQuake 0.85 (c) John Fitzgibbons
FitzQuake SDL port (c) SleepwalkR, Baker
QuakeSpasm 0.93.1 (c) Ozkan Sezer, Eric Wasylishen & others
Host_Init
Playing registered version.
Console initialized.
UDP Initialized
Server using protocol 666 (FitzQuake)
Exe: 18:16:12 Nov 16 2018
256.0 megabyte heap
Video mode 1024x768x24 60Hz (24-bit z-buffer, 0x FSAA) initialized
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce GTX 560 Ti/PCIe/SSE2
GL_VERSION: 4.4.0 NVIDIA 340.107
FOUND: ARB_vertex_buffer_object
FOUND: ARB_multitexture
GL_MAX_TEXTURE_UNITS: 4
FOUND: ARB_texture_env_combine
FOUND: ARB_texture_env_add
FOUND: SDL_GL_SetSwapInterval
FOUND: EXT_texture_filter_anisotropic
FOUND: ARB_texture_non_power_of_two
FOUND: GLSL
Sound Initialization
SDL audio spec : 44100 Hz, 512 samples, 2 channels
SDL audio driver: pulseaudio - Built-in Audio Analog Stereo, 32768 bytes buffer
Audio: 16 bit, stereo, 44100 Hz
CDAudio disabled at compile time
========= Quake Initialized =========
execing quake.rc
execing default.cfg
execing config.cfg
execing autoexec.cfg
=== Spirit ' s autoexec.cfg in id1 ===
Unknown command "sv_cheats"
Spirit's autoexec.cfg in id1 done
3 demo(s) in loop
]map e1m1
FITZQUAKE 0.85 SERVER (24778 CRC)
the Slipgate Complex
wagga wagga
Using protocol 666
Spirit entered the game
You can jump across...
You got the shells
{'shells': 40}
You get 5 shells
{'shells': 45}
You get 5 shells
{'shells': 50}
You get 5 shells
{'shells': 55}
You get 5 shells
{'shells': 60}
You get 5 shells
{'shells': 65}
You get 5 shells
{'shells': 70}
You get 5 shells
{'shells': 75}
You found a secret area!
You got the Double-barrelled Shotgun
{'shells': 80, 'ssg': 1}
Only 2 more to go...
You get 5 shells
{'shells': 85, 'ssg': 1}
Only 1 more to go...
You get 5 shells
{'shells': 90, 'ssg': 1}
You receive 15 health
Sequence completed!
You get 5 shells
{'shells': 95, 'ssg': 1}
You get 5 shells
{'shells': 100, 'ssg': 1}
You receive 15 health
You get 5 shells
{'shells': 105, 'ssg': 1}
You got the nails
You get 5 shells
{'shells': 110, 'ssg': 1}
You receive 15 health
Walk into the slipgate to exit.
You found a secret area!
You receive 100 health
Walk into the slipgate to exit.
Mod_LoadTexinfo: 1 texture(s) missing from BSP file
FITZQUAKE 0.85 SERVER (24778 CRC)
Castle of the Damned
Using protocol 666
Client Spirit removed
Shutting down SDL sound
{'shells': 110, 'ssg': 1}
$
and of course you do whatever you can imagine in your script.
[quote=Spirit]Wow, I totally missed that you even wrote “windows” in the title, sorry!
But still I am sure you could do something similar on Windows.[/quote]
Thanks for such detailed reply. Certainly - i got an idea - will keep you informed )
I have never run Q1 on other than Dos/Win system - but i have exp in webdev. So i’ll try to manage it.
[quote=Spirit]Wow, I totally missed that you even wrote “windows” in the title, sorry!
But still I am sure you could do something similar on Windows.[/quote]
Spirit, could you give a link to something i can read / test / download. The only thinf i have found is some Readmy in outdated github.
I’m sure i’m missing some great repository… ? Please help.