Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: slit8539 on October 07, 2016, 07:23:52 am
Title: give perk through trigger
Post by: slit8539 on October 07, 2016, 07:23:52 am
hey just a quick question , is it possible to give the players a free perk through a use trigger and if so how? thankyou for your time
Title: Re: give perk through trigger
Post by: reckfullies on October 08, 2016, 05:05:03 am
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).
Title: Re: give perk through trigger
Post by: Tomzen on October 08, 2016, 09:08:09 am
I would like to know how to give one a perk with a usable trigger.
Title: Re: give perk through trigger
Post by: reckfullies on October 08, 2016, 11:24:42 pm
Here is a function you could use to give a player a perk with a trigger:
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.
Title: Re: give perk through trigger
Post by: reckfullies on October 11, 2016, 01:59:05 am
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.
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:
Title: Re: give perk through trigger
Post by: GNT123 on October 11, 2016, 03:13:57 am
Were would I look to tell it to give me all perks?
Title: Re: give perk through trigger
Post by: reckfullies on October 11, 2016, 10:52:36 am
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.
Title: Re: give perk through trigger
Post by: reckfullies on October 11, 2016, 12:34:56 pm
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:
and for the perkname just look inside _zm_perks.gsh for all the names.(root/share/raw/scripts/zm/_zm_perks.gsh)
Title: Re: give perk through trigger
Post by: GNT123 on October 11, 2016, 11:53:06 pm
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:
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
Title: Re: give perk through trigger
Post by: reckfullies on October 12, 2016, 01:23:25 pm
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:
Title: Re: give perk through trigger
Post by: ulraz_viper on October 12, 2016, 05:12:06 pm