Planes, Carriers and Airbases (a 'can this be done' thread)

Edjren

Chieftain
Joined
Jan 1, 2006
Messages
5
Lately I've been working on a mod that changes the unit and promotion systems. Most of this stuff is just basic XML editing, but there are a few changes that I'd like to make that are more complicated. In my brief time modding here, I've learned that some things that seem like they'd be easy fixes are actually very difficult, if not impossible, to implement. So I figured I ask whether people thought that this was something that could be done before spending the next month and a half figuring that out for myself.

I've never liked the air unit systems in civ games. What with the building planes in half your cities and rebasing planes and figuring out which carrier needs planes so you can rebase more planes - I'd rather be building tanks.

So, what I would like to do is two things really.

The first is to modify the carrier units so that the planes are built in. I don't mean included with the carrier but rather they are a part of the carrier. So, when you build a carrier the finished project is a carrier with two planes.

The planes would function like normal carrier based planes, but they could never be destroyed and would always remain a part of the ship. If the planes are shot down in combat they aren't eliminated, but rather stay on the carrier reduced to 1 hp and normal recovery rates would apply.

The second thing is to create an 'Airbase' tile improvement. This would work under the same principle as the carrier unit, but the Airbase would have 2 built-in Fighters and a built-in Bomber. Like the carrier planes, the Airbase planes couldn't be destroyed except by destroying the air base.

Are these mods possible, given the modding tools that we currently have?
 
Not easy. Maybe doable, but I wouldn't take the task, knowing that effectively I'm not sure it could really be done. And not in a clean way for now.

The first one, yes, it can be done in Lua.

The second is more difficult with the current tool, you'll have to create a fake improvement, on completion replace it with a fake immobile (civilian ?) unit that will be simply a land based carrier.

Good luck :D
 
Are these mods possible, given the modding tools that we currently have?

No.

There is no way, currently, to allow anything other than a city to create units using XML. Using Lua, and the save/load functions, it'd be possible to have an automatic sort of process, where every 10 turns a Carrier gets a new airplane, but it can't be done in any interactive way, because the AI would have no idea how to handle it.

There's no way to prevent a unit from being killed in combat. You can crank up their Evasion promotion to where they take almost no damage from being intercepted, but they'll continue to take damage from the cities and units they attack. You can heal that damage, but it won't stop a unit from dying outright if it hits too strong of a defense.

As for the Airbase, forget it. You can add a new improvement type (although you can't add a custom graphic for it), but you can't make it host airplanes; air units generally die if they're somehow outside of a city at the end of a turn. (It's not 100%; sometimes they'll snap back to your capital.) You can't allow air units to rebase to a non-city target in the first place, but even if you could, the above problem would kill this idea.

Just add these to the long, long list of things we want the DLL for.
 
Ok. I guess I'll set this aside for the moment.

The 'land carrier' idea is a good one - better than an airbase improvement. If the airbase is a unit then it could more easily be included in any script that cycled through units to see if they had empty cargo spaces. And replacing the planes rather than having immortal planes works better too I think. Searching for empty cargo spaces would probably be simplest - plus if the planes were never destroyed I'd need to figure out what to do about their experience points.

Thanks for your help.
 
Back
Top Bottom