Bank

From Mount&Blade Modding Wiki
Revision as of 22:50, 29 January 2012 by 188.108.106.15 (Talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This Bank system was inspired by the Bank of Calradia v2.0 by Garnier, Keedo420 and lazeras. My system is a complete rework and aims to better fit the athmosphere of a medieval setting. It consists of 2 key parts - Moneylenders, which allow you to borrow money based on your relationship with the city and your standing in the realm and Landowners, which will sell you land based on the towns prosperity. The entire land system is heavily influenced by prosperity and population in a city.

Using this code requires you to give me (Name: Duh) credit.

Constants:

# Floris Bank System
slot_town_acres = 456
slot_acres_needed = 457
slot_player_acres = 458
slot_center_population = 459
slot_rent = 460
slot_upkeep = 461
slot_assets = 462
slot_debt = 463
slot_deadline = 464

Lets start of with the population a city has. I assign them this slot in scripts.py within the game_start bit.

  #Duh Town Population for Land required // Linked to bank system
 
  (try_for_range, ":town_no", towns_begin, towns_end),
	(this_or_next|eq,":town_no","p_town_1"),
	(this_or_next|eq,":town_no","p_town_5"),
	(this_or_next|eq,":town_no","p_town_6"),
	(this_or_next|eq,":town_no","p_town_8"),
	(this_or_next|eq,":town_no","p_town_10"),
	(eq,"$current_town","p_town_19"),
	(store_random_in_range, ":amount", 18000, 22000),
	(party_set_slot, ":town_no", slot_center_population, ":amount"),
	(val_div, ":amount", 200),
	(party_set_slot, ":town_no", slot_town_acres, ":amount"),
  (else_try),
	(store_random_in_range, ":amount", 8000, 12000),
	(party_set_slot, ":town_no", slot_center_population, ":amount"),
	(val_div, ":amount", 200),
	(party_set_slot, ":town_no", slot_town_acres, ":amount"),		
  (try_end),
 
  #Duh Over

As you can see the capitols are getting a random population of 18000-22000 people, while other cities are assigned a value between 8000-12000 folks. Over the course of the game this can change, because population remains dynamic (based on prosperity) and i did not put any more regulation on it than: no larger than 30000, no smaller than 5000. What you can also see in this code section is the amount of acres a town begins with - the thought is rather simple, this land is supposed to be able to support a cities population and i decided that 1 acre can support 200 people. A town will begin with sufficient land for its people.

Next up are simple triggers. There are several things handled here, including the aforementioned dynamic population.

	(24*14,
	[
		(try_for_range, ":town_no", towns_begin, towns_end),							#	Floris	//	Adjust Population Depending on Prosperity
			(party_get_slot, ":prosperity", ":town_no", slot_town_prosperity),
			(party_get_slot, ":population", ":town_no", slot_center_population),
			(assign,":change",0),
			(try_begin),
				(ge, ":prosperity", 60),
				(store_sub, ":change", ":prosperity",60),
				(val_div, ":change", 5),
				(val_add, ":change", 3),
			(else_try),
				(le, ":prosperity", 40),
				(store_sub, ":change", ":prosperity", 40),
				(val_div, ":change", 5),
				(val_sub, ":change", 3),
			(try_end),
			(store_div,":base",":population",100),										#	Base population change is 1% of pop
			(val_mul,":change",":base"),				
			(val_add,":population", ":change"),			
			(try_begin),
				(gt, ":population", 30000),
				(assign, ":population", 30000),
				(party_set_slot, ":town_no", slot_center_population, ":population"),
			(else_try),
				(lt, ":population", 5000),
				(assign, ":population", 5000),
				(party_set_slot, ":town_no", slot_center_population, ":population"),
			(else_try),
				(party_set_slot, ":town_no", slot_center_population, ":population"),
			(try_end),
		(try_end),	
 
		(try_for_range, ":town_no", towns_begin, towns_end),							#	Floris	//	Calculating Land Demand and Consequences for supply, pricing and renting
			(party_get_slot, ":population", ":town_no", slot_center_population),
			(party_get_slot, ":land_town", ":town_no", slot_town_acres),
			(party_get_slot, ":land_player", ":town_no", slot_player_acres),
			(party_get_slot, ":prosperity", ":town_no", slot_town_prosperity),
			(store_sub, ":revenue", ":prosperity", 50),
			(val_add, ":revenue", 100),
			(try_begin),
				(store_div, ":acres_needed", ":population", 200),						#	200 People warrant 1 acre of cultivated land
				(store_add, ":total_land", ":land_town", ":land_player"),
				(store_sub, ":surplus", ":total_land", ":acres_needed"),
 
				(try_begin),															#	AI Consequences
					(lt, ":total_land", ":acres_needed"),
					(store_sub, ":new_acres", ":acres_needed", ":total_land"),
					(val_add, ":land_town", ":new_acres"),
					(party_set_slot, ":town_no", slot_town_acres, ":land_town"),
				(else_try),
					(ge, ":surplus", 20),
					(val_sub, ":land_town", 2),
					(party_set_slot, ":town_no", slot_town_acres, ":land_town"),
				(try_end),
 
				(try_begin),															#	Player Consequences
					(le, ":total_land", ":acres_needed"),
					(val_mul, ":land_player", ":revenue"),										
					(party_set_slot, ":town_no", slot_rent, ":land_player"),
				(else_try),
					(store_mul, ":penalty", ":surplus", -1),
					(val_add, ":penalty", ":revenue"),
					(try_begin),
						(ge, ":penalty", 85),
						(val_mul, ":land_player", ":penalty"),
						(party_set_slot, ":town_no", slot_rent, ":land_player"),
					(else_try),
						(store_sub, ":non_rented", ":surplus", 15),
						(val_sub, ":land_player", ":non_rented"),
						(try_begin),													#	Safety check // No penalty on rent should turn rent negative.
							(lt, ":penalty", 0),
							(assign, ":penalty", 0),
						(try_end),
						(val_mul, ":land_player", ":penalty"),
						(party_set_slot, ":town_no", slot_rent, ":land_player"),
						(val_mul, ":non_rented", -50),
						(party_set_slot, ":town_no", slot_upkeep, ":non_rented"),
					(try_end),
				(try_end),
 
			(try_end),
			(party_get_slot, ":assets", ":town_no", slot_assets),						#	Adding/Subtracting profits/losses
			(party_get_slot, ":rent", ":town_no", slot_rent),
			(party_get_slot, ":upkeep", ":town_no", slot_upkeep),
			(val_add, ":assets", ":rent"),
			(val_add, ":assets", ":upkeep"),
			(party_set_slot, ":town_no", slot_assets, ":assets"),			
		(try_end),
 
	]),

The code is pretty self-explanatory and the comments should give you a good indication of what you are looking at. Every 2 weeks population, acres and revenue is processed by this code. A litte text i wrote on the forum elaborates it in more detail:

As long as the prosperity is between 40 and 60, there is no change, as soon as it goes above or beyond the following happens:

Prosperity - 60 (or 40) / 50 * 3 = change multiplier Change multiploer * Population / 100 = Change in population

That is then applied to the population, though it cannot go beyond 30000 or below 5000.

After this bit, it continues to calculate land demand and consequences due to that. 200 people warrant 1 acre of land - so if the population grows the AI will eventually build more acres (every 2 weeks) or remove them, though the removal of land will only happen if there is a surplus of 20 acres compared to what is needed to support the population. The consequences for the player are a different matter - here we dont automatically buy or sell land, but alter the money he gets based on supply and demand. If all is in balance, the player receives a rent of X (Prosperity - 50 + 100 - Surplus) denars for every acre he owns - if a surplus exists, every acre above the required amount causes a penalty of -1 , which is applied to the overall rent of all acres, should the surplus be larger than 15 acres then the acres outside of the 15 surplus range are not rented anymore and the player has to pay upkeep for them (50 denars each). All his other acres receive the calculated X denars rent instead of 100. I am not entirely happy with the surplus penalty or even the entire supply and demand system for acres - so there might be change in the future. In fact, do contact me, if you come up with a good system that offers both a reasonable chance of revenue as well as some risk.

Addtionally to this 2 week trigger, there is also a 1 hour trigger, which handles debt.

(1, 																				
[	
	(try_for_range, ":town_no", towns_begin, towns_end),							#	Floris Moneylenders // Not paying debts has consequences
		(party_get_slot, ":debt", ":town_no", slot_debt),
		(gt, ":debt", 0),															#	If a debt exists, a deadline exists
		(party_get_slot, ":deadline", ":town_no", slot_deadline),
		(store_current_hours, ":date"),
		(ge, ":date", ":deadline"),
		(call_script, "script_change_player_relation_with_center", ":town_no", -5, 0xff3333),
		(try_begin),
			(lt, ":debt", 100000),
			(val_mul, ":debt", 14),
			(val_div, ":debt", 10),
			(try_begin),
				(gt, ":debt", 100000),												#Debt doesnt get higher than 100000 denars
				(assign, ":debt", 100000),
			(try_end),
			(val_add, ":deadline", 24*14),
			(party_set_slot, ":town_no", slot_debt, ":debt"),
			(party_set_slot, ":town_no", slot_deadline, ":deadline"),
			(str_store_party_name, s1, ":town_no"),
			(display_message, "@You missed the deadline to pay back your debts in {s1}. They now grow at an interest of 50%."),
		(else_try),
			(assign, ":debt", 100000),												#If debt = 100000 denars, then additionally to -5 relation with town, you get -1 relation with Faction.
			(val_add, ":deadline", 24*14),
			(party_set_slot, ":town_no", slot_debt, ":debt"),
			(party_set_slot, ":town_no", slot_deadline, ":deadline"),
			(store_faction_of_party, ":faction_no", ":town_no"),
			(call_script, "script_change_player_relation_with_faction_ex", ":faction_no", -1),
			(str_store_party_name, s1, ":town_no"),
			(display_message, "@Your debt in {s1} is now so high that the King himself has taken notice. He has frozen your debt, but is displeased with the situation.", 0xff3333),
		(try_end),
	(try_end),		
 
]),

I would think the comments are sufficient as an explanation of how this works. Now all this is nice and dandy, but there has to be a way to interact with banks. So lets take a look at game menus - specifically the town menu. I added this above the option to leave:

	#	Floris Bank Overhaul	//	Original Idea by Lazeras
	("town_bank",
       [(party_slot_eq, "$current_town", slot_party_type, spt_town)],
       "Visit the landlords and moneylenders.",
       [	
			(assign, reg10, 0),
			(start_presentation, "prsnt_bank"),
        ]),

This bit will jump to the presentation that actually represents the bank and allows the player to interact with it. But before we go there, there is another bit of code here, which allows us to get to an overview of our lands, assets and debts. You will find this located in the report menu (which we restructured, so i cant really give you the exact location in the native menu).

		# Moneylending
		("view_bank_report",[],"View Financial Report",
			[(start_presentation, "prsnt_bank_quickview"),]),
 
		("return", [], "Return", 
			[(jump_to_menu, "mnu_reports"),]),

Now to finish this, we will look at presentations. First off the actual bank (its not pretty, but its functional).

   ("bank", 0, mesh_load_window, [ 													#	Floris Overhaul
    (ti_on_presentation_load,
      [
        (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
 
		(try_begin),
			(party_get_slot, ":assets", "$current_town", slot_assets),
			(troop_add_gold, "trp_player", ":assets"),
			(party_set_slot, "$current_town", slot_assets, 0),
		(try_end),
 
		(str_store_party_name, s1, "$current_town"),
 
 
	    (create_text_overlay, reg0, 
"@This area of {s1} can best be described as the very core of the town.^^\
 You can almost see the strings that are being pulled from here, the money that comes and goes at seemingly endless rates. \
 Here you can buy the land that is cultivated outside the towns gates and benefit from the ones working hard.\
 Of course you might not have the denars required to do so, but the moneylenders are known to have some spare change.",tf_center_justify),
        (position_set_x, pos1, 475),
        (position_set_y, pos1, 600),
        (overlay_set_position, reg0, pos1),
 
        (position_set_x, pos2, 800),
        (position_set_y, pos2, 900),		
		(overlay_set_size, reg0, pos2),
 
		(party_get_slot, ":population", "$current_town", slot_center_population),
		(party_get_slot, ":land_town", "$current_town", slot_town_acres),
		(party_get_slot, ":land_player", "$current_town", slot_player_acres),
		(store_add, ":land_total", ":land_town", ":land_player"),
		(assign, reg1, ":population"),
		(assign, reg2, ":land_total"),
		(assign, reg3, ":land_player"),
 
		(party_get_slot, ":debt", "$current_town", slot_debt),
		(assign, reg4, ":debt"),
 
		(assign, reg5, 0),														#Slider storage / acres		Buy
		(assign, reg6, 0),														#Slider storage / money		Borrow
		(assign, reg7, 0),														#Slider storage / acres		Build
		(assign, reg8, 0),														#Slider storage / money		Pay back
 
		(party_get_slot, ":prosp_mod", "$current_town", slot_town_prosperity),
		(store_mul, ":price_mod", ":prosp_mod", 10),
		(val_sub, ":price_mod", 500),
		(store_add, reg9, 1000, ":price_mod"),									#Buy Price 
		(store_add, reg10, 750, ":price_mod"),									#Sell Price 
		(store_add, reg11, 2000, ":price_mod"),									#Build Price
		#reg12 used for buy/sell switch
		(store_sub, ":rent_mod", ":prosp_mod", 50),
		(store_add, reg13, ":rent_mod", 100),									#Rent Revenue
 
		(create_text_overlay, "$g_presentation_obj_19", "@{reg1} people live in {s1}. There are currently {reg2} acres of land available for cultivation to provide them with \
 food and other goods. You own {reg3} acres of land in this town. You currently owe the moneylenders of {s1} {reg4} denars. The interest rate is 20% and the contract period amounts \
 to 2 weeks. If you dont manage to pay off your debt until the deadline, the interest is raised to 40%. Buying an existing acre costs {reg9} denars, while it sells for {reg10} denars. Building a new one requires {reg11} denars.\
 The rent paid to landowners currently accumulates to {reg13} denars per acre every 2 weeks and has to be collected in the town. Land wont be rented if a town is already well supplied.",tf_center_justify),
        (position_set_x, pos1, 475),
        (position_set_y, pos1, 450),
        (overlay_set_position, "$g_presentation_obj_19", pos1),
 
        (position_set_x, pos2, 900),
        (position_set_y, pos2, 1000),		
		(overlay_set_size, "$g_presentation_obj_19", pos2),	
 
		(try_begin),
			(eq, reg12, 2222),	
			(str_store_string, s2, "@Choose how many acres you wish to sell :"),
		(else_try),
			(str_store_string, s2, "@Choose how many acres you wish to buy :"),
		(try_end),
 
	(create_button_overlay, "$g_presentation_obj_16", "@{s2}",tf_center_justify),				#	Landlords buy
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 350),
        (overlay_set_position, "$g_presentation_obj_16", pos1),
 
		(store_troop_gold, ":funds", "trp_player"),
		(store_div, ":funds_build", ":funds", reg11),
		(val_div, ":funds", reg9),
		(val_min, ":funds", ":land_town"),
 
		(try_begin),
			(eq, reg12, 2222),
			(party_get_slot, ":sell_no", "$current_town", slot_player_acres),
			(assign, ":funds", ":sell_no"),
		(try_end),
 
	(create_slider_overlay, "$g_presentation_obj_1", 0, ":funds"),
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 310),
        (overlay_set_position, "$g_presentation_obj_1", pos1),
 
	(create_text_overlay, "$g_presentation_obj_2", "@0"),
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$g_presentation_obj_2", pos1),			
 
	(create_button_overlay, "$g_presentation_obj_3", "@Verify",tf_center_justify),		
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 275),
        (overlay_set_position, "$g_presentation_obj_3", pos1),	
 
 
 
	(create_text_overlay, reg0, "@Choose how much money you wish to borrow :",tf_center_justify),			#	Moneylenders borrow
        (position_set_x, pos1, 725),
        (position_set_y, pos1, 350),
        (overlay_set_position, reg0, pos1),
 
		(assign, ":fief_count", 0),																				#	Money = 250*Prosperity + Relationship*100 - Debt, IF Player owns fief or is renowned,
		(try_for_range, ":cur_center", centers_begin, centers_end),												#	otherwise not more than 5000 + Relationship*100 - Debt
			(party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
			(val_add, ":fief_count", 1),
		(try_end),
		(troop_get_slot, ":renown", "trp_player", slot_troop_renown),
		(party_get_slot, ":prosperity", "$current_town", slot_town_prosperity),
		(store_mul, ":money", ":prosperity", 250),
		(try_begin),
			(lt, ":fief_count", 1),
			(lt, ":renown", 500),
			(gt, ":money", 5000),
			(assign, ":money", 5000),
		(try_end),
		(party_get_slot, ":player_relation", "$current_town", slot_center_player_relation),
		(store_mul, ":trust", ":player_relation", 100),
		(val_add, ":money", ":trust"),
		(val_sub, ":money", ":debt"),
		(try_begin),																							#	Money lending cant turn negative
			(lt, ":money", 0),	
			(assign, ":money", 0),
		(try_end),
 
		(try_begin),
			(assign, reg25, 0),
			(try_for_range, ":town_no", towns_begin, towns_end),													#	Too much debt overall or in a single bank will stop banks from lending you money
				(party_get_slot, ":debt_all", ":town_no", slot_debt),
				(val_add, reg25, ":debt_all"),
			(try_end),
			(ge, reg25, 50000),
			(assign, ":money", 0),
		(try_end),
 
	(create_slider_overlay, "$g_presentation_obj_4", 0, ":money"),
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 310),
        (overlay_set_position, "$g_presentation_obj_4", pos1),
 
	(create_text_overlay, "$g_presentation_obj_5", "@0"),
        (position_set_x, pos1, 850),
        (position_set_y, pos1, 300),
        (overlay_set_position, "$g_presentation_obj_5", pos1),
 
	(create_button_overlay, "$g_presentation_obj_6", "@Verify",tf_center_justify),		
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 275),
        (overlay_set_position, "$g_presentation_obj_6", pos1),
 
 
 
	(create_text_overlay, "$g_presentation_obj_7", "@Buy and prepare uncultivated land :",tf_center_justify),		#	Landlord / Buy and Build
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 200),
        (overlay_set_position, "$g_presentation_obj_7", pos1),
 
 
	(create_slider_overlay, "$g_presentation_obj_8", 0, ":funds_build"),											#	Choose acres to build 
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 160),
        (overlay_set_position, "$g_presentation_obj_8", pos1),		
 
	(create_text_overlay, "$g_presentation_obj_9", "@0"),
        (position_set_x, pos1, 400),
        (position_set_y, pos1, 150),
        (overlay_set_position, "$g_presentation_obj_9", pos1),			
 
	(create_button_overlay, "$g_presentation_obj_10", "@Verify",tf_center_justify),		
        (position_set_x, pos1, 250),
        (position_set_y, pos1, 125),
        (overlay_set_position, "$g_presentation_obj_10", pos1),	
 
 
	(create_text_overlay, "$g_presentation_obj_11", "@Pay off your debt :",tf_center_justify),		#	Pay off your debt
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 200),
        (overlay_set_position, "$g_presentation_obj_11", pos1),		
 
		(store_troop_gold, ":funds", "trp_player"),
		(try_begin),
			(lt, ":debt", ":funds"),
			(assign, ":funds", ":debt"),
		(try_end),
 
	(create_slider_overlay, "$g_presentation_obj_12", 0, ":funds"),
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 160),
        (overlay_set_position, "$g_presentation_obj_12", pos1),		
 
	(create_text_overlay, "$g_presentation_obj_13", "@0"),
        (position_set_x, pos1, 850),
        (position_set_y, pos1, 150),
        (overlay_set_position, "$g_presentation_obj_13", pos1),			
 
	(create_button_overlay, "$g_presentation_obj_14", "@Verify",tf_center_justify),		
        (position_set_x, pos1, 700),
        (position_set_y, pos1, 125),
        (overlay_set_position, "$g_presentation_obj_14", pos1),	
 
 
 
	(create_game_button_overlay, "$g_presentation_obj_15", "@Done", 0),										#	Leave
        (position_set_x, pos1, 880),
        (position_set_y, pos1, 25),
        (overlay_set_position, "$g_presentation_obj_15", pos1),		
 
        ]),
 
	(ti_on_presentation_event_state_change, 
		[
        (store_trigger_param_1, ":object"),
        (store_trigger_param_2, ":value"),
 
		(try_begin),
			(eq, ":object", "$g_presentation_obj_1"),															#	Show chosen amount of land
			(assign, reg5, ":value"),
			(overlay_set_text, "$g_presentation_obj_2", "@{reg5}"),
		(else_try),
			(eq, ":object", "$g_presentation_obj_3"),															#	Sell/Buy chosen amount of land
			(try_begin),
				(eq, reg12, 2222),
				(try_begin),
					(gt, reg5, 0),
					(store_mul, ":price", reg5, reg10),
					(troop_add_gold, "trp_player", ":price"),					
					(party_get_slot, ":land_town", "$current_town", slot_town_acres),
					(val_add, ":land_town", reg5),
					(party_set_slot, "$current_town", slot_town_acres, ":land_town"),
					(party_get_slot, ":land_player", "$current_town", slot_player_acres),
					(val_sub, ":land_player", reg5),
					(party_set_slot, "$current_town", slot_player_acres, ":land_player"),
					(start_presentation, "prsnt_bank"),					
				(else_try),	
					(display_message, "@You cant sell 0 acres of land."),
				(try_end),
			(else_try),
				(try_begin),
					(gt, reg5, 0),
					(store_mul, ":cost", reg5, reg9),
					(troop_remove_gold, "trp_player", ":cost"),
					(party_get_slot, ":land_town", "$current_town", slot_town_acres),
					(val_sub, ":land_town", reg5),
					(party_set_slot, "$current_town", slot_town_acres, ":land_town"),
					(party_get_slot, ":land_player", "$current_town", slot_player_acres),
					(val_add, ":land_player", reg5),
					(party_set_slot, "$current_town", slot_player_acres, ":land_player"),
					(start_presentation, "prsnt_bank"),
				(else_try),
					(display_message, "@You cant buy 0 acres of land."),
				(try_end),
			(try_end),
		(else_try),
			(eq, ":object", "$g_presentation_obj_4"),															#	Show chosen amount of money
			(assign, reg6, ":value"),
			(overlay_set_text, "$g_presentation_obj_5", "@{reg6}"),
		(else_try),		
			(eq, ":object", "$g_presentation_obj_6"),															#	Borrow chosen amount of money
			(try_begin),
				(gt, reg6, 0),
				(party_get_slot, ":debt", "$current_town", slot_debt),
				(try_begin),
					(le, ":debt", 0),
					(store_current_hours, ":date"),
					(val_add, ":date", 24*14*2), 								#	First Deadline / 4 weeks / then 2 weeks (see simple_triggers)
					(party_set_slot, "$current_town", slot_deadline, ":date"),
				(try_end),
				(troop_add_gold, "trp_player", reg6),
				(val_mul, reg6, 120),
				(val_div, reg6, 100),
				(val_add, ":debt", reg6),
				(party_set_slot, "$current_town", slot_debt, ":debt"),
				(start_presentation, "prsnt_bank"),
			(else_try),
				(display_message, "@You cant borrow 0 denars."),
			(try_end),
		(else_try),
			(eq, ":object", "$g_presentation_obj_8"),															#	Show chosen amount of land	//	2nd Option
			(assign, reg7, ":value"),
			(overlay_set_text, "$g_presentation_obj_9", "@{reg7}"),			
		(else_try),
			(eq, ":object", "$g_presentation_obj_10"),															#	Buy chosen amount of land	//	2nd Option
			(try_begin),
				(gt, reg7, 0),
				(store_mul, ":cost", reg7, reg11),
				(troop_remove_gold, "trp_player", ":cost"),
				(party_get_slot, ":land_player", "$current_town", slot_player_acres),
				(val_add, ":land_player", reg7),
				(party_set_slot, "$current_town", slot_player_acres, ":land_player"),
				(start_presentation, "prsnt_bank"),
			(else_try),
				(display_message, "@You cant buy 0 acres of land."),
			(try_end),		
		(else_try),
			(eq, ":object", "$g_presentation_obj_12"),															#	Show chosen amount of money
			(assign, reg8, ":value"),
			(overlay_set_text, "$g_presentation_obj_13", "@{reg8}"),
		(else_try),
			(eq, ":object", "$g_presentation_obj_14"),															#	Pay back chosen amount of money
			(try_begin),
				(gt, reg8, 0),
				(troop_remove_gold, "trp_player", reg8),
				(party_get_slot, ":debt", "$current_town", slot_debt),
				(val_sub, ":debt", reg8),
				(party_set_slot, "$current_town", slot_debt, ":debt"),
				(try_begin),
					(le, ":debt", 0),
					(party_set_slot, "$current_town", slot_deadline, 0),
				(try_end),
				(start_presentation, "prsnt_bank"),
			(else_try),
				(display_message, "@You cant pay back 0 denars."),
			(try_end),
		(else_try),																								#	Switch Buy/Sell
			(eq, ":object", "$g_presentation_obj_16"),
			(try_begin),
				(neq, reg12, 2222),
				(assign, reg12, 2222),
				(start_presentation, "prsnt_bank"),
			(else_try),
				(assign, reg12, 0),
				(start_presentation, "prsnt_bank"),
			(try_end),
		(else_try),
			(eq, ":object", "$g_presentation_obj_15"),															#	Leave
			(presentation_set_duration, 0),
		(try_end),       
 
		]),
      ]),

