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

[Tutorial] Buyable Perk Slots

HOT
broken avatar :(
Created 10 years ago
by AlecKeaneDUB
0 Members and 1 Guest are viewing this topic.
12,381 views
broken avatar :(
×
broken avatar :(
True Blue Elite
Location: auAustralia
Date Registered: 8 February 2015
Last active: 2 years ago
Posts
688
Respect
Forum Rank
Zombie Enslaver
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Still Kickin'
Signature


×
Andy Whelan's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Andy Whelan's Contact & Social LinksAndyWhelanAndyWhelanAndyWhelan01
These errors you guys are getting are odd to me. It may he because I added in Bam's perks manually, as I dont use script placer Z. That could be the problem...something with the script placer, because the script and everything I posted works 110% perfect for me  ???

Well this sucks :( I guess I will put a perk limit of 5 perks on if I can find where to place it.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 5 years ago
Posts
6,877
Respect
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
These errors you guys are getting are odd to me. It may he because I added in Bam's perks manually, as I dont use script placer Z. That could be the problem...something with the script placer, because the script and everything I posted works 110% perfect for me  ???
i dont see how it "can" when you havent edited the trigger to which this applies?

The limit you are making is not even being looked at by the perks script when buying a perk?

Code Snippet
Plaintext
vending_trigger_think()
{

//self thread turn_cola_off();
perk = self.script_noteworthy;


self SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );

self SetCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookAt();

notify_name = perk + "_power_on";
level waittill( notify_name );

perk_hum = spawn("script_origin", self.origin);
perk_hum playloopsound("perks_machine_loop");

self thread check_player_has_perk(perk);

self vending_set_hintstring(perk);

for( ;; )
{
self waittill( "trigger", player );
index = maps\_zombiemode_weapons::get_player_index(player);

cost = level.zombie_vars["zombie_perk_cost"];
switch( perk )
{
case "specialty_armorvest":
cost = 2500;
break;

case "specialty_quickrevive":
cost = 1500;
break;

case "specialty_fastreload":
cost = 3000;
break;

case "specialty_rof":
cost = 2000;
break;

}

if (player maps\_laststand::player_is_in_laststand() )
{
continue;
}

if(player in_revive_trigger())
{
continue;
}

if( player isThrowingGrenade() )
{
wait( 0.1 );
continue;
}

if( player isSwitchingWeapons() )
{
wait(0.1);
continue;
}

if ( player HasPerk( perk ) )
{
cheat = false;

/#
if ( GetDVarInt( "zombie_cheat" ) >= 5 )
{
cheat = true;
}
#/

if ( cheat != true )
{
//player iprintln( "Already using Perk: " + perk );
self playsound("deny");
player thread play_no_money_perk_dialog();


continue;
}
}

if ( player.score < cost )
{
//player iprintln( "Not enough points to buy Perk: " + perk );
self playsound("deny");
player thread play_no_money_perk_dialog();
continue;
}

sound = "bottle_dispense3d";
player achievement_notify( "perk_used" );
playsoundatposition(sound, self.origin);
player maps\_zombiemode_score::minus_to_player_score( cost );
///bottle_dispense
switch( perk )
{
case "specialty_armorvest":
sound = "mx_jugger_sting";
break;

case "specialty_quickrevive":
sound = "mx_revive_sting";
break;

case "specialty_fastreload":
sound = "mx_speed_sting";
break;

case "specialty_rof":
sound = "mx_doubletap_sting";
break;

default:
sound = "mx_jugger_sting";
break;
}

self thread play_vendor_stings(sound);

// self waittill("sound_done");


// do the drink animation
gun = player perk_give_bottle_begin( perk );
player.is_drinking = 1;
player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
{
continue;
}

player SetPerk( perk );
player thread perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);
//earthquake (0.4, 0.2, self.origin, 100);
if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
//player.health = 160;
}


player perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

//player iprintln( "Bought Perk: " + perk );
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, cost, perk, self.origin );

player thread perk_think( perk );

}
}

this is the function from zombiemode_perks, as you havent touched it, your script is completely ignored when buying a perk, you need to add a check in there
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
i dont see how it "can" when you havent edited the trigger to which this applies?

The limit you are making is not even being looked at by the perks script when buying a perk?

