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

How to make a Custom Perk (For beginners) Basics

broken avatar :(
Created 4 years ago
by gympie6
0 Members and 1 Guest are viewing this topic.
5,003 views
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 weeks ago
Posts
561
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Introduction
Now I don't see a good tutorial about how to make a custom perk so I decide to create one myself.
This is the tutorial where I am going to explain you every step have to make a custom perk.



 

 
Before you start you have to choose a specialty from this list, remember that you shouldn't use one that's already being used in Call of Duty!
 
These are the perks cod waw use (Can't be used)
 
specialty_armorvest: Juggernaut
specialty_fastreload: Sleight of hand (faster reload) (Speed Cola)
specialty_rof: Double tap
specialty_quickrevive: Quick Revive
 
These are the perks that are used in Bo1 (Can't be used if you installed jei9363 perks)
 
specialty_bulletaccuracy: Steady Aim (DeadShot)
specialty_detectexplosive: Bomb Squad (PHD)
specialty_extraammo: Bandolier (Mule Kick)
specialty_longersprint: Sprint for longer (Staminup)
 
These are the perks that are used in Bo2 (Can't be used if you installed jei9363 perk/perks)
 
specialty_shades: Reduces the effects of flares/stun grenades (Elecric Cherry)
specialty_ordinance: Faster firing main tank gun (Vulture Aid)
 
These are free and can be used!
 
specialty_fireproof: Reduce the effects of the flamethrower
specialty_gpsjammer: Conceal yourself from radar
specialty_twoprimaries: Overkill
specialty_boost: Coaxial Machine Gun(driver gets a machine gun too)
specialty_bulletdamage: Stopping Power
specialty_bulletpenetration: Deep Impact
specialty_explosivedamage: Fireworks - Increase explosive damage
specialty_gas_mask: Reduces the effects of gas grenade attacks
specialty_grenadepulldeath: Martyrdom
specialty_holdbreath: Iron lungs
specialty_leadfoot: Increase tank's drive speed
specialty_ordinance: Faster firing main tank gun
specialty_pin_back: Toss back - resets timer on throwing back grenades
specialty_pistoldeath: Last stand
specialty_quieter: Dead Silence
specialty_specialgrenade: Specials Grenades x 3
specialty_water_cooled: Slows the overheating of tank guns
 
These are in Cod but doesn't work
 
X-specialty_doublegrenade: Primary grenade x2 (Doesn't work)
X-specialty_flak_jacket: Reduce damage taken from explosives (Doesn't work)
X-specialty_greased_bearings: Speed up the rate of rotation of tank turrets (Doesn't work)
X-specialty_reconnaissance: Reconnaissance (shows artillery and tanks on map) (Doesn't work)
X-specialty_weapon_betty: Bouncing Betty x2 (Doesn't work)
X-specialty_weapon_flamethrower: M2 Flamethrower (Doesn't work)
X-specialty_weapon_rpg: 2x Rocket Propelled Grenades (Doesn't work)
X-specialty_weapon_satchel: Satchel Charges x2 (Doesn't work)
 
List of Perks in Cod5
http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_Perks_Icons
 
specialty is like a key you can use to make a custom perk, without the key the perk can't be activated so be warned.
 
Now go to your rootfolder\raw\maps and copy paste _zombiemode_perks to your mod, if you already have this file you don't need to copy it.
There are people who doesn't understand what "rootfolder" is so this is what I mean:
c:\program Files (x86)\Steam\steamapps\common\Call of Duty World at War\raw\maps
 
When you done that just open the file with notepad++ or notepad and look top at the Init() method,
this is where all the items and shaders (perk) are going to be introduced!
 
if you scroll down you will see something like this:
level thread turn_jugger_on();
level thread turn_doubletap_on();
level thread turn_sleight_on();
level thread turn_revive_on();
level thread turn_PackAPunch_on();
*ADD YOUR OWN CUSTOM METHOD HERE*

It should look like this:
level thread turn_jugger_on();
level thread turn_doubletap_on();
level thread turn_sleight_on();
level thread turn_revive_on();
level thread turn_PackAPunch_on();
level thread turn_CUSTOM_PERK_NAME_HERE_on();

if you scroll down more you will see this (you can also search on: turn_doubletap_on())
 
turn_doubletap_on()
{
machine = getentarray("vending_doubletap", "targetname");
level waittill("doubletap_on");

for( i = 0; i < machine.size; i++ )
{
machine[i] setmodel("zombie_vending_doubletap_on");
machine[i] vibrate((0,-100,0), 0.3, 0.4, 3);
machine[i] playsound("perks_power_on");
machine[i] thread perk_fx( "doubletap_light" );
}
level notify( "specialty_rof_power_on" );
}

Then under that method you make something like this:
 
turn_CUSTOM_PERK_NAME_HERE_on()
{
machine = getentarray("vending_CUSTOM_PERK_NAME", "targetname");
flag_wait("electricity_on");

for( i = 0; i < machine.size; i++ )
{
machine[i] vibrate((0,-100,0), 0.3, 0.4, 3);
machine[i] playsound("perks_power_on");
}
level notify( "specialty_YOUR_CHOSEN_SPECIALTY_HERE_power_on" );
}

if you look at the notify in that method you see it needs a key, This is how it should look like:
level notify( "specialty_gas_mask_power_on" );

This is what I did for example:
turn_ragingdevil_on()
{
machine = getentarray("vending_ragingdevil", "targetname");
flag_wait("electricity_on");

for( i = 0; i < machine.size; i++ )
{
machine[i] vibrate((0,-100,0), 0.3, 0.4, 3);
machine[i] playsound("perks_power_on");
}
level notify( "specialty_fireproof_power_on" );
}

scroll down until you find this: vending_trigger_think() (you can also search for it)
If you look at it you will notice this:
switch( perk )
{
        case "specialty_armorvest":
cost = 2500;
break;

case "specialty_quickrevive":
players = get_players();
if(players.size == 1)
{
cost = 500;
self.reviveUsesLeft--;
}
else cost = 1500;
break;

case "specialty_fastreload":
cost = 3000;
break;

case "specialty_rof":
cost = 2000;
break;

                // Example, add your own custom perk price here!
        // Your key should be in here between the ""
case "specialty_fireproof":
cost = 3000;
break;
}

Next you search for vending_set_hintstring( perk )
In that function you see a lot of cases there,
add a custom one like this:
 
vending_set_hintstring( perk )
{
switch( perk )
{

case "specialty_armorvest":
self SetHintString( "Press & hold &&1 to buy Jugger-Nog [Cost: 2500]" );
break;

case "specialty_quickrevive":
flag_wait( "all_players_connected" );
players = get_players();
if(players.size == 1)
{
self SetHintString( "Press & hold &&1 to buy Revive [Cost: 500]" );
self.reviveUsesLeft = 3;
}
else self SetHintString( "Press & hold &&1 to buy Revive [Cost: 1500]" );
break;

case "specialty_fastreload":
self SetHintString( "Press & hold &&1 to buy Speed Cola [Cost: 3000]" );
break;

case "specialty_rof":
self SetHintString( "Press & hold &&1 to buy Double Tap Root Beer [Cost: 2000]" );
break;

case "specialty_fireproof": // Custom Key here between the ""
self SetHintString( "Press & hold &&1 to buy Raging Devil's Rum [Cost: 3000] ^1(Zombies can go raging!)" );
break;

default:
self SetHintString( perk + " Cost: " + level.zombie_vars["zombie_perk_cost"] );
break;

}
}

Scroll down until you find perk_think( perk, number )
 
There you see this: self UnsetPerk( perk );
under that add this: self UnsetPerk( "YOUR KEY HERE!" );
 
perk_hud_create( perk ) I am going to tell about this later but I think you understand what's going on here.
 
find this: perk_give_bottle_begin( perk )
add a new one in the method for example:
 
case "specialty_fireproof":
weapon = "zombie_perk_bottle_jugg"; // This is the bottle you will get if you drink the custom perk!
break;

Same thing goes for perk_give_bottle_end( gun, perk )
 
You are done! Now you have a custom perk!
Sorry for my bad english, I am going to update this tutorial later but this is basicly how to make a custom perk
 
If you think, meh this is way too difficult for you can also look at these links:
 
add guardian angel ale to your map (custom perk from cxca)
https://zombiemodding.com/index.php?topic=18820.0
 
ZOMB1E-KLLR

 
Credits to Death_reaper0 and MakeCents for their knowledge and explanation. :nyan:
Last Edit: January 07, 2022, 11:08:57 pm by gympie6
:awesome:1^-^1
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 20 April 2022
Last active: 10 days ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ghetto_wizzz's Groups
ghetto_wizzz's Contact & Social Links
hi again! i followed along this tutorial, and it's very insightful! but i can't seem to figure out the correct KVP's for this too work xD
I tried using the key as a targetname, I tried just the specialty name itself,("specialty_longersprint") and I also tried using the name of my perk as well.
I have already the KVP script_noteworthy then the specialty as the value, but I still just get the hand symbol and no prompt to purchase it.  I also don't have any extra perks downloaded, the ones i made and the original 4 being the only ones. If you know the correct KVP's i should be using please let me know, thanks in advanced! :)
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 weeks ago
Posts
561
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
hi again! i followed along this tutorial, and it's very insightful! but i can't seem to figure out the correct KVP's for this too work xD
I tried using the key as a targetname, I tried just the specialty name itself,("specialty_longersprint") and I also tried using the name of my perk as well.
I have already the KVP script_noteworthy then the specialty as the value, but I still just get the hand symbol and no prompt to purchase it.  I also don't have any extra perks downloaded, the ones i made and the original 4 being the only ones. If you know the correct KVP's i should be using please let me know, thanks in advanced! :)
It's a long time I have written this tutorial so I had to refresh my mind.
This are the kvp's you need for example:
 
 
 
Then in `vending_trigger_think()` in '_zombiemode_perks' you have to check in the switches if `speciality_longersprint` exists in there:
 

 
I think you missed a step somewhere or forgot to compile the map?
I hope this can help.
:thumbsup-smiley:1
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 20 April 2022
Last active: 10 days ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ghetto_wizzz's Groups
ghetto_wizzz's Contact & Social Links
+1 This is confirmed the correct KVP's and fixed the hand issue!
Problem now though is I have it all set up match perfect too how you have in your tutorial, ive also followed along ZombieKillers Tutorial, (To make sure I didn't miss something small or stupid) But nothing. I have the what i believe is the correct Text price setup as shown in the tutorial as well?
case "specialty_rof":
            cost = 2000;
            break;

        case "specialty_bulletaccuracy":
            cost = 2500;
            break;   

        case "specialty_longersprint":
            cost = 2000;
            break;   

        case "specialty_fireproof":
            cost = 1500;
            break;   

        case "specialty_detectexplosive":
            cost = 2500;
            break;   
        }
&
    case "specialty_rof":
        self SetHintString( &"ZOMBIE_PERK_DOUBLETAP" );
        break;

    case "specialty_bulletaccuracy":
        self SetHintString( "Press & Hold &&1 to buy Watcher Cola [Cost: 2500]" );
        break;

    case "specialty_longersprint":
        self SetHintString( "Press & Hold &&1 to buy Benadryl [Cost: 2000]" );
        break;

    case "specialty_fireproof":
        self SetHintString( "Press & Hold &&1 to buy Holywater [Cost: 1500]" );
        break;

    case "specialty_detectexplosive":
        self SetHintString( "Press & Hold &&1 to buy Genocide Zero [Cost: 2500]" );
        break;

    default:
        self SetHintString( perk + " Cost: " + level.zombie_vars["zombie_perk_cost"] );
        break;

    }
}

I also have them on the correct thread at the top of zombiemode_perks along with where we setup the targetname and key I assume.
 
Now the problem is I get in game "Power needs to be on", Like anyother.(Which is clear sign of it working at least) but when I use the switch for power, They still say the same thing. And Also if I gather enough points too purchase one of the perks, It just prompts me with the same vocal line, telling me i don't have enough points. I also tried under the assumption that i would have too add "zombie_vending_"MY PERK NAME", after it, Just under currosity, i even tried using the specialty as well. but then it went back too just being a Hand symbol again. Not sure what I could have missed, maybe something not in the tutorial, or maybe just simple knowledge that most beginner scripters would know, that i do not. Unsure at this point, Sorry to bother you with this all, im sure it is something on my side I missed or somewhere I didn't include the perks or something. Thanks for all your help again gympie, you have an insane amount of talent man!:)
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 weeks ago
Posts
561
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
 
+1 This is confirmed the correct KVP's and fixed the hand issue!
Problem now though is I have it all set up match perfect too how you have in your tutorial, ive also followed along ZombieKillers Tutorial, (To make sure I didn't miss something small or stupid) But nothing. I have the what i believe is the correct Text price setup as shown in the tutorial as well?
case "specialty_rof":
            cost = 2000;
            break;

        case "specialty_bulletaccuracy":
            cost = 2500;
            break;   

        case "specialty_longersprint":
            cost = 2000;
            break;   

        case "specialty_fireproof":
            cost = 1500;
            break;   

        case "specialty_detectexplosive":
            cost = 2500;
            break;   
        }
&
case "specialty_rof":
        self SetHintString( &"ZOMBIE_PERK_DOUBLETAP" );
        break;

    case "specialty_bulletaccuracy":
        self SetHintString( "Press & Hold &&1 to buy Watcher Cola [Cost: 2500]" );
        break;

    case "specialty_longersprint":
        self SetHintString( "Press & Hold &&1 to buy Benadryl [Cost: 2000]" );
        break;

    case "specialty_fireproof":
        self SetHintString( "Press & Hold &&1 to buy Holywater [Cost: 1500]" );
        break;

    case "specialty_detectexplosive":
        self SetHintString( "Press & Hold &&1 to buy Genocide Zero [Cost: 2500]" );
        break;

    default:
        self SetHintString( perk + " Cost: " + level.zombie_vars["zombie_perk_cost"] );
        break;

    }
}

I also have them on the correct thread at the top of zombiemode_perks along with where we setup the targetname and key I assume.
 
Now the problem is I get in game "Power needs to be on", Like anyother.(Which is clear sign of it working at least) but when I use the switch for power, They still say the same thing. And Also if I gather enough points too purchase one of the perks, It just prompts me with the same vocal line, telling me i don't have enough points. I also tried under the assumption that i would have too add "zombie_vending_"MY PERK NAME", after it, Just under currosity, i even tried using the specialty as well. but then it went back too just being a Hand symbol again. Not sure what I could have missed, maybe something not in the tutorial, or maybe just simple knowledge that most beginner scripters would know, that i do not. Unsure at this point, Sorry to bother you with this all, im sure it is something on my side I missed or somewhere I didn't include the perks or something. Thanks for all your help again gympie, you have an insane amount of talent man!:)
 
I think it's best first to follow Zombie Killer's perk tutorial. From him I learned all of this in the past.
When you understand how he made it work you can continue creating your own perks.
 
It could be that you have hit the hintstring limit. This is how to solve it with a workaround but I am not really a fan of it:
https://confluence.ugx-mods.com/display/UGXMODS/Hintstrings+not+updating
 
There is not much more I can say that can help, hitting limits in Call of Duty: World at War is a very difficult proccess that everyone goes through.
Even I hit them sometimes and be confused how to solve them. :P
<31
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 20 April 2022
Last active: 10 days ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ghetto_wizzz's Groups
ghetto_wizzz's Contact & Social Links
Yeah, its just funny how he messed up like twice and still managed to get it too work lol. I also don't quite understand how he got this variable "zombie_vending_black_ops" since he doesn't really show any where that would have been written down as a vari.. But anyways, I tried getting rid of some custom prices, but no luck, so i'll either figure it out myself somehow or ill just scrap that and keep the original 4 only :) Thanks again gympie sorry for being so annoying here!
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 2 weeks ago
Posts
561
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Yeah, its just funny how he messed up like twice and still managed to get it too work lol. I also don't quite understand how he got this variable "zombie_vending_black_ops" since he doesn't really show any where that would have been written down as a vari.. But anyways, I tried getting rid of some custom prices, but no luck, so i'll either figure it out myself somehow or ill just scrap that and keep the original 4 only :) Thanks again gympie sorry for being so annoying here!
He is not very clear in the tutorial, it also took me a few minutes to figure out what happend.
If you like to install Black Ops perks you can look here: https://www.ugx-mods.com/forum/mods/7/black-ops-perks/18611/
 
I also made a video tutorial about how to install them.
 
"Thanks again gympie sorry for being so annoying here!"
It's fine, you don't ask questions that are to hard for me to think about what the solution is.
Last Edit: May 16, 2022, 10:06:54 pm by gympie6
:coolsmiley:1
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 20 April 2022
Last active: 10 days ago
Posts
18
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ghetto_wizzz's Groups
ghetto_wizzz's Contact & Social Links
Awesome man, your bo perks worked perfectly since I already had my patch and localized_"mapname" in use! just manually installed and am now recieving no problems ;)
Thanks again for all your help gympie, expect too see your name all over my release once it's up haha!
:man-bowing:1

 
Loading ...