Excuse the weird tab-ins, the copy paste to the wiki did that... and i dont really feel like fixing that just for looks here :P. Anyways the last bit is the overview:

	 #	Floris Bank
  ("bank_quickview", 0, mesh_companion_overview, #mesh_companion_overview
   [
     (ti_on_presentation_load,
      [
	    (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),
 
#		(str_clear, s0),
 #       (create_text_overlay, reg0, "@Hello, {s0}", tf_scrollable),
 #       (position_set_x, pos1, 50),
  #      (position_set_y, pos1, 50),
 ###       (overlay_set_position, reg0, pos1),
 #       (position_set_x, pos1, 550),
 #       (position_set_y, pos1, 630),
  #      (overlay_set_area_size, reg0, pos1),
 #       (set_container_overlay, reg0),
 
 
 
 
		###HEADLINES###
		(assign, ":x_poshl", 155),
		(assign, ":y_pos", 581),
		(assign, ":jq_size", pos0),
		(position_set_x, ":jq_size", 720),
		(position_set_y, ":jq_size", 775),
 
        (create_text_overlay, reg1, "@Town", tf_center_justify),
    	(overlay_set_size, reg1, ":jq_size"),
 		(position_set_x, pos1, ":x_poshl"),
        (position_set_y, pos1, ":y_pos"),
        (overlay_set_position, reg1, pos1),
 
        (create_text_overlay, reg1, "@Acres", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 120),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),	
 
        (create_text_overlay, reg1, "@Owned", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 108),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),
 
        (create_text_overlay, reg1, "@Balance", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 112),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),
 
		(create_text_overlay, reg1, "@Assets", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 105),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),
 
        (create_text_overlay, reg1, "@Debt", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 105),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),	
 
        (create_text_overlay, reg1, "@Deadline", tf_center_justify),
       	(overlay_set_size, reg1, ":jq_size"),
		(val_add, ":x_poshl", 120),
 		(position_set_x, pos1, ":x_poshl"),
        (overlay_set_position, reg1, pos1),			
 
 
		(str_clear, s0),
		(create_text_overlay, reg0, s0, tf_scrollable),
        (position_set_x, pos1, 10),
        (position_set_y, pos1, 100),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 450),
        (overlay_set_area_size, reg0, pos1),
		(set_container_overlay, reg0),		
 
		(assign, ":jq_value", 100),
		(assign, ":jq_size", 0),
		(assign, ":x_pos", 0),
		(assign, ":y_pos", 547),
		(str_clear, s9),	
		(str_clear, s8),
 
 
        (assign, reg2, 0),#total_acres
        (assign, reg3, 0),#player_acres
        (assign, reg4, 0),#balance
        (assign, reg5, 0),#assets
		(assign, reg6, 0),#debt
		(assign, reg7, 0),#deadline
 
		(try_for_range, ":center_no", towns_begin, towns_end),
			(party_get_slot, ":land_town", ":center_no", slot_town_acres),
			(party_get_slot, ":land_player", ":center_no", slot_player_acres),
			(party_get_slot, ":assets", ":center_no", slot_assets),
			(party_get_slot,":debt",":center_no",slot_debt),
			(party_get_slot, ":deadline", ":center_no", slot_deadline),
			(party_get_slot, ":population", ":center_no", slot_center_population),
			(party_get_slot, ":prosperity", ":center_no", slot_town_prosperity),
 
			(store_add, ":land_total", ":land_town", ":land_player"),
 
			(store_div, ":acres_needed", ":population", 200),
			(store_sub, ":surplus", ":land_total", ":acres_needed"),
			(store_sub, ":revenue", ":prosperity", 50),
			(val_add, ":revenue", 100),
			(assign, ":upkeep_player", 0),
			(try_begin),															#	Player Balance
				(le, ":land_total", ":acres_needed"),
				(store_mul, ":rent_player", ":land_player", ":revenue"),										
			(else_try),
				(store_mul, ":penalty", ":surplus", -1),
				(val_add, ":penalty", ":revenue"),
				(try_begin),
					(ge, ":penalty", 85),
					(store_mul, ":rent_player", ":land_player", ":penalty"),
				(else_try),
					(store_sub, ":non_rented", ":surplus", 15),
					(val_sub, ":land_player", ":non_rented"),
					(store_mul, ":rent_player", ":land_player", 85),
					(store_mul, ":upkeep_player", ":non_rented", -50),
				(try_end),
			(try_end),
 
			(store_add, ":balance", ":rent_player", ":upkeep_player"),
 
			(val_add, ":jq_value", 1),   
 
			#center center name
			(val_add, ":x_pos", 118), 
			(str_store_party_name,s9, ":center_no"),
			(str_store_string, s1, "@{s9}"),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#center land in acres
			(val_add, ":x_pos", 135),  
			(assign, reg2, ":land_total"),
			(create_text_overlay, reg1, "@{reg2}", tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#Player land in city
			(val_add, ":x_pos", 113),  
			(assign, reg3, ":land_player"),
			(str_store_string, s1, "@{reg3}"),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#city Balance
			(val_add, ":x_pos", 110),  
			(assign, reg4, ":balance"),
			(str_store_string, s1, "@{reg4}"),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#Player assets in city
			(val_add, ":x_pos", 110),  
			(assign, reg4, ":assets"),
			(str_store_string, s1, "@{reg4}"),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#city Debt
			(val_add, ":x_pos", 105),  
			(assign, reg5, ":debt"),
			(str_store_string, s1, "@{reg5}"),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			#city Deadline
			(val_add, ":x_pos", 105),
			(try_begin),
				(gt, ":deadline", 0),
				(call_script, "script_game_get_date_text", 1, ":deadline"),
			(else_try),
				(str_store_string, s1, "@None"),
			(try_end),
			(create_text_overlay, reg1, s1, tf_left_align),
			(position_set_x, pos3, ":x_pos"),
			(position_set_y, pos3, ":y_pos"),
			(overlay_set_position, reg1, pos3),
			(position_set_x, pos3, 750),
			(position_set_y, pos3, 850),
			(overlay_set_size, reg1, pos3),
 
			(assign, ":x_pos", 0),
			(assign, ":x_poshl", 165),
			(val_sub, ":y_pos", 23),#linebreak 
			(ge, ":x_pos", 950),
			(assign, ":x_pos", 0),
			(val_sub, ":y_pos", 23),
		(try_end), #Center-Bank Loop End
 
	  (set_container_overlay, -1),
 
	  		 #Back to menu - graphical button
	    (create_game_button_overlay, "$g_jq_Return_to_menu", "@_Return to menu_"),	 
	    (position_set_x, pos1, 500),
        (position_set_y, pos1, 23),
        (overlay_set_position, "$g_jq_Return_to_menu", pos1),
		(assign, "$g_jq_Back_to_shop", 0), ##BUGFIX - savegame compatability 
		(assign, "$jq_nr", 0), ##BUGFIX - savegame compatability 
 
	  ]),
	 (ti_on_presentation_event_state_change,
     [
        (store_trigger_param_1, ":object"),
		(try_begin), 
			(eq, ":object", "$g_jq_Return_to_menu"),
			(presentation_set_duration, 0),
		(try_end),
		]),
	]),
	##	Floris Bank End

