Skip to main content

Loading a GSC script

File structure

GSC scripts should be placed in h1-mod/iw7-mod folder in your desired game's folder. In the scripts (or custom_scripts for IW7) folder, any GSC script with the .gsc suffix will be attempted to be loaded by the clients. Refer to the folder structure below to understand what mode-specific GSCs you can load.

To figure out what your file structure should look like, refer to below.

H1-Mod

Modern Warfare Remastered
โ”œโ”€โ”€ h1-mod
โ”‚ โ”œโ”€โ”€ scripts
โ”‚ โ”‚ โ”œโ”€โ”€ mp_and_sp_script.gsc
| | โ”œโ”€โ”€ mp
| | | โ””โ”€โ”€ my_multiplayer_script.gsc
| | โ”œโ”€โ”€ sp
| | | โ””โ”€โ”€ my_singleplayer_script.gsc
โ””โ”€โ”€ h1-mod.exe

IW7-Mod

Modern Warfare Remastered
โ”œโ”€โ”€ iw7-mod
โ”‚ โ”œโ”€โ”€ custom_scripts
โ”‚ โ”‚ โ”œโ”€โ”€ all_modes.gsc
| | โ”œโ”€โ”€ mp
| | | โ””โ”€โ”€ my_multiplayer_script.gsc
| | โ”œโ”€โ”€ cp
| | | โ””โ”€โ”€ my_zombies_script.gsc
| | โ”œโ”€โ”€ cp_mp
| | | โ””โ”€โ”€ multiplayer_and_zombies.gsc
| | โ”œโ”€โ”€ sp
| | | โ””โ”€โ”€ my_singleplayer_script.gsc
โ””โ”€โ”€ iw7-mod.exe

Handles

Custom GSC files will look for main() and init() functions in your scripts.

  • The main() function is called BEFORE the engine loads any GSC, which is primarily useful for using replacefunc early.
  • The init() function is called AFTER the engine loads many of the necessary GSCs, which is used for general use cases.

After you setup your main and/or init entrypoint(s), you are good to go.

Includes

If you want to include another script, use #include "<file>". This will load the script using the client's functionality for loading scripts.

#include maps\mp\_utility;
--- [...]