Model Point Shields

From FreeSpace Wiki
Revision as of 03:06, 7 December 2015 by Zookeeper (talk | contribs) (Added note about mini shield icon incompatibility)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
FS2 Open, 3.7.2:

Model Point Shields

Model point shields are an FSO feature intended to enable ships to have an arbitrary number of shield segments instead of being limited to the standard 4 quadrants. You can have 1, 2, 3, 4, 5 or however many segments your ship needs.

The basic idea is simple: each shield segment is defined by a single point. When something hits the ship, the segment which's point is closest to the point of impact is considered to have gotten hit. By carefully positioning the points in relation to each other and the ship's hull, one can make each segment cover specific parts of the ship.

To use them on a given ship, several things are required:

Shield points placed in the model file

Firstly, the number and placement of the shield segments is defined in the model file. In PCS2, you must add each segment as a special point and give it the $special=shieldpoint property. The name and radius of the special point are not used, but a name such as $ShieldsLeft is obviously good to supply for clarity, and the radius can be used as a means to visualize the reach of segments in relation to each other. However, the ordering of the points is meaningful, as it is the only information used by the engine to identify segments, and thus the following steps will need to define things in the exact same order.

Shield points enabled in ships.tbl

To enable the ship to use the aforementioned model-defined segments, it needs the "model point shields" ship type flag.

Re-mapping of augmentation controls for player ships

If the player can get to fly the ship, it needs to define which of the standard top/right/rear/left shield augmentation keys applies to which segment, see $Model_Point_Shield_Controls:; otherwise, shield augmentation controls will not work at all. Note how the same ordering as in the first step needs to be used here.

Shield icon

Shield icons used with standard 4-quadrant shields have their frames ordered as top,right,rear,left. However, here you need to naturally supply the same number of frames as the ship has shield segments, and again, the order of the frames needs to be the same as the order of the segments in the model file.

Note: the small target hull/shield integrity indicator below the crosshairs is designed to only work with standard 4-quadrant shields and cannot currently be customized per-ship. Therefore mods making use of the feature may want to disable the gauge entirely or override targhit1.ani with an empty one (so that the shield display is disabled, but the hull integrity is still shown).