ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

PipWrap

From ModEnc
Jump to: navigation, search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: PipWrap
File(s): rules(md).ini
Values: Unsigned integers: All non-negative whole numbers from 0 to either 32767, 2147483647 or 4294967295.
Special Values: 0
Default: 0
Applicable to: TechnoTypes:

AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes



This flag controls pip graphics rendering using special logic for units with PipScale=ammo.

If PipWrap is set to a positive integer greater than 0, that number of pips will be rendered. The most practical means of understanding which frame of pips2.shp is used for each pip at a given Ammo level is to simply see it in action.

Example

The following table shows the relevant frames from pips2.shp in non-expanded Red Alert 2. In Yuri's Revenge an additional frame used for occupancy pips was added in slot 12, so all frames pertaining to PipWrap are shifted one slot higher. Note that frame numbers start at 0 rather than 1, so frame 3 for example is actually the fourth frame.

Frame Number 14 15 16 17 18
Graphic E D C B A

To get an impression of how this logic works, assume that a unit has these three lines of code in its Rules(md).ini entry:

Ammo=12
PipScale=Ammo
PipWrap=3

The pips will then be rendered as follows, depending on the unit's current ammo level.

Current Ammo 12 11 10 9 8 7 6 5 4 3 2 1 0
Pips AAA AAB ABB BBB BBC BCC CCC CCD CDD DDD DDE DEE EEE

It should then be fairly evident that the use of PipWrap allows each pip to represent more than just 0 or 1 points of ammo. Each pip represents n−14 ammo points, where n is equal to the frame of pips2.shp used to draw the pip.

Frame Number 14 15 16 17 18 n
Graphic E D C B A ?
Ammo Points 0 1 2 3 4 n−14

Recommended Configurations

The previous example is only one of the many possible ways to configure PipWrap. However, not all possibilities yield desirable results. A basic rule of thumb is that PipWrap should be a factor of Ammo.

It is also important to note that should the quotient of Ammo divided by PipWrap be a number greater than 4, pips2.shp will need to be modified using a tool such as OS SHP Builder to include the necessary frames beyond frame 18. If the engine tries to draw a pip using a frame that doesn't exist—since the PipWrap scheme dictates that the pip should represent an amount of ammo points greater than 4—no graphic will be rendered for that pip.

Special values

If PipWrap=0, this special pip drawing logic will not be used. This is also the default behavior.

See also