Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: AlecKeaneDUB on April 05, 2015, 02:06:59 am
Title: Players deposit points to go towards opening a door?
Post by: AlecKeaneDUB on April 05, 2015, 02:06:59 am
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
Title: Re: Players deposit points to go towards opening a door?
Post by: Dust on April 05, 2015, 02:16:46 am
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 at the bottom of the file put
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 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
Title: Re: Players deposit points to go towards opening a door?
Post by: AlecKeaneDUB on April 05, 2015, 04:06:15 am
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 at the bottom of the file put
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 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
Title: Re: Players deposit points to go towards opening a door?
Post by: Dust on April 05, 2015, 06:17:02 am
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
Title: Re: Players deposit points to go towards opening a door?
Post by: AlecKeaneDUB on April 05, 2015, 07:08:22 am
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
Title: Re: Players deposit points to go towards opening a door?
Post by: Harry Bo21 on April 09, 2015, 08:05:14 am
I threw this together out of treyarchs perks script
Title: Re: Players deposit points to go towards opening a door?
Post by: AlecKeaneDUB on April 10, 2015, 01:31:23 am
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();
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
Title: Re: Players deposit points to go towards opening a door?
Post by: Harry Bo21 on April 10, 2015, 01:49:06 am
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
Title: Re: Players deposit points to go towards opening a door?
Post by: Dust on April 10, 2015, 01:57:13 am
I believe that will work. Just updated harrys code to include the support for bams perks.