UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Tutorial] Custom Perks

HOT
broken avatar :(
Created 8 years ago
by shinged
0 Members and 1 Guest are viewing this topic.
21,893 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 February 2014
Last active: 6 months ago
Posts
69
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
What is broken can be reforged
Signature
Completed maps:
Kingdom Hearts - World at War Link
Minecraft - Black ops 3 Link

WIP:
~

×
shinged's Groups
shinged's Contact & Social LinksTheShingedShingedvinny545Matarra_
Hey guys, today i'm gonna guide you guys through making a custom perk. You need at least a bit of scripting knowledge to do this as your perk won't actually do anything without scripting it ;)
IT IS EXTREMELY EASY TO GET CLIENT MISMATCH ERRORS WITH THIS,
HOWEVER IF YOU ARE POSITIVELY SURE YOU DID EVERYTHING 100% CORRECTLY LET ME KNOW
AND I WILL TRY TO FIX IT

First download my scripts here: https://mega.nz/#!Rk8D2JbI!rcYRTDhkgdYxC4TJiyHZW5N5k-dBMVHU8ZjjB1QJt9c

So lets start off by copying some shit.
 - Drag and drop everything but the .txt into your mapname/scripts/zm folder.
 - Open up your mapname GSC and paste this somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\zm_custom_perk_shader;
#using scripts\zm\_zm_perk_custom_perk;
- at the bottom of main() function put this
Code Snippet
Plaintext
level thread custom_perk_shader::custom_perk_shaders_init();

 - Now open up your mapname CSC and paste this somewhere at the top
Code Snippet
Plaintext
#using scripts\zm\_zm_perk_custom_perk;

 - Open up your mapname ZONE file and paste this at the bottom
Code Snippet
Plaintext
// custom perk shader script by Matarra
scriptparsetree,scripts/zm/zm_custom_perk_shader.gsc
// custom perk
scriptparsetree,scripts/zm/_zm_perk_custom_perk.gsc
scriptparsetree,scripts/zm/_zm_perk_custom_perk.csc
scriptparsetree,scripts/zm/_zm_perk_custom_perk.gsh
xmodel,kh_elemental_nade_vending // CHANGE THESE TO YOUR VALUES - XMODEL NAME FOR YOUR MACHINE
material,kh_perk_elemental_nades // CHANGE THESE TO YOUR VALUES - THIS IS YOUR PERK SHADER MATERIAL NAME

 - Now in Radiant, copy quick revive and stamp the prefab. Delete everything but the struct at the bottom.
 - Change these KVP's
Code Snippet
Plaintext
"specialty_customperk", "script_noteworthy"
"your xmodel name for perk machine", "model"

Now lets move on to APE, we'll save scripting for last
 - Make a material and call it something you'll remember, this will be the perk shader.
 - Give this these settings




Now for the scripting part, there really isn't that much to do because i mostly did it all for you. If you want to change variable names you can, but i suggest leaving them alone and just changing whats in the gsh, and certain things like hintstrings in the gsc.
 - Open up the custom_perk.gsh and change everything to your own shit. I suggest leaving the price really low for testing.
 - Dont worry about this variable
Code Snippet
Plaintext
CUSTOM_SHADER
we dont have access to treyarchs hud elements so i had to script them in manually. So just leave the value alone.
 
Open up the custom_perk.gsc
 - At the top add this somewhere
Code Snippet
Plaintext
#precache( "material", "kh_perk_elemental_nades" ); // CHANGE THIS TO YOUR PERK SHADER
Obviously change kh_perk_elemental_shit to your own material name in APE.
 - Find this
Code Snippet
Plaintext
zm_perks::register_perk_basic_info( PERK_CUSTOM_PERK, "customperk", CUSTOM_PERK_COST, "Hold [{+activate}] for Elemental-Nades [Cost: &&1]", GetWeapon( CUSTOM_PERK_BOTTLE_WEAPON ) );
change the hintstring to your perkname.
 - Find this
Code Snippet
Plaintext
trigger = GetEnt("vending_customperk", "target"); // CHANGE THIS TO YOUR PERK MACHINE NAME
change "vending_customperk" to whatever you might have changed it to in the gsh.
 - Find this
Code Snippet
Plaintext
trigger SetHintStringForPlayer(self, "Hold [{+activate}] for Elemental-Nades [Cost: 3000]"); // CHANGE THIS TO YOUR HINTSTRING ABOVE

and change it to your hintstring once again. This time you will need to specify the cost of it.
 - In the final function is where you will script your perk effect, the function gets called one time when the player purchases the perk.

Code Snippet
Plaintext
give_custom_perk()
and
Code Snippet
Plaintext
take_custom_perk( b_pause, str_perk, str_result )
both only get threaded a single time.

So there you have it. This tutorial is probably my largest tutorial yet and might have some errors. If you guys find any let me know and i will fix them asap.

