IMPORTANT INFORMATION FOR MODDERS AND ADMINS
Fist you should download theForce316 HQ Debug Utility. This mod will make all your radios visible. This is handy when deciding where to place radios and when checking to make sure your custom radios are where they are supposed to be.
To add your custom radios to a map you must retrieve the gsc file for the map from the map pk3 file. Enter your new radios into the GSC file and then create a new pk3. Recreate the filepath to the map's normal GSC location and place your new version of the mapname.gsc in that location.
I believe that if you want the server to create the HQ option in the vote menu for maps that do not natively support HQ then you will have to alter the .arena files as well.
Make sure that you add the letters svr into the name of the newly created pk3 file. This will denote the file as server-side only. This way the players will not download the PK3 file. They do not need it because only the server needs the information. It is the server that picks the location of the radio from the list and then notifies the players.
INSTRUCTIONS FOR THE APPLICATION OF THIS MOD TOOL
Note: I wrote this as part of a tutorial for modsonline before this tool was created. This tool replaces the need for pen and paper. I may update the text below to reflect this at some point but for now it will have to do.
The format for making these arrays is contained in the HQ.GSC file but I think very few admins have ever tried setting up custom radios because there are some quirky elements to the process. This tool will make the process easier for admins to create their own custom HQs.
This method is versatile and can be used to add HQs to maps that already have HQs as well at to ones that don't providing that the map supports TDM. You can even use this method to add new radios to your favorite stock maps at anytime. If you are a mapper then this will be handy for beta testing. If you don't like the radios position you can relocate or delete it without having to recompile your map and such.
Normally when a mapper is creating a map they place the radios in radiant and no further adjustments can be made. When the map is exported and turned into a BSP file the array containing the radios origins is coded directly into the file. This process is pretty much the same with all of the variables in the map.
Read these step once before starting the process.
Step 1 - Start up the map that you would like to add new radios to.
Step 2 - When you find a sweet spot to place a radio stand exactly where you want it to be and face the direction that you want the radio to face. You must use your third eye to imagine what its placement on the map will look like.
Step 3 - Open your console and type "viewpos" while standing tall. Do not crouch or go prone.
This will return your position to you with three dimensional coordinates plus the direction that you are facing. The third set of digits indicates your elevation. The last set of digits indicates your direction.
-2138, -6108, -207 89
Record this information
Step 4 - Work your way around the map and record the locations of all the radios that you would like to place.
Step 5 - You need to create little arrays to hold the information about each radio. Use notepad or a spreadsheet or pen and paper.
Example
Your raw viewpos coordinates -2138, -6108, -207 89
Format each item in the array like this. Note that the direction that you are facing is the second set of angles digits. Be vary careful to record negative \ positive integers. If you don't you may never find your radio!!!
radio = spawn ("script_model", (0,0,0));
radio.origin = (-2138, -6108, -207);
radio.angles = (0, 89, 0);
radio.targetname = "hqradio";
The first and last set of digits in the radio.angles represents the tilt of the radio. Its not worth the effort.
Step 6 - Once you have done this for every radio that you would like to place then you must subtract 60 units from your radio's elevation. The viewpos is just that. The position of your view. Your player is 60 units tall to the eyeballs. If you do not subtract 60 then all of your radios will be floating at eye level.
Step 7 - Format your array into an if statement like this and place it into the main() part of your map's GSC file.
// HQ Mode
if (getcvar("g_gametype") == "hq")
{
radio = spawn ("script_model", (0,0,0));
radio.origin = (-1938, -8182, 64);
radio.angles = (0, 178, 0);
radio.targetname = "hqradio";
radio = spawn ("script_model", (0,0,0));
radio.origin = (-486, -8191, 105);
radio.angles = (0, 86, 0);
radio.targetname = "hqradio";
radio = spawn ("script_model", (0,0,0));
radio.origin = (-131, -8491, 71);
radio.angles = (0, 89, 0);
radio.targetname = "hqradio";
}
and so on... you can add as many as you like... to a point. Eventually you will get a Max Entities error. I got this on Rhinevalley after adding 180 radios. :O
Madness!!!
TIPS AND HINTS
When recording your locations its handy to work without Fullscreen. When you open the console to use the "viewpos" command your mouse becomes available to use in Windows Operating System.
If you are good with spreadsheets then you can build your arrays directly into one. Don't just enter the viewpos info. Create the entire array in the spreadsheet and get over Step 6 in a flash with minimum room for error. When your data is ready to be turned into the final array (Step 7) you can use a word processor to format it properly.
Place your radios in places that will create a good style of gameplay. HQs are a great tool for getting players into parts of the map that are most often dead in the normal course of play during other gametypes. Placed properly an HQ can breath fresh life into a stale map.
Quote from ITOE_MC@modsonline:
This is an extremely useful tutorial. Thank you for making it.
I just wanted to add that the script will only work on maps that support HQ and/or TDM. When radio spawns aren't specified, the game will use TDM player spawns as locations for the radios. And in any case, you have to have TDM spawns defined in order to play HQ.
This tutorial will be especially useful for making TDM maps more compatible with HQ, when a map doesn't support HQ natively. There are quite a few maps out there that have players spawn in places they can get out of, but can't get into. Your radios can end up in those places, too. I think scripting radios in like this will override the TDM default placements, which will open up several maps to the HQ gametype.
Reply to ITOE_MC
I think that the game only uses TDM spawns for radios when AWE is running and the option is active and a number of extra radios has been defined. It has been my experience that a map that has no scripted radios will default to the deathmatch gametype on a stock COD 1.4 server.
Maps that do not have HQ as a declared gametype in its .arena file become HQ compatible once you script radios into them. The HQ game can still be started from your server's config or directly from your console. HQ cannot be started from the in-game GUI unless you add HQ to your "mp/my/mapname.arena" file in your custom hq pk3.
Thats why I used abbey as my example. I altered and repacked abbey during my experiments but I know that if you pack custom versions of a maps gsc files into pk3s and name the pk3s so they alphabetically come after the map and are in a mod folder called by your server then the custom GSC files take precedence as they are last in the load order. Make sure your pk3s are packed properly.
The loading order is KING!
Example
uo/User_mp_abbey_beta.pk3 (the untouched map)
zzz_svr_customhqs.pk3 (contains your custom GSC file "maps/mp/mp_abbey.gsc")
Your zzz_svr_customhqs.pk3 mod will load up after the map file and it will overwrite the default ones files in the actual map pk3.
If you want to set it up so that you can select the map/gametype via GUI then you can add your own copy of the .arena file with hq added to the list of gametypes the map works with.
So, your custom hqs for mp_abbey would need the following -
1. Call of Duty/uo/User_mp_abbey_beta.pk3 (the untouched map)
2. Call of Duty/LOADORDER/zzz_svr_customhqs.pk3 (contains your custom GSC file "maps/mp/mp_abbey.gsc")
-maps/mp/mp_abbey.gsc
-mp/mp_abbey.arena (if your map isn't HQ ready and you want GUI selection avaliable)
Put your zzz_svr_customhqs.pk3 in a folder called something like "LOADORDER" and add this to your server's
command line.
+set fs_game LOADORDER
This should loadup your mod and your altered files will supplant the original ones.
The process is easier with the stock maps because they are all HQ ready. There is no need to fiddle with the .arena files.
I should have been clearer in my original tutorial but i didn't want to overload people with too much information. These principals apply to all aspects of the game so it can help in making mods to other gametypes as well once you get it. I hope that helps.
|
PLEASE ENTER DATA FOR RADIO 1
ADD CODE BELOW TO YOUR GSC
|