Recent content by AIAndy

  1. A

    Quick Questions , Quick Answers

    It seems to be specifically disallowed by code in CvPlayer::canTradeItem: case TRADE_CITIES: { CvCity* pCityTraded = getCity(item.m_iData); if (NULL != pCityTraded && pCityTraded->getLiberationPlayer(false) == eWhoTo) { bResult = true; } else if (GC.getDefineINT("CAN_TRADE_CITIES") > 0 && 0...
  2. A

    Assigning AI to the same team breaks the mod

    Ah, that code is not actually in the BUG part of the code where I looked but in the Afforess folder. It does look slightly wrong though. def changedHideAutomateHunt(option, value): GC.getActivePlayer().setModderOption(ModderOptionTypes.MODDEROPTION_HIDE_AUTO_HUNT, value)...
  3. A

    Assigning AI to the same team breaks the mod

    They are not an issue because there is no cross platform. When you have multiple platforms there will not be the exact same processor instructions because of different compilers and their optimizers, sometimes not even the same instruction set. And floats are more susceptible to getting...
  4. A

    Assigning AI to the same team breaks the mod

    Floats and doubles are not the usual issue of OOS errors in Civ4. They are as deterministic as integers. The most common cause is using unsynchronized functions (like local player) or unsynchronized game state (that is usually UI state) from the synchronized code part or using functions that...
  5. A

    Quick Questions , Quick Answers

    I was mainly mentioning it because in that game you also have to split and merge armies pretty often and while you can manually do it, most of the time you press the split in half button once or several times to the sizes you need. Large stacks in Civ are actually somewhat similar so I think a...
  6. A

    Quick Questions , Quick Answers

    A popup seems too clunky to use anyway. Have you ever played Europa Universalis 4 or a similar Paradox game? The button to split an army in half solves most of that kind of need as if you want a smaller piece you can just press the split in half button again. The required skillset to implement...
  7. A

    Quick Questions , Quick Answers

    You should probably be more specific about not only what you want to be able to do but how you want to do it. Example: Add a button at <insert desired position on screen here> that when clicked deselects half of the currently selected units, equally split among unit types. @Thunderbrd : There...
  8. A

    C2C - Units

    I was planning to do it a bit more completely but then got stuck in all the redundant copies of more or less the same code and I won't get to much more in the next weeks as I will be away from my computer. So I have attached the changes as far as I got as a patch file. This means: - The code in...
  9. A

    C2C - Units

    The redundancy does not necessarily make it better as they increase the complexity and calculate parts of the same thing but in different ways. Both try to include the value of being able to produce a unit into the value of something else but instead of calling some unit value function, they try...
  10. A

    C2C - Units

    I have been skimming the XML files and it seems like the unit and building dependencies have changed a lot in the last years (well, nearly a decade ...). So if I get that correctly, to build a unit you usually need a building in the city itself and certain resources that are produced anywhere in...
  11. A

    C2C - Units

    Well, I have actually implemented the code for the "What if" evaluation of BoolExpr and applied it to the AI code that values buildings that enable buildings with ConstructCondition. The code there is pretty clear as it evaluates canConstruct with an extra building parameter so it checks if the...
  12. A

    C2C - Units

    Absolutely. This is a memory patching technique. If an info class is destroyed while it has a delayed resolution pointing to a part of its memory and that delayed resolution is not removed, then the delayed resolution will patch the memory anyway. At best it will be currently unused memory, at...
  13. A

    C2C - Units

    Well, there is AI code for the existing tags. While you probably could not do it in its full generality, you could do the same for the standard cases of TrainCondition that are similar to what the old tags express. As an example here is the code for determining if a bonus that a building...
  14. A

    C2C - Units

    The boolean expressions can be nested and there is no depth limit. You can consider them a tree that describes the order of evaluation. The leafs are evaluated first and then you work up the tree until you get to the root. In the XML representation of the tree you write the operator (And, Or...
  15. A

    Random(?) Crashes

    This is about reading a path in the XML which is usually relative and not absolute. But now that I look at it more closely this is from reading an XML file that I don't think is even present in C2C so the default XML from the BTS installation is used. And finally looking even more closely this...
Top Bottom