Unupgradeable obsolete units

Yes_Cantaloupe

Chieftain
Joined
May 15, 2008
Messages
7
Location
Austin/Denton, TX
I would like to make units that cannot upgrade, but still go obsolete after a certain tech and henceforth cannot be built.

Specifically, I would like to have predreadnought battleships be unable to be built after one can build dreadnoughts; however, it doesn't make much sense to me that throwing money at an obsolete ship can thicken its armor, increase its speed, and give it bigger guns; such massive overhauls necessitate building a new ship. However, I would like the option to build predreadnoughts disabled at this point, as they were well and truly obsolete.

Any ideas?
 
The only thing i can think of, is to tie a unit to a ressource that is going obsolete.
 
The only thing i can think of, is to tie a unit to a ressource that is going obsolete.

If I went this route, could I define some sort of custom resource that everyone somehow automatically has access to?

Could I make a custom event, triggered when the appropriate tech is discovered, that gives such a resource, and a second event, again triggered when the appropriate tech is researched, taking it away? This sounds terribly roundabout though, especially if I want to do this with several units. Surely an easier way exists?
 
I would like to make units that cannot upgrade, but still go obsolete after a certain tech and henceforth cannot be built.

Specifically, I would like to have predreadnought battleships be unable to be built after one can build dreadnoughts; however, it doesn't make much sense to me that throwing money at an obsolete ship can thicken its armor, increase its speed, and give it bigger guns; such massive overhauls necessitate building a new ship. However, I would like the option to build predreadnoughts disabled at this point, as they were well and truly obsolete.

Any ideas?

In FfH we have a bDisableUpgradeTo attribute that means that no unit can ever upgrade to that unit. Outisde of that everything works the same (so the earlier unit would still be obsoleted). It did take some SDK work to do but its relativly minor (just a return in the upgrade function to always return false when checking this unit).

Similiar ways, hmm.. You could add a python return in cannotTrain that would block the unit if you can build the better unit.

Ways just from an XML standpoint, hmm... you could require a building to build the lower unit, then obsolete the building with the tech that grants the more advanced unit.
 
In FfH we have a bDisableUpgradeTo attribute that means that no unit can ever upgrade to that unit. Outisde of that everything works the same (so the earlier unit would still be obsoleted). It did take some SDK work to do but its relativly minor (just a return in the upgrade function to always return false when checking this unit).

Similiar ways, hmm.. You could add a python return in cannotTrain that would block the unit if you can build the better unit.

Ways just from an XML standpoint, hmm... you could require a building to build the lower unit, then obsolete the building with the tech that grants the more advanced unit.

I thought about obsoleting a building, but I don't think that would work; after all, monasteries are obsoleted, and even after that one can build missionaries if one has one built.

I don't really know enough Python to do anything significant (although I suppose I could learn easily enough), and I don't know what SDK is.

Anything else I might try before I attempt to properly learn Python?
 
Dom Pedro II has created a mod that does this. Unfortunately, it has not been updated to BtS 3.13.
 
You could have the Unit A upgrade to Unit B (available at a specific Tech), then just make Unit B unbuildable (putting a -1) in the "Cost".

I think that theoretically, Unit B would replace Unit A in the cities' build list, but since it is unbuildable, it can't be built, thus causing Unit A to go obsolete at the Tech that makes Unit B available....
 
But you could still upgrade A to B i think... ^^
 
But by making B just a hair better than A, instead of a class better, I think it would still accomplish his goal.

predreadnought_battleship upgrades to predreadnought_battleship_improved (cannot be built) with the same tech that allows dreadnought battleships to be built.
 
How are upgrade costs calculated? If they're calculated based on relative costs, would that -1 mess stuff up? If I made this unit B an exact duplicate of unit A, could I define the cost to upgrade from A to B to be 0? While roundabout, this wouldn't be too hard, and would, I think, work. Hell, I could even give units A and B the same name.
 
Okay, this is something of a pain to do, as I'm actually doing this for a number of units, not just for predreadnought to dreadnought, but what I've come upon something of a solution.

I've defined a copy of each unit, i.e., PREDREADNOUGHT_ALT, with the exact stats and name as the original, except that:
-While the original upgrades to the alt, the alt upgrades to nothing.
-The alt has a cost of 10000 (-1 made it unbuildable, and so it did not obsolete the original).
-The tech requirements for the alt are the same as the next unit that I wish to have obsolete the original.

The results are that as soon as the next unit is available, the now obsolete one can not be built; instead the alt of it can be built and is at the end of the list, where it is out of sight and prohibitively expensive - so much that, I think, no AI or right-thinking human will ever consider building it. Also, the original unit is then upgradeable, at astronomical cost, to an exact duplicate of itself, a course of action which I also doubt will ever be considered.

