AntiCamper v1.0 by Harlequin (dtebben@alumni.caltech.edu) Should work in any OS How It Works ------------ All items which are tagged as camper-sensitive, which by default include the rocket launcher, grenade launcher, quad damage, red armor, and lightning gun, look around themselves about every 8 seconds. They have two detection ranges: a long range that includes only the item's line-of-sight, and a shorter range that can detect players even without LOS. If a player is detected for two consecutive think times, they are issued a warning of the form "**CAMPER WARNING FROM (item name)", their screen flashes and a sound is played. If they are still within detection range for a third think time, they are identified as a camper. All their armor and defensive powerups are removed, they are paralyzed, and their health is set to 1. A message is then sent to all players in the game, telling them who and where the camper is. The first player to frag the camper gets 3 frags instead of the normal 1, hopefully precipitating a free-for-all as everyone heads for the helpless camper. Campers also lose 2 frags each time they are busted. AntiCamper works only in deathmatch mode 1 (the standard DM mode where weapons respawn). Item respawn noises for camper-sensitive items have been disabled, simply because they help to alert campers that the item they're guarding is available again. Items detect campers even if the item is not currently respawned (it's still there, you just can't see or touch it). Item respawn times for camper-sensitive things are somewhat erratic, +/- 4 seconds or so, while this mod is running. This is an unavoidable consequence of giving items think times -- I see it as a feature rather than a bug, because it makes camping that much harder. When a client connects to a server that is running AntiCamper, they are informed of its presence via a centerprinted message. How To Install AntiCamper ------------------------- To install AntiCamper, you must have QCCDOS, the DOS-based QuakeC compiler; try looking at the following places if you don't have QCC: ftp://ftp.cdrom.com/pub/idgames/idstuff/source ftp://ftp.cdrom.com/pub/idgames2/quakec ftp://ftp.cdrom.com/pub/idgames2/utils Make a new subdir named "anticamp" off of your Quake directory and copy all the files from V101QC (a subdirectory of QCC) into it. Now unzip anticamp.zip into the new anticamp subdir, answering "yes to all" if it asks you whether or not to overwrite files. Enter the subdir and run QCCDOS. A file will be created called "progs.dat", which is what Quake looks for. To use the mod, run Quake with "-game anticamp". To recompile AntiCamper later on, just run QCCDOS again (after making any desired changes to the code -- see Optional Settings). Optional Settings ----------------- You don't have to change any of this stuff if you just want to use the defaults. But for those who (like me) are never satisfied until they have tweaked something to perfection, read on. NOTE: All of these involve recompiling AntiCamper to generate a new progs.dat. For instructions on how to do this, see "How To Install". ALSO, some settings require the user to "comment out" lines of code. This is done by putting two forward slashes // at the start of the line you wish to remove, using a text editor. DON'T delete any code, in case you want to restore the original setting later. *Item respawn sounds for camper-sensitive items can be enabled. I hate these personally, but I know some people like them. Just comment out line 12 in items.qc. *Camper/sniper warning sounds can be turned off. I'm not totally sure these are a good idea; they can give away a player's position in a deathmatch. On the other hand, they make sure that the player notices the warning. If you don't want to use them, you need to comment out lines 190 and 236 in anticamp.qc. The camper warning uses a barking-dog sound, and the sniper warning is the Ogre starting his chainsaw. *All weapons, armor, and powerups can be tagged as camper-sensitive by modifying lines 44-57 in items.qc. *Item detection radii can be assigned to maps on an individual basis. For instance, if there's one map where players are getting "false positives" (i.e. busted even though they weren't camping), you could decrease all items' detection zones for that level. Instructions on how to do this are in lines 66-74 and 91-97 in anticamp.qc. *Item think times can also be set differently for each level. Info on how this is accomplished can be found in lines 116-118 of anticamp.qc. Altering think times is the most powerful way to increase/decrease camper sensitivity on a level. *The connection message may be disabled by commenting out line 1018 in client.qc. Please send me feedback about what settings work well in deathmatch! If I get enough suggestions, I will change the defaults in the next version of AntiCamper. AntiSniper ---------- Also included in this mod is AntiSniper, a piece of code that lets you eliminate sniping on home-brewed maps. AntiSniper searches the map for a special entity called a sniper detector, and if it finds any, it causes them to act like camper-sensitive items. They search the area around themselves, and if the same player is loitering for too long they issue a sniper warning, then kill them as per AntiCamper. AntiSniper is totally optional; if it doesn't find any sniper-detection points on the map, it shuts itself down. Note: try not to let sniper detectors overlap detection radii, or they tend to cancel each other out within the zone of overlap. To take advantage of AntiSniper, you must create or modify a map so that it has sniper detectors. Sniper detectors are entities with classname 'info_null' and targetname 'sniper_detector'. They can be customized by setting various fields: 'speed' determines the distance they can see players from if they have line-of-sight, 'count' is their sighting distance without LOS, 'dmg' is their average think time (this varies to +/- 0.5 seconds), and 'message' is the string printed in warnings and busts. Set these fields in your map editor; if it doesn't support them, you'll have to text-edit the .map file manually. Sample .map entry for a sniper-detection point: { "classname" "info_null" "targetname" "sniper_detector" "message" "YOSEMITE" "speed" "600" "count" "150" "dmg" "6" "origin" "176 80 -168" } This would make a sniper detector located at coordinates '176 80 -168' with LOS range 600 and no-LOS range 150, which checks for snipers every 5.5-6.5 seconds. If it busted somebody it would bprint "x IS CAMPING AT YOSEMITE", and it issues warnings in the form "**SNIPER WARNING FROM YOSEMITE". You should set the message string to make it as unambiguous as possible, e.g. "THE TOP PLATFORM". You don't need to set all of these fields if you wish to use the default values. The defaults are: warning string: (**SNIPER WARNING FROM) "SNIPER DETECTOR" LOS detection range: 800 no-LOS range: 250 average think time: 8 But you do have to set the classname, targetname, and origin fields. Why did I use the info_null entity instead of just making my own? Well, I tried that, but if you run the resulting map without AntiCamper, Quake gives you all sorts of ugly error messages because it doesn't have a spawn function for sniper detectors. I figured info_null was pretty safe. AFAIK it has no effect on lighting or gameplay. However, if you want to use them, AntiSniper will detect and use map entities with classname "sniper_detector" (although the targetname must also be set to "sniper_detector"). Just be aware that if you use these instead of info_null, running the map without AntiCamper will generate a lot of garbage upon worldspawn. Integrating AntiCamper Into an Existing Mod Package --------------------------------------------------- I designed AntiCamper to be as modular as possible. All you have to do in order to bundle it into your own servermod code is the following: 1) Include anticamp.qc in your progs.src. Put it right above items.qc. 2) Look through the file changes.txt, where I documented all my mods. 3) Cut and paste my code from defs.qc, items.qc, client.qc, and misc.qc into the same places in your own files. Any place that I made additions to id's code I put the comment //#Harlequin# and a brief description of the addition. I didn't remove any of the original code (but I did alter some of it, so check carefully). I encourage other coders to use my work, and I will be happy to address any questions/comments/problems/feedback you might have. Email me at: dtebben@alumni.caltech.edu. Known Bugs ---------- None. Copyright and Distribution Information -------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GNU General Public License, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Credits ------- id Software, for setting the trend of user-configurable games, elevating shareware to its rightful place, and consistently being the best at what they do. Jonathan Jessup (jjessup@visuallink.com), for early ideas and playtesting.