Battlezone Universe

Battlezone Universe => Archive Vault => Public 1.3 Beta 4 Archive => Topic started by: mrtwosheds on July 30, 2008, 07:32:16 PM

Title: Inheritance?
Post by: mrtwosheds on July 30, 2008, 07:32:16 PM
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?
Title: Re: Inheritance?
Post by: Red Devil on July 30, 2008, 07:35:40 PM
ODF names only matter if they are identical.  The classLabel of ivtankabc should be classLabel = "ivtank" to inherit.  Same with ivtanabc.
Title: Re: Inheritance?
Post by: 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?
Title: Re: Inheritance?
Post by: mrtwosheds on July 30, 2008, 10:22:04 PM
Quoteshould be classLabel = "ivtank"
did you mean baseName = "ivtank" ?
classLabel = "wingman"
Title: Re: Inheritance?
Post by: General BlackDragon on July 30, 2008, 10:33:08 PM
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.
Title: Re: Inheritance?
Post by: Red Devil on July 30, 2008, 11:11:53 PM
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]


Title: Re: Inheritance?
Post by: Nielk1 on July 31, 2008, 05:48:09 AM
Be sure to check the units out, I remember some of the rarest values and newest additions not proliferating correctly.
Title: Re: Inheritance?
Post by: Commando on July 31, 2008, 02:06:33 PM
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.
Title: Re: Inheritance?
Post by: Avatar on July 31, 2008, 04:28:50 PM
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-