PipWrap: Difference between revisions
No edit summary |
Major de-Deeziring. It would help if someone could improve table stylings since I could not find a pre-made style class for these type of tables. |
||
Line 1: | Line 1: | ||
{{ | {{Flag | ||
|values={{Values|unsigned integers}} | |||
|special=0[[#Special values|{{sup|{{arr|d}}}}]] | |||
|default=0 | |||
|types={{Categ|Technoes}} | |||
|ra2=yes | |||
|yr=yes | |||
}} | |||
This flag controls pip graphics rendering using special logic for [[TechnoTypes|units]] with {{f|PipScale#Ammo|ammo|link}}. | |||
If {{f|PipWrap|link}} is set to a positive [[Help:Values#Integers|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 {{f|Ammo|link}} level is to simply see it in action. | |||
==Example== | |||
The following table shows the relevant frames from ''pips2.shp'' in non-expanded {{Ra2}}. In {{Yr}} an additional frame used for occupancy pips was added in slot 12, so all frames pertaining to {{f|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. | |||
{| cellpadding="4" | |||
!Frame Number | |||
|14 | |||
|15 | |||
|16 | |||
|17 | |||
|18 | |||
|- | |||
!Graphic | |||
|[[Image:Pipwrap e.png|E]] | |||
|[[Image:Pipwrap d.png|D]] | |||
|[[Image:Pipwrap c.png|C]] | |||
|[[Image:Pipwrap b.png|B]] | |||
|[[Image:Pipwrap a.png|A]] | |||
|} | |||
To get an impression of how this logic works, assume that a unit has these three lines of code in its {{rules}} entry: | |||
<pre>Ammo=12 | |||
PipScale=Ammo | |||
PipWrap=3</pre> | |||
The pips will then be rendered as follows, depending on the unit's current ammo level. | |||
{| cellpadding="4" | |||
!Current Ammo | |||
|12 | |||
|11 | |||
|10 | |||
|9 | |||
|8 | |||
|7 | |||
|6 | |||
|5 | |||
|4 | |||
|3 | |||
|2 | |||
|1 | |||
|0 | |||
|- | |||
!Pips | |||
|[[Image:Pipwrap a.png|A]][[Image:Pipwrap a.png|A]][[Image:Pipwrap a.png|A]] | |||
|[[Image:Pipwrap a.png|A]][[Image:Pipwrap a.png|A]][[Image:Pipwrap b.png|B]] | |||
|[[Image:Pipwrap a.png|A]][[Image:Pipwrap b.png|B]][[Image:Pipwrap b.png|B]] | |||
|[[Image:Pipwrap b.png|B]][[Image:Pipwrap b.png|B]][[Image:Pipwrap b.png|B]] | |||
|[[Image:Pipwrap b.png|B]][[Image:Pipwrap b.png|B]][[Image:Pipwrap c.png|C]] | |||
|[[Image:Pipwrap b.png|B]][[Image:Pipwrap c.png|C]][[Image:Pipwrap c.png|C]] | |||
|[[Image:Pipwrap c.png|C]][[Image:Pipwrap c.png|C]][[Image:Pipwrap c.png|C]] | |||
|[[Image:Pipwrap c.png|C]][[Image:Pipwrap c.png|C]][[Image:Pipwrap d.png|D]] | |||
|[[Image:Pipwrap c.png|C]][[Image:Pipwrap d.png|D]][[Image:Pipwrap d.png|D]] | |||
|[[Image:Pipwrap d.png|D]][[Image:Pipwrap d.png|D]][[Image:Pipwrap d.png|D]] | |||
|[[Image:Pipwrap d.png|D]][[Image:Pipwrap d.png|D]][[Image:Pipwrap e.png|E]] | |||
|[[Image:Pipwrap d.png|D]][[Image:Pipwrap e.png|E]][[Image:Pipwrap e.png|E]] | |||
|[[Image:Pipwrap e.png|E]][[Image:Pipwrap e.png|E]][[Image:Pipwrap e.png|E]] | |||
|} | |||
It should then be fairly evident that the use of {{f|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. | |||
{| cellpadding="4" | |||
!Frame Number | |||
|14 | |||
|15 | |||
|16 | |||
|17 | |||
|18 | |||
|'''''n''''' | |||
|- | |||
!Graphic | |||
|[[Image:Pipwrap e.png|E]] | |||
|[[Image:Pipwrap d.png|D]] | |||
|[[Image:Pipwrap c.png|C]] | |||
|[[Image:Pipwrap b.png|B]] | |||
|[[Image:Pipwrap a.png|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 {{f|PipWrap}}. However, not all possibilities yield desirable results. A basic rule of thumb is that {{f|PipWrap}} should be a factor of {{f|Ammo}}. | |||
It is also important to note that should the quotient of {{f|Ammo}} divided by {{f|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 {{f|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 {{f|PipWrap|0}}, this special pip drawing logic will ''not'' be used. This is also the default behavior. | |||
==See also== | |||
* {{f|PipScale|link}} | |||
* {{f|Ammo|link}} |
Latest revision as of 01:40, 20 December 2009
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 |
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 |
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 | ? | |||||
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.