Resource icon

C3X: EXE Mod including Bug Fixes, Stack Bombard, and Much More Release 23

The no tresspassing is working well, in my game The AI declared wars normally to each other
Glad to hear it.
there is a strange behavioru I noticed when using a HN unit to attack another unit inside its border but at the edge of it or vice versa but attackign a HN unit this time in its border after winning the unit will remain at a middle position
Interesting. The mod prevents trespassing by modifying a function that determines whether a unit can move between tiles and, if it can't, why not. If the adjacent move would trespass, the modified function returns an indication that the move would trigger war. There are other ways to indicate a move is not allowed but I was hoping that would give a popup to the human player. It doesn't, but it might still be useful for the AI. I guess that what's happening with this half-move is that the "triggers war" indication is not preventing the unit from engaging in combat but is preventing it from moving after combat is finished. In any case, this won't be a problem any more come R11 since I'm going to exempt HN (and invisible) units from the trespassing restrictions.
 
there is a strange behavioru I noticed when using a HN unit to attack another unit inside its border but at the edge of it or vice versa but attackign a HN unit this time in its border after winning the unit will remain at a middle position like in the picture and gain 2 tiles movement back
This bug can happen when the winning unit can't advance into an 'empty' tile for some reason.

There's a similar screenshot somewhere (in the CCM-development thread?) from an earlier version, where (IIRC) Settlers were allowed to move onto (impassable) Mountains without a road, but a Wheeled unit that an AI-Civ was using as a Settler-escort was not — so when it tried to move the units as a pair, the escort was left similarly stranded between 2 tiles.

Since Plains are not impassable in CCM, that suggests that there may be an(other) invisible/HN unit in that tile to the SE of your Knight(?), which is preventing it from completing its move. Either that, or — if the Viking Knight also has the HN-flag(?) — then due to the patch, it would be able to kill the enemy unit across the border, but not advance (because even if the attack-animation appears to show the attacking unit crossing the tile-border, the unit itself is considered by the game-engine to have remained in its present tile, until it wins — if it wins).
 
There's a similar screenshot somewhere (in the CCM-development thread?) from an earlier version, where (IIRC) Settlers were allowed to move onto (impassable) Mountains without a road, but a Wheeled unit that an AI-Civ was using as a Settler-escort was not — so when it tried to move the units as a pair, the escort was left similarly stranded between 2 tiles.

tjs282, you are remembering very well. The situation was discussed and shown in this and the following posts.
 
Glad to hear it.

Interesting. The mod prevents trespassing by modifying a function that determines whether a unit can move between tiles and, if it can't, why not. If the adjacent move would trespass, the modified function returns an indication that the move would trigger war. There are other ways to indicate a move is not allowed but I was hoping that would give a popup to the human player. It doesn't, but it might still be useful for the AI. I guess that what's happening with this half-move is that the "triggers war" indication is not preventing the unit from engaging in combat but is preventing it from moving after combat is finished. In any case, this won't be a problem any more come R11 since I'm going to exempt HN (and invisible) units from the trespassing restrictions.

Good continuation flintlock, wish you good luck
 
Flintlock... Units set as Wheeled have been able to attack Terrains that are impassible to Wheeled Units IF there is a Unit in the stack with them that can move to Terrain that is impassible to Wheeled Units. This does not happen constantly but can and does take place. When it does happen the Wheeled Unit that attacks is stuck between tiles. A Player cannot Hurt or Kill the Wheeled Unit their turn. The Next Turn the Units go back to correct tiles. My point is that it is not just Hidden Nationality or invisible Units or escorted Units affected by this issue. Non Wheeled Units allow Wheeled Units to attack Terrains that are impassible to Wheeled Units.

Edit... I believe if Units such as Wheeled Unit are also set with Cannot attack units on impassible Terrain, that may solve the problem.
 
Last edited:
OK, now on the military advisor screen, it says place a spy in order to view unit locations. I have a spy, but I am unable to view my opponents unit location.

This may be a design choice, but well, then the military advisor dialog should be changed.
 
OK, now on the military advisor screen, it says place a spy in order to view unit locations. I have a spy, but I am unable to view my opponents unit location. This may be a design choice, but well, then the military advisor dialog should be changed.

ynot56, to see the unit locations of a civ temporarily, you must steal the military plans of a civ with that spy. Normally you have the following text by the military advisor in the Script text file:

#MILITARYADVICEMOLE
#advisor Military Angry
Let's plant spies to learn more about our enemies (and our allies)!

If you want to have another text, you can change the text yourself in that file.
 
I have a spy, but I am unable to view my opponents unit location.
Not sure what this has to do with the patch? That sounds like one of the standard script.txt messages.

I don't use Espionage much/at all, but if you've successfully placed a spy, (AFAIK) you need to run the "Steal Plans" mission to obtain unit-locations.

Oof, ninja'd again... :ninja:
 
I love the suggested auto-fill amount for gold and gpt. It has always given the correct number for me in over 10 trials, and saves so much time. The stack worker and stack bombard commands are great too!

