Go into the _zm_perks file and search for how perks are given to players. Once you find it, make a script that gives the perk to the player once they activate your trigger(I'm assuming you know how to get a trigger from a script already).
I would like to know how to give one a perk with a usable trigger.
Here is a function you could use to give a player a perk with a trigger:
Code Snippet
Plaintext
#using scripts\zm\_zm_perks;
function init() { trig = GetEnt("perk_trigger", targetname); // Gets the entity with the targetname "perk_trigger". trig SetHintString("Press &&1 for perk."); // Changes the string that shows when looking at the trigger. trig SetCursorHint("HINT_NOICON"); // Changes the icon that shows when looking at the trigger.
trig waittill("trigger", player); // Waits until the player triggers the trigger and gets the player that does it.
player zm_perks::give_perk(perkname); // Gives the player a perk - I don't know all the names of the perks for this function so you would need to find the one you want.
// You could add a while loop if you need one for something you are doing.
Here is a function you could use to give a player a perk with a trigger:
Code Snippet
Plaintext
#using scripts\zm\_zm_perks;
function init() { trig = GetEnt("perk_trigger", targetname); // Gets the entity with the targetname "perk_trigger". trig SetHintString("Press &&1 for perk."); // Changes the string that shows when looking at the trigger. trig SetCursorHint("HINT_NOICON"); // Changes the icon that shows when looking at the trigger.
trig waittill("trigger", player); // Waits until the player triggers the trigger and gets the player that does it.
player zm_perks::give_perk(perkname); // Gives the player a perk - I don't know all the names of the perks for this function so you would need to find the one you want.
// You could add a while loop if you need one for something you are doing.
}
I've tried this with both electric cherry and juggernog, but it didn't work. However, I looked in the zm_perks script and found the give_random_perk() function, which works perfectly. Am I missing something here?
I used the following code to give electric cherry, but it didn't work. It took up a perk slot but didn't give me the icon nor effect.
Code Snippet
Plaintext
player zm_perks::give_perk("electric_cherry_perk");
I've tried this with both electric cherry and juggernog, but it didn't work. However, I looked in the zm_perks script and found the give_random_perk() function, which works perfectly. Am I missing something here?
I used the following code to give electric cherry, but it didn't work. It took up a perk slot but didn't give me the icon nor effect.
Code Snippet
Plaintext
player zm_perks::give_perk("electric_cherry_perk");
Not sure if this is problem but, while looking in _zm_perks.gsc I found that give_perk has 2 parameters.
give_perk(perk, bought).
An example of how I think this would be used is this:
Code Snippet
Plaintext
player zm_perks::give_perk("perkname", true/false); // True/false would indicate if it is a bought perk or not, it seems that having this set to true will mean that it increments some sort of challenge stat called "SURVIVALIST_BUY_PERK".
Last Edit: October 11, 2016, 02:00:45 am by reckfullies
Just go into root/scripts/zm/_zm_perks.gsc and look through the functions until you find what you need.
If there isn't a way to give all perks just give one at a time.
I'm pretty sure it's possible, if you look at Madgaz Gaming's FABRIK DER UNTOTEN map he has a buyable Perk-a-Lot machine which gives you all the perks when you buy it.
I'm pretty sure it's possible, if you look at Madgaz Gaming's FABRIK DER UNTOTEN map he has a buyable Perk-a-Lot machine which gives you all the perks when you buy it.
What I mean't was if it wasn't possible with a single function just do the give_perk function for every perk at once.
Ill look right now and see if they made a function for giving them all at once.
EDIT: It doesn't look like tryarch made a function for giving all perks.
You can just give the player every perk at the same time and it will essentially be the exact same.
If you are still having trouble with giving perks, make sure this is included in the script:
Code Snippet
Plaintext
#insert scripts\zm\_zm_perks.gsh;
and for the perkname just look inside _zm_perks.gsh for all the names.(root/share/raw/scripts/zm/_zm_perks.gsh)
Last Edit: October 11, 2016, 01:34:33 pm by reckfullies
What I mean't was if it wasn't possible with a single function just do the give_perk function for every perk at once.
Ill look right now and see if they made a function for giving them all at once.
EDIT: It doesn't look like tryarch made a function for giving all perks.
You can just give the player every perk at the same time and it will essentially be the exact same.
If you are still having trouble with giving perks, make sure this is included in the script:
Code Snippet
Plaintext
#insert scripts\zm\_zm_perks.gsh;
and for the perkname just look inside _zm_perks.gsh for all the names.(root/share/raw/scripts/zm/_zm_perks.gsh)
player zm_perks::give_perk("specialty_electriccherry", true);
^(what my thing looks like) Idk I cant get it to work I have tried true, and false different perks I just don't know what I'm doing wrong Double Post Merge: October 12, 2016, 03:32:15 am nvm I saw that one guy just post it on the shootable trigger topic
Last Edit: October 12, 2016, 03:32:15 am by GNT123
player zm_perks::give_perk("specialty_electriccherry", true);
^(what my thing looks like) Idk I cant get it to work I have tried true, and false different perks I just don't know what I'm doing wrong Double Post Merge: October 12, 2016, 03:32:15 am nvm I saw that one guy just post it on the shootable trigger topic
You put in the wrong name from the list, here is a simple list for people who don't want to look in the .gsh:
Code Snippet
Plaintext
PERK_JUGGERNOG - Juggernog PERK_QUICK_REVIVE - Quick Revive PERK_SLEIGHT_OF_HAND - Speed Cola PERK_DOUBLETAP2 - Doubletap PERK_STAMINUP - Staminup PERK_PHDFLOPPER - PHD Flopper - DO NOT USE(Unless you have a custom script since it isn't actually in the game)! PERK_DEAD_SHOT - Dead Shot PERK_ADDITIONAL_PRIMARY_WEAPON - Mule Kick PERK_ELECTRIC_CHERRY - Electric Cherry PERK_TOMBSTONE - Tombstone - DO NOT USE(Unless you have a custom script since it isn't actually in the game)! PERK_WHOSWHO - Whos Who - DO NOT USE(Unless you have a custom script since it isn't actually in the game)! PERK_VULTUREAID - Vulture Aid - DO NOT USE(Unless you have a custom script since it isn't actually in the game)! PERK_WIDOWS_WINE - Widows Wine