|Frequently Asked Questions|
Q: Why doesn't MAKE seem to do anything the second time I try to run it?
A: This is normal behaviour for a make program, which attempts to compile only source that have been changed. For example if you edit only one source file, only that one file is recompiled to save time. Unfortunately the previous makefiles (V1.5 and earlier) did not check the header files to see if they have been changed. This could cause problems when you changed a header file, because the changes would not be recompiled. This was particularly troublesome for people changing GAME_API_VERSION in game.h, because the change was not taking effect. Please download the latest makefile, currently V1.6, that fixes this problem, and also read this section that describes how to customise it.
Q: Why cant I use the project features of Wedit to generate a makefile automatically?
A: Currently the project features of WEDIT don't seem to work well enough to use for the purposes of compiling Q2 patches. Normally you would create a project, listing all the *.c files, and Wedit would automatically generate a makefile and do the compiling for you. Unfortunately, while it does generate a makefile, it has mistakes in it that make it unusable for our purposes. I will be looking into this to see if I can get it to work in the future, and I have tried contacting the author of LCC about it. Because the makefile we are using is manually created, if you create any NEW source files, you will have to edit the makefile by hand and list the filename of your extra source file(s). This is described here.
Q: I've compiled a patch with LCC, now the laser beams on maps like 'security' go right through the walls!
A: Patches compiled with LCC currently have a small bug which manifests itself on the 'security' map. The security laser beams go right through the pillars near the entrance. A fix has been found that works, but it is a hack that doesn't fix the cause of the problem. Until a better fix is discovered, you can try it however: in the file g_target.c on line 491, you'll see a line starting tr=gi.trace......copy and paste this line directly below itself. Thanks to Radix for the tip. If anyone knows what the real fix is, please let me know.
Q: When I try to run my DLL I get a window that says "error during initialisation".
A: This error is a general error that reports that the main game EXE cannot load and initialise the gamex86.dll file. The two most common reasons are:
1) The export name
of the function GetGameAPI is incorrectly _GetGameAPI. Make sure you've applied the fix to game.def.
2) You're running a version of Quake2 later than 3.08. You need to open the game.h file, and change the value of GAME_API_VERSION at the top of the file from 1 to 2.
3) Make sure you're using V1.6 or later of the makefile, otherwise changes to header files may not be taking effect.
Q: When I try to run my DLL I get the error "game is version 1, not 2".
A: You have applied the fix to game.def, but you are using a version of Quake older than 3.09. Update your version of Quake to the latest.
Q: When people run my DLL under Windows NT, Quake just exits immediately with no error messages. The same DLL works fine in Windows 95.
A: This will happen if you use GetGameAPI as the entry point for the DLL. Ever since people first got LCC working with Quake2 DLL's it has been standard practice to specify GetGameAPI as the entry point of the DLL. Unfortunately this is incorrect, causing Quake2 to simply exit under Windows NT. For some mysterious reason you can get away with it under Windows 95, which is probably why nobody noticed it earlier. The solution consists of adding a new function to the code - that does nothing - to become the entry point. This new code looks like this:
int _stdcall DLLMain(void *hinstDll,unsigned long dwReason,void *reserved)
The command line for LCCLink is then changed to reflect the new entry point as follows:
lcclnk -subsystem windows -dll -entry DLLMain *.obj game.def -o gamex86.dll
If you followed this tutorial you shouldn't have to worry about this because the fix is included in the procedure.
Q: I can't seem to run MAKE without copying it to my patch directory. Even when I do, I get all kinds of errors.
A: You forgot to include LCC's bin directory in the DOS path. Check your autoexec.bat file, as described here.
Q: Something has gone wrong with Wedit, I can't access my project, either it is blank or it crashes the program. I can't get in to delete it and start again. Help!
A: Unfortunately Wedit is not the most reliable of editors, and sometimes the project feature can go haywire. You wont lose any of your work, but you may be unable to load the project in Wedit to work on it. About the only way to get out of this situation is to delete the configuration information for Wedit, which is stored in the windows registry. Please dont attempt this unless you are confident about using regedit. :-)
Run regedit from the run command. Expand HKEY_LOCAL_MACHINE, (click the + sign) then SOFTWARE, then lcc. Right click on the key that says Wedit, and choose delete. Next time you run Wedit you'll find it completely blank. You will have to recreate your project, but none of your source files will be lost.