ItsMods

Full Version: Custom Perks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I am going to do this tutorial because I find it really usefull and easy, Nyan Cat

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

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
Nice and simple. Thanks! Keep them tuts coming
Nice Yamota
(07-27-2011, 13:00)OrangePL Wrote: [ -> ]Nice Yamota

Thanks MandarinPL, Troll
O no you crossed the line
Now this is going to happen to you at night
[Image: 1fxsnb.jpg]
Troll
(07-27-2011, 16:40)OrangePL Wrote: [ -> ]O no you crossed the line
Now this is going to happen to you at night
[Image: 1fxsnb.jpg]
Troll

Exclamation Undecided, thats not good
Fuck yea!
Code:
setBlastShield()
{
    self thread blastshieldUseTracker( "specialty_blastshield", ::toggleBlastShield );
    self SetWeaponHudIconOverride( "primaryoffhand", "specialty_blastshield" );
    self.maxhealth = 300;
        self.health = self.maxhealth;
}


unsetBlastShield()
{
    self notify ( "end_perkUseTracker" );
    self SetWeaponHudIconOverride( "primaryoffhand", "none" );
    self.maxhealth = 100;
       self.health = self.maxhealth;
}

Thanks for tut - I wonder if this code works?

EDIT: Is it possible that guys with cold blooded look like snipers? (non-ghillie)
(07-28-2011, 07:35)Metro-Police#45 Wrote: [ -> ]
Code:
setBlastShield()
{
    self thread blastshieldUseTracker( "specialty_blastshield", ::toggleBlastShield );
    self SetWeaponHudIconOverride( "primaryoffhand", "specialty_blastshield" );
    self.maxhealth = 300;
        self.health = self.maxhealth;
}


unsetBlastShield()
{
    self notify ( "end_perkUseTracker" );
    self SetWeaponHudIconOverride( "primaryoffhand", "none" );
    self.maxhealth = 100;
       self.health = self.maxhealth;
}

Thanks for tut - I wonder if this code works?

EDIT: Is it possible that guys with cold blooded look like snipers? (non-ghillie)

If those codes are ok, yes, they will work.

Yes, is possible to give ghillies to players, look on sniper mods