Simple Bank mode I have made

Users who are viewing this thread

Features
  • Account (unlocks at start) ctrl+1, ctrl+a,
  1. Put money with interest​
  2. Borrow money with rent
  • Transaction (unlocks at 100 001) ctrl+2, ctrl+t
  1. Send money to Lord
  2. Meet lord who you ahve already met (at 1 000 001 meet all lords is enabled)
  3. Filter lords by writing name or keywords (supported keywords are: "kings", "leaders”, "goldunder xx", "goldover xx", "relationunder xx", relationover xx")
  • Caravans (unlocks at 500 001) ctrl+3, ctrl+c
  1. Change leader
  2. Change destination
  3. Change troops
  4. Change items
  5. Give / take money from caravan
  6. Check distanse to target city
  7. See last visited town
  8. Change home settlement
  9. Buy free passage for certain amount of days
  • Fiefs (unlocks at 1 000 001) ctrl+4, ctrl+f
  1. See and change gold
  2. Visit
  3. See if there are avaible recruits
  4. Give away fiefs to other clans
  5. Filter owned fiefs by writing free text or using some of keywords (supported keywords are: "castles", "towns", "recruits")
Dropbox

For newest code please follow the link to nexus:

Patch 1.3.1.4
  • Compability check with 1.5.9
  • Bug fixes, new features.

Patch 1.2.3
  • Bug fix for getting negative amount after 2 bilions.
  • Interest is lower to 0.001 per day by default.

Patch 1.2.2
  • Bug fix for sharing bank saldo when starting new campaign after loading a file with game account (illegal wealth transfer)
  • Interest is added now to saldo instead to purse (can be changed in config dfile PutInterestIntoAccount)

