Difference between revisions of "User:SSX-Breaker"

From GTAMods Wiki
Jump to navigation Jump to search
(Other TC-Modefications from SSX-Breaker)
m (Either you use User: in front of the nickname or (a bit more easy) the U-Template ;-))
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{ToolBox
+
'''WPL''' is the format of the map-related files similar to [[IPL]]s from the previous games. It can be edited with [[WPL Manager]].
| version = 1.1
 
| author  = [[User:xmen|xmen]]
 
| game    = [[GTA 4]]
 
| genre  = library
 
}}
 
  
'''X Archive Poison''' is free .net library for GTA IV devs. It modifies in a very secured way through plenty of code lines those validates each operation prior to do changes. This library also provide manually validation as well as user can disable auto-validation. Current version is support only [[IMG]] operations, next version may have [[RPF]] operations as well.
+
== File Format ==
  
=== Version 1.0 ===
+
Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:
  
* Class : '''Archive_IMG'''
+
4b - UINT32  - Unknown
*# Variables
+
4b - UINT32  - Instances
*#*'''Table''' - ''IMG_Table''
 
*#*:object
 
*#*'''ArchivePath''' - ''string''
 
*#*:contains currently opened archive
 
*# Function(params) - return type, Description
 
*#*'''Add(string[] filePaths, bool doValidate, ProgressBar pb)''' - ''XOutput''
 
*#*:adds file(s) in currently opened archive, if any file is invalid it will not add
 
*#*'''Delete(string[] fileNames, bool doValidate)''' - ''XOutput''
 
*#*:deletes file(s) from currently opened archive, if any file not found it will not delete
 
*#*'''ExtractBytes(uint offset, int size)''' - ''byte[]''
 
*#*:returns byte[] read from currently opened archive, returns null if ArchivePath is empty
 
*#*'''Open(string ArchivePath)''' - ''bool''
 
*#*:returns ''true'' if the archive opened successfully else ''false''
 
*#*'''Rebuild(int RequiredGap, ProgressBar pb)''' - ''XOutput''
 
*#*:rebuilds currently opened archive
 
*#*'''Rename(string[] oldNames, string[] newNames, bool doValidate, ProgressBar pb)''' - ''XOutput''
 
*#*:searches all elements in oldNames array and change with newNames, if any oldName not found, it will not rename
 
*#*'''Replace(string[] filePaths, string[] fileNames, bool doValidate, ProgressBar pb)''' - ''XOutput''
 
*#*:searches all elements in fileNames array and replaces with filePaths, if any fileName not found, it will not replace
 
*#*'''Validate_Add(string[] filePaths)''' - ''XOutput''
 
*#*:manual validation for adding file(s)
 
*#*'''Validate_Delete(string[] fileNames, string backupDir)''' - ''XOutput''
 
*#*:manual validation for deleting file(s), ''backupDir'' param can have a directory path for file(s) backup. Leave empty if no backup required
 
*#*'''Validate_Rename(string[] oldNames, string[] newNames)''' - ''XOutput''
 
*#*:manual validation for renaming file(s)
 
*#*'''Validate_Replace(string[] filePaths, string[] fileNames, string backupDir)''' - ''XOutput''
 
