Additional Unit Classes?

PsiCorps

FF: Babylon 5 mod team
Joined
Dec 30, 2007
Messages
1,425
Location
Britain
Hi all
At present the FFP Mod contains all of the standard FF Unit Classes. So we have the following:-
  • Planetary Defense I-III
  • Invasion Ship I-III
  • Destroyer I-III
  • Cruiser I-III
  • Battleship I-III
  • Carrier I-III
  • Scout I-III
  • Stealth Ship I-III
  • Starbase I-III
  • Missile I-III
  • Fighter I-III
  • Bomber I-III

Is it possible to add a new Unit Class eg. Frigate I-III or alternatively can the Unit Classes already in game have their number increased eg instead of Cruiser I-III we have Cruiser I-V?

I'm asking because I need to add some additional units for each Civ in the B5 mod but don't have enough spare Unit Classes to use.
 
It should not be a problem.

The only things I can think of right now that may have any complications are starbases and anything that the Python in doCityAIProduction (in CvAI.py) might be better off knowing about. For starbases, you probably just need to make sure it is set up like the other ones (especially the new tags like making sure the bStarbase tag is set to 1 plus setting the iCultureRange to 2 and maybe specifying an iUpgradePriceOverride and, if it is not a regular starbase, along the lines of the sensor station, the bOtherStation is also set to 1). For the Python AI issue, my main concern is for adding additional generations of ship classes since the current checks for fighter and bomber squadrons use only the specific generations that already exist in FFP when deciding which unit type to force a build for. It is possible that this issue is irrelevant to the B5 mod, especially since, as of v1.8, the DLL now takes more things into account (specifically, ships that can carry them that don't have the special carrier unit AI type) when determining how many squadrons to build so that particular override is not as important as it used to be.

I'd just try adding 1 or 2 unit classes, and the associated unit types, and give it a try to rule out any immediate problems. I'd then add a couple more (making sure to include some sort of squadron and a starbase, if they are on the list of things to add) and then play a game to the point where I, and various AIs, can build all of them to make sure no Python errors pop up, and nothing odd happens.

I do not expect any serious problems with new unit classes.
 
I'd just try adding 1 or 2 unit classes, and the associated unit types, and give it a try to rule out any immediate problems. I'd then add a couple more (making sure to include some sort of squadron and a starbase, if they are on the list of things to add) and then play a game to the point where I, and various AIs, can build all of them to make sure no Python errors pop up, and nothing odd happens.

I do not expect any serious problems with new unit classes

That's excellent news God-Emperor, I'll not be adding Starbases or Fighters it's purely down to the ship units themselves. I can start work on this tonight now you've clarified this for me. Thanks again.
 
I have thought of one more thing.

The data for the advanced unit naming feature uses the unit class, so you should probably add some entries for each unit class into the Adv Unit Naming.ini file in the UserSettings folder. One entry per unit class per era is the way that goes.
 
Hi God-Emperor
Just to update you, I tried adding a new unit class but the Mod decided it didn't like that and refused to cooperate. What I did manage to do though was add additional units to the already existing classes. So Destroyer I-III is now Destroyer I-V and everything is working fine. I suspect a new unit class would need to have something added into the C++ and therefore a change to the DLL.

Thanks again for the help.
 
Hi God-Emperor
Just to update you, I tried adding a new unit class but the Mod decided it didn't like that and refused to cooperate. What I did manage to do though was add additional units to the already existing classes. So Destroyer I-III is now Destroyer I-V and everything is working fine. I suspect a new unit class would need to have something added into the C++ and therefore a change to the DLL.

Thanks again for the help.

It is definitely possible to add unit classes without C++, there isn't a list of all unit class types in the DLL.

Would you care to post your XML?
 
It is definitely possible to add unit classes without C++, there isn't a list of all unit class types in the DLL.

Would you care to post your XML?

I've uploaded the latest version of the Mod where, if you DL it, you can see what I've done.

What I wanted to do was have the planetary combat troops as a new unit class and the Battleship III & IV as a a Command Ship Class. Just trying to add one unit class caused me the problem so I tried it the way I have it in the Mod and it all works fine.
 
Top Bottom