• Welcome to Battlezone Universe.
 

News:

Welcome to the BZU Archive dated December 24, 2009. Topics and posts are in read-only mode. Those with accounts will be able to login and browse anything the account had access granted to at the time. No changes to permissions will be made to be given access to particular content. If you have any questions, please reach out to squirrelof09/Rapazzini.

Main Menu

Inheritance?

Started by mrtwosheds, July 30, 2008, 07:32:16 PM

Previous topic - Next topic

mrtwosheds

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?

Red Devil

ODF names only matter if they are identical.  The classLabel of ivtankabc should be classLabel = "ivtank" to inherit.  Same with ivtanabc.
What box???

mrtwosheds

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?

mrtwosheds

Quoteshould be classLabel = "ivtank"
did you mean baseName = "ivtank" ?
classLabel = "wingman"

General BlackDragon

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.



*****General BlackDragon*****

Red Devil

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]


What box???

Nielk1

Be sure to check the units out, I remember some of the rarest values and newest additions not proliferating correctly.

Click on the image...

Commando

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.

Avatar

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-