Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 252 Guests
Online:

LATEST FORUM THREADS

»
New BF2 Mod
BF2 General

Tutorials

»
CoDUO Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Force316 Radios Via Script
Versions: You must be logged in to view history.
This is a tutorial that will instruct you on an easy method to use when making your maps Headquarters compatible. Written by GosHawK (website).

The format for making these arrays is contained in the HQ.GSC file but I think its never been done before because it must be placed in the a specific spot in your map script. Some maps have a snippit of this code in the gsc but it is never placed properly so it doesn't work. It will not compile if you follow the example they give.

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. 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.

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.



PLEASE CHECK OUT MY FORCE316 | ACTION HQ MOD @ www.modsonline.com
FORCE316 | ACTION HQ MOD
http://www.modsonline.com/Downloads-list-24.html



Here is an example GSC for you. Abbey is one of my favorite custom maps. The only grievance that I had was its lack of gametype compatibility. I made this map HQ compatible by adding an my array to the main function in the Abbeys GSC file. Take note of the exact location of my array and its format. If duplicated you should be able to do this with any map.

Take a look around for my HQ debuging mod. It will show all of the radios at all times so that you don't have to run around busting them to test your map.

FORCE316 | Major Warden

__________________________________________________________

main()
{
setCullFog (800, 6000, 0.3, .27, .35, 0);
ambientPlay("ambient_abbey");

level._effect["water"] = loadfx ("fx/water/em_froth.efx");
mapsmp_fx::loopfx("water", (-2138, -6108, -207), 0.6);
level._effect["water"] = loadfx ("fx/water/em_froth.efx");
mapsmp_fx::loopfx("water", (-1848, -7910, -207), 0.6);


mapsmp_load::main();

getent ("waterfall1","targetname") playloopsound ("waterfall_dam2");
getent ("waterfall2","targetname") playloopsound ("waterfall_dam2");


game["allies"] = "american";
game["axis"] = "german";

game["american_soldiertype"] = "airborne";
game["american_soldiervariation"] = "normal";
game["german_soldiertype"] = "wehrmacht_soldier";
game["german_soldiervariation"] = "normal";

game["attackers"] = "allies";
game["defenders"] = "axis";

//retrival settings
level.obj["Code Book"] = (&"RE_OBJ_CODE_BOOK");
game["re_attackers"] = "axis";
game["re_defenders"] = "allies";
game["re_attackers_obj_text"] = (&"RE_OBJ_BRECOURT_OBJ_ATTACKER");
game["re_defenders_obj_text"] = (&"RE_OBJ_BRECOURT_OBJ_DEFENDER");
game["re_spectator_obj_text"] = (&"RE_OBJ_BRECOURT_OBJ_SPECTATOR");
game["re_attackers_intro_text"] = (&"RE_OBJ_BRECOURT_SPAWN_ATTACKER");
game["re_defenders_intro_text"] = (&"RE_OBJ_BRECOURT_SPAWN_DEFENDER");

// 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";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-353,-7562,197);
radio.angles = (0, 87, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1382, -7557, 110);
radio.angles = (0, 136, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-212, -7327, 0);
radio.angles = (0, 176, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-208, -5457, 71);
radio.angles = (0, 178, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-754, -5562, 66);
radio.angles = (0, 69, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-511, -5218, 314);
radio.angles = (0, 178, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1203, -5029, 344);
radio.angles = (0, -44, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1194, -5467, 544);
radio.angles = (0, 0, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-497, -4937, 64);
radio.angles = (0, -117, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-315, -3692, 65);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1745, -6712, 78);
radio.angles = (0, 90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1486, -7349, 74);
radio.angles = (0, 180, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1969, -5363, 69);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1648, -5796, 69);
radio.angles = (0, -45, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1107, -5134, 72);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1573, -5095, 84);
radio.angles = (0, 135, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-2259, -4068, 26);
radio.angles = (0, -78, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-3005, -6190, -96);
radio.angles = (0, 79, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-2799, -6624, -197);
radio.angles = (0, 110, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-2519, -7418, -153);
radio.angles = (0, 45, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-2082, -7734, -13);
radio.angles = (0, 0, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1710, -7639, 64);
radio.angles = (0, 0, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1379, -8527, 64);
radio.angles = (0, 90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1019, -8185, 67);
radio.angles = (0, -45, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1739, -8771, 136);
radio.angles = (0, 116, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1315, -7205, 76);
radio.angles = (0, 90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (853, -6210, -6);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1320, -5939, 177);
radio.angles = (0, -180, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1190, -6013, 61);
radio.angles = (0, 90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (894, -5677, 197);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (887, -5700, 61);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1127, -5791, 120);
radio.angles = (0, 90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (1438, -4786, 74);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-585, -4197, 69);
radio.angles = (0, -133, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-1259, -5996, 64);
radio.angles = (0, -90, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (-764, -6393, 62);
radio.angles = (0, -124, 0);
radio.targetname = "hqradio";

radio = spawn ("script_model", (0,0,0));
radio.origin = (908, -4931, 93);
radio.angles = (0, -178, 0);
radio.targetname = "hqradio";

}

}

__________________________________________________________

Update from the author:

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_customhqs.pk3 (contains your custom GSC file "maps/mp/mp_abbey.gsc")

Your zzz_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_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_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.

Quote from ITOE_MC:

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.

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»