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 usingreplacefuncearly. - 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;
--- [...]