PDA

View Full Version : Building attributes



uotfence
01-31-2007, 01:26
can someone tell me how to change building attributes, ie happiness bonus public health bonus etc

thanks in advance, very nice community you guys have here

Ciaran
01-31-2007, 11:49
Export_descr_buildings.txt

The boni come in levels (1,2,3...), each level representing a 5% bonus (level 1 equals a 5% happiness/health/etc bonus, level 2 a 10% bonus and so on).


Instead of opening a new threat, I might just as well post my question here, since it goes into much a similar vein.

Is it possible to use multiple building requirements for units in M2TW, like in MTW 1, or can any unit have only one certain building as a building requirement? And how about other buildings, can one building or building upgrade be dependant on the presence of another building (for example, the highest stable level requires the presence of at least a blacksmith)?
I wonder because, in short, I think acessing the high-quality troops, like Knights, is way too easy. Heck, even spear militia require a seperate building, but you get the best Knights by simply upgrading your castle. Now, when I think what I have to do in order to get even Feudal Knights in MTW 1, that feels like a real achievement, and it is also worth the time and money.

SilentResident
01-31-2007, 22:20
If you want more help about the attributes, try a look at:
"To all the M2TW Gamers: Game Bonus List" topic.

Foz
02-01-2007, 01:49
Instead of opening a new threat, I might just as well post my question here, since it goes into much a similar vein.

Is it possible to use multiple building requirements for units in M2TW, like in MTW 1, or can any unit have only one certain building as a building requirement? And how about other buildings, can one building or building upgrade be dependant on the presence of another building (for example, the highest stable level requires the presence of at least a blacksmith)?
I wonder because, in short, I think acessing the high-quality troops, like Knights, is way too easy. Heck, even spear militia require a seperate building, but you get the best Knights by simply upgrading your castle. Now, when I think what I have to do in order to get even Feudal Knights in MTW 1, that feels like a real achievement, and it is also worth the time and money.
Okay, Q&A Time. I'll post code and discuss.


Is it possible to use multiple building requirements for units in M2TW, like in MTW 1, or can any unit have only one certain building as a building requirement?
A: I think it is possible. Look at the following code that defines the wooden wall building for a city.


wooden_wall city requires factions { northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
{
convert_to 2
capability
{
recruit_pool "Conquistadores" 1 0.4 3 0 requires factions { spain, portugal, } and hidden_resource america
recruit_pool "Dismounted Conquistadores" 1 0.4 3 0 requires factions { spain, portugal, } and hidden_resource america
recruit_pool "Town Militia" 1 0.2 2 0 requires factions { england, scotland, france, hre, denmark, spain, portugal, Normans, }
recruit_pool "Italian Militia" 1 0.2 2 0 requires factions { milan, venice, papal_states, sicily, }
recruit_pool "EE Town Militia" 1 0.2 2 0 requires factions { poland, hungary, }
recruit_pool "EE Archer Militia" 1 0.2 2 0 requires factions { russia, }
recruit_pool "SE Town Militia" 1 0.2 2 0 requires factions { byzantium, }
recruit_pool "ME Town Militia" 1 0.2 2 0 requires factions { moors, turks, mongols, timurids, }
recruit_pool "ME Archer Militia" 1 0.2 2 0 requires factions { egypt, }
recruit_pool "Peasant Spearmen" 1 0.2 2 0 requires factions { Saxons, }
wall_level 1
gate_strength 1
tower_level 1
free_upkeep bonus 3
happiness_bonus bonus 1
recruitment_slots 2
}
material wooden
construction 2
cost 1200
settlement_min town
upgrades
{
stone_wall
}
}
Note that I've highlighted a line, because it does something interesting: it sets up a unit to be available for recruitment, but only to be available if the settlement is in America (it refers to a resource "america" but IIRC it's used to label all cities of the americas as american for game purposes). You should be able to do something very similar to this to impose building requirements on unit availability. More on that once I cover the particular mechanic.


And how about other buildings, can one building or building upgrade be dependant on the presence of another building (for example, the highest stable level requires the presence of at least a blacksmith)?