*#*:manual validation for deleting file(s), ''backupDir'' param can have a directory path for file(s) backup. Leave empty if no backup required
 
  
* Class : '''IMG_Table'''
+
The placement information corresponds to the previous [[Item_Placement#inst|instance]] section of the <code>.ipl</code> files. They have a binary structure like the [[Binary_IPL|binary ipl]] files introduced with [[San Andreas]]:
*# Variables
 
*#*'''Items''' - ''List<IMG_TableItem>''
 
*#*:contain all items info
 
*#*'''ItemNames''' - ''List<string>''
 
*#*:contains all items/files names
 
*# Function(params) - return type, Description
 
*#*'''GetIndexByName(string name)''' - ''int''
 
*#*:returns the index of found item through name, returns -1 if no match
 
  
* Class : '''IMG_TableItem'''
+
'''Section 0 - INST'''
*# Variables
 
*#*'''Size''' - ''int''
 
*#*:original file size
 
*#*'''ResourceType''' - ''ResourceType''
 
*#*'''OffsetBlock''' - ''uint''
 
*#*'''UsedBlocks''' - ''short''
 
*#*'''IsResourceFile''' - ''bool''
 
*# Properties
 
*#*'''Padding''' - ''int''
 
*#*:get or set padding
 
  
* Class : '''XOutput'''
+
4b - FLOAT  - Position X
*# Variables
+
4b - FLOAT  - Position Y
*#*'''IsException''' - ''bool''
+
4b - FLOAT  - Position Z
*#*:true if output had exception
+
4b - FLOAT  - Rotation X
*#*'''Message''' - ''string''
+
4b - FLOAT  - Rotation Y
*#*:contains the output message
+
4b - FLOAT  - Rotation Z
*#*'''OtherInfo''' - ''string''
+
4b - FLOAT  - Rotation W
*#*:contains the OtherInfo of output
+
4b - UINT32  - Model name [[:Category:Static_Model_Hashes|hash]]
 +
4b - UINT32  - Unknown
 +
4b - UINT32  - [[LOD]] Index (Index of another model in the current file)
 +
4b - UINT32  - Unknown
 +
4b - UINT32  - Unknown
  
* Class : '''Decryptor'''
+
''Rotation information as [[Wikipedia:Quarternion|Quarternion]]''
*# Properties
 
*#*'''GTA4Path''' - ''string''
 
*#*:get or set GTA IV Application path directly, starts recursion until user provide a valid App path or cancel
 
*# Function(params) - return type, Description
 
*#*'''GetGTAIVApp()''' - ''void''
 
*#*:get the GTA IV Application path from user, starts recursion until user provide a valid App path or cancel
 
  
=== Version 1.1 ===
+
'''Section 3 - Parked Cars'''
* Class : '''Archive_IMG'''
 
*# Function(params) - return type, Description
 
*#*'''ExtractFiles(int[] FileIndexes, string destDirectory)''' - ''XOutput''
 
*#*:extract file(s) by passing their indexes
 
*#*'''ExtractFiles(string[] FileNames, string destDirectory)''' - ''XOutput''
 
*#*:extract file(s) by passing their names
 
  
[http://www.x-squares.com/FilesVault.aspx?GroupID=2f5f81ed-f0ef-438a-a9ef-853fa18e5e3d Download]
+
4b - FLOAT  - Position X
 +
4b - FLOAT  - Position Y
 +
4b - FLOAT  - Position Z
 +
4b - FLOAT  - Unknown
 +
4b - FLOAT  - Unknown
 +
4b - FLOAT  - Unknown
 +
4b - UINT32  - Model name [[:Category:Static_Model_Hashes|hash]]
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
 +
4b - INT32  - Unknown
  
Please write author name in credits if you are using it ;)
+
'''Section 10 - Unknown Zon or Cull'''
 +
 
 +
4b - FLOAT    - Position X1
 +
4b - FLOAT    - Position Y1
 +
4b - FLOAT    - Position Z1
 +
4b - FLOAT    - Position X2
 +
4b - FLOAT    - Position Y2
 +
4b - FLOAT    - Position Z2
 +
 
 +
'''''X1, Y1, Z1''' = lower left vertex position'' and
 +
'''''X2, Y2, Z2''' = upper right vertex position''
 +
 
 +
 
 +
 
 +
<!---
 +
;Header
 +
<source lang="cpp">
 +
struct Header_t
 +
{
 +
    BYTE byteUnknown01[4];
 +
    DWORD dwNbrOfBlockInst;
 +
};
 +
</source>
 +
 
 +
;InstBlock (Start from 0x44)
 +
<source lang="cpp">
 +
struct Inst_t
 +
{
 +
    float  fPosition[3];
 +
    float  fRotation[4];
 +
    DWORD dwModelNameHash;
 +
    BYTE byteUnknown01[4];
 +
    DWORD dwAttachedLod;
 +
    BYTE byteUnknown02[8];
 +
};
 +
</source>
 +
-->
 +
 
 +
== XPL ==
 +
In the XBox 360's version of GTA 4 same files have the extension <code>.xpl</code>. The XPL and WPL formats  are same, but due to the fact XPL files are used on the Xenon platform its data is stored in the [[Wikipedia:Endianness|big-endian order]].
 +
<!--not sure where to put this: "They are used to map generic objects which are defined with another path in the [[Images.txt|image listing]] file."-->
 +
 
 +
== Tools ==
 +
* [[WPL Manager]] &ndash; by {{U|UZI-I|Yoann (UZI-I)}}
 +
 
 +
== External Link ==
 +
* {{GTAF|389423|WPL file format specification}}
  
=== Tools Using This ===
 
* [[X Mod Installer]]
 
 
{{GTA4-navi}}
 
{{GTA4-navi}}
 +
{{File-stub}}
 +
[[Category:Map Formats]][[Category:GTA 4]]

Latest revision as of 10:15, 25 May 2009

WPL is the format of the map-related files similar to IPLs from the previous games. It can be edited with WPL Manager.

File Format

Each world placement file starts with one single header followed by the object placement information. The structure for the header is very simple:

4b - UINT32   - Unknown
4b - UINT32   - Instances

The placement information corresponds to the previous instance section of the .ipl files. They have a binary structure like the binary ipl files introduced with San Andreas:

Section 0 - INST

4b - FLOAT   - Position X
4b - FLOAT   - Position Y
4b - FLOAT   - Position Z
4b - FLOAT   - Rotation X
4b - FLOAT   - Rotation Y
4b - FLOAT   - Rotation Z
4b - FLOAT   - Rotation W
4b - UINT32  - Model name hash
4b - UINT32  - Unknown
4b - UINT32  - LOD Index (Index of another model in the current file)
4b - UINT32  - Unknown
4b - UINT32  - Unknown

Rotation information as Quarternion

Section 3 - Parked Cars

4b - FLOAT   - Position X
4b - FLOAT   - Position Y
4b - FLOAT   - Position Z
4b - FLOAT   - Unknown
4b - FLOAT   - Unknown
4b - FLOAT   - Unknown
4b - UINT32  - Model name hash
4b - INT32   - Unknown
4b - INT32   - Unknown
4b - INT32   - Unknown
4b - INT32   - Unknown
4b - INT32   - Unknown
4b - INT32   - Unknown
4b - INT32   - Unknown

Section 10 - Unknown Zon or Cull

4b - FLOAT     - Position X1
4b - FLOAT     - Position Y1
4b - FLOAT     - Position Z1
4b - FLOAT     - Position X2
4b - FLOAT     - Position Y2
4b - FLOAT     - Position Z2

X1, Y1, Z1 = lower left vertex position and X2, Y2, Z2 = upper right vertex position



XPL

In the XBox 360's version of GTA 4 same files have the extension .xpl. The XPL and WPL formats are same, but due to the fact XPL files are used on the Xenon platform its data is stored in the big-endian order.

Tools

External Link