hi, how i can add my building\unit to race? and resources in existing biome?
as I understand include availables in "h_r_human" file. why not include in building\unit scripts, and resources discription include biomes list.
A City Builder / RTS · By
I really should have gotten around to documenting the XML format, but it's tedious work.
So, you want to add a building/unit to an existing race? "h_r_human" is the race definition. The "available_unit" entries aren't used that much, only for determining what settlers the race can produce. "available_structure" is the more important one, as that populates the list of structures you can place. New units should be added through a structure. The "id" attribute on "available_structure" needs to correspond with the "id" on a "structure_data" element somewhere in the xml files. The actual names of the files are only important for over-writing files through mods, you can name a new XML file whatever you'd like.
When you build that new structure it will train and support he new unit.
Note: "h_s_barracks_melee", and many of the other structure definition files in BaseMod.zip contain multiple structure definitions. You can do this if you like, I find it handy to keep the entire upgrade chain of a structure type together.
Hopefully this clears things up a little.
This is more of a multi-step process.
Side Note: Thanks for asking these questions, it's made me realize how crummy the ModApi is for modifying data instead of creating new data. I'll work up a better system for this but it will probably be a few weeks.
The world generator is based on noise maps (here's an overview) that have values between 0 and 1, there are several maps defined in "wg_noisemaps" in BaseMod.zip. (you can add new ones too). "noise_mapping" maps the values of noise maps to a biome, when the world is generating biomes are picked based on their noise mappings. The biome closest to all of it's "ideal_value"s is chosen.
desert, for example has:
<noise_mapping id="height" ideal_value="0.6" /> <noise_mapping id="rain" ideal_value="0.0" />
That means that an area that's fairly high in elevation and low in rainfall will tend to be desert.
For comparison, grassland has:
<noise_mapping id="height" ideal_value="0.6"/> <noise_mapping id="rain" ideal_value="0.4"/>
Both of these biomes have the same value for height, but different values for rain. If the "rain" noise map has a value of 0.1 in the area, then "desert" will be a better match, and will be picked. If the "rain" noise map has a value of "0.3" in the area, then "grassland" will be a closer match.
The noise mapping you pasted, uses the "oretype" noise map. That noise map controls what type of ore-type resources appear in the ground. This tends to make some areas rich in limestone, and others rich in copper.
Does that all make sense?
hello again. new mutate data question. how i can smaller this?
<mutators> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_cm"/> </add_element> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_tm"/> </add_element> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_wb"/> </add_element> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_bs"/> </add_element> </mutators>
below not work (work only "human_cm")
<mutators> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_cm"/> <available_structure id="human_tm"/> <available_structure id="human_wb"/> <available_structure id="human_bs"/> </add_element> </mutators>
and, structure data "needs_road_access" not working? i set true and nothing changes.
ps: in some cases, when click on error view in main menu, game crashes and crash log full spam. sample:
<mutators> <add_element parent_type="race" parent_id_attribute="id" parent_id_value="race_human"> <available_structure id="human_tm" id="human_wb" id="human_bs" id="human_cm"/> </add_element> </mutators>
Right now add_element will only add the first descendant. That was the simplest approach from a code standpoint. I could make it able to add multiple, but it doesn't seem like that big an issue to me.
needs_road_access is only used for UI feedback for the player. If a structure has needs_road_access set to true, then you'll see a warning icon in the game if the structure doesn't have a walkable hex (road or empty) adjacent to it.
<available_structure id="human_tm" id="human_wb" id="human_bs" id="human_cm"/>
Duplicate attributes aren't allowed in XML, and due to the way the data mutators are executed that XML file is parsed (and throws an error) for every datafile loaded.
Did I get everything? Thanks for all of the questions, by the way.