GSC Loading Guide

This guide assumes you are already familiar with the topic and you have loaded GSC scripts in the past on other clients.
You need a semi-advanced knowledge in programming before venturing into writing GSC scripts if you wish to achieve concrete results.

You can load custom game scripts on IW5 by creating a folder called scripts inside the userraw folder (target folder structure: Call of Duty Modern Warfare 3\userraw\scripts). After you have created this folder, you can place a custom script (must have .gsc extension) with an entry point called either main or init.

Custom game scripts are loaded at the same time as the other stock game scripts and the entry point is executed when the game level loads. There is no theoretical limit to how many custom script files you can add to the scripts folder. In practice, if too many script files are loaded, you may get an error message which causes the game to crash.

If your script does not have an entry point (main or init) it will be compiled but the code will not be executed, unless another script invokes it.
In that regard, you can have subfolders inside the scripts folder but you must invoke the entry point (which at that point can be a custom name) manually from another script. You can have a script with both main or init and both will be executed. main will be executed first.

In fact, you can place a GSC scripts file anywhere inside the base game folder (like userraw), but just because you can does not mean you should. It is only recommended for advanced users.

You can also override already existing game scripts by following the same steps you would take when doing so on CoD4.
In short, you can override a game script in the following fashion: Call of Duty Modern Warfare 3\userraw\maps\mp\gametypes\_callbacksetup.gsc
This means you must recreate the original folder structure of the game script you want to override inside the base game folder. The client will load your script _callbacksetup.gsc from the userraw folder instead of the stock game scripts. Stock game scripts are found inside fastfiles (.ff file extension) and can’t be easily edited. This is the preferred method to follow if you want to edit stock game scripts.

UNNAMED GSC SCRIPTS
Some GSC scripts are unnamed meaning that the community was not yet able to reverse the original name in clear text.
Scripts that are not found in gsc-tool’s token maps can only be accessed by using their numerical value in hexadecimal. For example: userraw\_id_001D.gsc

SUB FOLDERS

GAMEMODE SPECIFIC

  • Custom scripts placed in Call of Duty Modern Warfare 3\userraw\scripts\mp will only be loaded when the client is running Multiplayer.

  • Custom scripts placed in Call of Duty Modern Warfare 3\userraw\scripts\sp will only be loaded when the client is running Singleplayer.

MAP SPECIFIC

  • Custom scripts placed in Call of Duty Modern Warfare 3\userraw\scripts\<sp or mp>\<map name> will only be loaded when the corresponding level is loaded. The level name often differs from the display name. The `mapname’ dvar contains this information.

GAME TYPE SPECIFIC (MP Only)

  • Custom scripts placed in Call of Duty Modern Warfare 3\userraw\scripts\mp\<game type> will only be loaded when the corresponding game type is played. The game type name often differs from the display name (Free-For-All is dm for example). The `g_gametype’ dvar contains this information.