Indestructable automatic building

Vagabond ZOD

Chieftain
Joined
Oct 27, 2005
Messages
5
I want to setup a fantasy mod where a civilization is a race, for example elves, dwarves, etc. And I want cities of those race to stay that race even if conquered by another civ. I have an idea on how to do this, but I don't know if it's actually possible with the tools we have currently. So here goes...

When a settler for a specific race settles a new city it auto-builds 1 building. This building would have the following characteristics:
  • Can't be sold
  • Never destroyed when the city is conquered
  • Can't be built normally, only when a city is 1st established

The way I see it, this would allow some options that could hopefully be fun
  • Buildings that require the basic racial building. So if you conquer an opponent's city you could get some of their unique buildings
  • Units that require the basic racial building. Same reasoning as above.
  • Settlers built by that city linked to race, so if you conquer an enemy city you can build new cities of that race.

So I was wondering if my first list is possible, before I go modding and hit a brick wall. I was also wondering about if a few other things are possible, though they aren't quite as central to my design.
  • Different social policy trees based on civilization
  • Locked tech tree that can only be unlocked by a social policy (To learn elemental magic you need the Elemental social policy)
  • New resources - mana, magic research (so you'd have tech and magic research)

That's alot of questions, thanks to anyone who helps this novice modder out.
 
I want to setup a fantasy mod where a civilization is a race, for example elves, dwarves, etc. And I want cities of those race to stay that race even if conquered by another civ. I have an idea on how to do this, but I don't know if it's actually possible with the tools we have currently. So here goes...

When a settler for a specific race settles a new city it auto-builds 1 building. This building would have the following characteristics:
  • Can't be sold
  • Never destroyed when the city is conquered
  • Can't be built normally, only when a city is 1st established

The way I see it, this would allow some options that could hopefully be fun
  • Buildings that require the basic racial building. So if you conquer an opponent's city you could get some of their unique buildings
  • Units that require the basic racial building. Same reasoning as above.
  • Settlers built by that city linked to race, so if you conquer an enemy city you can build new cities of that race.

So I was wondering if my first list is possible, before I go modding and hit a brick wall. I was also wondering about if a few other things are possible, though they aren't quite as central to my design.
  • Different social policy trees based on civilization
  • Locked tech tree that can only be unlocked by a social policy (To learn elemental magic you need the Elemental social policy)
  • New resources - mana, magic research (so you'd have tech and magic research)

That's alot of questions, thanks to anyone who helps this novice modder out.

New resources are possible - but custom map icons for the resources currently aren't. I haven't tried giving a new building for each new city - but I know you can easily give custom buildings to your starting capital upon it's founding. I haven't tried having a custom locked tech tree - but you can make a policy unlockable until you've discovered a particular tech - kind of a backwards way of doing what you want. Different Social Policy trees would be difficult to create - not sure it it's possible. But you could make multiple social policy trees using FiresForever's (sp?) mod. It's definitely possible to customize the social policy screen as much as you want

http://forums.civfanatics.com/downloads.php?do=file&id=16650 - 6th from the bottom is an example of a reworked UI for a social policy page.

Units requiring a unique building are also easily modded.
 
New resources are possible - but custom map icons for the resources currently aren't.

Yes they are. You just have to edit one Lua file the game uses. (ResourceIconManager.lua, if I recall correctly.) That file right now hard-codes icon terrain atlases to the "official" one, but it's a one-line change to get it to use what's in the XML. The only icons you can't change easily are the font icons for Civilopedia text.

As for the rest, this'd be easy to do. When the city is founded, create a building through a simple Lua addition. Give the building a 100% capture chance and make it mutually exclusive with the other racial buildings, and you're done.

Differing tech and social policy trees can also be done, but it's harder. Actually, it's not that much harder, it's just that you'd have to modify quite a few Lua scripts or else the player would see all of the techs and policies, and not just the ones he has access to. You'd see 30 policy trees and have no idea why twenty of them were blocked off, that sort of thing. (That's an easy edit in SocialPolicyPopup.lua, by the way, and is one that many of us have already done in our own mods.)
For instance, if I wanted special policy trees and tech trees for the Elf race, then I'd just need to create TECH_ELF, Disable it so that no one else could take it, and then make all the custom techs and policies have that technology as a prerequisite. Repeat for the other races. The only headache is that Barbarians and City-States gain new technologies depending on whether other civs have them, so you could easily end up with a city-state having multiple racial techs, despite them being Disabled. You can hack this through Lua by checking each turn to see if they have these techs and removing as necessary.

Most of the other things you've described are also possible, but wouldn't work so well. For instance, take the Settler thing; to have the Settler "remember" the race of the city that created it, you'd need to create N different Settler units (and no, they can't share the same Unit Class, they'd need to be N distinct units), with each requiring a different building to be present in the city. So you'd see all N of them in the tech tree, although the city build menu would only show the one for that city, because these could NOT depend on that racial tech if you wanted each civ to be able to make all of them. (You can disable showing them all in the Civilopedia, too.)

This has a lot of minor logistical headaches, since it'd have to basically be kept separate from the techs the civs have in common. (You CAN mix them, but it's not pretty.) And like I said, the UI would not look pretty. But it can be done.
 
Back
Top Bottom