I tried having the alt upgradeable to the next unit, but this made the upgrade line for the original skip over the alt, and it was thus able to upgrade to the next unit at reasonable cost. If anyone has any ideas on how to improve this or do it another way entirely, I've yet to apply it to my entire mod; any suggestions would be welcome.
 
As I said, there is a mod that does this already out... All you have to do is update it to 3.13. I will probably even do it myself at some point if no one else does, since I need it.
 
I would like to make units that cannot upgrade, but still go obsolete after a certain tech and henceforth cannot be built.

Specifically, I would like to have predreadnought battleships be unable to be built after one can build dreadnoughts; however, it doesn't make much sense to me that throwing money at an obsolete ship can thicken its armor, increase its speed, and give it bigger guns; such massive overhauls necessitate building a new ship. However, I would like the option to build predreadnoughts disabled at this point, as they were well and truly obsolete.

Any ideas?

I agree with what your saying to some extent, though I would say ships can - and have - been re-fitted to carry bigger/better guns and better engines, and adding armour.

The result would be something less than a Dreadnought however, as obviously the Dreadnought was fully designed to make maximum use of the latest tech. So....would it be possible to have a Pre-Dreadnought upgradeable to a Pre-Dreadnought - Improved for example?

Presumably that would delay the problem, but you could then have the Pre-Dreadnought upgradeable to Uber Dreadnought at Future Tech 200 or something silly


There is another element to units to consider though in the form of experience and promotions. In reality a ship itself isn't going to improve in combat - if anything it should be weakened by the stresses it has endured. Therefore improvements because of experience could be considered to be related to the crew....but that leaves you in the possible position of having your most experienced crew, on your most dated ship.
 
Presumably that would delay the problem, but you could then have the Pre-Dreadnought upgradeable to Uber Dreadnought at Future Tech 200 or something silly

Pre-Dreadnought = 1870 ish to 1900 ish

Dreadnought= 1900 ish to 1920 ish Think (Great White Fleet) edit: Great white fleet was pre Dreadnought according to wiki

Don't know the dates well, but it is not a future tech.
 
Pre-Dreadnought = 1870 ish to 1900 ish

Dreadnought= 1900 ish to 1920 ish Think (Great White Fleet) edit: Great white fleet was pre Dreadnought according to wiki

Don't know the dates well, but it is not a future tech.

I didn't mean to imply that it was future tech

I was suggesting that if the proposed Pre-Dreadnought was to 'upgrade' to a unit that was set within a pretty much unattainable tech, you would make it in effect make it impossible to upgrade to.

On reflection though, I was being dense because it wouldn't be obsolete until the future tech was researched!

As such what would happen, upon the availability of Dreadnoughts, if a Pre-Dreadnought was 'upgradeable' to a weaker modern unit? ie; Pre-Dreadnought - Cruiser?

Is the AI programmed to simply upgrade units, or is it programmed to go for units based on their strength?

If the former, could such an upgrade be almost justified in roleplaying terms perhaps the Pre-Dreadnought has been sold for scrap, and the money raised + additional money spent has bought a new (smaller) warship?
 
I agree with what your saying to some extent, though I would say ships can - and have - been re-fitted to carry bigger/better guns and better engines, and adding armour.

The result would be something less than a Dreadnought however, as obviously the Dreadnought was fully designed to make maximum use of the latest tech. So....would it be possible to have a Pre-Dreadnought upgradeable to a Pre-Dreadnought - Improved for example?

Presumably that would delay the problem, but you could then have the Pre-Dreadnought upgradeable to Uber Dreadnought at Future Tech 200 or something silly


There is another element to units to consider though in the form of experience and promotions. In reality a ship itself isn't going to improve in combat - if anything it should be weakened by the stresses it has endured. Therefore improvements because of experience could be considered to be related to the crew....but that leaves you in the possible position of having your most experienced crew, on your most dated ship.

I do rather like the idea of a "refitted Predreadnought", but the problem would be that to upgrade to it, it would have to be available to build - and I have a feeling the AI would build that rather than newer, more expensive ships.

And I'm aware of the mod out there to do exactly what I want, but I lack the knowledge to update it. If another would, that would be awesome.
 
I always thought it was silly that the "Age of Sail" boats upgraded straght to a Destroyer. Why would a wooden Hull suddenly become iron? I know that originally the boats were reinforced with iron to create "Ironclads". The ironclad in civ4 really isnt a true Ironclad, its more of a representation of the short lived Monitor boats the US built during he Civil War.

Anyway the original idea for this came from seeing the USS Constitution docked in Charlestown harbor, here in Boston. Daily it is filled with people paying to get on the deck.

So to change the fact that the Frigates and such upgrated to Destroyers I added a Boat called "Museum Ship" (I made the Museum Ship unbuildable by putting a -1 as the cost)., it was a boat that the had zero strengh. But had the "ability" to "Build" a "Museum Ship" in port cities. This new building added +15% Wealth & +15% Culture.

I did that in warlords, havent done much with BTS yet
 
Back
Top Bottom