would someone like to explain how this works or does not work.
What I mean is if two units have a similar names at what point does the engine decide they are parent/child objects
eg Ivtank and ivtankabc would presumably inherit
would ivtanabc ?
how much similarity is required for inheritance to function or not?
And what entry's can be removed from a child object? all of them that are the same? or do some need to remain?
ODF names only matter if they are identical. The classLabel of ivtankabc should be classLabel = "ivtank" to inherit. Same with ivtanabc.
odf name is not used.
So just all of an odf entry's differing from ivtank with classlabel ivtank, need to be put in and any header they may be under?
Quoteshould be classLabel = "ivtank"
did you mean baseName = "ivtank" ?
classLabel = "wingman"
Quote from: mrtwosheds on July 30, 2008, 09:20:23 PM
odf name is not used.
So just all of an odf entry's differing from ivtank with classlabel ivtank, need to be put in and any header they may be under?
Pretty much.
Say, you want to make a varient of a ship. The varient *Must* be the same classlabel for it to work. A "Wingman" class, such as ivtank, for instance, you can make another wingman class and use the classlabel of "ivtank" to make the odf automatically take on almost all charachteristics of ivtank.odf.
Things that are NOT inherited: Custom Chunks, Damage Smoke, StatusIcon, Icon, UnitInfo thingies. Aside from that, I think all of the rest is used.
Here's an example. Anything that is different from the base class is specified, which overrides what is specified in the base class:
ivtank_w.odf
[GameObjectClass]
classLabel = "ivtank"
scrapCost = 30
customCost = 40
maxHealth = 4200
unitName = "Empty Sabre"
provideCount = 3
provideName2 = "ivtank_w"
provideName3 = "DefendUnit"
playerOnly = true
//Determines whether the ai can operate a unit or whether it is a human only vehicle. If set to true, the ai can't occupy the unit.
/////// weapons ///////////////////
weaponMask = 00001
weaponName1 = "gspstab_c"
////////////////////////////////////
[CraftClass]
[HoverCraftClass]
velocForward = 34.0
velocStrafe = 20.0
[Lod1]
[Lod2]
Be sure to check the units out, I remember some of the rarest values and newest additions not proliferating correctly.
There is only one requirement for inheritance. The base unit and the unit inheriting from it must use the same classLabel. This occurs automatically when the inheriting takes place.
There is one limitation with inheritance. Nothing under [MorphTankClass] inherits. Therefore you will have to leave that odf section alone.
Sounds more like the basics aren't understood here.
Inhertiting means using an ODF NAME instead of a CLASSLABEL.
So you'd use
classLabel = "MYODF"
instead of
classLabel = "wingman"
And the new odf will then use the entries from MYODF.ODF.
With a few exceptions you can make a basically empty ODF this way.
Then, if you want to change something, you only include the changes in the new odf. That's where you have to be careful with morphtank class and a few other things.
-Av-