Results 1 to 8 of 8

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

  1. #1
    ... connecting
    Join Date
    Apr 2020
    Posts
    3
    Thanks
    0
    Thanked 2 Times in 2 Posts

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

    Hello killtube,

    i'm new here and want to say "hello". With this done I excuse for my bad english (i'm from germany).
    I think that I'm familiar with scripting/coding (some years of batch and a year Java), so I know the
    BASICS.

    Some day's ago I played on one of the COD 2 mp servers and now i just want to print a simple
    "Hello World" to player screen. But till now this seemed to be impossible because the whole
    forum is posting nice gsc scripts but I don't get arround to understand what I have to do to run the
    scripts. I saw some "mods" (projects or how ever you would like to call it) they worked but I don't
    get it.

    So my request is if there a tutorial which shows me how to accomplish that.

    I searched for some hours, but with no results. I saw the many gsc (maybe this is the wrong route with
    this gsc scripts so give me a hint to the correct route) scripts on this forum but didn't know
    how to use them, especially were to put them that my server will load them or excute them. I copied
    some of them into the iw07 folder (in the maps/mp/gametypes folder) or edited the _load.gsc with no
    results (or got an error message after some seconds the game started loading the map).

    So I hope one of you can help me to achieve my goal to print a simple "Hello World" after a player
    connected and spawned for the first time.

    If I missed any detail you want to know about my request don't hasitate to ask because i wan't to get
    further. Also if I didn't saw a tutorial or missed anything within my search please don't kill me. In
    addition to that please don't understand this text/request as anoffence to you! This is a simple but
    helping request to get arround COD 2 scripting.

    Thank you! Killtube! Your pizzadox

    PS: I hope I hit the right Sub-Forum.
    Last edited by pizzadox; 12th April 2020 at 22:20. Reason: PS

  2. The Following User Says Thank You to pizzadox For This Useful Post:

    kung foo man (13th April 2020)

  3. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Hi,

    iw_07.iwd and iw_15.iwd (patch 1.2/1.3) contain all the stock script files

    maps/mp/: map script files
    maps/mp/gametypes: gametype script files

    What you are looking for are located in gametypes folder.
    For example, take a look in tdm.gsc at the function spawnPlayer() and _healthoverlay.gsc

    Printing a message, is possible with iprintlnbold.

    Edit: do not change stock iwds.
    Otherwise you will get impure client when joining most servers.

    Create a new zip file with .iwd extension with the same folder structure e.g. z_mod.iwd: maps/mp/gametypes
    IWD file name order overrides files in other iwds.
    For example, iw_15.iwd overrides iw_07.iwd.
    Last edited by Mitch; 13th April 2020 at 13:13.

  4. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (13th April 2020)

  5. #3
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    Funny, I just did a quick video, because I forgot how to do it myself.
    However it is on windows:

  6. The Following User Says Thank You to serthy For This Useful Post:

    kung foo man (13th April 2020)

  7. #4
    ... connecting
    Join Date
    Apr 2020
    Posts
    3
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Thank you Guys,

    this helped me a lot. In addition to my last request, is there a list with all
    functions and keywords which i could need to write scripts or should I
    stick to the two files you recommended for me?

    So thank you a lot for your invested time and effort!

    Your pizzadox

  8. The Following User Says Thank You to pizzadox For This Useful Post:

    kung foo man (20th April 2020)

  9. #5
    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

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

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

  11. #6
    ... connecting
    Join Date
    Apr 2020
    Posts
    3
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Of course thank you for your advises.

  12. #7
    ... 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?

  13. #8
    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
  •