Thread Rating:
  • 5 Vote(s) - 3.4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial .Gsc Modding for Beginners
#81
Someone should update this thread. It says we need to use modloader. But official support is released. So thats why there are a lot of noobs who is using modloader.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#82
hey guys just got into bo modding and i wanted to know if theres a variable or something that keeps the current mapname. i wanted to create a script that automatically sets your camo matching to the map being played but i cant write the if-statement without knowing what i have to put in there.
so far i have:
if(... =="mp_array")
{
camo = 12;
}
self calcWeaponOptions(camo, 0, 0, 0, 0);
Reply

#83
You can create temporary DVAR.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#84
(05-15-2015, 22:01)Nekochan Wrote: You can create temporary DVAR.

i will try that. ty for the help! Smile
Reply

#85
(05-15-2015, 21:04)iDesolate Wrote: hey guys just got into bo modding and i wanted to know if theres a variable or something that keeps the current mapname. i wanted to create a script that automatically sets your camo matching to the map being played but i cant write the if-statement without knowing what i have to put in there.
so far i have:
if(... =="mp_array")
{
camo = 12;
}
self calcWeaponOptions(camo, 0, 0, 0, 0);

Code:
if(getDvar("mapname") == "mp_array")
{
    doSomething();
}
[Image: MaEIQ.png]
Reply

#86
worked! thanks. although i had to write a switch-case function for it (too many ifs^^)
but that was easy peasy. now how do i change th reticle color? o.O

weaponoptions(<camo>,<lens>,<reticle>,<clantag>,<emblem>);

where the argument for the reticle color? or does it use a different function or maybe a dvar to be changed?
Reply

#87
(05-16-2015, 12:21)Pozzuh Wrote:
(05-15-2015, 21:04)iDesolate Wrote: hey guys just got into bo modding and i wanted to know if theres a variable or something that keeps the current mapname. i wanted to create a script that automatically sets your camo matching to the map being played but i cant write the if-statement without knowing what i have to put in there.
so far i have:
if(... =="mp_array")
{
camo = 12;
}
self calcWeaponOptions(camo, 0, 0, 0, 0);

Code:
if(getDvar("mapname") == "mp_array")
{
    doSomething();
}

Oh I didn't get question right, lol
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#88
When i copy your text into my file and i play a game it says unknown function

When i copy your text into my file and i play a game it says unknown function
Reply

#89
(12-24-2010, 00:01)aosma8 Wrote:
.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 =]
how can i get mp weapons to sp with help of this?
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

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