This is the DLL that I will use for next version of R.E.D. WWII and Another History.
All features are OFF by default, they are activated using different methods:
Options (using XML, SQL, Lua or direct selection in any advanced setup screen)
Updates of new columns in the Units table (using XML or SQL)
Updates of new values in the Defines table (using XML or SQL)
City Stacking Base Limit for unit of same type (or <StackClass>) in a domain (0 = use PLOT_UNIT_LIMIT, -1 = unlimited)
Change/Set/Get functions exposed to Lua (using Lua or source code)
See usage example in the mod's thread.
Note that there is an order of priority for the stacking rules:
- If you activate GAMEOPTION_CAN_STACK_IN_CITY, then the unit stacking class and city specific stacking value will have no effect, it will be unlimited stacking in cities for all.
- If units which have a specific <StackClass> are in a city, then the limit will be the higher value between the units <MaxStack> and the city limit for the units domain (air, sea, land)
To update the tables from another mod, just remember to set the References in the mod's properties so that R.E.D. DLL is loaded first.
Here's the mod ID for that use: 2896c6d4-0273-4527-813b-b9ab58f0b95e
Download available on CFC Database
You may want to also use my small UI fix for Unit Stacking to display all unit's flag when stacking:
All features are OFF by default, they are activated using different methods:
Options (using XML, SQL, Lua or direct selection in any advanced setup screen)
- GAMEOPTION_CAN_STACK_IN_CITY: allow illimited unit stacking in cities
- GAMEOPTION_CAN_ENTER_FOREIGN_CITY: allow placement of units in friendly cities (with open border or ally relation for CS)
- GAMEOPTION_REBASE_IN_FRIENDLY_CITY: allow rebasing of aircraft in friendly cities (with open border or ally relation for CS)
- GAMEOPTION_CIVILIAN_MOVE_THROUGH: Civilian units can move through foreign units
- GAMEOPTION_BEST_DEFENDER_BY_HEALTH: force the combat engine to pick the unit that will have the most Health left after the attack to defend a plot. If unchecked, the unit with the best fighting strength is used (even if it has only 1 HP left...)
Updates of new columns in the Units table (using XML or SQL)
- <StackClass> : can be any string, each different class can stack with another class, but not units of the same class.
- <MaxStack> : MaxStack: 0 (default) means use plots limit, -1 means no stacking limit, values above 0 means a specific plot limit for this unit type. Can be combined with StackClass.
Updates of new values in the Defines table (using XML or SQL)
City Stacking Base Limit for unit of same type (or <StackClass>) in a domain (0 = use PLOT_UNIT_LIMIT, -1 = unlimited)
- CITY_LAND_UNIT_LIMIT (default = 0)
- CITY_SEA_UNIT_LIMIT (default = 0)
- CITY_AIR_UNIT_LIMIT (default = -1)
Change/Set/Get functions exposed to Lua (using Lua or source code)
See usage example in the mod's thread.
- City:GetAirStackLimit()
- City:SetAirStackLimit()
- City:ChangeAirStackLimit()
- City:GetLandStackLimit()
- City:SetLandStackLimit()
- City:ChangeLandStackLimit()
- City:GetSeaStackLimit()
- City:SetSeaStackLimit()
- City:ChangeSeaStackLimit()
Note that there is an order of priority for the stacking rules:
- If you activate GAMEOPTION_CAN_STACK_IN_CITY, then the unit stacking class and city specific stacking value will have no effect, it will be unlimited stacking in cities for all.
- If units which have a specific <StackClass> are in a city, then the limit will be the higher value between the units <MaxStack> and the city limit for the units domain (air, sea, land)
To update the tables from another mod, just remember to set the References in the mod's properties so that R.E.D. DLL is loaded first.
Here's the mod ID for that use: 2896c6d4-0273-4527-813b-b9ab58f0b95e
Download available on CFC Database
You may want to also use my small UI fix for Unit Stacking to display all unit's flag when stacking:
