Difference between revisions of "2d Effect (RW Section)"
m (→Entry Type 3 - PEDs) |
m |
||
Line 5: | Line 5: | ||
{{RW Section|2dfx|0x0253F2F8}} | {{RW Section|2dfx|0x0253F2F8}} | ||
− | '''2dfx''' is one of Rockstar's [[List of RW section IDs#Rockstar.27s_Custom_Sections|custom sections]]. In [[GTA San Andreas]] it is used to store | + | '''2dfx''' is one of Rockstar's [[List of RW section IDs#Rockstar.27s_Custom_Sections|custom sections]]. In [[GTA San Andreas]] it is used to store 2d effects, which were located in [[ide|ide files]] in previous versions. The typical location in a SA [[model file|dff]] section hierarchy is ''[[Clump (RW Section)|Clump]] > [[Geometry List (RW Section)|Geometry List]] > [[Geometry (RW Section)|Geometry]] > [[Extension (RW Section)|Extension]] > 2dfx. |
There can be multiple effects per section, their types are defined by an ID. | There can be multiple effects per section, their types are defined by an ID. | ||
Line 75: | Line 75: | ||
8 CHECK_DIRECTION | 8 CHECK_DIRECTION | ||
16 BLINKING3 | 16 BLINKING3 | ||
+ | Special corona type (coronaShowMode) | ||
+ | 0 DEFAULT | ||
+ | 1 RANDOM_FLASHING | ||
+ | 2 RANDOM_FLASHIN_ALWAYS_AT_WET_WEATHER | ||
+ | 3 LIGHTS_ANIM_SPEED_4X // Used on model 10 green bottles. Lights alternately switched on-off. | ||
+ | 4 LIGHTS_ANIM_SPEED_2X // Used on skyscrapers in San Fierro | ||
+ | 5 LIGHTS_ANIM_SPEED_1X | ||
+ | 6 | ||
+ | 7 TRAFFICLIGHT | ||
+ | 8 TRAINCROSSLIGHT | ||
+ | 9 // Doesn't work (light is always disabled) | ||
+ | 10 AT_RAIN_ONLY // Enables only in rainy weather | ||
+ | 11 // 5s - on, 5s - off | ||
+ | 12 // 6s - on, 4s - off | ||
+ | 13 // 6s - on, 4s - off | ||
===Entry Type 1 - Particle Effects=== | ===Entry Type 1 - Particle Effects=== | ||
Line 155: | Line 170: | ||
The position of the index is the position of the wheel in the Slotmachine. Maybe it can be controlled using SCM. | The position of the index is the position of the wheel in the Slotmachine. Maybe it can be controlled using SCM. | ||
− | ===Entry Type 9=== | + | ===Entry Type 9 - Cover points=== |
− | Size is 12 bytes, used quite often and in large ammounts per file. | + | Size is 12 bytes, used quite often and in large ammounts per file. |
+ | |||
+ | 4b - FLOAT - x direction | ||
+ | 4b - FLOAT - y direction | ||
+ | 4b - DWORD - cover type | ||
+ | |||
+ | This section defines where peds can cover during firefights. | ||
{{Research}} | {{Research}} |
Revision as of 12:08, 20 August 2014
This article may need to be rewritten. Please help improve this article. The discussion page may contain suggestions. |
{{{NAME}}} | |
---|---|
RenderWare Stream Section | |
Vendor | {{{VENDORNAME}}} |
Module | {{{MODULENAME}}} |
Module ID | 0x{{{MODULEID}}}
|
Identifier | 0x{{{IDENTIFIER}}}
|
Chunk ID | 0x{{{MODULEID}}}{{{IDENTIFIER}}}
|
Versions | All |
Hierarchy | |
Parents: None | |
Children: None | |
Extensions: None | |
File Format |
2dfx is one of Rockstar's custom sections. In GTA San Andreas it is used to store 2d effects, which were located in ide files in previous versions. The typical location in a SA dff section hierarchy is Clump > Geometry List > Geometry > Extension > 2dfx.
There can be multiple effects per section, their types are defined by an ID.
Header
A 2dfx section starts with a 4 byte DWORD which is the number of 2dfx entries that follow.
Entries
There is a common 20 byte header for each 2dfx entry:
12 byte - FLOAT[3] - Position Vector (xyz) 4 byte - DWORD - Entry Type 4 byte - DWORD - Data Size
Entry Type defines the type of the 2dfx entry, and Data Size the number of bytes that follow the first 20, until the next entry starts.
Entry Type 0 - Light
This type defines lights and has a size of 76 or 80 bytes.
- With size of 76 bytes
0x00 | RwRGBA color 0x04 | float coronaFarClip 0x08 | float pointlightRange 0x0C | float coronaSize 0x10 | float shadowSize 0x14 | BYTE coronaShowMode 0x15 | BYTE coronaEnableReflection 0x16 | BYTE coronaFlareType 0x17 | BYTE shadowColorMultiplier 0x18 | BYTE flags1 0x19 | char coronaTexName[24] 0x31 | char shadowTexName[24] 0x49 | BYTE shadowZDistance 0x4A | BYTE flags2 0x4B | BYTE padding
- With size of 80 bytes
0x00 | RwRGBA color 0x04 | float coronaFarClip 0x08 | float pointlightRange 0x0C | float coronaSize 0x10 | float shadowSize 0x14 | BYTE coronaShowMode 0x15 | BYTE coronaEnableReflection 0x16 | BYTE coronaFlareType 0x17 | BYTE shadowColorMultiplier 0x18 | BYTE flags1 0x19 | char coronaTexName[24] 0x31 | char shadowTexName[24] 0x49 | BYTE shadowZDistance 0x4A | BYTE flags2 0x4B | BYTE lookDirection_x 0x4C | BYTE lookDirection_y 0x4D | BYTE lookDirection_z 0x4E | BYTE padding[2]
Flags 1 (flags1)
1 CORONA_CHECK_OBSTACLES 2 FOG_TYPE 4 FOG_TYPE 8 WITHOUT_CORONA 16 CORONA_ONLY_AT_LONG_DISTANCE 32 AT_DAY 64 AT_NIGHT 128 BLINKING1
Flags 2 (flags2)
1 CORONA_ONLY_FROM_BELOW 2 BLINKING2 4 UDPDATE_HEIGHT_ABOVE_GROUND 8 CHECK_DIRECTION 16 BLINKING3
Special corona type (coronaShowMode)
0 DEFAULT 1 RANDOM_FLASHING 2 RANDOM_FLASHIN_ALWAYS_AT_WET_WEATHER 3 LIGHTS_ANIM_SPEED_4X // Used on model 10 green bottles. Lights alternately switched on-off. 4 LIGHTS_ANIM_SPEED_2X // Used on skyscrapers in San Fierro 5 LIGHTS_ANIM_SPEED_1X 6 7 TRAFFICLIGHT 8 TRAINCROSSLIGHT 9 // Doesn't work (light is always disabled)
10 AT_RAIN_ONLY // Enables only in rainy weather 11 // 5s - on, 5s - off 12 // 6s - on, 4s - off 13 // 6s - on, 4s - off
Entry Type 1 - Particle Effects
This type defines particle effects and has a size of 24 bytes.
24b - CHAR[24] - particle effect name
The particle effect name is an entry in effects.fxp.
Entry Type 3 - PEDs
The PED-Section consists in 56 bytes. It`s used for spawning PEDs (Like on ticketbooth, Windows of shops, Blackjack-tables,...) It includes information about the External Script ped is going to use when spawned, it`s facing angle and it`s behaviour.
4b - INT32 - Type (1 - Sitting, 5 - Standing...) 36b - VECTOR3[3] - Rotation 8b - CHAR[8] - External script name 4b - INT32 - PED-Existing-Probability 1b - BYTE - Unknown 1b - BYTE - Not used 1b - BYTE - Unknown 1b - BYTE - Not used
External script name field has to contain a name defined by 0884 opcode like PEDSLOT or TICKET. If the PED just stands/sits/lays, this field is set to 'none'. ePedAttractorType
0 PED_ATM_ATTRACTOR, 1 PED_SEAT_ATTRACTOR, 2 PED_STOP_ATTRACTOR, 3 PED_PIZZA_ATTRACTOR, 4 PED_SHELTER_ATTRACTOR, 5 PED_SCRIPTED_ATTRACTOR, 6 PED_STAND_N_GO_ATTRACTOR, 8 PED_LIE_ATTRACTOR, 9 PED_SEAT_HOUSE_ATTRACTOR,
This section is incomplete. You can help by fixing and expanding it.
Entry Type 6 - EnEx markers
Type may call game crash!
4b - FLOAT - Rotation angle enter-marker (relative to the object) (Always 0?) 4b - FLOAT - The radius of the approximation to the marker X 4b - FLOAT - The radius of the approximation to the marker Y 12b - FLOAT[3]- The position of exit-marker (offset relative to the object) (Always 0?) 4b - FLOAT - angle of rotation exit-marker (relative to the object) (always 0?) 4b - INT32 - Number of interior 4b - INT32 - Flags? 8b - CHAR[8] - The name of the interior 4b - INT32 - color of the sky
Entry Type 7 - Street Signs
This type defines the texts that appear on street signs and has a size of 88 bytes.
0x00 | RwV2d size 0x08 | RwV3d rotation 0x14 | WORD flags 0x16 | RwChar text[4][16]
Flags (flags)
Bits 0-1 - Number of used lines
0 - 4 lines 1 - 1 lines 2 - 2 lines 3 - 3 lines
Bits 2-3 - Max number of symbols in one line
0 - 16 symbols 1 - 2 symbols 2 - 4 symbols 3 - 8 symbols
Bits 4-5 - Text color
0 - 0xFFFFFFFF (white) 1 - 0xFF000000 (black) 2 - 0xFF808080 (grey) 3 - 0xFF0000FF (red)
The lines can start with arrows, such as <
, ^
and >
; also _
is used instead of a whitespace.
Entry Type 8 - Slotmachine-wheels
This is for Slotmachines.
4b - Int32 - Wheelindex
Every wheel in the slotmachine has an index, increments by 1 and starrting with 1. The position of the index is the position of the wheel in the Slotmachine. Maybe it can be controlled using SCM.
Entry Type 9 - Cover points
Size is 12 bytes, used quite often and in large ammounts per file.
4b - FLOAT - x direction 4b - FLOAT - y direction 4b - DWORD - cover type
This section defines where peds can cover during firefights.
Entry Type 10 - Escalators
This type defines escalators and has a size of 40 bytes.
12b - FLOAT[3] - bottom of escalator (xyz) 12b - FLOAT[3] - top of escalator (xyz) 12b - FLOAT[3] - escalator end (Z pos, matches top Z if escalator goes up, bottom Z if it goes down) 4b - DWORD - direction 0/1 (down/up)
The normal position info of the header gets the same function of th estart-position in opposite to the end-position. Positions seem to be roundet to *.5 or *.0 by the game, so it doesnt make many sense to create escalators with the value of *.3 or *.7. This got the effect that a Escalator looks like in the picture (Example: vgseesc01.dff). Legend to the picture:
- Escalator_Standart_Position - Positioninfo from the header
- Escalator_Bottom - Bottominfo from the section
- Escalator_Top - Topinfo from the section
- Escalator_End - Endinfo from the section
External Link
- ^ GTAForums: Encryption of light information
Tools and Scripts
- GTAForums: DexX Tools by DexX – 2dfx export from 3DSMax (MaxScript)
- GTAForums: 2dfx Editor by Aschratt – 2dfx Editing
- RW Analyze by steve-m (no 2dfx support yet, but needed by above script)