Most certainly this can be (and is already) done. View the code below.


merchants_wharf city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and building_present_min_level port port
{
capability
{
trade_fleet 1
trade_base_income_bonus bonus 2
}
material wooden
construction 3
cost 1600
settlement_min city
upgrades
{
warehouse
}
}

After the line sets up the factions allowed to build the building, it goes on to specify that a port type building must exist (the first word port) of at least the level port (the second use of port). If you made this for instance instead read as follows...


merchants_wharf city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and building_present_min_level smith armourer

...then you would have to have an armourer (smith tells the game which set of buildings armourer is part of) built in this city before you could build a merchant's wharf. I could be wrong, but I am guessing that building_present_min_level can be used in a similar way to how "hidden_resource america" was used in the first example, in order to impose a building presence requirement on a recruitable unit. So if you wanted to require at least a "knight's stables" in order to allow the conquistadores to be recruited by the walls (instead of forcing it to be in america), I think the code should be:


recruit_pool "Conquistadores" 1 0.4 3 0 requires factions { spain, portugal, } and building_present_min_level equestrian knights_stables

Important notes:

1. Make sure you check where any building you set as a requirement can be built. Often they are city- or castle-specific. In the case of the armourer I showed above, that Merchants Wharf could only be built in a city then, because the smith line of buildings requires a city to be built. The building also requires it can only be built in a city, by "merchants_wharf city requires." There is a nearly identical castle_smith line of buildings, but the game considers them entirely different things. So if I did this:


merchants_wharf city requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, } and building_present_min_level castle_smith c_armourer

..Then all the code looks fine, and seems to make sense, except that a city as required by merchants_wharf can in fact never build a c_armourer building (restricted to castles) and therefore the wharf would be unavailable anywhere. Similar things could happen with units, if you impose for instance a smith (city only) requirement on a unit that is only recruited in castle wall buildings. This is very important, and you'll drive yourself nuts if you don't make certain what you're doing as you're doing it.

2. Test each idea at least once before starting to change everything. I haven't tried ANY of these things myself, but I'm quite good at picking this sort of thing up just from reading files. That being the case, though, it's still possible I misinterpreted something, or that something you want to do just isn't supported by the game, and I'd hate for a custom EDB file to get into a state where you can't figure out all of your changes to undo them and get the game running. This also gives you a better idea of what you've botched if the game decides not to load at any point as there's less changes to consider as possible sources of trouble.

3. I intentionally avoided handing you the code for exactly what you want to do. You wouldn't learn anything that way, and if I'm going to take this much time explaining something, I at least want the satisfaction of knowing you took that information and successfully applied it your problem... plus it puts you in a far better position should you decide to mod the file beyond the few things you outlined. I realize it may be a little less convenient, but I also hope it will end up being far more helpful to you and perhaps the community at large.

That said... best of luck. Keep me posted with any questions you have, and of course results!

Ciaran
02-01-2007, 09:16
Thanks for the answer, although I knew most of it from RTW, but I´m glad that at least in the building department nothing changed.

However, your unit example isn´t exactly what I asked, it refers to a hidden resource, they are unproblematic. But up to RTW 1.2 it was possible to have a unit to require more than one building (one of the stable line and one from the blacksmith line, for example), trying the same from 1.3 onward resulted in game crashes. That is the big question.

Foz
02-01-2007, 18:06
Thanks for the answer, although I knew most of it from RTW, but I´m glad that at least in the building department nothing changed.

However, your unit example isn´t exactly what I asked, it refers to a hidden resource, they are unproblematic. But up to RTW 1.2 it was possible to have a unit to require more than one building (one of the stable line and one from the blacksmith line, for example), trying the same from 1.3 onward resulted in game crashes. That is the big question.

What you're looking for is in there, it's just hiding in the middle somewhere:


I could be wrong, but I am guessing that building_present_min_level can be used in a similar way to how "hidden_resource america" was used in the first example, in order to impose a building presence requirement on a recruitable unit. So if you wanted to require at least a "knight's stables" in order to allow the conquistadores to be recruited by the walls (instead of forcing it to be in america), I think the code should be:


