Kenway1776
Landlubber
How do I improve town economy? Kinda sad see barbados island always on bad economic situation. And is trading mission really help to improve town economy? Or is just normal quest?
Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
How do I improve town economy? Kinda sad see barbados island always on bad economic situation. And is trading mission really help to improve town economy? Or is just normal quest?
I was talking to "redarmy275" on our Discord the other day, who was trying to give the player some more influence in the town economy.How do I improve town economy?
string sTownName = GetCurrentTownID();
int TownGold = GetTownGold(sTownName);
TraceAndLog(sTownName + ": Old Gold = " + TownGold);
SetTownGold(sTownName, TownGold+100);
TownGold = GetTownGold(sTownName);
TraceAndLog(sTownName + ": New Gold = " + TownGold);
Douwesen: Old Gold = 12000000
Douwesen: New Gold = 12000100
Douwesen: Old Gold = 12000100
Douwesen: New Gold = 12000200
Douwesen: Old Gold = 12000200
Douwesen: New Gold = 12000300
Douwesen: Old Gold = 12000300
Douwesen: New Gold = 12000400
Why?Why is the loanshark now responsible for the town's entire gold reserve? Possibly add a small percentage to the town's gold when you make a deposit with the loanshark, as he's investing some of your money into local companies in the hope of making some profit for himself. But I don't think your entire loan should be taken from the town, nor your entire deposit be given to the town.
Honestly, I never did quite understand the difference between those two...But I can see one improvement that may need to be made to "Usurer_dialog.c". Isn't 'sti' the correct way to convert a string to an integer, rather than 'makeint'?
Easy. Remove all the adjustments to town gold apart from the one where you're depositing gold, and change that to give 10% of the deposit to the town as the loanshark uses some of your money to invest in local business in the hope of making a profit. (He's not a charity, so he has to make the money to pay your interest somehow!)If you want to make it more fancy, go for it.
SetTownGold(NPC_Area, GetTownGold(NPC_Area)+makeint(Pchar.Quest.Loans.(NPC_Area).Sum));
SetTownGold(NPC_Area, GetTownGold(NPC_Area)+makeint(sti(Pchar.Quest.Deposits.(NPC_Area).Sum)/10));
I thought that 'makeint' is to convert a float to an integer, while 'sti' converts a string to an integer, and that's how I used them here - 'sti' to turn the attribute into an integer, 'makeint' to turn it back into an integer after it's been divided by 10. Having said that, there are plenty of code lines which use 'makeint' to convert an attribute to an integer and seem to get away with it - unless any of them are causing bugs which haven't been spotted yet...Honestly, I never did quite understand the difference between those two...
Without anyone knowing better, I'd say that's a decent way to look at 'em.I thought that 'makeint' is to convert a float to an integer, while 'sti' converts a string to an integer, and that's how I used them here
I kind-of hope so; that was the original wish, after all...Whether that will affect the town's actual economy status, and therefore the types of ships for sale in the shipyard, items for sale from stores and traders, etc., I've no idea.
Version 2 attached. In this one, the fraction of your deposit which the loanshark invests in local business is now a variable defined at the top of the file:I kind-of hope so; that was the original wish, after all...
But probably not, actually.
I suspect that requires a call to the 'AdjustTownEconomy' function too; as shown by 'LaunchRandomTownEvent' in Towntable.c .
float NPC_INVEST_RATE = 0.1; // If you deposit money, the loanshark invests this much of it into local business...
int NPChar_Investment; // ... and this is the amount invested
NPChar_Investment = makeint(sti(Pchar.Quest.Deposits.(NPC_Area).Sum) * NPC_INVEST_RATE);
SetTownGold(NPC_Area, GetTownGold(NPC_Area) + NPChar_Investment); // GR: Some of deposit invested into town gold
switch (GetTownEconomy(GetTownFromID(NPC_Area)))
{
case TOWN_ECONOMY_STARVING:
if (NPChar_Investment > 10000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1);
if (NPChar_Investment > 50000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1);
break;
case TOWN_ECONOMY_STRUGGLING:
if (NPChar_Investment > 50000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1);
if (NPChar_Investment > 500000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1);
break;
case TOWN_ECONOMY_SURVIVING: if (NPChar_Investment > 500000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break;
case TOWN_ECONOMY_PROSPERING: if (NPChar_Investment > 1000000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break;
// No entry for TOWN_ECONOMY_WEALTHY as that's the maximum economy level!
}
Oooh; nice improvements there!!Version 2 attached.
Version 2 attached. In this one, the fraction of your deposit which the loanshark invests in local business is now a variable defined at the top of the file:Then, at case "deposit_exit":Code:float NPC_INVEST_RATE = 0.1; // If you deposit money, the loanshark invests this much of it into local business... int NPChar_Investment; // ... and this is the amount invested
Depending on the town's current economy and how much you deposit, the economy can go up by 1, and the lower two economies can even go up by 2 if you invest a lot. Note, those threshhold values are the amount the loanshark is investing, currently 10% of your deposit, so you'd need to deposit 500000 to raise a "starving" settlement up to "surviving". I might raise the values because the town's initial gold is its population multiplied by TOWN_GOLD_SCALAR, a global variable defined in "InternalSettings.h" and currently 10000, which means even the smallest, most pathetic town with a population of 200 will have 2000000 gold. Having said that, look through "InitTowns.c" - population, and therefore initial gold, does not necessarily relate to the town economy. And random events don't necessarily change the town's gold to match the economy change, which means that over time, the link between town gold and town economy breaks even more.Code:NPChar_Investment = makeint(sti(Pchar.Quest.Deposits.(NPC_Area).Sum) * NPC_INVEST_RATE); SetTownGold(NPC_Area, GetTownGold(NPC_Area) + NPChar_Investment); // GR: Some of deposit invested into town gold switch (GetTownEconomy(GetTownFromID(NPC_Area))) { case TOWN_ECONOMY_STARVING: if (NPChar_Investment > 10000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); if (NPChar_Investment > 50000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break; case TOWN_ECONOMY_STRUGGLING: if (NPChar_Investment > 50000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); if (NPChar_Investment > 500000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break; case TOWN_ECONOMY_SURVIVING: if (NPChar_Investment > 500000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break; case TOWN_ECONOMY_PROSPERING: if (NPChar_Investment > 1000000) AdjustTownEconomy(GetTownFromID(NPC_Area), 1); break; // No entry for TOWN_ECONOMY_WEALTHY as that's the maximum economy level! }
In any case, here's the result of depositing about 8.8 million with the Speightstown loanshark. For comparison, also shown is Cayman's current status.
View attachment 39049 View attachment 39050
Speightstown goes from economy -1 (struggling) to +1 (prospering) because the loanshark puts about 880000 into local businesses. Speightstown's "struggling" gold was nearly 6.5 million before the deposit. Cayman has 7.4 million and economy +2 (wealthy), the highest possible rating. (This is a well-advanced game in which random events have had a few years to play havoc with towns' gold reserves and economies.)
it is difficult to find the population. Find a citizen and have a dialogue where he provides the population. It is impossible if the city you want to know the economic data of is the enemy. So I had an idea, is there a way to add a simple spy mechanic? I thought about whether to put a character in the fort, or in the city hall that is a spy. then you talk to him and he tells you the data of a certain colony. Hence if it is an allied colony it provides the precise data, if it is an enemy colony it provides approximate data. I want to do this, but I have no idea how to do it. I even know a little bit and c++. but i get lost when i look at the codesI did that using "console.c", though I can't remember off-hand exactly what commands I used.
But you should be able to find a town's population by talking to one of its citizens. Look for a permanent resident, who probably won't be carrying a weapon. There are also random visitors who do carry weapons and who have different things to say, such as random game hints, trying to sell you things or begging for money; these will never tell you the population. You may need to talk to a permanent resident several times before the conversation offers the chance to ask about the colony.
And you should be able to get some idea of the town's gold by talking to the store or shipyard because they use the town's gold rather than their personal wealth.
Speightstown should be "Surviving", similar to Sao Jorge and Kralendijk, though its population is smaller so its initial gold is lower. Bridgetown is "Struggling" and also has a relatively small population. Random events can improve or reduce the economies - check the tavern news.Is Barbados in the current build set to be eternally struggling? I've noticed a constant low amount of goods with both traders.
It is not impossible. Forts and ships now have a small but non-zero chance of seeing through your false flag so you probably don't want to sail to the port, but you can moor at a nearby beach, walk to town, then talk to citizens.it is difficult to find the population. Find a citizen and have a dialogue where he provides the population. It is impossible if the city you want to know the economic data of is the enemy.