Skip to end of metadata
Go to start of metadata

NOTE: Before reading this guide, determine where your World at War root directory is located.

Non-Steam Install: C:\Program Files (x86)\Activision\Call of Duty World at War\

Steam Install: C:\Program Files (x86)\Steam\steamapps\common\Call of Duty World at War\

For the rest of this guide, it will be assumed that the word "root" refers to the appropriate installation path shown above.

Say 'Yes to all' if Windows asks you about replacing files when dragging files into your root directory.

trem_bank_2.gsc is a banking system made by UGX treminaor that allows players to deposit money in a 'bank' for other players to withdraw from. Optionally, the map's creator can enable interest gain on the bank balance as well as put a limit on the amount of bank withdraws per round.

trem_bank was recently updated to version 2.1. Please update your installation accordingly with the new files. This wiki article has been updated to reflect the changes for version 2.1.

Files: trem_bank_2.1.rar

Changelog

2.1 update fixed the default notify waittill name... it was set to a flag name instead of a notify name, which means it would never work. Fixed the Withdrawl limit reached iPrintLn which was not working. - 10:45, 20 July 2014 (PDT)

Preparation

Download the files above.
Copy these files to the following locations:

trem_bank_2.gsc -> root\mods\MAPNAME\maps
trem_bank_mouse.menu -> root\raw\ui\scriptmenus
trem_bank_keyboard -> root\raw\ui\scriptmenus
images/trem_bank_bg.iwi -> root\mods\MAPNAME\images
materials/trem_bank_bg -> root\raw\materials\

Setup

Radiant

You can place as many bank locations as you want with version 2.1. You can place some snazzy brushes and xmodels to make an area look like a bank, but all you need for functionality is one trigger_use.

Place a trigger_use by first creating a brush using the 2D window in Radiant, then with the brush selected, right click the 2D window and choose trigger -> trigger_use.
Give the trigger the following KvP by selecting the trigger and pressing N on your keyboard:

Key

Value

targetname

trem_bank_trig

CSV

You must include the trem_bank.menu in your mod.ff in order for it to show on-screen in-game. To do this, first open Launcher and go to the Mods tab. Next, select your mod from the dropdown box. If you are using ZCT mod, do this in your root/zone_source/nazi_zombie_mapname.csv instead.

In the textbox below the dropdown box, add this to the top or bottom of the list:

menufile,ui/scriptmenus/trem_bank_mouse.menu
menufile,ui/scriptmenus/trem_bank_keyboard.menu
material,trem_bank_bg

IWD

You should have already added trem_bank_2.gsc to root/mods/mapname/maps. If not, do so now. Then, in the Mod tab of Launcher with your mod selected, scroll down in the right-hand listbox and find trem_bank_2.gsc. Check the box beside it.

Script

In order for trem_bank_2 to run in your map, it must be 'called' in your root/raw/maps/mapname.gsc. Open this file with (preferably) Text Editors, although Windows Notepad will suffice.

Find:

maps\_zombiemode::main();

and add:

precacheMenu("trem_bank_mouse");
precacheMenu("trem_bank_keyboard");

immediately before 'maps_zombiemode::main();'. It should look like:

precacheMenu("trem_bank_mouse");
precacheMenu("trem_bank_keyboard");
maps\_zombiemode::main();

Then add:

level thread maps\trem_bank_2::bank();

immediately after 'maps_zombiemode::main();'. It should look like:

precacheMenu("trem_bank_mouse");
precacheMenu("trem_bank_keyboard");
maps\_zombiemode::main();
level thread maps\trem_bank_2::bank();

Customization

There are numerous settings available for trem_bank_2. They are:

Enable/Disable withdraw limit

Withdraw Limit Number

Withdraw Penalty Time Length

Enable/Disable Interest

Interest Amount Percentage

Enable/Disable Player Control Lock

Enable/Disable Wait Notify

Mouse/Keyboard choice for menu

View root/mods/mapname/maps/trem_bank_2.gsc to edit the settings and read descriptions of them.

Menu Example

For reference, This is what the menu looks like:

Keyboard:

Finishing up

After completing Preparation and  Setup, you must compile your map and mod.

Source

trem_bank_2.gsc

