View Single Post
Old 11-26-11, 09:14 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

ColisionableObject controller:

ArmorLevel - The armor level in cm [0..100]
Hit_Points - The amount of hitpoints this ship can take
CrashDepth - The maximum depth this ship survives
CrashSpeed - The number of hitpoints to be accumulated in 1 sec when ship under crash depth
Rebound - The rebound coefficient [0..1] to be used when colliding with other objects

These are global parameters for the ship, the armor level can be overridden by the settings in each box, and it's used in conjunction with this structure:
AmmoDamageInfo - AmmoDamageInfo User Data.
MinEF - The min hit points this ammunition worths
MaxEF - The max hit points this ammunition worths
Armor Level - The armor level it penetrates
MinRadius - The minimum radius of splash damage. The ammunition takes all its hitpoints until this distance
MaxRadius - The maximum radius of splash damage. The ammunition takes no hitpoints beyond this distance. If 0 no splash

So when the ammo hits a ship it substracts a number of hitpoints from the surrounding boxes, between minef and maxef, according to the distance to the impact, and also calculating the armor penetration factor (don't know how it's calculated), if the value of armor level in the box is -1 then the global armor level is taken, same for the hitpoints (the global value is defined in the matching zone in zones.cfg).

Now the boxes in the zon file :

Boxes:
Type - The type of zone
ArmorLevel - The armor level of zone: -1 means it has armor of LinkTo Other object linked to zone or the global object itself.

Where Type is a reference to the number of a zone defined in zones.cfg, ArmorLevel is the armor value unique to this box, LinkTo is the ID of an object in the ship that you want destroyed when this box hitpoints reach 0, ie you have a ship with two masts and a cable between them, the cable is a child of mast1, so if mast1 is destroyed then it's child's (in this case the cable) are destroyed as well, but if mast2 is destroyed then the cable remains giving an odd effect, so you link the box of mast two the cable using it's id and when mast2 is destroyed so is the cable.

Leaving us with zones.cfg. It has three parts:
a [Zones List] it's where the different zones are defined, a number and a name, the number is the cross reference between this file and the boxes in each ship .zon.
b the zones definition section is where you define each zone properties ie:
[AmmoBunkersAbove]
Category=Fore Ammo Bunker
Multiplier=1.000000
Flotability=0.000000
HitPoints=50
Destructible=No
Armor Level=-1
Critic Flotation=0.300000
Critical=No
Critical Chance=0.05
Effect1=#dc_bubbles, 50
FloodingTime=59.999996
CargoType=Ammo
Crash Depth=6

The shell or torpedo 'doing the damage' has to be able to overcome the AP of the zone in order to cause damage. i.e.: the AmmoDammageInfo controller's ArmorLevel has to be >= the unit's zone that it hit to cause damage

Last edited by TheDarkWraith; 11-26-11 at 09:26 PM.
TheDarkWraith is offline   Reply With Quote