Thread Rating:
  • 5 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial .Gsc Modding for Beginners
#1
.Gsc modding for beginners


Before we start Im also currently a beginner as well so if I make a mistake please correct me, thanks.

Firstly, What is a GSC file?

Definition:
Quote: The difference between PC modding and console (Xbox 360) modding: console mods require you to have a modded "patch_mp.ff". These patches consist out of modded . Gsc files, basically the heart of the game.
Gsc modding is quite simple once you get the hang of it this tutorial will go over the basics for black ops gsc modding. When you download a mod have u ever wondered why modders use _rank.gsc file it is because it has the OnPlayerSpawned thread .There are many .gsc files you can use (in the gamescripts see below).

Getting Started:
Firstly we will need Itsmodsloader to load the mods :
http://www.itsmods.com/forum/Thread-ItsModsloader.html

Secondly:
Gamescripts:
http://www.itsmods.com/forum/Thread-Call...ipt-s.html

Thirdly: Dvar List:
http://www.itsmods.com/forum/Thread-Comp...rdump.html
Weapons Dvar List:
http://www.itsmods.com/forum/Thread-All-...DVARS.html

Modding:
Open Gamescripts/maps/mp/gametypes/_rank.gsc and you will see lots of code take a look and familiarise yourself with some of theses codes as you will need many of them to mod .Then search (Control + F) and enter in: onPlayerSpawned

You will now see this:

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
    }
}

This code is one part of what makes the gsc file run.
onPlayerSpawned() = Thread name
; = The semi colon ends a command.
As you can see there are many brackets in the one paragraph of code. The { bracket in gsc coding means opening line of code and this bracket } ends the line(Think of it like a sentence) . These brackets are a vital component of gsc modding and must be included or else you will get many errors.

Commands:
Now we know some basics of gsc modding we will want to add some commands so that we can do HEAPS of awesome things ingame.

So I want my favourite gun the Famas with Dual clips and silencer + Reflex sight when I spawn:

Famas command:
Self giveWeapon ( " famas_reflex_dualclip_silencer_mp " );

The code above^^ is the code used to get your gun and its attachments and camouflage.
For any other gun:
giveWeapon(weaponname, 0, calcWeaponOptions ( <camo>, <lens>, <reticle>, <tag>, <emblem> ));


Tip: When adding any gun make sure to have _mp if its in multiplayer and have the gun name etc between the quotes .

So now what??? We add it to the OnPlayerSpawned() Thread:

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
                                self giveWeapon ( "famas_reflex_dualclip_silencer_mp", 0, false );
    
    }
}
Yay! We now have a Famas when we spawn lol. Now I want to give myself a perk

Command:
self setPerk(specialty_name);

Ill give myself : Lightweight
self setPerk("specialty_Lightweight");



Final Code:

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
giveWeapon ( "famas_reflex_dualclip_silencer_mp", 0, false );
        self setPerk("specialty_Lightweight");
}
}

Awesome now we have Lightweight AND Famas. Feel free to change the code to suite yourself.

Save:
Make sure you are on _rank.gsc and then save it ( Control + S ). Now we will want to test this mod.

Loading:
For those of you who dont know how to load the mod into black ops well your in luck:

1)Place _rank.gsc into itsmodloaders mod folder :
Itsmodsloader\mod\maps\mp\gametypes\_rank.gsc
2) Run the exe.
3)Run the game.
4)Play your mods.
5)IMPORTANT : DISABLE VAC WHILE LAYING IN PRIVATE MATCH
Settings/VAC/ NO


Quote:
Info:VAC2 DETECTED - use in private matches with sv_vac 0
Want to play legit after that?
1. Close the game.
2. Close Steam.
3. Restart Steam.
4. Start the game without any hacks loaded.



Extra Info:
All Credits go to TMS_Killingdyl (loll) for this useful information about variables:

Variables:
Quote:Variables in gsc does not have to be defined by type like in more complex scripts neither does it have to be defined before use.
There are only 4 types of variables.
Int - Integer (5, 0, -5)
Float - Decimal number (5.6034)
String - Text String ("Hi")
Boolean - True or False

int(string) turns a string "1" to the integer 1

There are different ways variables stored in gsc
self.variable = "Killingdyl"; - stores the variable attached to whatever self is, most of the time its a player
level.variable = Random Text"; - stores the variable to the level, resets if map_restart(true);
functionvariable = ::function; - stores a function into a variable
position = (x, y, z); - position is an array with 3 values
angle = (pitch, yaw, roll); - angle is an array with 3 values
array = []; - defines an array, doing this will clear any previous values inside the array
array[value] = []; - defines multi-dimensional arrays, clears any previous values.
To call the functionvariable you do it like this
[[functionvaraible]](arguments);

Variables are used in if-else statements. You can use the following evaluators.
== - equal to
!= - not equal to
> - greater than
< - less than
>= - greater than or equal to
<= - less than or equal to

For variables that are defined true or false, in if statements you can use the following.
if(variable) - this is the same as if(variable == true)
if(!variable) - this is the same as if(variable == false)
true == 1 and false == 0


HAVE FUN!

Well thats pretty much it =]

Reply

#2
Deffinately a chance in our christmas price competition.
Reply

#3
(12-24-2010, 09:25)surtek Wrote: Deffinately a chance in our christmas price competition.

you want me to copy paste mine over?
Reply

#4
depends on if you want to win something or not

good work aosma8
Reply

#5
(12-24-2010, 11:35)d0h! Wrote: depends on if you want to win something or not

want can i win?
Reply

#6
i think to learn gsc copy a gun game and edit it i will start to understandt stuff.. and than boom!
if you dig true the world... what comes up first your feet or your head ;qq
Reply

#7
nice tuturial.
--
Reply

#8
(12-25-2010, 11:28)TheSaboteur Wrote: i think to learn gsc copy a gun game and edit it i will start to understandt stuff.. and than boom!

But people like things to be explained to them right?

@Eekhorn: Thanks
Reply

#9
cashed my mod and i cant go back.. now i have to restart
RTD V2.7 RELEASE STATUS: Rolls Finished, debugging
Reply

#10
I can't open the: Thirdly: Dvar List:
http://www.itsmods.com/forum/Thread-Blac...-List.html
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.