Page 5 of 5

Re: .gsc Scripting help needed

Posted: June 12th, 2011, 9:08 pm
by F |Madness| U
Okay I see, thanks. Do you know of any guide or so on how to go about this? I checked mappers united wiki and other places and couldn't find it. I assume you have to atleast make a "newgametype".gsc, similar to tdm.gsc for example, but other than that I have no idea.

Re: .gsc Scripting help needed

Posted: June 12th, 2011, 10:07 pm
by Drofder2004
cj.gsc is dm.gsc with two minors adjustments.

the <gametype>.gsc files are for gametype specific scripts.
the globallogic.gsc is where most of the major work takes place.

Usually however, a custom mod will simply create there own seperate gsc file (e.g codjumper.gsc) which hold thes majority of the info.

When I took over the modding on previous games, I organised everything in to its own file.
jumping - admin - voting - messages - punishments

With CoD4, there are only 5 gsc files that are not converted files that already existed.
"setup" - Initialise/Precache/Dvars
"punish" - punishments
"commands" - Menus/voting
"utility" - some common functions (and also, voting started and didnt not move from here)
"codjumper" - core functions

All other files are to remove the features that exist in stock games, such as 'hardpoints' (radar/airstrike)...

Re: .gsc Scripting help needed

Posted: June 13th, 2011, 2:28 pm
by F |Madness| U
Okay I understand how you layed it out etc, however how do you actually make the gametype, if you know what I mean?

For example I have all my code that runs my nadetraining mod inside the _rank.gsc. And I can load my nadetraining mod on any gametype and it will work. How would I go about creating a new gametype "nt" for example, that would be based on "dm" (no objectives or teamwork etc). -Thanks

Re: .gsc Scripting help needed

Posted: June 13th, 2011, 5:03 pm
by Drofder2004
Instead of loading it using your _rank files, you could put all that info into a "nt.gsc" file and load it that way.
Then add your new gametype to the bottom of "_gametypes.txt"

Compile and g_gametype nt.

Re: .gsc Scripting help needed

Posted: June 13th, 2011, 5:11 pm
by F |Madness| U
Thankyou very much!

Re: .gsc Scripting help needed

Posted: June 14th, 2011, 7:13 pm
by F |Madness| U
I have a few small questions, and a problem :lol:

Firstly, when you're in the process of making a mod, once you edit your .gscs to test some new code etc, do you recompile the mod and load it up to see if it works? Because wouldn't that be quite time consuming having to re-compile every time you change the .gsc? Reason I was asking is because with Black Ops scripting official mod tools arn't released yet, so I can't compile the mod, I just have the .gsc in blackops/mods/mymod/maps/mp/gametypes/_rank.gsc. I tryed creating a nt.gsc and adding nt to bottom of _gametypes.txt and then running but it didn't work, so I guess you have to compile for a new gametype to work.

But yeah even with mod tools for cod4 for example, do you re-compile the mod each time you change some script?

And my problem, I found a dvar to remove the glare of the sun when you look at it, and added it into the .gsc (see code below).
The problem is however, the glare of the sun is removed for me. but any other players who connect can still see the sunglare.
If it makes any difference, I am the server host (but it's not like on cod4- I have no seperate window for the dedi server, only the window that I am playing on).

Code: Select all

visualdvars()
{
        setVolFog(0, 300, 2000, 3000, 0, 0, 0, 0.0);
        setDvar("r_sun_from_dvars", "1");
        setDvar("r_sunflare_max_size", "0" );     
}
 
onPlayerConnect()
{
        for(;;)
        {
                level waittill( "connected", player );
                player thread visualdvars();
                                 ....
                 }
}

Re: .gsc Scripting help needed

Posted: June 14th, 2011, 7:32 pm
by Opel
fs_usedevdir 1 will let you edit your scripts, all you have to do is edit them then devmap with your mod. Also try using setclientdvar for the sun glare.

Re: .gsc Scripting help needed

Posted: June 14th, 2011, 7:42 pm
by Drofder2004
Compiling a mod takes seconds and combined with some custom cmd lines, you can compile+run the mod with one-click.

Re: .gsc Scripting help needed

Posted: June 14th, 2011, 8:40 pm
by F |Madness| U
I've never compiled a mod I didn't realise it would be that quick, I thought it would be like custom maps that take a few minutes to compile.

But yeah I made nt.gsc , and added nt to the bottom of _gametypes.txt, and so my mod folder structure is like:

blackops\mods\mymod\maps\mp\gametypes\_gametypes.txt
blackops\mods\mymod\maps\mp\gametypes\_nt.gsc

However if I do /g_gametype nt; map mp_cracked it just lags for a second, then loads the map in dm. Is this because it has to be compiled for a new gametype you think?

And if I use SetClientDvar, I get unknown function setDvar("r_sunflare_max_size", "0" );.