Woops forgot the altered script bits, so that the deadline fits the presentation:

  #script_game_get_date_text:
  # This script is called from the game engine when the date needs to be displayed.
  # INPUT: arg1 = number of days passed since the beginning of the game
  # OUTPUT: result string = date
  ("game_get_date_text",
    [
		(store_script_param_1, ":version"),
      (store_script_param_2, ":num_hours"),
      (store_div, ":num_days", ":num_hours", 24),
      (store_add, ":cur_day", ":num_days", 23),
      (assign, ":cur_month", 3),
      (assign, ":cur_year", 1257),
      (assign, ":try_range", 99999),
      (try_for_range, ":unused", 0, ":try_range"),
        (try_begin),
          (this_or_next|eq, ":cur_month", 1),
          (this_or_next|eq, ":cur_month", 3),
          (this_or_next|eq, ":cur_month", 5),
          (this_or_next|eq, ":cur_month", 7),
          (this_or_next|eq, ":cur_month", 8),
          (this_or_next|eq, ":cur_month", 10),
          (eq, ":cur_month", 12),
          (assign, ":month_day_limit", 31),
        (else_try),
          (this_or_next|eq, ":cur_month", 4),
          (this_or_next|eq, ":cur_month", 6),
          (this_or_next|eq, ":cur_month", 9),
          (eq, ":cur_month", 11),
          (assign, ":month_day_limit", 30),
        (else_try),
          (try_begin),
            (store_div, ":cur_year_div_4", ":cur_year", 4),
            (val_mul, ":cur_year_div_4", 4),
            (eq, ":cur_year_div_4", ":cur_year"),
            (assign, ":month_day_limit", 29),
          (else_try),
            (assign, ":month_day_limit", 28),
          (try_end),
        (try_end),
        (try_begin),
          (gt, ":cur_day", ":month_day_limit"),
          (val_sub, ":cur_day", ":month_day_limit"),
          (val_add, ":cur_month", 1),
          (try_begin),
            (gt, ":cur_month", 12),
            (val_sub, ":cur_month", 12),
            (val_add, ":cur_year", 1),
          (try_end),
        (else_try),
          (assign, ":try_range", 0),
        (try_end),
      (try_end),
      (assign, reg1, ":cur_day"),
      (assign, reg2, ":cur_year"),
      (store_time_of_day, reg3), ## CC
	  (try_begin),
		(this_or_next|eq, ":version", 1),
		(try_begin),
			(eq, ":cur_month", 1),
			(str_store_string, s1, "str_january_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 2),
			(str_store_string, s1, "str_february_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 3),
			(str_store_string, s1, "str_march_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 4),
			(str_store_string, s1, "str_april_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 5),
			(str_store_string, s1, "str_may_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 6),
			(str_store_string, s1, "str_june_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 7),
			(str_store_string, s1, "str_july_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 8),
			(str_store_string, s1, "str_august_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 9),
			(str_store_string, s1, "str_september_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 10),
			(str_store_string, s1, "str_october_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 11),
			(str_store_string, s1, "str_november_reg1_reg2_v2"),
		  (else_try),
			(eq, ":cur_month", 12),
			(str_store_string, s1, "str_december_reg1_reg2_v2"),
		  (try_end),
		(else_try),	  
		  (try_begin),
			(eq, ":cur_month", 1),
			(str_store_string, s1, "str_january_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 2),
			(str_store_string, s1, "str_february_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 3),
			(str_store_string, s1, "str_march_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 4),
			(str_store_string, s1, "str_april_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 5),
			(str_store_string, s1, "str_may_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 6),
			(str_store_string, s1, "str_june_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 7),
			(str_store_string, s1, "str_july_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 8),
			(str_store_string, s1, "str_august_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 9),
			(str_store_string, s1, "str_september_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 10),
			(str_store_string, s1, "str_october_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 11),
			(str_store_string, s1, "str_november_reg1_reg2"),
		  (else_try),
			(eq, ":cur_month", 12),
			(str_store_string, s1, "str_december_reg1_reg2"),
		  (try_end),
		(try_end),
      (set_result_string, s1),
  ]),

and the according strings:

  ("january_reg1_reg2_v2", "January {reg1}, {reg2}"),
  ("february_reg1_reg2_v2", "February {reg1}, {reg2}"),
  ("march_reg1_reg2_v2", "March {reg1}, {reg2}"),
  ("april_reg1_reg2_v2", "April {reg1}, {reg2}"),
  ("may_reg1_reg2_v2", "May {reg1}, {reg2}"),
  ("june_reg1_reg2_v2", "June {reg1}, {reg2}"),
  ("july_reg1_reg2_v2", "July {reg1}, {reg2}"),
  ("august_reg1_reg2_v2", "August {reg1}, {reg2}"),
  ("september_reg1_reg2_v2", "September {reg1}, {reg2}"),
  ("october_reg1_reg2_v2", "October {reg1}, {reg2}"),
  ("november_reg1_reg2_v2", "November {reg1}, {reg2}"),
  ("december_reg1_reg2_v2", "December {reg1}, {reg2}"),

Another bit i forgot - the presentation uses the following mesh, which you need to add to module_meshes:

 ## Companions Overview, by Jedediah Q, modified by lazeras
  ("companion_overview", 0, "companion_overview", 0, 0, 0, 0, 0, 0, 1, 1, 1),
  ("companion_overview_details", 0, "companion_overview_details", 0, 0, 0, 0, 0, 0, 1, 1, 1),
##

Enjoy

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox