Difference between revisions of "2DFX"

From GTAMods Wiki
Jump to navigation Jump to search
(Statistics)
(Type 3: Peds)
 
(23 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{This|This article describes the usage of the 2dfx section inside a plain text [[IDE]]. For the [[List of RW section IDs|RW Section]] of models see [[2DFX (RW Section)]], for the [[GTA IV]] IPL section see [[2DFX (IPL Section)]].}}
+
{{This|This article describes the usage of the 2dfx section inside a plain text [[IDE]]. For the [[List of RW section IDs|RW Section]] of models see [[2d Effect (RW Section)]], for the [[GTA IV]] IPL section see [[2DFX (IPL Section)]].}}
 
{{Research}}
 
{{Research}}
 
{{IdeSection
 
{{IdeSection
| game        = [[GTA III]], [[GTA VC]]
+
| game        = {{Icon|3}} {{Icon|VC}} {{Icon|4}}
 
| description = Used to place 2D effects and ped behaviors on objects
 
| description = Used to place 2D effects and ped behaviors on objects
 
}}
 
}}
'''2DFX''' is a section in the [[item definition]] file. It is used to place 2D effects (like lights and particles) and ped behaviors on objects. This section is somewhat unique compared to other sections because it needs to be attached to an existing object rather than defining itself. If too much effects are loaded or drawn in the game, some of the effects will load in and out or won't appear at all.
+
'''2DFX''' is a section in the [[item definition]] file in [[GTA III]], [[Vice City]], and [[GTA IV]]. It is used to place 2D effects (like lights and particles) and ped behaviors on objects. This section is somewhat unique compared to other sections because it needs to be attached to an existing object rather than defining itself. If too many effects are loaded or drawn in the game, some of the effects will load in and out or won't appear at all.
  
==Format==
+
== GTA III and Vice City ==
===Type 0: Lights===
+
{{Pre|
 +
2dfx
 +
# [[#Type 0: Lights|type 0: lights]] (III/VC)
 +
Id, X, Y, Z, R, G, B, unknown, 2DFXType, "Corona", "Shadow", Distance, OuterRange, Size, InnerRange, ShadowIntensity, Flash, Wet, Flare, Flags
 +
# [[#Type 1: Particles|type 1: particles]] (III/VC)
 +
Id, X, Y, Z, R, G, B, unknown, 2DFXType, Particle, StrengthX, StrengthY, StrengthZ, Scale
 +
# [[#Type 2|type 2]] (III/VC)
 +
Id, X, Y, Z, R, G, B, unknown, 2DFXType, unknown, unk1, unk2, unk3, unknown
 +
# [[#Type 3: Peds|type 3: peds]] (VC)
 +
Id, X, Y, Z, R, G, B, unknown, 2DFXType, Behavior, unk1, unk2, unk3, RotX, RotY, RotZ
 +
# [[#Type 4: Sun Reflections|type 4: sun reflections]] (VC)
 +
Id, X, Y, Z, R, G, B, unknown, 2DFXType
 +
end
 +
}}
 +
 
 +
=== Type 0: Lights ===
 
This can create a complex light source on an object. If the object has a sub object, the light will disappear when the main object changes into the sub object (like when lampposts are knocked).
 
This can create a complex light source on an object. If the object has a sub object, the light will disappear when the main object changes into the sub object (like when lampposts are knocked).
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
! width="36px"| {{Icon|3}} {{Icon|VC}}
+
! style="width: 3em;"| {{Icon|3}} {{Icon|VC}}
! width="150px"| Identifier
+
! style="width: 12em;"| Identifier
! width="100px"| Type
+
! style="width: 6em;" | Type
 
! Description
 
! Description
 
|-
 
|-
| <center>A</center> || <center>ID</center> || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
+
| A || Id || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
 
|-
 
|-
| <center>B,C,D</center> || <center>X, Y, Z</center> || float[3] || X, Y, and Z coordinates relative to the center of the object
+
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 
|-
 
