Changes between Version 8 and Version 9 of ioquake3
- Timestamp:
- Jul 13, 2011 5:50:31 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ioquake3
v8 v9 39 39 Going the other way is easier, however. You need to add a "trap function" that when called, actually drops out of the VM, reinterprets any memory pointers, and does whatever you need it to. Adding a trap function is a bit of a pain, especially if you're doing it to botlib (if so you'll have to change the function export structure: just grep -i "Stupidly" and you'll find all the changes I made for one of our botlib traps: trap_BotMoveStupidlyInDirection). Adding traps like we did for reading/writing sockets is much easier, though: just follow the step-by-step instructions below and copy the style of the existing entries there. Typically our edits are at the bottom of the files, but if you search "quagents" (case-insensitive) you'll turn then up quickly. 40 40 41 = 42 41 43 ==== Adding a Trap Function ==== 42 44 Edit these files: … … 49 51 * '''qcommon/common.c''': we've defined all our trap functions here, but you probably don't ''have'' to. Still, it's a convenient place to do it, so why don't we keep them together and define the function here. 50 52 * '''server/sv_game.c''': edit SV_GameSystemCalls and add a case for your enum value to call your function with. If you're passing memory addresses out of the virtual machine, use VMA(x) to remap address in args[x] from VM-memory to Quake-memory. Keep in mind that there's no way to go the other way - you won't be able to see memory outside the VM from within it. 53 54 === Quake Filesystem === 55 Quake uses a private, isolated filesystem for all file I/O. This means that all data generated directly from the game - screenshots, log files, etc., will be stored in this filesystem. The "home directory" for this filesystem, where all loads and stores occur by default, is located at ~/.quagents3/quagents3. The '.' prefix on the directory indicates a hidden directory, which means you will not be able to see it from your standard GUI filesystem browser. Instead, use your terminal to access it. 56 57 For more information, see the "files.c" file located in code/qcommon. 51 58 52 59 == Quagents Behavior ==