But, I notice there's no stack sentry command (or I missed it). I often like to sentry artillery type units and offensive units right next to a landing spot near my capital in 20k games to try to spawn a leader.
 
I tried to get 10b installed, but it does not update the exe, nor copy the original exe to unmodded.exe. I deleted the exe I had (it was created by r6). Copied the folder I created with the extracted 10B files. Ran install.bat. Norton stopped it, so I turned off Norton and ran install.bat. It seemed to run, though I did not set echo to see the process. C3C did not do the worker stack, so it was clear
the update did not occur.

I do not remember the process I used for r6, but it looks like I had copied the files into the Conquest folder. I am not sure, what I did about the art and text folders.

So do I need to do a reinstall of c3c and then run the install.bat from with in the C3r10b (my name) folder? The install doc mentions that the art and text and config are dependent, does that mean I need to incorporate them into the game files?
 
But, I notice there's no stack sentry command (or I missed it).
There isn't one, but I'll add it to the list. Stack sentry would be easy to implement like stack fortify (and unlike for example stack bombard where there's a lot of additional logic needed to determine when to stop bombarding). It probably won't appear in R11, though, as I'd like to finish up those last two features I mentioned and get it released finally. If I keep adding things, it'll never get done.
So do I need to do a reinstall of c3c and then run the install.bat from with in the C3r10b (my name) folder? The install doc mentions that the art and text and config are dependent, does that mean I need to incorporate them into the game files?
It's not necessary to reinstall C3C to update C3X. You can install a newer version of the mod over top of an older version and it will "just work", it will find the unmodded EXE, modify it, and replace the old modded EXE with the newer version. It's best to keep the mod in its own folder for sake of neatness but it should work even if you dump it into your main Conquests folder. So you shouldn't merge the C3X Art and Text folders into the original game's.

You said the installer "seemed to run", so I'm guessing you didn't get any error message, but did you get the success message? It should pop up a little "Mod installed successfully" message if everything worked okay. If you don't get any message at all, and the command prompt just flashes for a second, that means it's hitting some kind of error that it's not programmed to show in a popup. In that case you should run the install script from the command prompt to see what's happening to it.
 
Here is what occurred:

C:\Windows\system32>REM This line sets the current directory to the one where the file is located, ie the mod folder. This is
C:\Windows\system32>REM necessary in case the batch file is run as administrator with UAC enabled b/c then, for whatever reason,
C:\Windows\system32>REM Windows will start the script with the current directory set to C:\system32 or something like that.
C:\Windows\system32>PUSHD "F:\SteamLibrary\steamapps\common\Sid Meier's Civilization III Complete\Conquests\C3X10b\"
F:\SteamLibrary\steamapps\common\Sid Meier's Civilization III Complete\Conquests\C3X10b>REM Unfortunately we can't use tcc -run here. See comment above low_addr_buf in ep.c for why.
F:\SteamLibrary\steamapps\common\Sid Meier's Civilization III Complete\Conquests\C3X10b>tcc\tcc.exe -m32 -Wl,-nostdlib -g -lmsvcrt -luser32 -lkernel32 -DC3X_INSTALL ep.c -o temp.exe && temp.exe
Found Steam executable in "Civ3Conquests.exe"
In file included from <string>:37:
F:/SteamLibrary/steamapps/common/Sid Meier's Civilization III Complete/Conquests/C3X10b/common.c:45: error: unknown array element size

ep.c1047((in_start):
Assertion failed

No idea what it is looking for there. C3X10b is the folder with all the c3x stuff. I ran the install
from within that folder.
 
Last edited:
In file included from <string>:37:
F:/SteamLibrary/steamapps/common/Sid Meier's Civilization III Complete/Conquests/C3X10b/common.c:45: error: unknown array element size

ep.c1047((in_start):
Assertion failed
This means it's failing to compile the code to inject. The specific error message ("unknown array element size" on line 45 of common.c) indicates that the perfume_config_spec struct is not defined at that point. It's supposed to be defined in C3X.h but would be missing if that file is from an earlier version of the mod. It must be picking up the old C3X.h from R6, try deleting that and any other .h and .c files from your Conquests folder.
 
It worked, not I just have to get use to the individual workers not showing, instead having numerical values for their types.
 
One great thing about the perfume notepad is that you can adjust the AI's build preferences during the game. Just Alt+Tab, adjust perfume values, save the notepad and then save the game and load it again. The game then will run on the new version of the notepad.

I managed to get the AI to build scouts and granaries in their first 2-3 cities (the AI benefits massively from having a granary in the capital and maybe the second city, but not much more after that).

The deity AI can on avg crank out a scout in 2 turns. Set the scout perfume extremely high for around 6 turns to get the expansionist AI to crank out 3 scouts on a standard map like a human would. Then turn it off so that the AI can move on the next highest perfumed project: the granary.

Civs not starting with Pottery will take a while to be able to build a granary. You shall have to leave the extreme granary perfume on for a while. On Deity, it could be until around 3000 BC that every one has access to granaries. Then you can turn the perfume off. This whole routine usually ends up with the AI having 2-3 granaries in their first cities. This is what I've observed with debug on. In a normal game where you can't see, you can just go off the time stamps above.

Another solution for granaries is to add another heavily perfumed granary clone that requires Palace. Then the AI will only build that in the capital. The actual granary will need to be heavily negatively perfumed to make sure the AI doesn't build it on top of the clone. The drawback is that the AI will never build granaries in their other cities but the redundant granary in the capital may still get built due to failed wonder cascades.

Once the expansion phase is over things like walls, barracks and harbors can have perfume values turned on.

I have Courthouses and Police Stations perfumed and given them 1 and 2 happy faces. This seems to benefit the AI quite a bit, esp with markets not multiplying luxuries in my mod and due to the perfume, they build them indiscriminately in their inner core and capital.

Once the industrial age starts, factory perfume is a no brainer. But things are a bit more headachy when it comes to powerplants. Perfuming multiple plants will result in them all being built, causing a loop. I'm not sure how the AI behaves in stock game when it comes to powerplants. Does it refrain from building newer plants if it has already built a Coal Plant? If the answer is no then it's maybe worth settling the AI on perfumed Coal Plants and nothing else (every other powerplant being negatively perfumed). Industrializing rapidly makes the AI a lot scarier. But then what if the AI doesn't have coal?
 
Last edited:
the AI benefits massively from having a granary in the capital and maybe the second city, but not much more after that.

Another solution for granaries is to add another heavily perfumed granary clone that requires Palace. Then the AI will only build that in the capital. The actual granary will need to be heavily negatively perfumed to make sure the AI doesn't build it on top of the clone. The drawback is that the AI will never build granaries in their other cities but the redundant granary in the capital may still get built due to failed wonder cascades.

In that case why not giving the palace additionally the "granary-flag" ? All civs (including all AI civs) will have that granary boost in the capital and there are no problems with building granaries in other cities. The granary-flag is not in the list of cumulative flags (but there should be a test to check it). What can happen is that the AI civs will build a granary in the capital, but this is less problematic compared to the drawback that the AI will never build granaries in their other cities. May be the granaries could get an additional flag to soften that problem in the capital.

I have Courthouses and Police Stations perfumed and given them 1 and 2 happy faces. This seems to benefit the AI quite a bit, esp with markets not multiplying luxuries in my mod

These are the settings of the CCM mods for the marketplace, courthouse and administrative center. Their happiness is multiplied by some GWs. At present they have no perfume by the Flintlock mod, but the AI flavor from the Firaxis editor.
 
Last edited:
The "Hyperlink limit exceeded-bug":

If you have more than 34 units/buildings in a mod, that all have hardcoded links to the same resource, the following message will appear and if you have much more than 34 of those units the game could crash to desktop (CTD). The CTD can be seen easily when clicking in the AOI scenario on one of the units needing iron. The bug seems to be connected to the limited space in the "Allows-box" of the resources entry.

Resource Overflow Bug.jpg



A first "cure" for that bug was Vuldacon´s great idea to write on those "endangered" icons "Don´t click".

Dont click.jpg


The problem of this solution is, that since Adam and Eve, the prohibited must be tested and there are also clicks by mistake. Additionally the player is not easily receiving the informations about those resources.

Therefore the next step in fighting against that bug was using a solution that was found by accident in Anthony Boscia´s Worldwide mod: If the first resources slot in the editor for units and buildings stays empty, the complete hardcoded resources entries for that unit/building in the civilopedia are skipped. These are the current settings in the CCM and RARR mods.

Bismarck Class.jpg


The drawbacks of that method are, that the possible resources that can be set for a unit in the editor, are reduced from 3 to 2 for units and from 2 to 1 for buildings. Additionally the needed resources should be listed in the civilopedia textbox of that unit/building. The manual drawn links in the textbox are not causing the "Hyperlink limit exceeded-messages" and CTDs, as the automatic entries in the "Allows-box" of the resources are not created by them.

I have now found a document in my archives with posts that were written 10 years ago or earlier, offering an interesting solution for that problem. Unfortunately I have no link to that post and have not noted the author of that post, offering the following solution for that problem:

1. Backup your Civ3Conquests.exe.
2. Open Civ3Conquests.exe in Windows Notepad or a similar text editor
3. Use CTRL-F to find the phrase MessageBoxA . Ignore the first occurrence and find the second one.
4. Select the whole MessageBoxA phrase and one additional character that follows it* (in Windows Notepad it'll look like blank space, in Notepad++ it will be a NUL character).
5. Type PostMessageA (this should replace the selected text).
6. Save and play.

* That additional character is essential since the file size must remain the same, and the replacement phrase is one letter longer.
What it does is that it makes the game dump the silly "Hyperlink limit exceeded" message into its own internal message system instead of displaying it.


When opening the boosted Flintlock R10B exe with Notepad++ it seems that the entry to change is in line 16821. Unfortunately in the cornucopia of offered save formats in Notepad++ I have not found the save format that resolves a working exe and therefore I was not able to do a test of that posted solution.

Flintlock, I hope you can do more with these informations.
 
Last edited:
Back
Top Bottom