I would like to implement maintenance costs into my mod. Is there a way to attach a per turn cost to a building?
You should ask the guys from War of the West, you can see in their preview that they have buildings with upkeep.
you can make it by script only.
I know this might be kind of ghetto, but what if you just put a negative income bonus on a building?
Negative income only works if you have bonusses to start with and don't give integer numbers.
I think building it by script is best, It's actually pretty easy to script. SettlementTurnStart SettlementIsLocal/ SettlementBuildingExists (condition might be wrong lol), console_command add_money -250 and you're done!
I'd Combine it with the "income_bonus" IIRC it shows up as an effect followed by a number but doesn't actually do anything so if you change it in the text strings it could look like: upkeep kost: 250
Example of a script:
As long as the building is present in the relevant settlement, you will pay each turn 250 maintenance costs.Code:monitor_event SettlementTurnStart SettlementName Imladris and SettlementBuildingExists >= m_greek_history add_money egypt -250 end_monitor![]()
You will have to do each building for each settlement for each faction... the script will be large.
Also, the add_money command does not show up in the treasury scroll until the following turn (and even then it doesnt show up as anything in particular, the money is just not there). So the AI will still think it has that money until the next turn when it will be too late and suddenly the AI is bankrupt. And u as the player will be like, "this scroll doesnt add up, i had 15,000 last turn with an income of 350, and suddenly i have 10,000"... because nothing shows up (or adds up) in the scroll when taken from script unless u do it via kings purse.
Better i think, but more involved is changing the kings purse +/- When a building is constructed. this way it shows up in the treasury scroll.
...longbows, in skilled hands, could reach further than trebuchets...
Well there is no need to add the name of the settlement, hence one monitor per building you want upkeep for is enough.
But changing the kings purse ( didn't even know this was possible actually ) does a "set kings purse" command exist ? or only "increase kings purse" ? Alternativly can it go negative ?
There is the increment_kings_purse "your faction" "amount of money" command. I guess it will also work like this: increment_kings_purse engeland -200
EDIT: I just looked in the Docudemons and there is also the set_kings_purse command
Last edited by Emperor of Hell; October 27, 2011 at 04:52 AM.
Yep, negative values work.
The answer is yes...i was able to make the kings purse increase/decrease when kings gained or lost regions....i have had them fall into the negative before and it worked ok...not sure if they can start at a negative number, though i'm sure i've seen other mods start with them in the negative...
Last edited by valvegas1; October 27, 2011 at 10:33 PM.
I think there may be a limit to the number of modifications that can be made to the king's purse, though I'm not sure how or why that would be the case. RB uses modifications to the purse to simulate trade agreements with off-map factions and only the first half-dozen or so seem to work. Also, the reduction to the the Irish purse based on retaking all the Irish provinces seems to fail a lot when you turtle the game and have agreed to a large number of these events prior to that happening.
It could simply be an issue with the number of counters in play of course, since RB uses a large number of them. Or it might be the case that they ARE working and the display doesn't always update correctly...