Code Snippet
Plaintext
vending_trigger_think()
{

//self thread turn_cola_off();
perk = self.script_noteworthy;


self SetHintString( &"ZOMBIE_FLAMES_UNAVAILABLE" );

self SetCursorHint( "HINT_NOICON" );
self UseTriggerRequireLookAt();

notify_name = perk + "_power_on";
level waittill( notify_name );

perk_hum = spawn("script_origin", self.origin);
perk_hum playloopsound("perks_machine_loop");

self thread check_player_has_perk(perk);

self vending_set_hintstring(perk);

for( ;; )
{
self waittill( "trigger", player );
index = maps\_zombiemode_weapons::get_player_index(player);

cost = level.zombie_vars["zombie_perk_cost"];
switch( perk )
{
case "specialty_armorvest":
cost = 2500;
break;

case "specialty_quickrevive":
cost = 1500;
break;

case "specialty_fastreload":
cost = 3000;
break;

case "specialty_rof":
cost = 2000;
break;

}

if (player maps\_laststand::player_is_in_laststand() )
{
continue;
}

if(player in_revive_trigger())
{
continue;
}

if( player isThrowingGrenade() )
{
wait( 0.1 );
continue;
}

if( player isSwitchingWeapons() )
{
wait(0.1);
continue;
}

if ( player HasPerk( perk ) )
{
cheat = false;

/#
if ( GetDVarInt( "zombie_cheat" ) >= 5 )
{
cheat = true;
}
#/

if ( cheat != true )
{
//player iprintln( "Already using Perk: " + perk );
self playsound("deny");
player thread play_no_money_perk_dialog();


continue;
}
}

if ( player.score < cost )
{
//player iprintln( "Not enough points to buy Perk: " + perk );
self playsound("deny");
player thread play_no_money_perk_dialog();
continue;
}

sound = "bottle_dispense3d";
player achievement_notify( "perk_used" );
playsoundatposition(sound, self.origin);
player maps\_zombiemode_score::minus_to_player_score( cost );
///bottle_dispense
switch( perk )
{
case "specialty_armorvest":
sound = "mx_jugger_sting";
break;

case "specialty_quickrevive":
sound = "mx_revive_sting";
break;

case "specialty_fastreload":
sound = "mx_speed_sting";
break;

case "specialty_rof":
sound = "mx_doubletap_sting";
break;

default:
sound = "mx_jugger_sting";
break;
}

self thread play_vendor_stings(sound);

// self waittill("sound_done");


// do the drink animation
gun = player perk_give_bottle_begin( perk );
player.is_drinking = 1;
player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
{
continue;
}

player SetPerk( perk );
player thread perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);
//earthquake (0.4, 0.2, self.origin, 100);
if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
//player.health = 160;
}


player perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

//player iprintln( "Bought Perk: " + perk );
bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, cost, perk, self.origin );

player thread perk_think( perk );

}
}

this is the function from zombiemode_perks, as you havent touched it, your script is completely ignored when buying a perk, you need to add a check in there
since he said he installed bams perks and bams perks has a perk limit hes just changing that limit so he wont have to edit the vending_trigger_think() function since bams limit just makes the perk machines trigger invisible if you have more perks then the limit that is set in
Code Snippet
Plaintext
level.perk_limit = 4;
by just incrementing it by one when the player presses 'USE' in the trigger
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 5 years ago
Posts
6,877
Respect
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
yes but bams script checks against "level"

his checks against "player"
Last Edit: May 14, 2015, 07:21:17 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 9 months ago
Posts
191
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Let's all just light up a blunt, and make stuff.
×
AlecKeaneDUB's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AlecKeaneDUB's Contact & Social LinksAlecKeaneDUBaleckeanedubAlecKeaneDUB
yes but bams script checks against "level"

his checks against "player"
where in my scriot do you see it checking against "player"? Mine checks for level and yes...it does work perfectly for me. -_-
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 5 years ago
Posts
6,877
Respect
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
i just assumed based on the fact otherwise, one player buying it will reward all players, just looked through the script and see that is the case however

I got confused because someone else posted this part

Quote
flag_wait( "all_players_connected" );
players = get_players();
for( i = 0; i < players.size; i++ )
{
   players.perk_limit = perk_limit;
}

Which leads me to believe the people having trouble are actually having trouble with bams side of things, but if this script will literally only work with bams perks set up, you should really put "install bams perks" as step 1 ;)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 9 months ago
Posts
191
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
Let's all just light up a blunt, and make stuff.
×
AlecKeaneDUB's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AlecKeaneDUB's Contact & Social LinksAlecKeaneDUBaleckeanedubAlecKeaneDUB
i just assumed based on the fact otherwise, one player buying it will reward all players, just looked through the script and see that is the case however

I got confused because someone else posted this part

Which leads me to believe the people having trouble are actually having trouble with bams side of things, but if this script will literally only work with bams perks set up, you should really put "install bams perks" as step 1 ;)
Ahh okay I understand. ;) Perhaps I'll re-write this with the necessary checks and update it when everything gets sorted out. Not sure what the deal is with Bam's perks though
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 5 years ago
Posts
6,877
Respect
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
It might be an idea, to have one of the people whos having trouble, send you their perk script, and anything else related you you can take a look :)
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 3 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Sorry to post dig here but I'd like to get this script working but with harrybo21's perks.

Any chance I could get some help here?
broken avatar :(
×
broken avatar :(
Location: usIndiana
Date Registered: 13 September 2013
Last active: 3 years ago
Posts
66
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
krimzon's Groups
krimzon's Contact & Social Links
Will test when I get home. Thank you sir.

Double Post Merge: April 19, 2016, 05:24:03 am
Also how easy would it be to convert this to a dmg trigger for ee style extra slots, something you have to find, no cost.
Last Edit: April 19, 2016, 05:24:03 am by krimzon

 
Loading ...