Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: preGSC

  1. #1
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    24
    Thanks
    4
    Thanked 16 Times in 10 Posts

    Lightbulb preGSC

    Hey!

    I just want your opinion about a new tool I'm making.
    It is basically a GSC preprocessor, which will let us use new syntax elements in GSC scripting.
    Currently it support condition operator (level.speed = amount > 50 ? 100 : 25), and reference variables (&p = level.players[i]).

    It picks up the GSCs from the folder you are working in (with for example shorthand ifs and references), transforms them to proper GSC syntax which can be read by CoD, and saves to an output folder (for example I'm working in the 'source' folder, and compiling into 'maps'). It is also very fast, so it doesn't even slow down compiling. It is available on both Windows and Linux, and hopefully compatible with all CoD versions which are using GSC. A much better description, instructions, parameters, and the file itself can be found here: http://www.moddb.com/downloads/pregsc.

    I hope you gonna like it, every suggestion or opinion are welcome!

    Also I'm planning more language elements, tell me if you miss anything from GSC, or if you think something could make the coding more comfortable!

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    There is no such thing as "GSC scripting". .GSC is a file format. Not a language. It's as ridiculous to refer to "GSC Scripting" as it is to refer to "ZIP Scripting".

    The language used in COD scripting is usually referred to as COD Script. Certainly, the developers of COD refer to it that way.

    Other than that, good luck with your project.

    BTW - if you ever wondered what G.S.C. means, it is the initials of Grant Stuart Collier, former President of Infinity Ward. This was told to me directly by Grant, the first time I met him in person.
    Last edited by Tally; 11th November 2013 at 22:15.

  3. #3
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    24
    Thanks
    4
    Thanked 16 Times in 10 Posts
    Quote Originally Posted by Tally View Post
    There is no such thing as GSC scripting. .GSC is a file format. Not a language. It's as ridiculous to refer to "GSC Scripting" as it is to refer to "ZIP Scripting". The language used in COD scripting is usually referred to as COD Script.

    BTW - if you ever wondered what G.S.C. means, it is the initials of Grant Stuart Collier, former President of Infinity Ward.
    Let me keep calling it that way, I think GSC is only used in CoD, and it is much clearer that "CoD scripting", since many people outta there calling "menu editing" as "menu scripting" too. So saying CoD scripting wouldn't be obvious enough for everyone. However that's probably true what you say, but I think it does not matter until I'm not writing an official letter to IW (also I thought it is Game SCript )
    Last edited by iCore; 11th November 2013 at 22:19.

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by iCore View Post
    Let me keep calling it that way, I think GSC is only used in CoD, and it is much clearer that "CoD scripting", since many people outta there calling "menu editing" as "menu scripting" too. So saying CoD scripting wouldn't be obvious enough for everyone. However that's probably true what you say, but I think it does not matter until I'm not writing an official letter to IW (also I thought it is Game SCript )
    Very few computer languages give their name to a file format. PHP is one. I'm sure you can think of others. But there are more that don't. For example, C and C++ do not, neither does Python, nor does Cobal. However, if you want to keep doing it, then obviously I can't stop you.

    BTW - you say you thought it stood for Game Script. But what does the "c" stand for? Game Script Code? That doesn't even sound right.

  5. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    This reminds me pretty much of this discussion http://modsonline.com/Forums-top-158856-10.html

    I always wanted #ifdef and co to circumvent version depending errors (e.g. "function not found" from 1.3 to 1.2 server).

    You could use the .menu parser from Enemy Territory (GPL and free to download game files, "parent" of CoD1): https://github.com/mgrdcm/ET-GPL/blo...cs/l_precomp.c (might be just easier to write the needed parts yourself)

    Where we can find your current source code?
    timescale 0.01

  6. #6
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    24
    Thanks
    4
    Thanked 16 Times in 10 Posts
    Quote Originally Posted by Tally View Post
    BTW - you say you thought it stood for Game Script. But what does the "c" stand for? Game Script Code? That doesn't even sound right.
    No, I thought it is Game SCript (2 letters from SCript )

    Quote Originally Posted by kung foo man View Post
    I always wanted #ifdef and co to circumvent version depending errors (e.g. "function not found" from 1.3 to 1.2 server).

    You could use the .menu parser from Enemy Territory (GPL and free to download game files, "parent" of CoD1): https://github.com/mgrdcm/ET-GPL/blo...cs/l_precomp.c (might be just easier to write the needed parts yourself)

    Where we can find your current source code?
    Currently I didn't share the source code yet, but it'll be on GitHub soon
    Also I'm really a beginner in C++, my programming logic is okay for writing the algorithm, but I'm dumb for sure to understand that menu parser :P Also I was never working with any parsers yet so also my current code is really gay :> But anyhow, it is ultrafast, so it's not a big problem currently
    And if you mean #define, ifdef, ifndef, etc in "CoD Script", then I'll check what can I do with them ^^
    Last edited by iCore; 12th November 2013 at 10:47.

  7. The Following User Says Thank You to iCore For This Useful Post:

    kung foo man (12th November 2013)

  8. #7
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    24
    Thanks
    4
    Thanked 16 Times in 10 Posts
    Quote Originally Posted by kung foo man View Post
    I always wanted #ifdef and co to circumvent version depending errors (e.g. "function not found" from 1.3 to 1.2 server).
    So here it is: http://mezesmadzag.hu/preGSC.zip

    Usage is the same as in CoD Menu:
    #define KUNG
    #undef KUNG
    #ifdef KUNG
    #ifndef KUNG
    #else
    #endif

    I hope it is working perfectly, I have tested some critical conditions, but please sign back if it does or not

  9. #8
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Huh, a binary?

    I thought you hooked FS_FOpenFile, FS_Read etc. to parse .gsc-files on the fly.
    timescale 0.01

  10. #9
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    24
    Thanks
    4
    Thanked 16 Times in 10 Posts
    Quote Originally Posted by kung foo man View Post
    Huh, a binary?

    I thought you hooked FS_FOpenFile, FS_Read etc. to parse .gsc-files on the fly.
    Uhhh, no, you haven't even read about it on ModDB
    I can hook nothing, especially not in C, nor do I have Assembly knowledge.
    Also Ninja said it'd be much work for him too to modify GSC syntax on server side.

    At least this way it doesn't require any modification on the server :>

  11. #10
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Sorry, I didn't saw the moddb link

    You can see, it is now as readable as the original version, but without any copying, since it will be converted to the optimal version. It makes this code also fast and nice.You can see, it is now as readable as the original version, but without any copying, since it will be converted to the optimal version. It makes this code also fast and nice.
    Do you just think that, because the code is shorter (not using helper-variables), or did you actually test it?
    timescale 0.01

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
  •