Hello
I am going to do this tutorial because I find it really usefull and easy,![Nyan Cat Nyan Cat](https://www.itsmods.com/forum/images/smilies/poptart.gif)
I am going to show you how to make your custom perks. To make a perk you dont have to modify _rank.gsc or _missions.gsc, those arent magic gsc files, what we are going to modify is _perks.gsc and _perkfunctions.gsc.
1- Open _perks.gsc and find the thread init().
2- You will find this:
and under it:
3- In the level.scriptPerks we are going to add a new one, in my case will be called "specialty_omapowers". So just add somewhere beetween those level.scriptPerks:
4- A bit under that we find all this, this are the _setperk and _unsetperk commands:
5- Add our one there:
Now we have to create those threads, for example in _perkfunctions.gsc
6- Open _perkfunctions.gsc and make 2 threads anywhere, doesnt matter where, I do this for example, you can make them do whatever you want, in my case they give fast speed and blastshield:
7- Now, go to your gsc, where you code your mod, and to give the perk:
8- Done, you have created a custom perk,![Nyan Cat Nyan Cat](https://www.itsmods.com/forum/images/smilies/poptart.gif)
Clean gsc files:
http://pastebin.com/5MFbH79j = _perks.gsc
http://pastebin.com/MGvH76F3 = _perkfunctions.gsc
Both files go inside a folder called perks inside mp folder: maps\mp\perks
I am going to do this tutorial because I find it really usefull and easy,
![Nyan Cat Nyan Cat](https://www.itsmods.com/forum/images/smilies/poptart.gif)
I am going to show you how to make your custom perks. To make a perk you dont have to modify _rank.gsc or _missions.gsc, those arent magic gsc files, what we are going to modify is _perks.gsc and _perkfunctions.gsc.
1- Open _perks.gsc and find the thread init().
2- You will find this:
Code:
// perks that currently only exist in script: these will error if passed to "setPerk", etc... CASE SENSITIVE! must be lower
level.scriptPerks = [];
level.perkSetFuncs = [];
level.perkUnsetFuncs = [];
level.fauxPerks = [];
and under it:
Code:
level.scriptPerks["specialty_blastshield"] = true;
level.scriptPerks["_specialty_blastshield"] = true;
level.scriptPerks["specialty_akimbo"] = true;
level.scriptPerks["specialty_siege"] = true;
level.scriptPerks["specialty_falldamage"] = true;
level.scriptPerks["specialty_fmj"] = true;
blablablablabla
3- In the level.scriptPerks we are going to add a new one, in my case will be called "specialty_omapowers". So just add somewhere beetween those level.scriptPerks:
Code:
level.scriptPerks["specialty_omapowers"] = true;
4- A bit under that we find all this, this are the _setperk and _unsetperk commands:
Code:
level.perkSetFuncs["specialty_blastshield"] = ::setBlastShield;
level.perkUnsetFuncs["specialty_blastshield"] = ::unsetBlastShield;
level.perkSetFuncs["specialty_siege"] = ::setSiege;
level.perkUnsetFuncs["specialty_siege"] = ::unsetSiege;
level.perkSetFuncs["specialty_falldamage"] = ::setFreefall;
level.perkUnsetFuncs["specialty_falldamage"] = ::unsetFreefall;
5- Add our one there:
Code:
level.perkSetFuncs["specialty_omapowers"] = ::setomapowers;
level.perkUnsetFuncs["specialty_omapowers"] = ::unsetomapowers;
Now we have to create those threads, for example in _perkfunctions.gsc
6- Open _perkfunctions.gsc and make 2 threads anywhere, doesnt matter where, I do this for example, you can make them do whatever you want, in my case they give fast speed and blastshield:
Code:
setomapowers()
{
self _setPerk( "_specialty_blastshield" );
self.moveSpeedScaler = 3;
}
unsetomapowers()
{
self _unsetPerk( "_specialty_blastshield" );
self.moveSpeedScaler = 1;
}
7- Now, go to your gsc, where you code your mod, and to give the perk:
Code:
self _setperk("specialty_omapowers");
8- Done, you have created a custom perk,
![Nyan Cat Nyan Cat](https://www.itsmods.com/forum/images/smilies/poptart.gif)
Clean gsc files:
http://pastebin.com/5MFbH79j = _perks.gsc
http://pastebin.com/MGvH76F3 = _perkfunctions.gsc
Both files go inside a folder called perks inside mp folder: maps\mp\perks