recruit_pool "Conquistadores" 1 0.4 3 0 requires factions { spain, portugal, } and building_present_min_level equestrian knights_stables

To elaborate, the Conquistadors would then be recruited by the walls, but require a knights_stables to be recruitable too. You should be able to use a building_present_min_level condition in exactly the same way the Conquistadors use "hidden_resource america," tying it to whatever other building you want to require (in addition to the one where the unit is recruited from obviously).

In your specific case, I'm suggesting you try this to see if it works:


building equestrian
{
levels stables knights_stables barons_stables earls_stables kings_stables
{
stables castle requires factions { northern_european, middle_eastern, eastern_european, greek, southern_european, }
{
capability
{
recruit_pool "Hobilars" 1 0.5 4 0 requires factions { england, }
recruit_pool "Border Horse" 1 0.5 4 0 requires factions { scotland, }
recruit_pool "Mounted Sergeants" 1 0.5 4 0 requires factions { france, hre, milan, venice, papal_states, sicily, }
recruit_pool "Scouts" 1 0.5 4 0 requires factions { denmark, }
recruit_pool "Jinetes" 1 0.5 4 0 requires factions { spain, portugal, }
recruit_pool "Polish Shooters" 1 0.5 4 0 requires factions { poland, }
recruit_pool "Kazaks" 1 0.5 4 0 requires factions { russia, }
recruit_pool "Magyar Cavalry" 1 0.5 4 0 requires factions { hungary, }
recruit_pool "Skythikon" 1 0.5 4 0 requires factions { byzantium, }
recruit_pool "Desert Cavalry" 1 0.5 4 0 requires factions { moors, egypt, }
recruit_pool "Turkish Horse Archers" 1 0.5 4 0 requires factions { turks, timurids, }
recruit_pool "Mongol Horse Archers" 1 0.5 4 0 requires factions { mongols, }
recruit_pool "Mailed Knights" 1 0.5 4 0 requires factions { Normans, } and building_present_min_level castle_smith c_armourer
}
material wooden
construction 2
cost 1200
settlement_min town
upgrades
{
knights_stables
}
}
I've bolded the line I modified, and used italics to indicate exactly what I added. In this case the faction Normans should now be required to have an armourer present in any given castle before that castle's Stables will add Mailed Knights to the recruitment pool there.

I don't know for sure that this works since I've extended a concept I can only find applied to buildings (buildings_present_min_level) to the realm of recruitable troops too, but the fact that conditionals can be attached to recruitment pool entires (like hidden_resource america did) makes me pretty confident it will in fact work.

Ciaran
02-02-2007, 12:01
Precisely that´s the code, which I know already. I have quite a history of tweaking around RTW and various RTW mods, after all. So I know how it´s supposd to work, the question is whether it actually does, or if the game will crash. As I said, in RTW 1.2 multiple building requirements were possible, from 1.3 on they were not.

Foz
02-02-2007, 22:00
Precisely that´s the code, which I know already. I have quite a history of tweaking around RTW and various RTW mods, after all. So I know how it´s supposd to work, the question is whether it actually does, or if the game will crash. As I said, in RTW 1.2 multiple building requirements were possible, from 1.3 on they were not.
Well sheesh... If you already know how to do it, then go try it instead of being lazy. It should take all of 10 minutes (if even) to setup a unit with that sort of line, go start the game, and build some buildings to see what happens.

uotfence
02-02-2007, 22:18
hey guys a follow up question.

is it necessary to unpack your files first? or can you just drop the txt file(from a previous unpack) in there and edit it.

oh hell let me just ask specifically what i want and hopefully someone will be nice enough to help

i have a fresh copy with lands to conquer 2.1 on it

i want to edit the game so cities are not so retarded hard to manage in late game because of squalor and other happiness bonuses. i want to do so by editing some building attributes. so can anyone tell me what i need to do?:help:

i don't remember it being so hard in RTW :(

uotfence
02-06-2007, 01:02
http://blogbugs.org/uploads/f/freshsex/21606_thumb.jpg enjoy and thanks for the help