Patch 1.2.0
  • New layout (old can be accessed by setting UseNewLayout flag to "false" in config file.

Patch 1.1.4.2
  • Bug fixes

Patch 1.1.4
  • Added documentation to module files (all .cs files \Documentation).
  • Balance weakest nation
  • Changed encyclopedia for balancing.
  • Popups disabled as default.
  • Bank future change displayed as tooltip of current money icon (predicted changes tooltip)
  • Remove pdb debug file.


Path 1.1.3
  • Changed game menu
  • Added encyclopedia entry for bank

Path 1.1.2
  • Fix for always disabled market

Path 1.1.1
  • Removed assembly fiels
  • Added configuration.xml (main folder of my mode)
  • Daily popups can be disabled by config
 
Last edited:
I am working with a mod that changes income type from daily to weekly. But couldn't manage how this daily , weekly ticks work. Did you understand how it work?
 
I know what you need. THere is like total houer counter in game, which changes as it should even if you pause, do normal or fast speed in game. It is accessed by "TaleWorlds.CampaignSystem.Campaign.CurrentTime". It is set to 0 on new campaign so its total in game houers one have played a char.

It is 24 HourlyTickEvent per one DailyTickEvent.
@Sasete


I hope this helps you.

Code for some debugging
public class BirkeGameTimeDebug : MBSubModuleBase
{
public override void OnGameLoaded(Game game, object initializerObject)
{
TaleWorlds.CampaignSystem.CampaignEvents.HourlyTickEvent.AddNonSerializedListener(this, HourlyTickEvent);
TaleWorlds.CampaignSystem.CampaignEvents.DailyTickEvent.AddNonSerializedListener(this, DailyTickEvent);
}

private void DailyTickEvent()
{
var now = DateTime.Now;
if (Debugger.IsAttached)
{
Debug.WriteLine($"DailyTickEvent: CampaignTime: {TaleWorlds.CampaignSystem.Campaign.CurrentTime}, {now.Minute}:{now.Second}.{now.Millisecond}, RealTicks: {DateTime.Now.Ticks}");
}
}

private void HourlyTickEvent()
{
var now = DateTime.Now;
if (Debugger.IsAttached)
{
Debug.WriteLine($"HourlyTickEvent: CampaignTime: {TaleWorlds.CampaignSystem.Campaign.CurrentTime}, {now.Minute}:{now.Second}.{now.Millisecond}, RealTicks: {DateTime.Now.Ticks}");
}
}
}

Output
HourlyTickEvent: CampaignTime: 2187101, 57:30.719, RealTicks: 637220122507194017
HourlyTickEvent: CampaignTime: 2187102, 57:31.548, RealTicks: 637220122515482362
HourlyTickEvent: CampaignTime: 2187103, 57:32.377, RealTicks: 637220122523778839
HourlyTickEvent: CampaignTime: 2187104, 57:33.227, RealTicks: 637220122532272515
HourlyTickEvent: CampaignTime: 2187105, 57:34.39, RealTicks: 637220122540398341
HourlyTickEvent: CampaignTime: 2187106, 57:34.875, RealTicks: 637220122548758823
HourlyTickEvent: CampaignTime: 2187107, 57:35.725, RealTicks: 637220122557251414
HourlyTickEvent: CampaignTime: 2187108, 57:36.561, RealTicks: 637220122565617885
HourlyTickEvent: CampaignTime: 2187109, 57:37.359, RealTicks: 637220122573597151
HourlyTickEvent: CampaignTime: 2187110, 57:38.191, RealTicks: 637220122581919163
HourlyTickEvent: CampaignTime: 2187111, 57:39.26, RealTicks: 637220122590260626
HourlyTickEvent: CampaignTime: 2187112, 57:39.889, RealTicks: 637220122598893150
HourlyTickEvent: CampaignTime: 2187113, 57:40.714, RealTicks: 637220122607144825
HourlyTickEvent: CampaignTime: 2187114, 57:41.558, RealTicks: 637220122615586189
HourlyTickEvent: CampaignTime: 2187115, 57:42.363, RealTicks: 637220122623637831
HourlyTickEvent: CampaignTime: 2187116, 57:43.223, RealTicks: 637220122632239038
HourlyTickEvent: CampaignTime: 2187117, 57:44.59, RealTicks: 637220122640591476
HourlyTickEvent: CampaignTime: 2187118, 57:44.903, RealTicks: 637220122649032756
HourlyTickEvent: CampaignTime: 2187119, 57:45.706, RealTicks: 637220122657067555
HourlyTickEvent: CampaignTime: 2187120, 57:46.527, RealTicks: 637220122665275739
HourlyTickEvent: CampaignTime: 2187121, 57:47.377, RealTicks: 637220122673775992
HourlyTickEvent: CampaignTime: 2187122, 57:48.222, RealTicks: 637220122682220324
HourlyTickEvent: CampaignTime: 2187123, 57:49.63, RealTicks: 637220122690636114
HourlyTickEvent: CampaignTime: 2187124, 57:49.877, RealTicks: 637220122698770895
DailyTickEvent: CampaignTime: 2187124, 57:50.28, RealTicks: 637220122700289732
HourlyTickEvent: CampaignTime: 2187125, 57:50.821, RealTicks: 637220122708215705
HourlyTickEvent: CampaignTime: 2187126, 57:51.660, RealTicks: 637220122716607112
HourlyTickEvent: CampaignTime: 2187127, 57:52.494, RealTicks: 637220122724946085
HourlyTickEvent: CampaignTime: 2187128, 57:53.306, RealTicks: 637220122733065922
HourlyTickEvent: CampaignTime: 2187129, 57:54.176, RealTicks: 637220122741764285
HourlyTickEvent: CampaignTime: 2187130, 57:54.988, RealTicks: 637220122749888638
HourlyTickEvent: CampaignTime: 2187131, 57:55.844, RealTicks: 637220122758443830
HourlyTickEvent: CampaignTime: 2187132, 57:56.645, RealTicks: 637220122766455996
HourlyTickEvent: CampaignTime: 2187133, 57:57.527, RealTicks: 637220122775279054
HourlyTickEvent: CampaignTime: 2187134, 57:58.320, RealTicks: 637220122783207611
HourlyTickEvent: CampaignTime: 2187135, 57:59.148, RealTicks: 637220122791485576
HourlyTickEvent: CampaignTime: 2187136, 58:0.14, RealTicks: 637220122800141322
HourlyTickEvent: CampaignTime: 2187137, 58:0.822, RealTicks: 637220122808223183
HourlyTickEvent: CampaignTime: 2187138, 58:1.677, RealTicks: 637220122816772105
HourlyTickEvent: CampaignTime: 2187139, 58:2.528, RealTicks: 637220122825287449
HourlyTickEvent: CampaignTime: 2187140, 58:3.316, RealTicks: 637220122833162421
HourlyTickEvent: CampaignTime: 2187141, 58:4.156, RealTicks: 637220122841560134
HourlyTickEvent: CampaignTime: 2187142, 58:5.47, RealTicks: 637220122850474119
HourlyTickEvent: CampaignTime: 2187143, 58:5.812, RealTicks: 637220122858128809
HourlyTickEvent: CampaignTime: 2187144, 58:6.658, RealTicks: 637220122866582024
HourlyTickEvent: CampaignTime: 2187145, 58:7.499, RealTicks: 637220122874996457
HourlyTickEvent: CampaignTime: 2187146, 58:8.340, RealTicks: 637220122883407855
HourlyTickEvent: CampaignTime: 2187147, 58:9.164, RealTicks: 637220122891647707
HourlyTickEvent: CampaignTime: 2187148, 58:9.977, RealTicks: 637220122899775861
DailyTickEvent: CampaignTime: 2187148, 58:10.12, RealTicks: 637220122900125504
HourlyTickEvent: CampaignTime: 2187149, 58:10.827, RealTicks: 637220122908271120
HourlyTickEvent: CampaignTime: 2187150, 58:11.647, RealTicks: 637220122916471654
HourlyTickEvent: CampaignTime: 2187151, 58:12.491, RealTicks: 637220122924913980
HourlyTickEvent: CampaignTime: 2187152, 58:13.335, RealTicks: 637220122933355342
HourlyTickEvent: CampaignTime: 2187153, 58:14.176, RealTicks: 637220122941763378
HourlyTickEvent: CampaignTime: 2187154, 58:15.0, RealTicks: 637220122950002026

HourlyTickEvent: CampaignTime: 2187155, 58:33.115, RealTicks: 637220123131151669
HourlyTickEvent: CampaignTime: 2187156, 58:36.421, RealTicks: 637220123164214982
HourlyTickEvent: CampaignTime: 2187157, 58:39.713, RealTicks: 637220123197135513
HourlyTickEvent: CampaignTime: 2187158, 58:43.183, RealTicks: 637220123231837993
HourlyTickEvent: CampaignTime: 2187159, 58:46.477, RealTicks: 637220123264777798
HourlyTickEvent: CampaignTime: 2187160, 58:49.782, RealTicks: 637220123297823008
HourlyTickEvent: CampaignTime: 2187161, 58:53.94, RealTicks: 637220123330948010
HourlyTickEvent: CampaignTime: 2187162, 58:56.405, RealTicks: 637220123364058999
HourlyTickEvent: CampaignTime: 2187163, 58:59.725, RealTicks: 637220123397250338
HourlyTickEvent: CampaignTime: 2187164, 59:3.181, RealTicks: 637220123431810109
HourlyTickEvent: CampaignTime: 2187165, 59:6.535, RealTicks: 637220123465351847
HourlyTickEvent: CampaignTime: 2187166, 59:9.843, RealTicks: 637220123498436482
HourlyTickEvent: CampaignTime: 2187167, 59:13.128, RealTicks: 637220123531282700
HourlyTickEvent: CampaignTime: 2187168, 59:16.426, RealTicks: 637220123564269302
HourlyTickEvent: CampaignTime: 2187169, 59:19.740, RealTicks: 637220123597407735
HourlyTickEvent: CampaignTime: 2187170, 59:23.35, RealTicks: 637220123630350461
HourlyTickEvent: CampaignTime: 2187171, 59:26.370, RealTicks: 637220123663705194
HourlyTickEvent: CampaignTime: 2187172, 59:29.863, RealTicks: 637220123698634387
DailyTickEvent: CampaignTime: 2187172, 59:29.895, RealTicks: 637220123698954053
HourlyTickEvent: CampaignTime: 2187173, 59:33.146, RealTicks: 637220123731462025
HourlyTickEvent: CampaignTime: 2187174, 59:36.431, RealTicks: 637220123764317706
HourlyTickEvent: CampaignTime: 2187175, 59:39.717, RealTicks: 637220123797176548
HourlyTickEvent: CampaignTime: 2187176, 59:43.171, RealTicks: 637220123831711515
HourlyTickEvent: CampaignTime: 2187177, 59:46.497, RealTicks: 637220123864978276
HourlyTickEvent: CampaignTime: 2187178, 59:49.757, RealTicks: 637220123897579967
HourlyTickEvent: CampaignTime: 2187179, 59:53.32, RealTicks: 637220123930322380
HourlyTickEvent: CampaignTime: 2187180, 59:56.465, RealTicks: 637220123964653888
HourlyTickEvent: CampaignTime: 2187181, 59:59.749, RealTicks: 637220123997498917
HourlyTickEvent: CampaignTime: 2187182, 0:3.60, RealTicks: 637220124030601822
HourlyTickEvent: CampaignTime: 2187183, 0:6.377, RealTicks: 637220124063778554
HourlyTickEvent: CampaignTime: 2187184, 0:9.730, RealTicks: 637220124097300516
HourlyTickEvent: CampaignTime: 2187185, 0:13.189, RealTicks: 637220124131892900
HourlyTickEvent: CampaignTime: 2187186, 0:16.488, RealTicks: 637220124164884785
 
Last edited:
What will be best way to punishsomeone wh odoesnt pay back? Spawn a party which wilol hunt him down or make assoult inside of city on next visit?

Does anyone have some code for both actions?
 
Prevent him from trading with the cities of the faction he has a debt with. And as his "reputation" grows, every cities.
He should only be able to repay his loans. Until then, no trade.
 
I still didnt figure it out how to be ableto save state of bank in game save file. Im using an item I have created named banksaldo which I add before save with int value and remove on game loads..... I could as best keep truck of loans given by different factions....
 
Yeah this sounds great.

I would say as a way to punish people for not paying back their loans, firstly the player loses a whole bunch of good standing with the bank's faction and the city in which the bank resides. The bank should send out a succession of harder troops after you to collect the loan - perhaps they employ small factions to do this for them (Lake Rats, Eleftheroi etc). You could even be assigned a "quest" to collect the debts of non-payers.

Could you put your source code up on github or something? I'd love to see how you did what you've done so far.
 
You should use CampaignTime instead of DateTime, it actually matches the campaign time and you have many functions to convert time (seconds, ms, weeks, etc..), as well as elapsed time and so on
 
I would say as a way to punish people for not paying back their loans, firstly the player loses a whole bunch of good standing with the bank's faction and the city in which the bank resides. The bank should send out a succession of harder troops after you to collect the loan...

Like small group ambush encounters when you enter villages and cities?

for example:
 
Like small group ambush encounters when you enter villages and cities?

for example:

Making ambush group willl make one only richer...... and not willing to pay back. If you have 100ish troops it would be quite unrealistic that bank send 100 troops as well to fight you.... Easiest way is to just force player to pay back in common manner.

Im thinking on lowering reknown and maybe randomly making your clan members leave you.....
Suting down player workshops and caravans can be also a way to get coins back.......
 
Yeah this sounds great.

I would say as a way to punish people for not paying back their loans, firstly the player loses a whole bunch of good standing with the bank's faction and the city in which the bank resides. The bank should send out a succession of harder troops after you to collect the loan - perhaps they employ small factions to do this for them (Lake Rats, Eleftheroi etc). You could even be assigned a "quest" to collect the debts of non-payers.

Could you put your source code up on github or something? I'd love to see how you did what you've done so far.

Send me your email And I will send you files back.
 
Making ambush group willl make one only richer...... and not willing to pay back. If you have 100ish troops it would be quite unrealistic that bank send 100 troops as well to fight you.... Easiest way is to just force player to pay back in common manner.

Im thinking on lowering reknown and maybe randomly making your clan members leave you.....
Suting down player workshops and caravans can be also a way to get coins back.......
Is it possible to add Assassins to the Normal Nightime scene -as in not the way it played out in Warband where you get a little text saying "Youve walked into an Ambush" and then go on to fight your 5-7 guys. Meaning you dont know you are about to be ambushed, the villains are in the normal town scene like up on roofs etc...
 
Back
Top Bottom