Resource icon

Carrier Fleets & Armadas - Automatic Extra Air Slots Version 1.2

Gleb Bazov

Warlord
Joined
Feb 13, 2017
Messages
176
Gleb Bazov submitted a new resource:

Carrier Fleets & Armadas - Automatic Extra Air Slots - Carrier Fleets & Armadas automatically receive additional air slots when they are created.

This mod implements a simple LUA function to grant newly-formed Carrier Fleets and Armada additional air slots to reflect what should be the obvious distinction between a single aircraft carrier and a group of such ships.

The default setting is for Carrier Fleets to receive 3 and for Carrier Armadas - 6 additional air slots. The values can be customized by editing the SQL file in the mod directory.

Read more about this resource...
 
Last edited:
Yes, it is. If you have any issues with save games, do let me know, but i have encountered none and see no reason why there would be a problem. So, yes, the answer to your question is yes.

(NOTE: There will be no issues with new save games, but, obviously, you cannot use this mod to affect prior save games that you generated before enabling the mod.)

The LUA code is only there to grant promotions that are otherwise coded in XML/SQL. Once the promotion is granted, it persists regularly as any other regular game data does. There is no issue with persisting the LUA game scripts data because the LUA code is necessary for one purpose only - to grant the promotion. Once the promotion is granted, the LUA part is no longer involved.

There is also no danger of duplicate promotions being granted because a unit can't have the same promotion twice. Further, you cannot combine naval carrier units into fleets or armadas (you can only build them - I suspect this was done to avoid accidentally creating carrier units loaded with a greater number of planes than they can carry). So, as a result, there is no way you could have both armada and carrier automatic capacity promotions in one unit. All the more so because I made the two automatic promotions mutually exclusive. There is no way you can ever earn either of these promotions in-game or get to one through the other. Only the LUA code can grant these promotions.

So yes, in essence, the regular problem with persisting LUA data across save games does not affect this mod. And I think I've eliminated all potential bugs and hiccups, so I consider this mod component to be in final release.

However, if there are any issues at all, please let me know! I'd be happy to fix any and all. Cheers! :)
 
Last edited:
For anyone interested in customizing the number of extra air slots granted to carrier fleets/armadas with this mod, I've included a short instruction within the mod's SQL file. Here it is reproduced, for convenience:

/*--=======================================================
MOD CUSTOMIZATION:
To amend the amount of extra air slots to be automatically granted to Carrier
Fleets and Armadas, change the values in Section II below, as indicated.
------------------------------------------------------------------------------------------------------------------

...

/*--=======================================================
SECTION II
Change the values -3- and -6- below to customize the automatic extra air slots.
--========================================================

INSERT INTO ModifierArguments
( ModifierId, Name, Type, Value, Extra, SecondExtra ) VALUES
( 'FLEET_BONUS_AIRCRAFT_SLOT', 'Amount', 'ARGTYPE_IDENTITY', 3, NULL, NULL ),
( 'ARMADA_BONUS_AIRCRAFT_SLOT', 'Amount', 'ARGTYPE_IDENTITY', 6, NULL, NULL );

/*--=======================================================
--========================================================

So, all you have to do is change the Values -3- and -6- to any value you desire, and voila.

Cheers.
 
I have not tried tackling the bar on forming carriers into fleet/armada groups yet. This would have to be a UI LUA mod, and my mod only tackles In Script LUA for now. However, I'm willing to give it a go. I'll see what I can do! :) The immediate issue is that, if I achieve this, I'd have to rewrite the existing parts of my mod, because the existing restriction has allowed me not to bother with checking for existing promotions and making sure that I don't add both the automatic Fleet and Armada promotions to the same carrier unit using LUA (it would be overkill -- a newly formed armed would have +9 additional air slots on top of any other promotions). But that's do doable, though the implementation I currently envision isn't the most elegant (I'd have to create a third auto promotion -- an intermediate one -- to bridge the gap and bring a Fleet carrier group up to the capacity level of an Armada carrier group, but not to exceed it). Unfortunately, there is no function like pUnit:GetAirSlots():SetAirSlots(x) that I can find, so I've been forced to improvise and terminate my LUA code in an XML-coded promotion, rather than do everything under the hood. In fact, pUnit:GetAirSlots() itself exists only in the UI context.

The other problem is what to do with the potential of the newly-formed carrier group having an excess of air units on board. I think that's why Firaxis restricted the direct formation of carrier groups, enabling Fleets and Armada to be only built/purchased. But, I guess, that's solved by making sure that the capacity of the new group unit is more or equal to the sum of air slots of the two base units.

I'll give it a go and let you know how I fare.

Cheers.
 
Last edited:
Thanks for making this mod. Can anyone confirm if this is working with the latest Rise and Fall update?
 
Top Bottom