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.
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
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! 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! +1
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
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
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
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(); }
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
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
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
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
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
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.