There are a few things that get you started scripting wise in CoD2:
- your map script gets called first
- then the game calls maps/mp/gametypes/_callbacksetup::CallBack_StartGameType()
- Kills, Damage, Player Connected, Player Disconnected events get called from the game in _callbacksetup.gsc
- the gametypes setsup callbacks such that these calls gets redirected to the correct one in tdm.gsc/ctf.gsc etc.
- images/huds/models and some more need to be 'precached' in the first frame of the game
- start your game with +developer 1, so the console gives you error messages, there is no debugger, so iPrintln() and runtime errors are your only friends
- this is only *.gsc files, for menu modding/weapon/effect/model modding its another story
- https://scripts.zeroy.com/ & https://wiki.zeroy.com/index.php for more keywords etc
- you call functions on objects: 'player thread myFunc()' -> in myFunc() you can refer to the caller as 'self'
- minimal waittime (based on server framerate sv_fps is 1/20 = 0.05
- you shouldn't have infinite loops, or you get a runtime error
- you can activate bots to help a bit more, just see on tdm.gsc on top the commented out line on addTestClients()
- gsc files and a few others are serverside, they can stay in your fs_game-folder and arent needed for the clients, images/models/sounds/menus need to be inside an iwd (zip) file and are downloaded on connect