Alekseyev_
Warlord
- Joined
- Jul 18, 2014
- Messages
- 259
Very hyped for R10!
Interesting you guys mention this now, I myself just recently stumbled over the hijacking of the L key while playing a game. I fixed it by making the unit load command take precedence over activating the city location highlighter. That fix will appear in R10 which is coming soon. Remapping the highlighter to O would work too but I like having it bound to L since it's supposed to be short for "location", as in AI city location. Similarly the P key binding is supposed to be short for "production". At first I wanted those key bindings to include shift, control, or alt, but that turned out to be surprisingly difficult since the game processes those key presses in some functions other than the ones I'm familiar with.
I've never had this happen to me. Sorry but I can't do anything about bugs that I can't reproduce.To me this is a bug, but it might be unique to me. Sometimes, and I am not sure why it happens (it doesn't happen that often), the game will no longer accept mouse input. I have to save from the keyboard and then load the game again.
Added to the list. That function is probably not labelled in the Steam version. There are far more labeled functions, like 10 times as many at least, in the GOG version since that's where I do all my reverse engineering work. In the Steam version I only find & label what I need to port the mod over.Not related, but I would love to have the option to have improvements be able to remove pop/building pollution fully. While a minor distraction in normal play, on scenarios that limit your ability to create workers it does get annoying (and far more problematic for the AI than myself). I saw the function labeled in Ghydra, but failed to find it on the steam version (I don't quite get how to use the search function)
Actually the easiest thing would have been to move the city location highlighter to a different key but I didn't even think of that at the time. I just like the idea of L for "location", though it doesn't really matter. Also when I was programming that in the first place I had forgotten about L to load units otherwise I probably would have picked a different key. I don't like how the game reuses hotkeys depending on context, there's one annoying overlap, Shift+D for both diplomacy and some worker function (auto clear pollution?), that always trips me up.I'm happy for your fix to be the permanent solution to the problem Flintlock if it makes implementing it much easier for you. It was a suggestion I thought of as a work-around for the issue after I discovered it, but it sounds like your fix of the issue will be a better overall solution given it makes more sense for L to have multiple functions depending on context
Don't quote me, but I think this might already be possible using @Quintillus' Editor (it might even be possible using the original Firaxis Editor?)Not related, but I would love to have the option to have improvements be able to remove pop/building pollution fully.
"B" being used for both "{B}uild(/join) city" and "{B}ombard" works fine in the epic-game -- but not in mods which include bombard-capable units which also have a population-cost.I don't like how the game reuses hotkeys depending on context, there's one annoying overlap, Shift+D for both diplomacy and some worker function (auto clear pollution?), that always trips me up.
This doesn't quite work. A building with the flag "Reduces population pollution" SETS population pollution at 1 (as long as city is a metropolis, 0 otherwise).Don't quote me, but I think this might already be possible using @Quintillus' Editor (it might even be possible using the original Firaxis Editor?)
If you can give an improvement(s) a sufficiently large negative pollution-value, you should be able to cancel out those last 2 pollution-icons which are left over after building a "Reduces population pollution"-improvement (= epic-game Mass-Transit, caps pop-pollution at 1 icon) and a "Reduces building pollution"-improvement (=epic-game Recycling Center, caps building-pollution at 1 icon).
iVar1 = (this->Body).Improvements_Pollution;
ret = iVar1;
if (0 < iVar1) {
i_improvement = 0;
num_cleaning_improvs = 0;
if (0 < bic_data.ImprovementsCount) {
iVar3 = 0;
do {
bVar2 = has_improvement(this,i_improvement,true);
if (bVar2 != false) {
id = *(int *)((int)(&(bic_data.Improvements)->CivilopediaEntry + 3) + iVar3 + 0x1c);
if (-1 < id) {
bVar2 = Leader::has_tech(leaders + (byte)(this->Body).CivID,id);
if (bVar2 != false) goto LAB_004b1bd3;
}
if ((*(byte *)((int)&(bic_data.Improvements)->ImprovementFlags + iVar3) & 0x40) != 0) {
num_cleaning_improvs = num_cleaning_improvs + 1;
}
}
LAB_004b1bd3:
i_improvement = i_improvement + 1;
iVar3 = iVar3 + 0x110;
} while (i_improvement < bic_data.ImprovementsCount);
ret = 1;
if (num_cleaning_improvs == 0) {
ret = iVar1;
}
}
}
return ret & (ret < 0) - 1;
}
This doesn't quite work. A building with the flag "Reduces population pollution" SETS population pollution at 1 (as long as city is a metropolis, 0 otherwise).
If you can give an improvement(s) a sufficiently large negative pollution-value, you should be able to cancel out those last 2 pollution-icons which are left over after building a "Reduces population pollution"-improvement (= epic-game Mass-Transit, caps pop-pollution at 1 icon) and a "Reduces building pollution"-improvement (=epic-game Recycling Center, caps building-pollution at 1 icon).
Then maybe this would be the best and easiest way to fix it. Have the game treat negative pollution properly and allow buildings reduce city pollution (down to a minimum of 0, of course) with negative pollution output. Then buildings with the other flags could be given negative pollution in mods and that way negate it entirely.This doesn't quite work. A building with the flag "Reduces population pollution" SETS population pollution at 1 (as long as city is a metropolis, 0 otherwise).
Reading the code, it seems that negative pollution is meaningless. From what I understood from the function, pollution generated by a building [ iVar1 ] is only counted if positive [ if (0 < iVar1) ]. Negative pollution goes to "return ret & (ret < 0) - 1;", returning 0. [ "value & value<0" returns 1 (true), 1-1 gives 0 ]. I'm unsure how 0 pollution is handled, but I assume the function is never called for that value.
I tried in game giving -100 pollution to a building with the flag "Reduces population pollution" to no effect. There are other permutations that I didn't try, but the evidence so far suggest that it doesn't work.
The Antal exe reduced pollution to 0. This is a size 26 city with & without Mass Transit. Maybe Flintlock should look into what Antal changed on the pollution with the p4 exe.
Takeo, have you watched what happened with the population pollution in the next turns in that city with the Mass Transit in it ?
I can't say for sure that it would be easy without having looked into it, but I can't imagine it would be difficult. The easiest thing would probably be to make the B key activate bombard instead of join city when both options are available. It should also be possible to move join city to another key like J, but to do a proper job of that you'd have to update the button tooltip and maybe other things as well.Not sure if it's possible to fix this, though...?
Thanks for the link, I didn't know Antal had already done this. I hadn't found that function he called class_City::Calculate_Pollution, which is at 0x4B1C10 in the GOG EXE and looks like it's used to compute the pollution amount to display in the city screen. It does contain a duplicate of the logic used when spawning pollution. Reducing the minimum pollution to zero would be simple using a few machine code edits like Antal describes. Actually what I would do is edit the two pollution computing functions used when spawning pollution then replace Calculate_Pollution with a small function that calls those two and sums the results.What Antal did is change 4 "1" to 0. In specific, both the "Reduces population pollution" and the "Reduces building pollution" set their respective pollution to 0 rather than 1. However, it required to change it in 4 locations because civ3 has some duplicated code for whatever reason.
https://forums.civfanatics.com/thre...t-all-in-civ3-conquests.526144/#post-13221884
Not "J" please: this one's my preferred hotkey to activate stack-movement!It should also be possible to move join city to another key like J
OK, I must be doing something wrong.Meanwhile, I implemented scenario configs like I described. Here's what it looks like:
View attachment 618914
This enables no-raze and limits railroad movement for the WW2 Pacific scenario. This file is loaded automatically along with the WW2 scenario and its settings are layered on top of the default config, which itself is layered on top of a hardcoded "base" config. I also added a mod info button which shows which config files are loaded. This is useful to verify that everything is working as expected. Here's what it looks like (note the button itself in the upper right):
View attachment 618915
I didn't know J was bound to stack move, I've always used X for that. The hotkeys in this game are quite a mess. Maybe I'll get around to sorting that out at some point, the ideal solution would be to make them all rebindable. But don't hold your breath for that, implementing that doesn't sound like much fun. In the mean time I'll try to look into swapping the priorities, like I did with the L key, so B prefers bombard over join city when both actions are available.Not "J" please: this one's my preferred hotkey to activate stack-movement!
I guess that second image I posted is misleading. Even though it says "Version: 9", the per-scenario configs, info button, etc. are not present in the R9 version that's currently posted on CFC. I implemented that stuff then took the screenshot without bumping the mod version since the last release. Apologies for the confusion. The per-scenario configs will be in R10 or, if you really want it now, you could download the very latest version from my GitHub (https://github.com/maxpetul/C3X). It should work alright at the moment, but in general the latest GitHub version is incomplete and untested.Then I fired up the game, only to discover 59 turns into my current run that monster AI-Austria has nonetheless gone ahead and razed 3 or 4 cities in western Russia (I also do not remember seeing the "C3X Info" button in my "Preferences" screen). So the scenario-specific config.ini is apparently not being consulted.
New in this version:
- Scenario-specific mod configurations
- Mod info button
- Better logic for grouping units on right click menu
- Option to let units move after airdropping
- Fix phantom resource bug
- Fix air units losing a turn after being set to intercept
- L key loads unit over activating AI city loc highlighter