# GSC Loading Guide

**URL:** <https://forum.alterware.dev/t/gsc-loading-guide/591>\
**Category:** IW5-Mod Discussion\
**Tags:** docs\
**Created:** [April 17, 2024, 8:47am UTC](https://forum.alterware.dev/t/gsc-loading-guide/591 "2024-04-17T08:47:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [April 17, 2024, 8:47am UTC](https://forum.alterware.dev/t/gsc-loading-guide/591/1 "2024-04-17T08:47:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [April 17, 2024, 8:55am UTC](https://forum.alterware.dev/t/gsc-loading-guide/591/2 "2024-04-17T08:55:23Z")

</div>

Closed on April 17, 2024, 8:55am UTC



---

<div class="post-metadata">

**Author:** ![Future](https://forum.alterware.dev/user_avatar/forum.alterware.dev/future/32/207_2.png) [@Future](https://forum.alterware.dev/u/Future)\
**Post date:** [April 17, 2024, 8:55am UTC](https://forum.alterware.dev/t/gsc-loading-guide/591/3 "2024-04-17T08:55:30Z")

</div>

Pinned on April 17, 2024, 8:55am UTC


