Modme Forums

[BO3] IW Style Bank System

Game Asset Reversing | Releases


FrostIceforge:

Thread By: Frost Iceforge
Customizable bank system for BO3 Zombies maps inspired by the bank from Zombies in Spaceland.

This adds a pool of money shared among all players accessible using 2 trigger_use brushes with targetnames "iw_bank_deposit" and "iw_bank_withdrawal."

I added option to require a fee to withdraw from the bank like in Black Ops II. Fee, initial balance, and interval of deposit/withdrawal all editable.

INSTRUCTIONS:
1. If you don't have any other scripts to give or take points in your map's GSC, add this to the top of zm_MAPNAME.gsc with the other #using things

#using scripts\zm\_zm_score;
2. Add the following to your function main() in zm_MAPNAME.gsc
//Frosty's IW style bank system
level thread iw_bank_system_init();
3. Add the following BELOW your function_main() in zm_MAPNAME.gsc
//Frosty's IW style bank system
function iw_bank_system_init()
{
	//START OF EDITABLE VARIABLES
	level.payments_in_bank = 0; //Change to have bank start with money. Amount is this times interval.
	level.payment_interval = 1000; //Change to have bank deposit or withdrawal in different intervals. IW and BO2 used 1000.
	level.withdrawal_fee = 0; //Fee for each withdrawal. Set to 100 for BO2 style, and 0 for IW style.
	//END OF EDITABLE VARIABLES
	deposit = GetEnt( "iw_bank_deposit", "targetname" );
	withdrawal = GetEnt( "iw_bank_withdrawal", "targetname" );
	deposit SetCursorHint( "HINT_NOICON" );
	deposit SetHintString("Hold ^3[{+activate}]^7 to deposit $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
	withdrawal SetCursorHint( "HINT_NOICON" );
	if(level.withdrawal_fee > 0)
	{
		withdrawal SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Fee: $" + level.withdrawal_fee + "] [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
	}
	else
	{
		withdrawal SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
	}
	deposit thread iw_bank_deposit_logic(withdrawal);
	withdrawal thread iw_bank_withdrawal_logic(deposit);
}

function iw_bank_deposit_logic(withdrawal)
{
	while(1)
	{
		self waittill("trigger", player);
		if(player.score >= level.payment_interval)
		{
			level.payments_in_bank++;

			player zm_score::minus_to_player_score(level.payment_interval);

			self SetHintString("Hold ^3[{+activate}]^7 to deposit $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");

			if(level.withdrawal_fee > 0)
			{
				withdrawal SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Fee: $" + level.withdrawal_fee + "] [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
			}
			else
			{
				withdrawal SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
			}
		}
	}
}

function iw_bank_withdrawal_logic(deposit)
{
	while(1)
	{
		self waittill("trigger", player);
		if(level.payments_in_bank >= 1)
		{
			level.payments_in_bank--;

			player zm_score::add_to_player_score(level.payment_interval);

			deposit SetHintString("Hold ^3[{+activate}]^7 to deposit $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");

			if(level.withdrawal_fee > 0)
			{
				player zm_score::minus_to_player_score(level.withdrawal_fee);

				self SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Fee: $" + level.withdrawal_fee + "] [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
			}
			else
			{
				self SetHintString("Hold ^3[{+activate}]^7 to withdraw $" + level.payment_interval + " [Balance: $" + (level.payments_in_bank * level.payment_interval) + "]");
			}
			
		}
	}
}
4. Add 2 trigger_use brushes with targetnames "iw_bank_deposit" and "iw_bank_withdrawal" to your Radiant map file.
5. Save everything. Compile and link and you're done!

Be sure to credit me in your published map.


ModmeBot:

Reply By: Noah Gamerscore
wow. That is badass. Great job! This deserves a win


ModmeBot:

Reply By: truman08
Thanks Frosty but I get the following error. I'm not sure where I could have gone wrong? I'm pretty new to this so apologies if I'm being stupid.

UNRECOVERABLE ERROR:
^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_challenge.gsc'
ERR(6E) scripts/zm/zm_challenge.gsc (350,0) : Compiler Internal Error : Unresolved external 'zm_score::minus_to_player_score'


FrostIceforge:

Reply By: Frost Iceforge

truman08
Thanks Frosty but I get the following error. I'm not sure where I could have gone wrong? I'm pretty new to this so apologies if I'm being stupid. UNRECOVERABLE ERROR: ^1SCRIPT ERROR: No generated data for 'scripts/zm/zm_challenge.gsc' ERR(6E) scripts/zm/zm_challenge.gsc (350,0) : Compiler Internal Error : Unresolved external 'zm_score::minus_to_player_score'

I guess you don't have any other parts of your GSC that are things to give or take away points? If not, add this with the #using stuff at the top:
#using scripts\zm\_zm_score;


FrostIceforge:

Reply By: Frost Iceforge
I am adding the requirement to add #using scripts\zm\_zm_score to the top of your GSC. I forgot this was not normally there since I add it to all my own maps. This should fix the compile error.


ModmeBot:

Reply By: truman08
Yes that fixed the error. Compiled, tested and it's working perfectly. Thanks for your help with this. Keep up the good work my friend!


ModmeBot:

Reply By: Azazel
I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything.


FrostIceforge:

Reply By: Frost Iceforge

Azazel
I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything.

Oh, wow. Sorry to hear that, I don't know what it could be. The only thing I can think of is to triple check that your triggers are named the right KVPs, or that your triggers are in fact trigger use. Make sure they have targetnames "iw_bank_deposit" and "iw_bank_withdrawal."
PM me screenshots showing everything is spelled and set up correctly and still doesn't work, and I'll PM you my Discord and we can call about it.


ModmeBot:

Reply By: Azazel

Frost Iceforge
Azazel I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything. Oh, wow. Sorry to hear that, I don't know what it could be. The only thing I can think of is to triple check that your triggers are named the right KVPs, or that your triggers are in fact trigger use. Make sure they have targetnames "iw_bank_deposit" and "iw_bank_withdrawal." PM me screenshots showing everything is spelled and set up correctly and still doesn't work, and I'll PM you my Discord and we can call about it.

I tried it again on a fresh map and it works, this script probably just doesnt work with one of the ones i was using (impossible to tell which one, i added this after using quite a few)



Also, a bit of a request, do you think you could possibly do it so the points carry over games? Like BO2 style, mixed in with IW?


FrostIceforge:

Reply By: Frost Iceforge

Azazel
Frost Iceforge Azazel I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything. Oh, wow. Sorry to hear that, I don't know what it could be. The only thing I can think of is to triple check that your triggers are named the right KVPs, or that your triggers are in fact trigger use. Make sure they have targetnames "iw_bank_deposit" and "iw_bank_withdrawal." PM me screenshots showing everything is spelled and set up correctly and still doesn't work, and I'll PM you my Discord and we can call about it. I tried it again on a fresh map and it works, this script probably just doesnt work with one of the ones i was using (impossible to tell which one, i added this after using quite a few) Also, a bit of a request, do you think you could possibly do it so the points carry over games? Like BO2 style, mixed in with IW?

Good to hear it works on a fresh map! Always a shame when you have script conflicts, but I can't do anything about that... I'd have to check every script tutorial ever made.

I have considered making a BO2 style bank, but I have NO IDEA how to make variables carry over across games. The only one I have ever seen was Project Thor on World at War customs having the BO2 fridge. Never seen it in BO3. The second I find out how to make it, I will make it an option here and make a BO2 style fridge.


For now, I'm considering making a Revelations style weapon table, so look forward to that!


ModmeBot:

Reply By: Azazel

Frost Iceforge
Azazel Frost Iceforge Azazel I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything. Oh, wow. Sorry to hear that, I don't know what it could be. The only thing I can think of is to triple check that your triggers are named the right KVPs, or that your triggers are in fact trigger use. Make sure they have targetnames "iw_bank_deposit" and "iw_bank_withdrawal." PM me screenshots showing everything is spelled and set up correctly and still doesn't work, and I'll PM you my Discord and we can call about it. I tried it again on a fresh map and it works, this script probably just doesnt work with one of the ones i was using (impossible to tell which one, i added this after using quite a few) Also, a bit of a request, do you think you could possibly do it so the points carry over games? Like BO2 style, mixed in with IW? Good to hear it works on a fresh map! Always a shame when you have script conflicts, but I can't do anything about that... I'd have to check every script tutorial ever made. I have considered making a BO2 style bank, but I have NO IDEA how to make variables carry over across games. The only one I have ever seen was Project Thor on World at War customs having the BO2 fridge. Never seen it in BO3. The second I find out how to make it, I will make it an option here and make a BO2 style fridge. For now, I'm considering making a Revelations style weapon table, so look forward to that!

I will be! and if its any help, heres a WAW script that maybe you can convert?? it carries between games.

I can link you the original thread but im not sure if linking to other sites is allowed here. Its on UGX. Idk how to convert the gsc script otherwise id do it myself!

Hope this helps you release something awesome, cant wait for your revelations weapon table!
bank_begin()
{
	players = getplayers();
	for(i=0; i<players.size; i++)="" {="" players[i].stored_points="players[i]" getstat(3005);="" if="" (!(players[i].stored_points="">= 0  || players[i].stored_points < 251))
		{
		players[i].stored_points = 0;
		players[i] SetStat(3005,players[i].stored_points);
		}
	}
	self thread bank_withdraw();
	self thread bank_depostit();
}

bank_withdraw()
{
	user = undefined;
	bank_withdraw = getEnt("bank_withdraw", "targetname");
    bank_withdraw setHintString( "press & hold &&1 to withdraw 1000 points [cost: 100]" ); 
	bank_withdraw setCursorHint("HINT_NOICON");
	while(1)
	{
	bank_withdraw waittill( "trigger", user );
    if( is_player_valid(user) && user.stored_points >0 && user.score >= 100)
	{
	user maps\_zombiemode_score::add_to_player_score( -100 );
 	user playlocalsound("cha_ching");
	wait 0.1;
	user maps\_zombiemode_score::add_to_player_score( 1000 );
	user.stored_points -=1;
	user SetStat(3005,user.stored_points);
	}
	}
}

bank_depostit()
{
	user = undefined;
	bank_deposit = getEnt("bank_deposit", "targetname");
    bank_deposit setHintString( "press & hold &&1 to deposit 1000 points" ); 
	bank_deposit setCursorHint("HINT_NOICON");
	while(1)
	{
 	bank_deposit waittill( "trigger", user );
	if( is_player_valid(user) && user.score >= 1000 && user.stored_points < 250)
	{
 	user playlocalsound("cha_ching");
	user maps\_zombiemode_score::add_to_player_score( -1000 );
	user.stored_points +=1;
	user SetStat(3005,user.stored_points);
	wait 0.1;
	}
}
}</players.size;>


FrostIceforge:

Reply By: Frost Iceforge

Azazel
Frost Iceforge Azazel Frost Iceforge Azazel I havent gotten any errors and ive double checked everything and it just doesnt seem to work. I am not sure what im doing wrong. In game, i go up to the triggers and i get nothing. no message or anything. Oh, wow. Sorry to hear that, I don't know what it could be. The only thing I can think of is to triple check that your triggers are named the right KVPs, or that your triggers are in fact trigger use. Make sure they have targetnames "iw_bank_deposit" and "iw_bank_withdrawal." PM me screenshots showing everything is spelled and set up correctly and still doesn't work, and I'll PM you my Discord and we can call about it. I tried it again on a fresh map and it works, this script probably just doesnt work with one of the ones i was using (impossible to tell which one, i added this after using quite a few) Also, a bit of a request, do you think you could possibly do it so the points carry over games? Like BO2 style, mixed in with IW? Good to hear it works on a fresh map! Always a shame when you have script conflicts, but I can't do anything about that... I'd have to check every script tutorial ever made. I have considered making a BO2 style bank, but I have NO IDEA how to make variables carry over across games. The only one I have ever seen was Project Thor on World at War customs having the BO2 fridge. Never seen it in BO3. The second I find out how to make it, I will make it an option here and make a BO2 style fridge. For now, I'm considering making a Revelations style weapon table, so look forward to that! I will be! and if its any help, heres a WAW script that maybe you can convert?? it carries between games. I can link you the original thread but im not sure if linking to other sites is allowed here. Its on UGX. Idk how to convert the gsc script otherwise id do it myself! Hope this helps you release something awesome, cant wait for your revelations weapon table! bank_begin() { players = getplayers(); for(i=0; i<players.size; i++)="" {="" players.stored_points="players" getstat(3005);="" if="" (!(players.stored_points="">= 0 || players.stored_points < 251)) { players.stored_points = 0; playersSetStat(3005,players.stored_points); } } self thread bank_withdraw(); self thread bank_depostit(); } bank_withdraw() { user = undefined; bank_withdraw = getEnt("bank_withdraw", "targetname"); bank_withdraw setHintString( "press & hold &&1 to withdraw 1000 points [cost: 100]" ); bank_withdraw setCursorHint("HINT_NOICON"); while(1) { bank_withdraw waittill( "trigger", user ); if( is_player_valid(user) && user.stored_points >0 && user.score >= 100) { user maps\_zombiemode_score::add_to_player_score( -100 ); user playlocalsound("cha_ching"); wait 0.1; user maps\_zombiemode_score::add_to_player_score( 1000 ); user.stored_points -=1; user SetStat(3005,user.stored_points); } } } bank_depostit() { user = undefined; bank_deposit = getEnt("bank_deposit", "targetname"); bank_deposit setHintString( "press & hold &&1 to deposit 1000 points" ); bank_deposit setCursorHint("HINT_NOICON"); while(1) { bank_deposit waittill( "trigger", user ); if( is_player_valid(user) && user.score >= 1000 && user.stored_points < 250) { user playlocalsound("cha_ching"); user maps\_zombiemode_score::add_to_player_score( -1000 ); user.stored_points +=1; user SetStat(3005,user.stored_points); wait 0.1; } } }
So, I asked the scripting page if the stat system is even in BO3 customs, and NateSmith himself told me it is disabled in BO3. The WaW scripts relied on it.
Here is the post.
Sorry to crush the dreams of anyone wanting a BO2 bank. Hopefully Treyarch lets us do it in a later update!</players.size;>


ModmeBot:

Reply By: LI4MBATES
bit late to the party, but im pretty sure ive done everything that needs doing but when i go over to the trigger_use' it says not available with that hand symbol? anyone know why or can anyone help me out please?


ModmeBot:

Reply By: Harry Bo21

LI4MBATES
bit late to the party, but im pretty sure ive done everything that needs doing but when i go over to the trigger_use' it says not available with that hand symbol? anyone know why or can anyone help me out please?


level thread iw_bank_system_init();


youve missed this probably

if not then odds are youve got the kvps on the trigger wrong


ModmeBot:

Reply By: LI4MBATES
by kvps you just mean the actual targetnames? you dont need to add any extra kvps's do you?