Edits to Forts & Encampments

scottmanman

Chieftain
Joined
Apr 1, 2017
Messages
4
I was thinking it would be fun to make a "One city challenge" type scenario, where each civ has 1 city, but the borders would expand super far, so basically you would be controlling an empire but only the "capital" was important.

Most of this I can figure out how to do, what I really need though is to understand whether it is possible to edit encampments or forts. I would like for these to be the main defensive/strategic tiles.

What I want:
Either the ability to build multiple encampments in one city OR the ability to give forts the ranged attack and defense that cities and encampments have
 
The following SQL statement will enable you to build multiple Encampments in a city:

UPDATE Districts Set OnePerCity=0 WHERE DistrictType='DISTRICT_ENCAMPMENT';

Theoretically, the number is unlimited (as it would be, for instance, with Neighbourhoods, which have OnePerCity set to false by default). In practice, however (judging from extensive testing) the game starts behaving erratically when you build more than three districts (non-Neighbourhood) of the same type in any one city. While you might be able to build 3 in a given city (I have not tested extensively beyond that number, as CTD incidence increases dramatically), the next city that tries to build a third functional district of the same kind will likely cause the game to crash.

Second caveat is this. You can only build the district building in your first district of a kind in any given city.

If you are looking for some Lua script for your mod, I have code that implements a culture bomb mechanic (for any district or improvement) with unlimited range. You can make it the same as in the base game (radius one plot) or increase it to 20 plots :). Would work well with your rapid borders expansion.
 
PS. Oh, and if you look carefully in the Downloads section, there is already a mod that allows the human player to play one city challenge. You could expand it easily to encompass all players. In fact, here you go, the mod attached.
 

Attachments

Thanks I like the idea of the culture bomb on forts! Is there any way to just add the city walls attack/defense mechanic to forts then? that would honestly be the best solution i think. This would give the most flexibility as far as location, amount of forts, territorial expansion and whatnot.

Im kind of new to modding, are there official documentation somewhere or do I just have to go in and read each file and experiment to figure out what each thing does?
 
Well, I haven't tested this, but I see no immediate reason why it would be impossible to make forts into culture bombs even outside of cultural borders, using LUA. That's certainly something I could implement for my existing code, if you are intrested. You could also make forts provide additional healing to units (even using XML, I believe). I see no way, however, to make forts capable of carrying buildings and such.

As for attack/defense... hmm... possibly. There is certainly a way to make enemy units sustain damage if they are next to (or even near) or on the fort hex. There may also be a way (although I am just speculating -- the tutorial does this, but I haven't tried extending this function outside it) to prevent enemy units from occupying the fort. Anything beyond that is either beyond my capabilities or, most likely, requires access to the DLL. But, I'll give some thought to what we can do. I'll let you know.
 
Ok, Yea, I think it would be sufficient to have forts with the following features:

Culture Bomb outside territory
Heal Units inside fort
Add defense to units inside fort
Damage enemy unit adjacent to fort
Raise height of unit inside fort, (so a unit on plains would see as if it were on a hill for example)
Forts able to be constructed on any non-mountain land hex (I dont know if there are restrictions currently)

If it is possible to have different levels of forts depending on the era or necesity, for example Basic Fort (+5 defense, Heal 5 per turn, 5 dmg to enemy), Stronghold (+10 defense, Heal 5 per turn, 15 dmg to enemy), Army base (defense +20, heal +0 per turn, 0 dmg to enemy), Forward Opperating Base (defense +0, heal +0, 20 dmg to enemy) etc.

If there was a basic fort built, I think I would be able to create new versions myself.

Thanks for helping so much!
 
Fort is an improvement not a building. Any effects for improvements, except their inane yield, are achieved by modifiers. There's a requirement that checks player's Era. So, you probably can create a bunch of modifiers with reqs set for different eras and attach them to the new fort. That way this improvement will have different stats in each era.
Other option is to define several different improvements and upgrade them using Lua when player enters a new era or even better - gets a tech for an upgrade. This way each improvement could look differently. In first approach the look will always be the same.
 
Back
Top Bottom