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

give perk through trigger

broken avatar :(
Created 8 years ago
by slit8539
0 Members and 1 Guest are viewing this topic.
6,782 views
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 29 August 2013
Last active: 3 years ago
Posts
4
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
slit8539's Groups
slit8539's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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).
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 27 December 2014
Last active: 4 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Tomzen's Groups
Tomzen's Contact & Social Links
I would like to know how to give one a perk with a usable trigger.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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.

   
}
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 19 June 2016
Last active: 6 years ago
Posts
9
Respect
Forum Rank
Legless Crawler
Primary Group
Member
Personal Quote
I.e.
×
avidpenguin's Groups
avidpenguin's Contact & Social Links
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");
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 October 2014
Last active: 5 years ago
Posts
15
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
GNT123's Groups
GNT123's Contact & Social Links
Were would I look to tell it to give me all perks?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
Were would I look to tell it to give me all perks?

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.
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 27 December 2014
Last active: 4 years ago
Posts
13
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
Tomzen's Groups
Tomzen's Contact & Social Links
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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 October 2014
Last active: 5 years ago
Posts
15
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
GNT123's Groups
GNT123's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 3 years ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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

broken avatar :(
×
broken avatar :(
Location: gbEurope
Date Registered: 20 September 2016
Last active: 2 years ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ulraz_viper's Groups
ulraz_viper's Contact & Social Links

 
Loading ...