//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
//|||| Name    : trem_bank_2.gsc 
//|||| Info   	 : This is a bank system where players can deposit and withdraw points from one global total. I am aware this idea has been toyed with many times by many people, but I don't care as I wanted to make my own. This is completely and totally my code, and has not been ripped/taken from anyone else's code that I have seen or used. 
//|||| Site       : ugx-mods.com
//|||| Author  : [UGX] treminaor
//|||| Notes    : menu file: trem_bank_mouse.menu or trem_bank_keyboard.menu depending on what you want
//|||| Ver	     : 2.1 - 7/20/2014 | Fixed the default notify waittill name, it was set to a flag. Fixed the Withdrawl limit reached iPrintLn
//||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include common_scripts\utility; 
#include maps\_zombiemode_utility;
#include maps\_utility;
bank()
{
	//Don't touch these//
	level.bank = [];
	level.bank["total"] = 0;
	level.bank["drawcount"] = 0;
	level.bank["drawtimer_number"] = 0;
	level.bank["debug"] = false;
	level.bank["status"] = "unlocked";
	setDvar("bank_total", 0); // dont worry about players editing this, it wont actually change the points in the bank - it's only used for menu purposes. | i went ahead and added a watch func for it just in case tho
	///////////////////////////
	/////////////////////////////////// |Modifcations Section| //////////////////////////////////////////
	level.bank["withdrawl_enabled"]		= true; // Change this to false to disable the withdrawl penalty.
	level.bank["withdrawl_limit"]		 	= 8; // Change this number to make the amount of withdrawls allowed before penalty higher or lower.
	level.bank["penaltytime"]				 	= 60; // Change this number to make the withdrawl penalty longer or shorter. Values are in seconds. .10 would be one tenth of a second and 10 would be ten seconds
	level.bank["interest_enabled"]			= true; // Change this to false to disable the interest feature.
	level.bank["interest_interval"] 			= 120; //Change this number to make the interest interval longer or shorter. Values are in seconds. .10 would be one tenth of a second and 10 would be ten seconds
	level.bank["interest_amount"]			= .10; // Change this number to increase or decrease the amount of interest gained on the bank total. This should be a decimal. It is used this way: level.bank_total*.10; which would return 10% of the total points in the bank, then add that 10% to the overal total (eg 1000*.10 = 100. 1100 is the new total.)
	level.bank["menu_type"]				 	= "mouse"; // Change "mouse" to "keyboard" if you wish to use a keyboard-based menu instead of a mouse one. You must precache the other menu in your zone_source, etc.
	level.bank["announce_balance"]		= true; //Change to false if you don't want the bank to print an updated balance for all players to see after it has been used. Also announces when interest is gained.
	level.bank["wait_for_notify"]		 	= false; //Change to true if you want to have the bank wait for something to happen before it's enabled.
	level.bank["notify"]						 	= "Pack_A_Punch_on"; // If level.bank_wait_for_notify is set to true, you can set the notify here. The default is for the power switch to be flipped, but if you know what you're doing you can make your own notify.
	level.bank["notify_string"]			 	= "Power must be on."; // Chnage this if you need to.
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	level.bank_trigs = getEntArray("trem_bank_trig","targetname");
	if(level.bank["debug"]) iPrintLn("Bank: Debug Active.");
	for(i=0;i<level.bank_trigs.size;i++)
	{
		level.bank_trigs[i] setCursorHint("HINT_NOICON");
		if(level.bank["wait_for_notify"])
			level.bank_trigs[i] setHintString(level.bank["notify_string"]);
		level.bank_trigs[i] thread bank_hint_swap();
		level.bank_trigs[i] thread bank_trig_setup();
		if(level.bank["interest_enabled"])
			thread bank_interest_gain();
		thread watch_bank_dvar();
	}
}
 
bank_hint_swap()
{
	while(1)
	{
		if(level.bank["status"] == "locked")
			self setHintString("Withdrawl limit reached. Please wait "+level.bank["penaltytime"]+" seconds.");
		else
			self setHintString("Press &&1 to use the bank (Balance: "+level.bank["total"]+")");
		wait 0.5;
	}
}
 
bank_trig_setup()
{
	if(level.bank["wait_for_notify"]) 
		level waittill( level.bank["notify"] );
	while(1)
	{		
		player = undefined;
		self waittill("trigger",player);
		menu = "trem_bank_"+level.bank["menu_type"];
		if(level.bank["status"] != "locked")
		{
			player freezeControls(true);
			player disableWeapons();
			player openMenu(menu);
			player bank_logic(menu);
			wait 0.5;
		}
	}
}
 
bank_logic(menu)
{
	self waittill("menuresponse", menu, action);
	type = getSubStr(action, 0, 1);
	amount = int(getSubStr(action, 2));
	if(type == "d") //deposit
	{	
		if(self.score >= amount)
		{
			self maps\_zombiemode_score::minus_to_player_score(amount);
			level.bank["total"] = level.bank["total"] + amount;
			if(level.bank["announce_balance"]) iPrintLn("Bank: ^2Balance has been increased by "+self.playername+". It is now "+level.bank["total"]+" (Increase of "+amount+").");
		}
		else
			self iPrintLn("Bank: ^1"+self.playername+", you do not have enough points to complete the selected deposit.");
	}
	else if(type == "w") //withdraw
	{
		if(level.bank["total"] >= amount)
		{
			self maps\_zombiemode_score::add_to_player_score(amount);
			level.bank["total"] = level.bank["total"] - amount;
			if(level.bank["announce_balance"]) iPrintLn("Bank: ^1Balance has been decreased by "+self.playername+". It is now "+level.bank["total"]+" (Decrease of "+amount+").");
			level.bank["drawcount"]++;
		}
		else
			self iPrintLn("Bank: ^1Insufficient Funds!");
	}
	else
		if(level.bank["debug"]) iPrintLn("Bank: menu esc'd");
	setDvar("bank_total", level.bank["total"]);
	self closeMenu(menu);
	self freezeControls(false);
	self enableWeapons();
	if( level.bank["withdrawl_enabled"] && level.bank["withdrawl_limit"] == level.bank["drawcount"])
	{
		iPrintLn("Bank: Withdrawl limit reached by "+self.playername+". Bank use is forbidden for "+level.bank["penaltytime"]+" seconds.");
		level.bank["status"] = "locked";
		wait(level.bank["penaltytime"]);
		level.bank["status"] = "unlocked";
		level.bank["drawcount"] = 0;
	}
}
bank_interest_gain()
{
	while(1)
	{
		if(level.bank["announce_balance"] && level.bank["total"] > 0) iPrintLn("Bank: ^5Interest gained.");
		interest = int(level.bank["total"] * level.bank["interest_amount"]);
		level.bank["total"] = level.bank["total"] + interest;
		wait(level.bank["interest_interval"]);
	}
}
watch_bank_dvar()
{
	while(1)
	{
		if(level.bank["total"] != getDvarInt("bank_total"))
			setDvar("bank_total", level.bank["total"]);
		wait 0.5;
	}
}

Credit: Treminaor