[BO1] Perk Script Overhaul

broken avatar :(
Created 438 days ago
by death_reaper0
0 Members and 1 Guest are viewing this topic.
926 views
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 36 days ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) [You are not allowed to view external links. Register or Login to see them]
discord server:
[You are not allowed to view external links. Register or Login to see them]
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
this is a modification to the base perks script that allows people to do multiple things easier, this includes:
-easy to add custom perks
-built in perk slots (per player and global)
-automatically detects any perks in the map ran (no need to add level variables)
-changes functions to allow perks to be customized with 1 line each (price, model, sounds, bottle weapon etc)


first of all, back up your original perks script (in case something goes wrong or you want to revert back)

go to bo1 raw/maps and find _zombiemode_perks.gsc and make a copy of it, rename to whatever you want (e.g. _zombiemode_perks_old.gsc)

now open the original and delete EVERYTHING and replace it with this:
[You are not allowed to view external links. Register or Login to see them]

save the file and that's pretty much it, now i'll go over how to use any additions (these are also listed in the file)

adding a perk WITH a specific specialty used by the game
around line 113 you should see some lines like this:
	level thread add_perk("vending_jugg", "specialty_armorvest", "jugger_light", "zombie_vending_jugg_on", 2500, undefined, &"ZOMBIE_PERK_JUGGERNAUT", "specialty_juggernaut_zombies", "zombie_perk_bottle_jugg", "mx_jugger_sting", undefined);
this is what adds juggernog specifically to the map/mod, there's one of these for each perk native to the game (including dlc)
to add a new perk your going to copy that line and place it under them. now we're going to change it, heres what each part of that line means (also listed in the file if you forget)

add_perk( vending_machine, specialty, light_fx, machine_change, cost, perk_name, perk_name_actual, shader, bottle_weapon, short_jingle, function);
vending_machine - targetname on machine
specialty - trigger specialty (script_noteworthy)
light_fx - name of fx used for machine (level._effect[ -> light_fx <- ]) e.g. "zombie_vending_jugg_on"
machine_change - name of model to change to when powers on (CAN leave undefined if none)
cost - cost of the perk (should be a whole number e.g. 2500 )
perk_name - string of perks name e.g. "Deadshot Daquari" (leave undefined if string is already made e.g. &"ZOMBIE_PERK_JUGGERNAUT")
perk_name_actual - use this if above is undefined ONLY! should be used if string exists e.g. "ZOMBIE_PERK_JUGGERNAUT"
shader - name of icon to show up in game e.g. "specialty_juggernaut_zombies"
bottle_weapon - name of bottle used when drinking e.g. "zombie_perk_bottle_jugg"
short_jingle - name of jingle to play upon purchase e.g. "mx_jugger_sting"
function - threaded fuction that will only play if perk exists e.g. ::my_fuction

adding a perk WITHOUT a specific specialty used by the game
this is pretty much the exact same as the above, except you WILL NOT need a specific specialty, i can be literally anything you can think of, like "specialty_a_custom_perk" only thing is each perk needs a unique one, can even be as simple as "specialty_perk1" and "specialty_perk2"
when adding, use
add_custom_perk( vending_machine, specialty, light_fx, machine_change, cost, perk_name, perk_name_actual, shader, bottle_weapon, short_jingle, function);
instead
when using this however you will need to use different ways of checking the perk, such as finding if the player has it, for giving it and removing it by special means. these are also listed in the file but here they are again
HasPerk( specialty_NAME )		-|-	will become	-|-		maps\_zombiemode_perks::HasCustomPerk( specialty_NAME )
UnsetPerk( specialty_NAME ) -|- will become -|- maps\_zombiemode_perks::UnsetCustomPerk( specialty_NAME )
SetPerk( specialty_NAME ) -|- will become -|- maps\_zombiemode_perks::SetCustomPerk( specialty_NAME )

some small extra stuff for this are as follows
extra fuctions for custom specialty perks
maps\_zombiemode_perks::IsCustomPerk( specialty_NAME ) - returns true if specialty is listed as a custom specialty
maps\_zombiemode_perks::CreateCustomPerk( specialty_NAME ) - shouldnt be needed, but this will create a custom specialty (add_custom_perk() will automaticly use this)
maps\_zombiemode_perks::HasThePerk( specialty_NAME ) - finds out if player has that perk as custom or normal (it will find out if its custom or normal for you)



now on to some small extras
changing perk slots
per player you will need to call
maps\_zombiemode_perks::give_perk_slot();

on a player, this gives 1 perk slot. if you want to add more just call it as many times as you wish
to change the base perk slot amount change
	level.perk_limit = 4;	//change to be perk limit for all players

to however many you want, should be at line 28


custom perk fuctions
this already includes 2 custom perks i have made, use them if you want but you may need to edit if you do. these will not come with any models or shaders, you will need to make your own
TUFBREW
this is pretty much the double damge doubletap 2.0 uses, if you would like this to be doubletap 2.0 instead you can change
tufbrew_func( mod, hit_location, hit_origin, player, amount )
{
if(player HasThePerk("specialty_bulletdamage") && ( mod == "MOD_RIFLE_BULLET" || mod == "MOD_PISTOL_BULLET" ) )
{
if(amount >= self.health)
player maps\_zombiemode_score::player_add_points( "death", mod, hit_location, self.isdog );
self DoDamage( amount, player.origin );
}
return false;
}

to
tufbrew_func( mod, hit_location, hit_origin, player, amount )
{
if(player HasThePerk("specialty_rof") && ( mod == "MOD_RIFLE_BULLET" || mod == "MOD_PISTOL_BULLET" ) )
{
if(amount >= self.health)
player maps\_zombiemode_score::player_add_points( "death", mod, hit_location, self.isdog );
self DoDamage( amount, player.origin );
}
return false;
}

this should be around line 1738

CANDOLIER
this perk lets each gun have 2 more clips of ammo
this one will require a LOT of editing. if you want to get it to work uncomment line 129, should look like
	level thread candolier();	//bandolier perk, 2 extra clips of ammo for each gun, add to weapon files of each gun

and now you will need to go to EVERY gun you are going to use and change the maxammo and startammo to be 2 clips higher than it should be, and how the script will work is WITHOUT the perk it detects if the player has any ammo from these 2 extra clips, and if so remove them, with it, it will ignore the extra ammo and let the player take it. its important that all guns do this cause it will not skip over the guns you dont use this on. this is why it is commented out by default


if used please credit, if you have any trouble reply here and i'll answer if i can
Last Edit: June 08, 2018, 10:55:21 pm by death_reaper0

 

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 Twitch
Loading ...