kiwitt
Jul 19, 2009, 02:32 PM
For my "Road to War Mini-Mod".
I am considering introducing multiple unique units in a particular Unit Class, within the same nation. e.g. Britain had multiple types of battle-ships, but still essentially Battleship Class, so it would be nice for the Civ to be able to build different types at different times.
e.g. When "Warships" are researched it can build Battleships, When Anti-Air is researched it can build Battleships with Anti-Air, when Improved Anti-Air is research it can build Battleships with Radar.
xienwolf
Jul 19, 2009, 02:41 PM
You want to be able to choose between multiple types, or to change what the UU is completely so that only 1 of them can be built at any time? For the first, you need some SERIOUS DLL work to get it going. For the second, it is also pretty in depth, but already done for you in the Modcomp Section, Dynamic Unique Units. You would just change the rules for how to set Unique units for each civ so that it replaces your UUs from within a set list.
kiwitt
Jul 19, 2009, 04:01 PM
e.g.
1) One Global Class - e.g. "BattleShips"
2) Each Nation has one Unique Unit for "Battleships" Class
3) Some Nations have multple Unique Units e.g. Multiple types of Battleships (But can only build the latest model)
2) I think I can work on as the "Code" there in the RTW Mod already.
3) will be a little bit harder and will require me to look at the Modcomp section. (here (http://forums.civfanatics.com/showthread.php?t=237740) ?)
xienwolf
Jul 19, 2009, 05:39 PM
Aye, that's the modcomp I mentioned. You'd be using different rules for the Unlocking of Unique units than what he used, but mostly you'll be looking to snag the code which changes how the game looks up what UU you use, and allows you to modify that value for each player. Since you only want 1 UU to be available for each person at any time, but that 1 item to change as the game progresses, it is almost exactly what you want.
zyphyr
Jul 20, 2009, 02:41 AM
A relatively easy way to do it is just have multiple Unit Classes..
Battleship1 (Battleship)
Battleship2 (Battleship with Anti-Air)
Battleship3 (Battleship with Radar)
etc..
Have each obsolete the one before it.
No reason for any complicated code.
kiwitt
Oct 01, 2009, 05:35 PM
I am now getting on to research and coding my 0.4x of my mod. (Fighters and Ships)
Here is in details what I would like to happen
1) Number of Unit Limit set in Unitclass file per player.
2) AI or Player can then build the units up to limit set.
3) AI or Player can then research a tech and can then build a later unit in the same class. The operative word is "can" not "must". The AI of player should be able to chose which unit it wants to build within the unit number limit as some may have different features that it wants, e.g better AA, better speed, better range, etc.
e.g For Battleships (build limit of 5)
Possible build order - Battleship1, Battleship2, Battleship3, Battleship1, Battleship4
For Battleships, I propose leaving the Unitclass intact
e.g. Creating Unique Units
Battleship_US1, Battleship_US2, Battleship_US3, Battleship_US4
Battleship_GE1, Battleship_GE2, .... etc.
Battleship_EN1, ... etc.
I suppose the AI would automatically produce the strongest unit, which is fine as it is more likely to be the latest unit.
Will this work ?