|-
| <center>E,F,G</center> || <center>R, G, B</center> || integer[3] || color of the light and everything associated with it in RGB format, also affects the intensity of the light so that darker the color the dimmer the light (meaning black (0,0,0) will yield a light so dim that it's not visible)
+
| E,F,G || R, G, B || integer[3] || color of the light and everything associated with it in RGB format, also affects the intensity of the light so that darker the color the dimmer the light (meaning black (0,0,0) will yield a light so dim that it's not visible)
 
|-
 
|-
| <center>H</center> || <center>''unknown''</center> || integer || usually 0 or 200
+
| H || ''unknown'' || integer || usually 0 or 200
 
|-
 
|-
| <center>I</center> || <center>2DFX type</center> || integer || always 0 for lights
+
| I || 2DFXType || integer || always 0 for lights
 
|-
 
|-
| <center>J</center> || <center>Corona</center> || string || corona texture associated to the light, texture defined in <code>particle.txd</code>, usually "coronastar" for lights
+
| J || Corona || string || corona texture associated to the light, texture defined in <code>particle.txd</code>, usually "coronastar" for lights
 
|-
 
|-
| <center>K</center> || <center>Shadow</center> || string || light texture that is cast on the ground, texture defined in <code>particle.txd</code>, usually "shad_exp" for lights
+
| K || Shadow || string || light texture that is cast on the ground, texture defined in <code>particle.txd</code>, usually "shad_exp" for lights
 
|-
 
|-
| <center>L</center> || <center>Distance</center> || float || view distance of the light, is limited by the draw distance of the host object
+
| L || Distance || float || view distance of the light, is limited by the draw distance of the host object
 
|-
 
|-
| <center>M</center> || <center>Outer range</center> || float || the range the light can cast on objects, cars, and peds
+
| M || OuterRange || float || the range the light can cast on objects, cars, and peds
 
|-
 
|-
| <center>N</center> || <center>Size</center> || float || the size of the corona, can be a float or integer, size 0 means no visible corona but effect of light still visible
+
| N || Size || float || the size of the corona, can be a float or integer, size 0 means no visible corona but effect of light still visible
 
|-
 
|-
| <center>O</center> || <center>Inner range</center> || float || the range the light can cast on the ground
+
| O || InnerRange || float || the range the light can cast on the ground (shadow)
 
|-
 
|-
| <center>P</center> || <center>IDE flag</center> || integer || [[OBJS#Object_Flags|IDE flag]], only the time-dependent flags are useable
+
| P || ShadowIntensity || integer || shadow intensity (0 - 255), usually 40
 
|-
 
|-
| <center>Q</center> || <center>Flash</center> || integer || sets the type of flashing ([[2DFX#Types of Flashes|see below]])
+
| Q || Flash || integer || sets the type of flashing ([[2DFX#Types of Flashes|see below]])
 
|-
 
|-
| <center>R</center> || <center>Wet</center> || integer || sets the particle to be "reflective" on wet grounds, will only work if the ground around the light is set to wet when raining<br>0 - not reflective when wet, 1 - reflective when wet
+
| R || Wet || integer || sets the particle to be "reflective" on wet grounds, will only work if the ground around the light is set to wet when raining<br>0 - not reflective when wet, 1 - reflective when wet
 
|-
 
|-
| <center>S</center> || <center>Flare</center> || integer || sets the particle to create a lens flare on the screen, similar to what the sun does<br>0 - no lens flare, 1 - yellow lens flare, 2 - white lens flare
+
| S || Flare || integer || sets the particle to create a lens flare on the screen, similar to what the sun does<br>0 - no lens flare, 1 - yellow lens flare, 2 - white lens flare
 
|-
 
|-
| <center>T</center> || <center>Dust</center> || integer || sets the intensity of light reflecting off dust, values 4 to 7 have visible effects
+
| T || Flags || integer || bit 0 - disable z-test for corona, bits 1-2 - fog (dust) type
 
|}
 
|}
  
 
====Types of Flashes====
 
====Types of Flashes====
{| {{prettytable}}
+
{|class="wikitable center-col-1"
| 0
+
|0 ||constantly lit all time
| constantly lit all time
+
|-
 +
|1 ||constantly lit at night
 +
|-
 +
|2 ||occasional flicker all time
 +
|-
 +
|3 ||occasional flicker at night
 +
|-
 +
|4 ||1.02 seconds flashes
 +
|-
 +
|5 ||1.02 seconds flashes at night
 +
|-
 +
|6 ||2.04 seconds flashes
 +
|-
 +
|7 ||2.04 seconds flashes at night
 +
|-
 +
|8 ||4.08 seconds flashes
 +
|-
 +
|9 ||4.08 seconds flashes at night
 
|-
 
|-
| 1
+
|10 ||random flicker
| constantly lit at night
 
 
|-
 
|-
| 2
+
|11 ||random flicker at night
| occasional flicker all time
 
 
|-
 
|-
| 3
+
|12 ||hardcoded traffic lights properties
| occasional flicker at night
 
 
|-
 
|-
| 4
+
|13 ||{{Icon|3}} 1.02 seconds flashes only during lift bridge's alarm
| ~1 second flashes
 
 
|-
 
|-
| 5
+
|14 ||{{Icon|3}} unused, flashes only during lift bridge's alarm
| ~1 second flashes at night
+
|}
 +
All night flashes occur between 19:00 and 7:00. Type 12 is involved in hardcoded properties of traffic lights. It is mainly used to position the lights on the traffic light. A traffic light without a 2DFX entry will crash the game when the traffic light is loading.
 +
 
 +
====Types of Flags====
 +
{|class="wikitable center-col-1"
 +
|0 ||{{Icon|VC}} No DUST, coronas don't appear through models with no collision.
 
|-
 
|-
| 6
+
|1 ||{{Icon|VC}} No DUST, coronas appears through models with no collision.
| ~2 seconds flashes
 
 
|-
 
|-
| 7
+
|2 ||{{Icon|VC}} DUST when foggy weather, coronas don't appear through models with no collision.
| ~2 seconds flashes at night
 
 
|-
 
|-
| 8
+
|3 ||{{Icon|VC}} DUST when foggy weather, coronas appears through models with no collision.
| ~3 seconds flashes
 
 
|-
 
|-
| 9
+
|4 ||{{Icon|VC}} DUST all the time, coronas don't appear through models with no collision.
| ~3 seconds flashes at night
 
 
|-
 
|-
| 10
+
|5 ||{{Icon|VC}} DUST all the time, coronas appear through models with no collision.
| random flicker
 
 
|-
 
|-
| 11
+
|6 ||{{Icon|VC}} DUST all the time, coronas appear through models with no collision.
| random flicker at night
 
 
|-
 
|-
| 12
+
|7 ||{{Icon|VC}} DUST all the time, coronas appear through models with no collision.
| hardcoded traffic lights properties
 
 
|}
 
|}
Type 12 is involved in hardcoded properties of traffic lights. It is mainly used to position the lights on the traffic light. A traffic light without a 2DFX entry will crash the game when the traffic light is loading.
 
  
 
===Type 1: Particles===
 
===Type 1: Particles===
 
This can create simple particles on an object
 
This can create simple particles on an object
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
! width="36px"| {{Icon|3}} {{Icon|VC}}
+
! style="width: 3em;"| {{Icon|3}} {{Icon|VC}}
! width="150px"| Identifier
+
! style="width: 12em;"| Identifier
! width="100px"| Type
+
! style="width: 6em;" | Type
 
! Description
 
! Description
 
|-
 
|-
| <center>A</center> || <center>ID</center> || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
+
| A || Id || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
 
|-
 
|-
| <center>B,C,D</center> || <center>X, Y, Z</center> || float[3] || X, Y, and Z coordinates relative to the center of the object
+
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 
|-
 
|-
| <center>E,F,G</center> || <center>R, G, B</center> || integer[3] || useless values
+
| E,F,G || R, G, B || integer[3] || useless values
 
|-
 
|-
| <center>H</center> || <center>''unknown''</center> || integer || usually 63 or 200
+
| H || ''unknown'' || integer || usually 63 or 200
 
|-
 
|-
| <center>I</center> || <center>2DFX type</center> || integer || always 1 for particles
+
| I || 2DFXType || integer || always 1 for particles
 
|-
 
|-
| <center>J</center> || <center>Particle</center> || integer || particle type ([[2DFX#Types of Particles|see below]])
+
| J || Particle || integer || particle type ([[2DFX#Types of Particles|see below]])
 
|-
 
|-
| <center>K,L,M</center> || <center>unk1, unk2, unk3</center> || float[3] || unknown, rotation of particle?
+
| K,L,M || StrengthX, StrengthY, StrengthZ || float[3] || X, Y, and Z strength representing the direction and length of movement of the particle, see [[039D#List of particle effects|opcode 039D]] for more information
 
|-
 
|-
| <center>N</center> || <center>Size</center> || float || the size of the particle
+
| N || Scale || float || scale of the particle
 
|}
 
|}
  
 
====Types of Particles====
 
====Types of Particles====
 
[[File:2dfx_particles.png|thumb|Ordered from 6 to 0 from left to right, all size is 1 with Tommy at the bottom for comparison]]
 
[[File:2dfx_particles.png|thumb|Ordered from 6 to 0 from left to right, all size is 1 with Tommy at the bottom for comparison]]
{| {{prettytable}}
+
{|class="wikitable center-col-1"
| 0
+
! {{Icon|3}} || {{Icon|VC}} || Name || Description
| small white smoke
+
|-
 +
| colspan="2" | 0 || POBJECT_<wbr>PAVEMENT_<wbr>STEAM || small white smoke
 
|-
 
|-
| 1
+
| colspan="2" | 1 || POBJECT_<wbr>WALL_<wbr>STEAM || small white smoke
| small white smoke
 
 
|-
 
|-
| 2
+
| colspan="2" | 2 || POBJECT_<wbr>DRY_<wbr>ICE || larger white smoke
| larger white smoke
 
 
|-
 
|-
| 3
+
| colspan="2" | 3 || POBJECT_<wbr>SMALL_<wbr>FIRE || fire (start new game to see)
| fire (it doesn't burn)
 
 
|-
 
|-
| 4
+
| colspan="2" | 4 || POBJECT_<wbr>DARK_<wbr>SMOKE || black smoke
| black smoke
 
 
|-
 
|-
| 5
+
| - || {{a|c}} | 5 || POBJECT_<wbr>WATER_<wbr>FOUNTAIN_<wbr>VERT || water fountain (will spray water droplets on the screen)
| water fountain (Vice City only, will spray water droplets on the screen)
 
 
|-
 
|-
| 6
+
| - || {{a|c}} | 6 || POBJECT_<wbr>WATER_<wbr>FOUNTAIN_<wbr>HORIZ || water spray (will spray water droplets on the screen)
| water spray (Vice City only, will spray water droplets on the screen)
 
 
|}
 
|}
  
 
===Type 2===
 
===Type 2===
It is unknown what this type does. This type was used in GTA III but should be usable in Vice City.
+
This causes peds to investigate interesting spots.{{Ref|1}} This type was never used in Vice City but it can be used. See [[:File:2dfxType2.jpg|here]] for a map of all the locations in GTA III.
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
! width="36px"| {{Icon|3}} {{Icon|VC}}
+
! style="width: 3em;"| {{Icon|3}} {{Icon|VC}}
! width="150px"| Identifier
+
! style="width: 12em;"| Identifier
! width="100px"| Type
+
! style="width: 6em;" | Type
 
! Description
 
! Description
 
|-
 
|-
| <center>A</center> || <center>ID</center> || integer ||  
+
| A || Id || integer ||  
 
|-
 
|-
| <center>B,C,D</center> || <center>X, Y, Z</center> || float[3] ||  
+
| B,C,D || X, Y, Z || float[3] ||  
 
|-
 
|-
| <center>E,F,G</center> || <center>R, G, B</center> || integer[3] ||  
+
| E,F,G || R, G, B || integer[3] ||  
 
|-
 
|-
| <center>H</center> || <center>''unknown''</center> || integer || usually 63 or 200
+
| H || ''unknown'' || integer || usually 63 or 200
 
|-
 
|-
| <center>I</center> || <center>2DFX type</center> || integer || always 2
+
| I || 2DFXType || integer || always 2
 
|-
 
|-
| <center>J</center> || <center>''unknown''</center> || integer ||  
+
| J || ''unknown'' || integer ||  
 
|-
 
|-
| <center>K,L,M</center> || <center>''unknown''</center> || float[3] ||  
+
| K,L,M || ''unk1'', ''unk2'', ''unk3'' || float[3] ||  
 
|-
 
|-
| <center>N</center> || <center>''unknown''</center> || integer ||  
+
| N || ''unknown'' || integer ||  
 
|}
 
|}
  
Line 173: Line 193:
 
This can make a ped have simple behaviors around the object.
 
This can make a ped have simple behaviors around the object.
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
! width="36px"| {{Icon|VC}}
+
! style="width: 3em;"| {{Icon|VC}}
! width="150px"| Identifier
+
! style="width: 12em;"| Identifier
! width="100px"| Type
+
! style="width: 6em;" | Type
 
! Description
 
! Description
 
|-
 
|-
| <center>A</center> || <center>ID</center> || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
+
| A || Id || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
 
|-
 
|-
| <center>B,C,D</center> || <center>X, Y, Z</center> || float[3] || X, Y, and Z coordinates relative to the center of the object
+
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 
|-
 
|-
| <center>E,F,G</center> || <center>R, G, B</center> || integer[3] || useless values
+
| E,F,G || R, G, B || integer[3] || useless values
 
|-
 
|-
| <center>H</center> || <center>''unknown''</center> || integer || usually 0 or 200
+
| H || ''unknown'' || integer || usually 0 or 200
 
|-
 
|-
| <center>I</center> || <center>2DFX type</center> || integer || always 3 for peds
+
| I || 2DFXType || integer || always 3 for peds
 
|-
 
|-
| <center>J</center> || <center>Behavior</center> || integer || behavior type ([[2DFX#Types of Behaviors|see below]])
+
| J || Behavior || integer || behavior type ([[2DFX#Types of Behaviors|see below]])
 
|-
 
|-
| <center>K,L,M</center> || <center>unk1, unk2, unk3</center> || float[3] || unknown, useless values?
+
| K,L,M || Queue direction || float[3] || direction of some que
 
|-
 
|-
| <center>N,O,P</center> || <center>RotX, RotY, RotZ</center> || float[3] || rotation of ped when animation is playing
+
| N,O,P || Use direction || float[3] || rotation of ped when animation is playing
 
|}
 
|}
  
 
====Types of Behaviors====
 
====Types of Behaviors====
{| {{prettytable}}
+
{|class="wikitable"
 
| 0
 
| 0
 
| walks to the coordinates to use an ATM then walks away
 
| walks to the coordinates to use an ATM then walks away
Line 211: Line 231:
 
|-
 
|-
 
| 4
 
| 4
| unknown, used in game
+
| runs to shelter from rain,{{Ref|2}} see [[:File:2dfxType3.4.jpg|here]] for a map of all the locations
 
|}
 
|}
  
Line 217: Line 237:
 
This can create a sun "reflection" exactly and behaving like the ones seen on cars.
 
This can create a sun "reflection" exactly and behaving like the ones seen on cars.
  
{|{{Prettytable}} width="100%"
+
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
! width="36px"| {{Icon|VC}}
+
! style="width: 3em;"| {{Icon|VC}}
! width="150px"| Identifier
+
! style="width: 12em;"| Identifier
! width="100px"| Type
+
! style="width: 6em;" | Type
 +
! Description
 +
|-
 +
| A || Id || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
 +
|-
 +
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 +
|-
 +
| E,F,G || R, G, B || integer[3] || useless values
 +
|-
 +
| H || ''unknown'' || integer || usually 120
 +
|-
 +
| I || 2DFXType || integer || always 4 for sun reflections
 +
|}
 +
 
 +
Used on models lh_icecream01, hospital and lhcoastsky1
 +
 
 +
== GTA San Andreas ==
 +
Most effects are stored in dff 2d Effect (RW Section) https://gtamods.com/wiki/2d_Effect_(RW_Section). The only exception is effect 5.
 +
 
 +
== GTA IV ==
 +
{{incomplete}}
 +
 
 +
GTA IV 2DFX Category doesn't have all Types description. More description about 2dfx types will be added later.
 +
 
 +
=== Type 0: Lights ===
 +
 
 +
Type ''Lights'' ignore by the game. GTA IV using light in .wdr/wft models
 +
 
 +
=== Type 1: Particles ===
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
! style="width: 3em;"| {{Icon|4}}
 +
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 
! Description
 
! Description
 
|-
 
|-
| <center>A</center> || <center>ID</center> || integer || associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
+
| A || Id || string || associated to existing object ID defined in OBJS or TOBJ section
 
|-
 
|-
| <center>B,C,D</center> || <center>X, Y, Z</center> || float[3] || X, Y, and Z coordinates relative to the center of the object
+
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 
|-
 
|-
| <center>E,F,G</center> || <center>R, G, B</center> || integer[3] || useless values
+
| E || Type || integer || always 1
 
|-
 
|-
| <center>H</center> || <center>''unknown''</center> || integer || usually 120
+
| F,G,H,I || RX, RY, RZ, RW || float[4] || Rotation in quaternion
 
|-
 
|-
| <center>I</center> || <center>2DFX type</center> || integer || always 4 for sun reflections
+
| J || Name || string || particle name, defined in <code>common\data\effects\</code>
 +
|-
 +
| K ||| integer || stages of destruction? (between 0 and 4)
 +
|-
 +
| L ||  || integer || ?
 +
|-
 +
| M || Size || float || size of particle
 +
|-
 +
| N || Draw distance || integer || draw distance
 +
|-
 +
| O ||  || integer || ? (between 0 and 5)
 +
|-
 +
| P,Q,R || Color || integer[3] || RGB color when applicable
 
|}
 
|}
  
==Statistics==
+
=== Type 2: Explosion ===
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
! style="width: 3em;"| {{Icon|4}}
 +
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 +
! Description
 +
|-
 +
| A || Id || string || associated to existing object ID defined in OBJS or TOBJ section
 +
|-
 +
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 +
|-
 +
| E || Type || integer || always 2
 +
|-
 +
| F,G,H,I || RX, RY, RZ, RW || float[4] || rotation in quaternion
 +
|-
 +
| J ||  || integer ||
 +
|-
 +
| K ||  || integer  ||
 +
|-
 +
| L ||  || integer ||
 +
|-
 +
| M ||  || integer ||
 +
|}
 +
 
 +
=== Type 10: Escalator ===
 +
 
 +
GTA SA Using Escalator attribute in .dff models, GTA IV has the Escalator Attribute too, but all parameters are unknown and possible section maybe call the game crash.
 +
 
 +
=== Type 12: Proc Object ===
 +
 
 +
=== Type 13: WorldPoint ===
 +
 
 +
=== Type 14: Ladder ===
 +
 
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
! width="40px"| {{Icon|4}}
 +
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 +
! Description
 +
|-
 +
| A || Name || string || Model name, who using Ladder Section
 +
|-
 +
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates
 +
|-
 +
| E || 2DFX Type || Integer || This is 2DFX Type. Always use the value 14 for Ladder
 +
|-
 +
| F,G,H,I || RX, RY, RZ, RW || float[4] || Rotation in quaternion
 +
|-
 +
| J,K,L || StartX,StartY,StartZ || float[3] || Start Ladder Position (When player start to climb)
 +
|-
 +
| M,N,O || EndX,EndY,EndZ || float[3] || End Ladder Position (When player finished to climb)
 +
|-
 +
| P,Q,R || ClimbDirectionX, ClimbDirectionY, ClimbDirectionZ || float[3] || Climb Direction Position
 +
|-
 +
| S || Flag || Integer || Unknown Flag, Always(?) using value 1
 +
|}
 +
 
 +
=== Type 15: Audio ===
 +
 
 +
=== Type 17: SpawnPoint ===
 +
{|class="wikitable center-col-1 center-col-2" style="width: 100%;"
 +
! style="width: 3em;"| {{Icon|4}}
 +
! style="width: 12em;"| Identifier
 +
! style="width: 6em;" | Type
 +
! Description
 +
|-
 +
| A || Id || string || associated to existing object ID defined in OBJS or TOBJ section
 +
|-
 +
| B,C,D || X, Y, Z || float[3] || X, Y, and Z coordinates relative to the center of the object
 +
|-
 +
| E || Type || integer || Always 17
 +
|-
 +
| F,G,H,I || RX, RY, RZ, RW || float[4] || Rotation in quaternion
 +
|-
 +
| J,K,L,M || || integer[4] || Flags
 +
|}
 +
 
 +
=== Type 18: LightShaft ===
 +
 
 +
=== Type 19: ScrollBar ===
 +
 
 +
=== Type 21: SwayableAttr ===
 +
 
 +
=== Type 22: BouyancyAttr ===
 +
 
 +
=== Type 23: WalkDontWalkAttr ===
 +
 
 +
 
 +
== Statistics ==
 
Total number of 2DFX entries in:
 
Total number of 2DFX entries in:
:GTA III: 927
+
:GTA III: 927 (max 2000)
 
::Type 0: 859
 
::Type 0: 859
 
::Type 1: 53
 
::Type 1: 53
 
::Type 2: 15
 
::Type 2: 15
  
:Vice City: 1069
+
:Vice City: 1069 (max 1210)
 
::Type 0: 834
 
::Type 0: 834
 
::Type 1: 63
 
::Type 1: 63
Line 247: Line 399:
 
::Type 3: 162
 
::Type 3: 162
 
::Type 4: 10
 
::Type 4: 10
 +
 +
:GTA IV: 17043
 +
::Type 0: 13831
 +
::Type 1: 2385
 +
::Type 2: 23
 +
::Type 12: 60
 +
::Type 14: 103
 +
::Type 15: 246
 +
::Type 17: 117
 +
::Type 18: 204
 +
::Type 19: 34
 +
::Type 21: 11
 +
::Type 22: 10
 +
::Type 23: 19
 +
 +
== References ==
 +
# {{Note|1}} [https://www.youtube.com/watch?v=zcQvqQlIYTM Video demonstration of type 2], by Nick007J
 +
# {{Note|2}} [https://www.youtube.com/watch?v=DjEPUpccqx0 Video demonstration of type 3, behavior 4], by Nick007J
 +
 +
{{N|4|SA|VC|3}}

Latest revision as of 14:18, 4 April 2024

This article describes the usage of the 2dfx section inside a plain text IDE. For the RW Section of models see 2d Effect (RW Section), for the GTA IV IPL section see 2DFX (IPL Section).
2DFX (IDE section)
Supported games:GTA III Vice City GTA IV
Brief description:Used to place 2D effects and ped behaviors on objects
IDE Sections:
2DFX AMAT ANIM CARS HIER HAND MLO OBJS
PATH PEDS TANM TOBJ TREE TXDP WEAP

2DFX is a section in the item definition file in GTA III, Vice City, and GTA IV. It is used to place 2D effects (like lights and particles) and ped behaviors on objects. This section is somewhat unique compared to other sections because it needs to be attached to an existing object rather than defining itself. If too many effects are loaded or drawn in the game, some of the effects will load in and out or won't appear at all.

GTA III and Vice City

2dfx
# type 0: lights (III/VC)
Id, X, Y, Z, R, G, B, unknown, 2DFXType, "Corona", "Shadow", Distance, OuterRange, Size, InnerRange, ShadowIntensity, Flash, Wet, Flare, Flags
# type 1: particles (III/VC)
Id, X, Y, Z, R, G, B, unknown, 2DFXType, Particle, StrengthX, StrengthY, StrengthZ, Scale
# type 2 (III/VC)
Id, X, Y, Z, R, G, B, unknown, 2DFXType, unknown, unk1, unk2, unk3, unknown
# type 3: peds (VC)
Id, X, Y, Z, R, G, B, unknown, 2DFXType, Behavior, unk1, unk2, unk3, RotX, RotY, RotZ
# type 4: sun reflections (VC)
Id, X, Y, Z, R, G, B, unknown, 2DFXType
end

Type 0: Lights

This can create a complex light source on an object. If the object has a sub object, the light will disappear when the main object changes into the sub object (like when lampposts are knocked).

GTA III Vice City Identifier Type Description
A Id integer associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E,F,G R, G, B integer[3] color of the light and everything associated with it in RGB format, also affects the intensity of the light so that darker the color the dimmer the light (meaning black (0,0,0) will yield a light so dim that it's not visible)
H unknown integer usually 0 or 200
I 2DFXType integer always 0 for lights
J Corona string corona texture associated to the light, texture defined in particle.txd, usually "coronastar" for lights
K Shadow string light texture that is cast on the ground, texture defined in particle.txd, usually "shad_exp" for lights
L Distance float view distance of the light, is limited by the draw distance of the host object
M OuterRange float the range the light can cast on objects, cars, and peds
N Size float the size of the corona, can be a float or integer, size 0 means no visible corona but effect of light still visible
O InnerRange float the range the light can cast on the ground (shadow)
P ShadowIntensity integer shadow intensity (0 - 255), usually 40
Q Flash integer sets the type of flashing (see below)
R Wet integer sets the particle to be "reflective" on wet grounds, will only work if the ground around the light is set to wet when raining
0 - not reflective when wet, 1 - reflective when wet
S Flare integer sets the particle to create a lens flare on the screen, similar to what the sun does
0 - no lens flare, 1 - yellow lens flare, 2 - white lens flare
T Flags integer bit 0 - disable z-test for corona, bits 1-2 - fog (dust) type

Types of Flashes

0 constantly lit all time
1 constantly lit at night
2 occasional flicker all time
3 occasional flicker at night
4 1.02 seconds flashes
5 1.02 seconds flashes at night
6 2.04 seconds flashes
7 2.04 seconds flashes at night
8 4.08 seconds flashes
9 4.08 seconds flashes at night
10 random flicker
11 random flicker at night
12 hardcoded traffic lights properties
13 GTA III 1.02 seconds flashes only during lift bridge's alarm
14 GTA III unused, flashes only during lift bridge's alarm

All night flashes occur between 19:00 and 7:00. Type 12 is involved in hardcoded properties of traffic lights. It is mainly used to position the lights on the traffic light. A traffic light without a 2DFX entry will crash the game when the traffic light is loading.

Types of Flags

0 Vice City No DUST, coronas don't appear through models with no collision.
1 Vice City No DUST, coronas appears through models with no collision.
2 Vice City DUST when foggy weather, coronas don't appear through models with no collision.
3 Vice City DUST when foggy weather, coronas appears through models with no collision.
4 Vice City DUST all the time, coronas don't appear through models with no collision.
5 Vice City DUST all the time, coronas appear through models with no collision.
6 Vice City DUST all the time, coronas appear through models with no collision.
7 Vice City DUST all the time, coronas appear through models with no collision.

Type 1: Particles

This can create simple particles on an object

GTA III Vice City Identifier Type Description
A Id integer associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E,F,G R, G, B integer[3] useless values
H unknown integer usually 63 or 200
I 2DFXType integer always 1 for particles
J Particle integer particle type (see below)
K,L,M StrengthX, StrengthY, StrengthZ float[3] X, Y, and Z strength representing the direction and length of movement of the particle, see opcode 039D for more information
N Scale float scale of the particle

Types of Particles

Ordered from 6 to 0 from left to right, all size is 1 with Tommy at the bottom for comparison
GTA III Vice City Name Description
0 POBJECT_PAVEMENT_STEAM small white smoke
1 POBJECT_WALL_STEAM small white smoke
2 POBJECT_DRY_ICE larger white smoke
3 POBJECT_SMALL_FIRE fire (start new game to see)
4 POBJECT_DARK_SMOKE black smoke
- 5 POBJECT_WATER_FOUNTAIN_VERT water fountain (will spray water droplets on the screen)
- 6 POBJECT_WATER_FOUNTAIN_HORIZ water spray (will spray water droplets on the screen)

Type 2

This causes peds to investigate interesting spots.[1] This type was never used in Vice City but it can be used. See here for a map of all the locations in GTA III.

GTA III Vice City Identifier Type Description
A Id integer
B,C,D X, Y, Z float[3]
E,F,G R, G, B integer[3]
H unknown integer usually 63 or 200
I 2DFXType integer always 2
J unknown integer
K,L,M unk1, unk2, unk3 float[3]
N unknown integer

Type 3: Peds

This can make a ped have simple behaviors around the object.

Vice City Identifier Type Description
A Id integer associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E,F,G R, G, B integer[3] useless values
H unknown integer usually 0 or 200
I 2DFXType integer always 3 for peds
J Behavior integer behavior type (see below)
K,L,M Queue direction float[3] direction of some que
N,O,P Use direction float[3] rotation of ped when animation is playing

Types of Behaviors

0 walks to the coordinates to use an ATM then walks away
1 walks to the coordinates to sit down for a while then stand back up and walks away
2 walks to the coordinates to wait for a bus; additional peds will line up behind each other
3 walks to the coordinates, stands for a very short while, then leave (like window shopping)
4 runs to shelter from rain,[2] see here for a map of all the locations

Type 4: Sun Reflections

This can create a sun "reflection" exactly and behaving like the ones seen on cars.

Vice City Identifier Type Description
A Id integer associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E,F,G R, G, B integer[3] useless values
H unknown integer usually 120
I 2DFXType integer always 4 for sun reflections

Used on models lh_icecream01, hospital and lhcoastsky1

GTA San Andreas

Most effects are stored in dff 2d Effect (RW Section) https://gtamods.com/wiki/2d_Effect_(RW_Section). The only exception is effect 5.

GTA IV

This section is incomplete. You can help by fixing and expanding it.

GTA IV 2DFX Category doesn't have all Types description. More description about 2dfx types will be added later.

Type 0: Lights

Type Lights ignore by the game. GTA IV using light in .wdr/wft models

Type 1: Particles

GTA IV Identifier Type Description
A Id string associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E Type integer always 1
F,G,H,I RX, RY, RZ, RW float[4] Rotation in quaternion
J Name string particle name, defined in common\data\effects\
K integer stages of destruction? (between 0 and 4)
L integer ?
M Size float size of particle
N Draw distance integer draw distance
O integer ? (between 0 and 5)
P,Q,R Color integer[3] RGB color when applicable

Type 2: Explosion

GTA IV Identifier Type Description
A Id string associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E Type integer always 2
F,G,H,I RX, RY, RZ, RW float[4] rotation in quaternion
J integer
K integer
L integer
M integer

Type 10: Escalator

GTA SA Using Escalator attribute in .dff models, GTA IV has the Escalator Attribute too, but all parameters are unknown and possible section maybe call the game crash.

Type 12: Proc Object

Type 13: WorldPoint

Type 14: Ladder

GTA IV Identifier Type Description
A Name string Model name, who using Ladder Section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates
E 2DFX Type Integer This is 2DFX Type. Always use the value 14 for Ladder
F,G,H,I RX, RY, RZ, RW float[4] Rotation in quaternion
J,K,L StartX,StartY,StartZ float[3] Start Ladder Position (When player start to climb)
M,N,O EndX,EndY,EndZ float[3] End Ladder Position (When player finished to climb)
P,Q,R ClimbDirectionX, ClimbDirectionY, ClimbDirectionZ float[3] Climb Direction Position
S Flag Integer Unknown Flag, Always(?) using value 1

Type 15: Audio

Type 17: SpawnPoint

GTA IV Identifier Type Description
A Id string associated to existing object ID defined in OBJS or TOBJ section
B,C,D X, Y, Z float[3] X, Y, and Z coordinates relative to the center of the object
E Type integer Always 17
F,G,H,I RX, RY, RZ, RW float[4] Rotation in quaternion
J,K,L,M integer[4] Flags

Type 18: LightShaft

Type 19: ScrollBar

Type 21: SwayableAttr

Type 22: BouyancyAttr

Type 23: WalkDontWalkAttr

Statistics

Total number of 2DFX entries in:

GTA III: 927 (max 2000)
Type 0: 859
Type 1: 53
Type 2: 15
Vice City: 1069 (max 1210)
Type 0: 834
Type 1: 63
Type 2: 0
Type 3: 162
Type 4: 10
GTA IV: 17043
Type 0: 13831
Type 1: 2385
Type 2: 23
Type 12: 60
Type 14: 103
Type 15: 246
Type 17: 117
Type 18: 204
Type 19: 34
Type 21: 11
Type 22: 10
Type 23: 19

References

  1. ^ Video demonstration of type 2, by Nick007J
  2. ^ Video demonstration of type 3, behavior 4, by Nick007J