Results 1 to 8 of 8

Thread: [COD2][Request]Tutorial print hello world to screen/load gsc script's on server

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    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

  2. The Following 2 Users Say Thank You to serthy For This Useful Post:

    kung foo man (20th April 2020),vesicant (10th April 2022)

  3. #2
    ... connecting
    Join Date
    Jan 2018
    Posts
    5
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by serthy View Post
    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
    Does anyone know the full list of files that can stay serverside vs. files that have to be downloaded to the client?

  4. #3
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    Quote Originally Posted by vesicant View Post
    Does anyone know the full list of files that can stay serverside vs. files that have to be downloaded to the client?
    If some file is not in the mods or maps on the server to which you are connected, and which are cached somewhere (from somewhere a non-existent file is accessed), then the presence of it in the client in any other downloaded file from other servers will lead to conflict.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •