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

Players deposit points to go towards opening a door?

broken avatar :(
Created 9 years ago
by AlecKeaneDUB
0 Members and 1 Guest are viewing this topic.
2,682 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 3 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
So I had a hard time making a subject that fit what I need but anyway...

What I have is a trigger with a very high price that will open a secret door which allows players to move on to the next area of the map. Now, for a while now, I've had this idea in my head of a bank-type thing that allows players to deposit their points to reach a set amount.
For example:

There is a door that costs 50,000 to open. All players can go up to the trigger and deposit their points, and each time a player does this it will add up the total points that have been deposited to go towards the 50,000 and will open the door.

I'm not sure if any of that made sense, as this is kinda hard to explain. Hopefully someone understand and can help me out since I hardly know anything about scripting and would not be able to do this on my own.
**CREDITS WILL BE GIVEN WHEN I RELEASE THE MAP**
Thanks for taking the time to read and any help will be very much appreciated.  :D
Marked as best answer by AlecKeaneDUB 9 years ago
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
I believe I know what you mean, and I think I know a good way to accomplish this. Give me a few minutes while I write it up and test it


in your mapname.gsc under maps\_zombiemode::main(); put
Code Snippet
Plaintext
thread bank_door();

at the bottom of the file put

Code Snippet
Plaintext
bank_door()
{
level.deposited_points = 0; //this will go up as the players deposit the points
level.amount_required = 5000; //this will be how much the players need to get, you can change this to your liking
level.deposit = 1000; //this is how much the players deposit at a time
bank_door = getent("bank_door","targetname"); //door in radiant
bank_door_trig = getent("bank_door_trig","targetname"); //trigger in radiant
bank_door_trig SetCursorHint("HINT_NOICON"); //Getting rid of hand symbol
bank_door_trig SetHintString("Press &&1 to deposit "+level.deposit+ " points"); //hint string that the players will see, feel free to change it
while(1) //while loop so players can activate it more than once
{
wait 0.1;
bank_door_trig waittill("trigger",player);
if(player.score >= level.deposit)
{
player maps\_zombiemode_score::minus_to_player_score( level.deposit );
level.deposited_points = level.deposited_points + level.deposit;
iprintlnbold("You have deposited " +level.deposited_points+ " out of " +level.amount_required);
if(level.deposited_points >= level.amount_required)
{
bank_door_trig delete();
bank_door connectpaths();
bank_door delete();
flag_set("enter_zone1"); //change this to whatever your zone is called
}
}
}
}

at the top you will see
level.deposited_points = 0; do not modify this, since they will have deposited 0 points at the start of the map anyway
level.amount_required = 5000; this will be how much they need to have the door open, so change that to whatever you want
level.deposit = 1000; //this is how much the players deposit at a time, in this case everytime they press F they will deposit 1000 till they hit the amount_required which in this case is 5000.
bank_door = getent, is the KVP in radiant. The first "" is the value in this case bank_door, the second "" is the key, most of the time its targetname. change the first value to whatever you want to be on the door. Make sure its a script_brushmodel in radiant
same thing with the trig, make a trigger_use in radiant with the kvp then change it in that line. Make sure to keep the parenthesis.
the rest should be relatively the same. if you change one of the values at the top, the script will automatically change it when its suppose to
at the bottom you will see
Code Snippet
Plaintext
flag_set("enter_zone1");
you change that to the name of your zone that you set up like a normal zone. This will allow the zombies to spawn once the zone is activated.
That should cover it, any questions feel free to ask
Last Edit: April 05, 2015, 02:54:50 am by thezombiekilla6
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 3 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 believe I know what you mean, and I think I know a good way to accomplish this. Give me a few minutes while I write it up and test it


in your mapname.gsc under maps\_zombiemode::main(); put
Code Snippet
Plaintext
thread bank_door();

at the bottom of the file put

Code Snippet
Plaintext
bank_door()
{
level.deposited_points = 0; //this will go up as the players deposit the points
level.amount_required = 5000; //this will be how much the players need to get, you can change this to your liking
level.deposit = 1000; //this is how much the players deposit at a time
bank_door = getent("bank_door","targetname"); //door in radiant
bank_door_trig = getent("bank_door_trig","targetname"); //trigger in radiant
bank_door_trig SetCursorHint("HINT_NOICON"); //Getting rid of hand symbol
bank_door_trig SetHintString("Press &&1 to deposit "+level.deposit+ " points"); //hint string that the players will see, feel free to change it
while(1) //while loop so players can activate it more than once
{
wait 0.1;
bank_door_trig waittill("trigger",player);
if(player.score >= level.deposit)
{
player maps\_zombiemode_score::minus_to_player_score( level.deposit );
level.deposited_points = level.deposited_points + level.deposit;
iprintlnbold("You have deposited " +level.deposited_points+ " out of " +level.amount_required);
if(level.deposited_points >= level.amount_required)
{
bank_door_trig delete();
bank_door connectpaths();
bank_door delete();
flag_set("enter_zone1"); //change this to whatever your zone is called
}
}
}
}

at the top you will see
level.deposited_points = 0; do not modify this, since they will have deposited 0 points at the start of the map anyway
level.amount_required = 5000; this will be how much they need to have the door open, so change that to whatever you want
level.deposit = 1000; //this is how much the players deposit at a time, in this case everytime they press F they will deposit 1000 till they hit the amount_required which in this case is 5000.
bank_door = getent, is the KVP in radiant. The first "" is the value in this case bank_door, the second "" is the key, most of the time its targetname. change the first value to whatever you want to be on the door. Make sure its a script_brushmodel in radiant
same thing with the trig, make a trigger_use in radiant with the kvp then change it in that line. Make sure to keep the parenthesis.
the rest should be relatively the same. if you change one of the values at the top, the script will automatically change it when its suppose to
at the bottom you will see
Code Snippet
Plaintext
flag_set("enter_zone1");
you change that to the name of your zone that you set up like a normal zone. This will allow the zombies to spawn once the zone is activated.
That should cover it, any questions feel free to ask
Thank you so so much! :D it all works perfectly other than one error I got about an assert error with my zone, but I think that's because I added the kvp script flag: zone_2 on my trigger. I guess that kvp isnt need or something but thanks so much for your help! :D +1
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Ya you dont need that kvp. The flag_set in the script is replacing the script_flag in radiant, so it is automatically activating that zone just like it would if you bought the door normally
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 3 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
Ya you dont need that kvp. The flag_set in the script is replacing the script_flag in radiant, so it is automatically activating that zone just like it would if you bought the door normally
One more question. Would it be difficult to give each player a random perk after they deposit all points? Kind of like a reward for completing a challenge
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
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 Links[email protected]HarryBo21HarryBo000
I threw this together out of treyarchs perks script

Code Snippet
Plaintext
give_perk_after_door()
{
vending_triggers = GetEntArray( "zombie_vending", "targetname" );

perk = vending_triggers[ randInt( vending_trigger.size ) ].script_string;

self SetPerk( perk ); // Gives perk
self thread perk_vo(perk); // Take this out if you dont want the player to quote
wait .1;
if( perk == "specialty_armorvest" ) // If its jugg
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
self.health = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
}
}

Code Snippet
Plaintext
players = get_players();
for ( i = 0; i < players.size; i++ )
{
    players[ i ] give_perk_after_door();
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 September 2014
Last active: 3 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 threw this together out of treyarchs perks script

Code Snippet
Plaintext
give_perk_after_door()
{
vending_triggers = GetEntArray( "zombie_vending", "targetname" );

perk = vending_triggers[ randInt( vending_trigger.size ) ].script_string;

self SetPerk( perk ); // Gives perk
self thread perk_vo(perk); // Take this out if you dont want the player to quote
wait .1;
if( perk == "specialty_armorvest" ) // If its jugg
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
self.health = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
}
}

Code Snippet
Plaintext
players = get_players();
for ( i = 0; i < players.size; i++ )
{
    players[ i ] give_perk_after_door();
}
Thank! :)
Now, sorry for being a newbie...but where do I put these scripts and where would I thread them? I'm not entirely sure where I would do that
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Thank! :)
Now, sorry for being a newbie...but where do I put these scripts and where would I thread them? I'm not entirely sure where I would do that

You would put this part after the door delete();
Code Snippet
Plaintext
players = get_players();
for ( i = 0; i < players.size; i++ )
{
    players[ i ] give_perk_after_door();
}

then the first code Harry gave you, would go at the very bottom of the script. Also if you are using bams black ops perks, you also need to copy the vending_triggers = getentarray line and paste it underneath the line and make it like
Code Snippet
Plaintext
vending_triggers_black_ops = GetEntArray("zombie_vending_black_ops","targetname");
  i believe his perks has a targetname of zombie_vending_black_ops, you can find out by highlighting the perk machine in radiant and look at what the targetname is called. Change the first "" to whatever that is
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
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 Links[email protected]HarryBo21HarryBo000
ah, to include bams within the function i wrote, you would need to also add exceptions for mule kick, deadshot and staminup, but i cant remember the DVARs youre meant to use for them at the moment?

Itll set the perks, but wont give you the 3rd gun, increased move speed or laser I think?

something like

Code Snippet
Plaintext
if( perk == "specialty_armorvest" ) // If its jugg
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
self.health = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
}
// I only added a exception for jugg, which is what is above, sets the players health etc
if( perk == "specialty_extraammo" ) // If its mulekick
{
self.inventorySize = 3; // This is mulekick
}
if( perk == "specialty_longersprint" ) // If its staminup
{
self setClientDvar( "DVARNAME", VALUE ); // you would put the Dvar here
}
if( perk == "specialty_bulletaccuracy" ) // If its deadshot
{
// you would put the Dvar here
}
Last Edit: April 10, 2015, 01:53:15 am by Harry Bo21
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Code Snippet
Plaintext
give_perk_after_door()
{
vending_triggers = GetEntArray( "zombie_vending", "targetname" );
        vending_triggers_black_ops = GetEntArray( "zombie_vending_black_ops", "targetname" ); //Remember to change this if targetname is different

perk = vending_triggers[ randInt( vending_triggers.size ) ].script_string;


self SetPerk( perk ); // Gives perk
self thread perk_vo(perk); // Take this out if you dont want the player to quote
wait .1;
if( perk == "specialty_armorvest" ) // If its jugg
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
self.health = level.zombie_vars["zombie_perk_juggernaut_health"]; // Sets up jugg health
}
if( perk == "specialty_longersprint" ) // If players has stamina up
{
self setClientDvar("player_sprintTime", 10);
}
         self.MuleCount = 1;
if( perk == "specialty_extraammo" ) // If players has mule kick
{
self.MuleCount = 3;
}
if( perk == "specialty_bulletaccuracy" ) // If players has deadshot
{
self setClientDvar( "cg_laserForceOn", 1 );
}
}

I believe that will work. Just updated harrys code to include the support for bams perks.

 
Loading ...