Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Custom Perks
#1
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
Reply

#2
Nice and simple. Thanks! Keep them tuts coming
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#3
Nice Yamota
[Image: lQDUjba.jpg]
Reply

#4
(07-27-2011, 13:00)OrangePL Wrote: Nice Yamota

Thanks MandarinPL, Troll
Reply

#5
O no you crossed the line
Now this is going to happen to you at night
[Image: 1fxsnb.jpg]
Troll
[Image: lQDUjba.jpg]
Reply

#6
(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
Reply

#7
Fuck yea!
[Image: lQDUjba.jpg]
Reply

#8
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)
Reply

#9
(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
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Black Ops 2 Custom background? jotape99 10 11,704 10-29-2013, 07:22
Last Post: xInfinity.
  Custom xanims DidUknowiPwn 8 6,691 08-28-2013, 08:17
Last Post: RaZ
  Help Make ac130 shoot custom bullets Ra3shed 0 2,583 07-23-2013, 13:02
Last Post: Ra3shed
  [Tutorial] Custom gametype HUD iAegle 17 14,302 07-14-2013, 01:16
Last Post: Nekochan
Video Custom Facepaints? Cuddlyedits 5 4,185 07-01-2013, 14:58
Last Post: iPaddie
  Help dedicated servers and custom dvars mattyman 0 2,363 06-22-2013, 07:33
Last Post: mattyman
Information [Tutorial] Adding DLC Maps as Custom Maps. Nekochan 151 139,472 05-25-2013, 01:05
Last Post: Nero Z zero
  QS Mod by GeKKo v 6.5 with Custom Maps GeKKoFL0X 35 28,908 05-21-2013, 19:30
Last Post: [HARD] Tony.
  [Request] custom gun mod ColorCorrects 2 2,946 05-18-2013, 22:19
Last Post: mitchhacker
  Custom load screen mw3? balakent 4 4,192 05-04-2013, 14:48
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

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