Any way of forbidding (player AND AI) sea unit from entering cities ?


Feb 24, 2015
I would like to make sure ships dont go hide in cities for any reason; they can go heal beside them.
If they get attacked while there.... well that would be the feature; you can't hide a ship in your pocket.

All the ways I can think of doing it with Lua almost certainly break the path-finding code (as cities can be used like canals on a narrow isthmus).
You could do it in the DLL - that would also remove the ability of cities to be used as canals, but wouldn't break the path-finding code.
Hello and thanks for the reply.

So far, I ve only worked with lua coding in the file of R.E.D. That s the project that keeps me playing and modding CIV5.
Do you have a link I could check out to be able to "open" the dll file and be able to change some parameter ?
I m super curious other things could be changed there.... it's probly one of the only file(s) I ve not checked : )

Another question, I ve seen that in the original files (taken from GIT), Gedemon included one cvGameCore_RED.dll file.
I have not seen the original file (.rc ?) is it possible to decompile that file to see if I would want to change some content there too ?
found the original on the GIT

Thanks : )
Last edited:
I wish to be able to add some kind of on-map building linked to the city (a port) where the city newly created water unit would spawn (no port, no way of building sea units).
Only one instance per city and only buildable on a water tile next to the city (maybe on a land tile next to city and water tile if it's easier).
Some kind of immobile unit that can be attacked and defeated.
I would also want the unit spawned on the port tile to be forced to move before being able to attack (ideally, if a sea unit has not left the port tile, city cannot start construction of another sea unit)
and forbid unit from entering it's location.

I would like to add that same kind of "feature" for vehicle and air units later on (air factory/vehicle factory)

Considering Im not too bad at scripting with lua but it's gonna be my first time playing with the dll.... You think I should forget about this ?
Last edited:
With a modded DLL (mine or one based on it), pretty much all of that can be achieved with Lua in one form or another (but think tile improvement rather than building placed outside the city hex)

However, there is no way that the AI is going to understand that it must build something in a city before it can build naval units and move those units before making ranged attacks without extensive mods to the AI logic code in the DLL.
thanks for the answer.

DLL related : I ve taken the fork Gedemon had made for his las version of RED (v45), but there seems to be no .sln in the cloned folder. I ve tryed to copy paste the .sln from the Civ5Tool from the original "vanilla" folder but I cant seem to link them to Gedemon files... Any idea how I can do that ?

Also, I ve checked this "tuto" for rebuilding the DLL, but somehow the vcsetup.exe cannot be found there anymore.
Is there a new/more recent step by step way for compiling the DLL to be able to include it in a MOD ?
I ve installed VS2013 on my machine, when I start the project, it ask if I want to update the tools to 2013, (look like the base tools are 2008), I did not update the tools but if someone did, could it cause problem with the DLL ?

Kudo to you and Gedemon for being able to work on those DLL, I m not sure Im gonna be able to do much in those file; not sure how all the libs are connected (event related I guess) but still it's a lot of work....
Top Bottom