If you follow my tutorial you MUST credit me. Simply saying: "Matarra - Custom perk shader script and custom perk tutorial" will suffice
Last Edit: December 02, 2016, 10:21:04 pm by shinged
broken avatar :(
×
broken avatar :(
Location: at
Date Registered: 26 November 2016
Last active: 6 years ago
Posts
45
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Signature
12 year old music critic, quadrasexual Minecrafter, Linkin Park fan, Hentai enthusiast, intelligent atheist and vegan.
×
Cxwh's Groups
Cxwh's Contact & Social LinksCxwhModsGodAspire
Awesome tutorial dude :D
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 February 2014
Last active: 6 months ago
Posts
69
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
What is broken can be reforged
×
shinged's Groups
shinged's Contact & Social LinksTheShingedShingedvinny545Matarra_
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 February 2015
Last active: 9 months ago
Posts
63
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Blink-420's Groups
Blink-420's Contact & Social LinksBlink-420
Awesome, very very much appreciated. Working great and very easy to follow tutorial! I have a question, might be stupid.. how do you create more than 1 of these custom perks? :)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 February 2014
Last active: 6 months ago
Posts
69
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
What is broken can be reforged
×
shinged's Groups
shinged's Contact & Social LinksTheShingedShingedvinny545Matarra_
copy the gsc, gsh, and csc. And you would have to rename a bunch of variables. Then put #using in your mapname GSC and CSC. Also add them too your zone file. Its gonna take a bit of scripting knowledge to figure out and i'd prefer people to try to learn it themselves. It makes it much easier to understand treyarchs coding down the line
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 February 2015
Last active: 9 months ago
Posts
63
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Blink-420's Groups
Blink-420's Contact & Social LinksBlink-420
copy the gsc, gsh, and csc. And you would have to rename a bunch of variables. Then put #using in your mapname GSC and CSC. Also add them too your zone file. Its gonna take a bit of scripting knowledge to figure out and i'd prefer people to try to learn it themselves. It makes it much easier to understand treyarchs coding down the line

Yeah I figured thats how it would have to be done but wasn't sure.. thanks :)

Double Post Merge: December 03, 2016, 04:18:28 am
Also, one thing I just noticed is that you can buy the perk over and over taking up another perk slot, and the shader will repeat itself. But once you buy the perk once the hintstring won't pop up again on the machine.
Last Edit: December 03, 2016, 04:18:28 am by Blink-420
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 24 June 2016
Last active: 5 years ago
Posts
5
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
morphiac's Groups
morphiac's Contact & Social Links
How do I select individual objects in a prefab?
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 1 November 2013
Last active: 4 years ago
Posts
61
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
hajhaka's Groups
hajhaka's Contact & Social Links
It just lets me spam buy it even if i already have it
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 18 February 2015
Last active: 9 months ago
Posts
63
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
×
Blink-420's Groups
Blink-420's Contact & Social LinksBlink-420
How do I select individual objects in a prefab?
You have to select the prefab - right click - prefab and stamp the prefab
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 3 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
It just lets me spam buy it even if i already have it

Same here. Everything else is great. And you can fill up your max perk slots with this.

broken avatar :(
×
broken avatar :(
Location: usU.S.A! U.S.A!
Date Registered: 10 June 2015
Last active: 4 years ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Abnormal202
Signature
-Abnormal202
×
qwerty195's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
I made a custom model for the perk machine and bottle weapon. How do I refer to them in the gsh though? I don't tink just putting the name in from APE works.
Last Edit: December 30, 2016, 04:44:51 pm by qwerty195
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 17 February 2014
Last active: 6 months ago
Posts
69
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
What is broken can be reforged
×
shinged's Groups
shinged's Contact & Social LinksTheShingedShingedvinny545Matarra_
I made a custom model for the perk machine and bottle weapon. How do I refer to them in the gsh though? I don't tink just putting the name in from APE works.
You also need to precache the model either in your zone file or by placing the model somewhere in your map. Usually you replace the machine model in radiant with yours
broken avatar :(
×
broken avatar :(
Location: usU.S.A! U.S.A!
Date Registered: 10 June 2015
Last active: 4 years ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Abnormal202
×
qwerty195's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Okay I have no idea why this has happened because it was working alright earlier, but now whenever I buy the custom perk, this happens:
  • There is no animation involving the drinking of the perk
  • The shader doesn't appear
  • The actual perk effect doesn't happen
  • Player can no longer sprint or knife
  • Seems to nullify the effects of Solo quick revive (maybe other perks; I haven't really tested)
This is obviously very broken and I don't know why. I checked through all the files a million times to see that I've followed the tutorial, but maybe I'm missing something? The last thing I was doing was trying to get the custom models for the perk machine, bottle and shader to work (which by the way, the perk machine model does work). Any ideas?
broken avatar :(
×
broken avatar :(
Location: fi
Date Registered: 25 June 2013
Last active: 7 months ago
Posts
3,997
Respect
1,025Add +1
Forum Rank
Eviscerator
Primary Group
UGX V.I.P.
My Groups
More
My Contact & Social Links
More
×
HitmanVere's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Okay I have no idea why this has happened because it was working alright earlier, but now whenever I buy the custom perk, this happens:
  • There is no animation involving the drinking of the perk
  • The shader doesn't appear
  • The actual perk effect doesn't happen
  • Player can no longer sprint or knife
  • Seems to nullify the effects of Solo quick revive (maybe other perks; I haven't really tested)
This is obviously very broken and I don't know why. I checked through all the files a million times to see that I've followed the tutorial, but maybe I'm missing something? The last thing I was doing was trying to get the custom models for the perk machine, bottle and shader to work (which by the way, the perk machine model does work). Any ideas?

Its not properly giving you perks weaponfile, thats why you cant sprint/knife and animation doesnt play
broken avatar :(
×
broken avatar :(
Location: usU.S.A! U.S.A!
Date Registered: 10 June 2015
Last active: 4 years ago
Posts
86
Respect
Forum Rank
Rotting Walker
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Abnormal202
×
qwerty195's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Quote
Its not properly giving you perks weaponfile, thats why you cant sprint/knife and animation doesnt play
I figured it out. Like you said I didn't do the perk bottle weapon correctly and that caused all the errors. I changed it back to the stock speed cola bottle and now it works fine.

 
Loading ...