I am having some trouble modding building requirements. I don't understand how logic here works. Let's assume I have a government building with two possible upgrade paths:
mygovprec > mygov1_level1 > mygov1_level2 > mygov1_level3 > mygov1_level4
mygovprec > mygov2_level1 > mygov2_level2 > mygov2_level3
Code:
building mygov
{
levels mygovprec mygov1_level1 mygov2_level1 mygov1_level2 mygov2_level2 mygov1_level3 mygov2_level3 mygov1_level4
; etc
}
Now I need a building that requires one government path and not the other AND either a market or caravans. So logic should be "(mygov2_level1 OR mygov2_level2 OR mygov2_level3) AND (market OR caravans)". I am only aware of `building_present_min_level` condition so I tried something like this:
Code:
building mybuilding
{
; ...
mybuilding_level1 requires factions { ... }
and building_present mygov
and building_present market or building_present caravans
and not building_present_min_level mygov mygov1_level1 or building_present_min_level mygov mygov2_level1
and not building_present_min_level mygov mygov1_level2 or building_present_min_level mygov mygov2_level2
and not building_present_min_level mygov mygov1_level3 or building_present_min_level mygov mygov2_level3
and not building_present_min_level mygov mygov1_level4
; ...
}
I tried to play with order of conditions, but I don't understand the rule how the engine evaluates this, in which order and which precedence. In any normal language, AND takes precedence over OR. That doesn't seem to be the case here. Left-to-right also doesn't seem like the way this works.
There might be some typos in the code, please ignore them. Also I broke the condition into several lines for readability (and how I hoped it would be evaluated).