Difference between revisions of "Item Definition"

From Grand Theft Wiki
Jump to navigation Jump to search
m
(contributions from myself, Aschratt, DK22Pac, MarioSonic2987, Solom, and The Hero)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{cleanup}}
{{IdeSection
{{IdeSection
| noheader = 1
|noheader = 1
}}
}}
'''Item definition''' files, known by the extension '''.ide''', are usually used to assign a model and texture file to a unique object ID, along with many parameters depending on the section. These files are in human readable text format, and allow the # character to comment lines out. IDE files can easily be opened and edited using any text-editing program like [[Wikipedia:Notepad|Notepad]].


==Structure==
'''Item definition''' files, usually identified by the file extension <code>.ide</code>, are used to declare many different aspects for the map system or to specify special behavior rules for one of the aspects. They are stored in plain text format, so that they can be opened by any text editing program (like [[wp:Notepad|Notepad]]), but there are also some tools to simplify editing.
The .ide files are split up into many sections. How many of them you use in your file is optional, they can even be empty. Each section starts with a section identifier and ends with the keyword "end", both in a single line.


Example:
== Overview ==
objs
The ''item definition'' files are split up into several sections. There is no order on how you arrange the sections and sections do not need to appear in the file.
...
end


===OBJS===
=== Format and syntax description ===
Used to define standard static map objects.


''GTA III, VC and SA format''
Line comments are indicated by the character <code>#</code> (number sign) and empty lines are allowed. They can be placed anywhere in the file. The game reads up to a maximum of 256 characters for each line and ignores the rest if the line is longer. Each section starts with a section identifier (usually four characters long, e.g. <code>objs</code>, <code>tobj</code>, etc.) indicating how the content of the section gets interpreted by the game. The identifier is followed by the definition entries. Each entry takes one line and every line follows a specific format which are described in the articles handling the sections in detail (see below). The end of any section is indicated by the terminating string <code>end</code>. Both the section identifier and terminating string are case sensitive. Lines within sections are always formatted in the same way differing only in the number of parameters describing the semantical content of the line. Data are usually separated by the character <code>,</code> (comma) but can be separated by <code> </code>&nbsp;(space). Tabs and spaces anywhere in the beginning of the line, between data, or after the data are omitted by the game and can be used to improve readability for human eyes. The games' parser uses an invariant culture to parse numerical values and strings, which means strings are [[Wikipedia:ASCII|ASCII]] encrypted and the decimal separator is <code>.</code> (period).
ID, ModelName, TextureName, ObjectCount, DrawDist, [DrawDist2, ...], Flags


{| width="100%" class="prettytable collapsible collapsed"
==== Example ====
!width="250px"|Identifier
{{Pre|
!Description
# line comment
|-
objs
|<center>ID</center>||unique object ID (integer)
# default style in objs section
|-
200, ind_land101, pjs, 1, 127, 0
|<center>ModelName</center>||name of the .dff [[model file]], without extension (string)
# valid style
|-
    200 ind_land101 pjs 1 127 0
|<center>TextureName</center>||name of the .txd [[texture dictionary]], without extension (string)
end
|-
}}
|<center>ObjectCount</center>||amount of sub objects, e.g. damaged parts, usually 1 (integer) - '''''optional for SA, default 1'''''
|-
|<center>DrawDist</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|-
|<center>Flags</center>||[[OBJS#Object Flags|object flags]], defining special behavior, default 0 (integer)
|}
 
''GTA IV format''


ModelName, TextureName, DrawDistance, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X, Y, Z, Radius, WDD
== Format ==
The following table contains all known sections in the item definition. The supported games column lists games that support the sections but it doesn't necessarily means they're functional in the games.


Note that GTA IV does not use any unique object ID numbers
{|class="mw-collapsible wikitable center-col-1 center-col-2" style="width: 100%;"
 
!style="width: 7em;"|Section
{| width="100%" class="prettytable collapsible collapsed"
!style="width: 8em;"|Supported games
!width="250px"|Identifier
!Description
!Description
|-
|-
|<center>ModelName</center>||name of the .wdr [[model file]], without extension (string)
|<code>[[OBJS|objs]]</code>||{{Icon|t}} {{Icon|4}}||Defines simple objects. They can be placed into the world through the <code>[[INST|inst]]</code> section of the [[Item Placement|item placement]] files.
|-
|<center>TextureName</center>||name of the .wtd [[texture dictionary]], without extension (string)
|-
|<center>DrawDistance</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|-
|<center>Flag1</center>||object flag, defining special behavior
|-
|<center>Flag2</center>||object flag, defining special behavior, default 0 (integer)
|-
|<center>Bounds Min</center>||Lower Left vertex local position of a model bounding box
|-
|<center>Bounds Max</center>||Upper Right vertex local position of a model bounding box
|-
|<center>Radius</center>||Radius dimensions of the bounding Sphere
|-
|-
|<center>WDD</center>||the model dictionary file that contains the LOD model for the defined Modelname
|<code>[[TOBJ|tobj]]</code>||{{Icon|t}} {{Icon|4}}||Defines time objects. The section functions similarly to <code>objs</code> but has two additional parameters defining the in-game time range the object can get rendered. These objects can be placed into the world through the <code>inst</code> section of the item placement files.
|}
 
===TOBJ===
Used to define timed map objects. All but the last two columns are the same as the OBJS section.
 
''GTA III, VC and SA format:''
ID, ModelName, TextureName, ObjectCount, DrawDist, [DrawDist2, ...], Flags, TimeOn, TimeOff
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|-
|<center>ID</center>||unique object ID (integer)
|<code>[[HIER|hier]]</code>||{{Icon|t}} {{Icon|4}}||Defines clump objects for use in cutscenes.
|-
|-
|<center>ModelName</center>||name of the .dff [[model file]], without extension (string)
|<code>[[CARS (IDE Section)|cars]]</code>||{{Icon|t}} {{Icon|4}}||Defines vehicle objects.
|-
|-
|<center>TextureName</center>||name of the .txd [[texture dictionary]], without extension (string)
|<code>[[PEDS|peds]]</code>||{{Icon|t}} {{Icon|4}}||Defines pedestrian objects (random NPC's).
|-
|-
|<center>ObjectCount</center>||amount of sub objects, e.g. damaged parts, usually 1 (integer) - '''''optional for SA, default 1'''''
|<code>[[PATH (IDE Section)|path]]</code>||{{Icon|3}} {{Icon|SA}}||Adds path nodes to defined objects. This section is unstable in Vice City.
|-
|-
|<center>DrawDist</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|<code>[[2DFX|2dfx]]</code>||{{Icon|3}} {{Icon|VC}} {{Icon|SA}} {{Icon|4}}||Adds particle effects and simple ped behaviors to defined objects.
|-
|-
|<center>Flags</center>||object flags, defining special behavior, default 0 (integer)
|<code>[[WEAP|weap]]</code>||{{Icon|VC}} {{Icon|SA}} {{Icon|4}}||Defines weapon objects.
|-
|-
|<center>TimeOn</center>||activation time in game hours (integer)
|<code>[[ANIM|anim]]</code>||{{Icon|SA}} {{Icon|4}}||Defines animated objects. The section functions similarly to <code>objs</code> but has one additional parameter indicating an IFP or WAD animation file to assign an animation to the object. These objects can be placed into the world through the <code>inst</code> section of the item placement files.
|-
|<center>TimeOff</center>||deactivation time in game hours (integer)
|}
 
''GTA IV format''
 
ModelName, TextureName, DrawDist, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X,Y,Z, Radius, WDD, NightFlag
 
Note that GTA IV does not use any unique object ID numbers.
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|-
|<center>ModelName</center>||name of the .wdr [[model file]], without extension (string)
|<code>[[TXDP|txdp]]</code>||{{Icon|SA}} {{Icon|4}}||Used to virtually extend [[Texture Archive|texture dictionaries]].
|-
|-
|<center>TextureName</center>||name of the .wtd [[texture dictionary]], without extension (string)
|<code>[[TANM|tanm]]</code>||{{Icon|4}}||Used to combine <code>tobj</code> and <code>anim</code> sections.<br>Those objects get placed inside the <code>inst</code> section of the WPL.
|-
|-
|<center>DrawDistance</center>||[[draw distance]] in [[unit]]s, one for each sub object (float)
|<code>[[TREE|tree]]</code>||||This section is read in GTA IV but is not functional.
|-
|-
|<center>Flag1</center>||object flag, defining special behavior
|<code>[[VNOD|vnod]]</code>||{{Icon|4}}||–
|-
|-
|<center>Flag2</center>||object flag, defining special behavior, default 0 (integer)
|<code>[[LINK|link]]</code>||{{Icon|4}}||–
|-
|-
|<center>Bounds Min</center>||Lower Left vertex local position of a model bounding box
|<code>[[MLO|mlo]]</code>||{{Icon|4}}||Used to create [[interior]]s. This section does also contain information about portals (previous <code>[[ENEX|enex]]</code> connections) and dimensions of the interior which influences certain aspects, like the weather, for example. All objects are placed relative to an offset placed using <code>mlo+</code> inside the IPL or WPL file.
|-
|-
|<center>Bounds Max</center>||Upper Right vertex local position of a model bounding box
|<code>[[AMAT|amat]]</code>||{{Icon|4}}||This is Audio Materials. Possible Used to make a sound effect at the model. Usually used for dynamic objects.
|-
|-
|<center>Radius</center>||Radius dimensions of the bounding Sphere
|<code>[[LODM|lodm]]</code>||||This is read in GTA IV but section is not functional.
|-
|-
|<center>WDD</center>||the model dictionary file that contains the LOD model for the defined Modelname
|<code>[[AGRPS|agrps]]</code>||{{Icon|4}}||–
|-
|-
|<center>NightFlag</center>||assumed to be hardcoded time flags
|<code>[[HAND|hand]]</code>||VC Xbox/Mobile||–
|}
|}


===ANIM===
== IDE Flags ==
'''Animated Map Objects''', used to define objects whose sub objects are animated. Note: There must be animation frames for each sub object, also the collision model remains static - no solid animations.
Flags are used in order to specify the behaviour of objects. They are interpreted as signed 32-bit integer values where each bit describes a [[wp:Boolean_algebra_(logic)|boolean]] value of a different aspect.


''GTA SA only:''
=== GTA III ===
ID, ModelName, TextureName, AnimName, DrawDist, Flags
{| class="wikitable"
;ID, ModelName, TextureName, DrawDist, Flags: same as for the OBJS section
! Bits !! Dec !! Hex !! Name !! Description !! Examples
;AnimName: name of the [[IFP|animation archive]], without extension (string)
 
''GTA IV format''
 
ModelName, TextureName, Wad, DrawDist, Flag1, Flag2, (Bounds min)X,Y,Z, (Bounds max)X,Y,Z, (Bounds Sphere)X,Y,Z, Radius, WDD
 
;ModelName, TextureName, DrawDistance, Flags, Bounds min, Bounds max, Bounds Sphere X,Y,Z, Radius, WDD: same as for the OBJS section
 
;Wad: name of the (.wad) animation archive, without extension (string)
 
===PEDS===
Used to define characters and pedestrians
 
''GTA III format:''
ID, ModelName, TxdName, Threat, Behavior, AnimationType, VehClass
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|-
|<center>ID</center>||Unique model ID
| 0 || 1 || 0x1 || - || Cull model if player doesn't look at it? Read, but ignored. || Fences
|-
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
| 1 || 2<ref name="III">[http://www.gtaforums.com/index.php?showtopic=102833&view=findpost&p=1067607073 Screenshots of flags in GTA III], by {{U|spaceeinstein}}</ref> || 0x2 || DO_NOT_FADE || Do not fade the object when it is being loaded into or out of view. || Some lampposts
|-
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
| 2 || 4<ref name="III" /> || 0x4 || DRAW_LAST || Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. || Trees
|-
|-
|<center>Threat</center>||The threat of the ped as defined in the ped.dat file
| 3 || 8 || 0x8 || ADDITIVE || Render with additive blending. Previous flag must be enabled too. ||
|-
|-
|<center>Behavior</center>||The behavior of the ped as defined in the pedstats.dat file
| 4 || 16<ref name="III" /> || 0x10 || IS_SUBWAY || Model is a tunnel, i.e. set the object as invisible unless the player enters [[Cullzone.dat|cull zone flag 128]]. This flag works only with static models. || Tunnels, some dynamic objects
|-
|-
|<center>AnimationType</center>||The type of animation being used on the ped for movements
| 5 || 32 || 0x20 || IGNORE_LIGHTING || Don't use static lighting, we want dynamic if it's possible. || Some lampposts and trafficlights
|-
|-
|<center>VehClass</center>||The class of vehicle that the ped will drive<br>The value is in hex! It needs to be converted into decimal and back
| 6 || 64<ref name="III" /> || 0x40 || NO_ZBUFFER_WRITE || Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Not implemented in the PS2 version. || Shadow
|}
|}


''Vice City format''
=== GTA Vice City ===
ID, ModelName, TxdName, Threat, Behavior, AnimationType, VehClass, StartAnimation?, Radio1, Radio2


{| width="100%" class="prettytable collapsible collapsed"
{| class="wikitable"
!width="250px"|Identifier
! Bits !! Dec !! Hex !! Name !! Description !! Examples
!Description
|-
|<center>ID</center>||Unique model ID
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
|-
|<center>Threat</center>||The threat of the ped as defined in the ped.dat file
|-
|<center>Behavior</center>||The behavior of the ped as defined in the pedstats.dat file
|-
|<center>AnimationType</center>||The type of animation being used on the ped for movements
|-
|-
|<center>VehClass</center>||The class of vehicle that the ped will drive<br>The value is in hex! It needs to be converted into decimal and back
| 0 || 1 || 0x1 || IS_ROAD || Identifies objects to draw "wet reflections" on them. || Roads
|-
|-
|<center>Radio1, Radio2</center>||Ped's preferred radio station
| 1 || 2 || 0x2 || DO_NOT_FADE || Do not fade the object when it is being loaded into or out of view. || Some night objects, North Point Mall
|}
 
===WEAP===
''GTA III and VC format:''
ID, ModelName, TextureName, Animation, ?, DrawDistance, ?
;Animation: From ped.ifp, animation used to wield and shoot the weapon
 
===CARS===
Used to define vehicles
 
''GTA III formats''
 
''Car''
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, WheelID, WheelScale
 
''Boat and Train''
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules
 
''Plane''
ID, ModelName, TxdName, Type, HandlingID, GameName, Class, Frequency, Level, Comprules, LODModel
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|-
|<center>ID</center>||Unique model ID
| 2 || 4 || 0x4 || DRAW_LAST || Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. || Fencse, trees
|-
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
| 3 || 8 || 0x8 || ADDITIVE || Render with additive blending. Previous flag will be enabled automatically. || Night windows
|-
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
| 4 || 16 || 0x10 || - || Read, but not used. || _dy, _dt objects
|-
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''boat'', ''train'', and ''plane''<br>This data is related to hardcoded functions and must not be changed or else it might crash the game
| 5 || 32 || 0x20 || IGNORE_LIGHTING || Don't use static lighting, we want dynamic if it's possible. || Interior objects
|-
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the [[handling.cfg]] file
| 6 || 64 || 0x40 || NO_ZBUFFER_WRITE || Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. || Tree shadows
|-
|-
|<center>GameName</center>||Name corresponding to its [[GXT]] entry, case sensitive and must be seven characters or less!<br>Invalid name will show up as ''NAME missing''
| 7 || 128 || 0x80 || DONT_RECEIVE_SHADOWS || Do not draw dynamic shadows on this object. || Small objects, pickups, lamps, trees
|-
|-
|<center>Class</center>||Class of the vehicle
| 8 || 256 || 0x100 || IGNORE_DRAW_DISTANCE || Ignore draw distance for this object (sets its "level" (island id) to 0). || LOD models, North Bridge
|-
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets
| 9 || 512 || 0x200 || IS_GLASS_TYPE_1 || Breakable glass type 1: glass object changes its textures when breaking. || Small windows
|-
|-
|<center>Level</center>||unknown
| 10 || 1024 || 0x400 || IS_GLASS_TYPE_2 || Breakable glass type 2: glass object doesn't change its textures when breaking. || Large windows
|-
|<center>Comprules</center>||unknown
|-
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''
|-
|<center>WheelScale</center>||Scale of wheel and [[Collision File|collision]] models, 1.0 for original size of wheel and collision models<br>Only available for type ''car'', has no effect if used on type ''boat''
|-
|<center>LODModel</center>||ID number of LOD model, can be any valid vehicle model<br>Only available for type ''plane''
|}
|}


''Vice City formats''
==== Reference table ====


''Car''
{| class="wikitable"
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, WheelID, WheelScale
! Bits !! Dec !! Hex !! Name !! Model info flag !! Ref address !! Ref description
 
''Bike''
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, Unknown, WheelScale
 
''Boat and Heli''
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules
 
''Plane''
ID, ModelName, TxdName, Type, HandlingID, GameName, Anims, Class, Frequency, Level, Comprules, LODModel
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|-
|<center>ID</center>||Unique model ID
| 0 || 1 || 0x01 || IS_ROAD || 0x04 || 0x4CA1D7 || '''<code>CRenderer::RenderRoads()</code>'''
{{Pre|1=
if (CModelInfo::GetModelInfo(entity->m_nModelIndex)->m_nFlags & IS_ROAD)
    entity->Render();
}}
|-
|-
|<center>ModelName</center>||Name of the .dff [[model file]], without extension
| 1 || 2 || 0x02 || DO_NOT_FADE || 0x20 || 0x4C7E03 || '''<code>CRenderer::ShouldModelBeStreamed(CEntity *,CVector const&)</code>'''
{{Pre|1=
if (model->m_nFlags & DO_NOT_FADE) {
    if (distance >= model->GetLargestLodDistance() + 30.0f)
        return true;
}
else if ( distance >= model->GetLargestLodDistance() + 50.0f)
    return true;
}}
|-
|-
|<center>TxdName</center>||Name of the .txd [[texture dictionary]], without extension
| 2 || 4 || 0x04 || DRAW_LAST || 0x40 || 0x56F4F3 || '''<code>CSimpleModelInfo::SetupBigBuilding(int,int)</code>'''
{{Pre|1=
if (model->m_nFlags & DRAW_LAST) {
    model->m_nFlags &= ~DRAW_LAST;
    dbgprint("%s was draw last\n", model->m_szName);
}
}}
|-
|-
|<center>Type</center>||Type of vehicle, which includes ''car'', ''bike'', ''boat'', ''plane'', and ''heli''; flyable helicopters are type ''car''
| 3 || 8 || 0x08 || ADDITIVE || 0x80 || 0x582590 || '''<code>CVisibilityPlugins::RenderFadingAtomic(RpAtomic *,float)</code>'''
{{Pre|1=
if (model->m_nFlags & ADDITIVE)
    RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDONE);
}}
|-
|-
|<center>HandlingID</center>||Name corresponding to its handling data in the [[handling.cfg]] file.
| 4 || 16 || 0x10 || -  || 0x100 || - || -
|-
|-
|<center>GameName</center>||Name corresponding to its [[GXT]] entry, case sensitive and must be seven characters or less!<br>Invalid name will not show up in the game
| 5 || 32 || 0x20 || IGNORE_LIGHTING || 0x200 || 0x56F7C4 || '''<code>CSimpleModelInfo::SetAtomic(int,RpAtomic *)</code>'''
{{Pre|1=
if (model->m_nFlags & IGNORE_LIGHTING)
    atomic->geometry->flags &= ~rpGEOMETRYLIGHT;
}}
|-
|-
|<center>Anims</center>||Appropriate animation file mainly used on bikes
| 6 || 64 || 0x40 || NO_ZBUFFER_WRITE || 0x400 || 0x581390 || '''<code>CVisibilityPlugins::RenderFadingEntities(CLinkList<CVisibilityPlugins::AlphaObjectInfo> &)</code>'''
{{Pre|1=
if (model->m_nType == MODEL_INFO_SIMPLE && model->m_nFlags & NO_ZBUFFER_WRITE)
    RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
}}
|-
|-
|<center>Class</center>||Class of the vehicle
| 7 || 128 || 0x80 || DONT_RECEIVE_SHADOWS || 0x800 || 0x48AF21 || '''<code>CFileLoader::LoadObjectInstance(char const*)</code>'''
{{Pre|1=
if (model->m_nFlags & DONT_RECEIVE_SHADOWS)
    entity->m_nFlags.bDontCastShadowsOn = true;
}}
|-
|-
|<center>Frequency</center>||Frequency of the vehicle spawning randomly on the streets
| 8 || 256 || 0x100 || IGNORE_DRAW_DISTANCE || 0x1000 || 0x487CDE || '''<code>CEntity::SetupBigBuilding()</code>'''
{{Pre|1=
if (model->m_afLodDistances[0] > 2500.0f <nowiki>||</nowiki> model->m_nFlags & IGNORE_DRAW_DISTANCE)
    entity->m_nLevel = 0;
}}
|-
|-
|<center>Level</center>||unknown
| 9 || 512 || 0x200 || IS_GLASS_TYPE_1 || 0x2000 || 0x488CCD || '''<code>CEntity::PreRender()</code>''', probably in-lined '''<code>CModelInfo::IsGlassModel(int)</code>''' @0x488CAA
{{Pre|1=
bool CModelInfo::IsGlassModel(int modelId) {
    CBaseModelInfo *model = CModelInfo::GetModelInfo(modelId);
    if (model->m_nType == MODEL_INFO_SIMPLE <nowiki>||</nowiki> model->m_nType == MODEL_INFO_TIME) {
        CSimpleModelInfo *simpleModel = reinterpret_cast<CSimpleModelInfo *>(model);
        return simpleModel->m_nFlags & IS_GLASS_TYPE_1 <nowiki>||</nowiki> simpleModel->m_nFlags & IS_GLASS_TYPE_2;
    }
    return false;
}
}}
|-
|-
|<center>Comprules</center>||unknown
| 10 || 1024 || 0x400 || IS_GLASS_TYPE_2 || 0x4000 || 0x488CE7 || '''<code>CEntity::PreRender()</code>'''
|-
{{Pre|1=
|<center>WheelID</center>||ID number of wheel model<br>Only available for type ''car'', has no effect if used on type ''boat''
if (CModelInfo::IsGlassModel(modelId)) {
|-
    if (!(CModelInfo::GetModelInfo(modelId)->m_nFlags & IS_GLASS_TYPE_2) ) {
|<center>WheelScale</center>||Scale of wheel and [[Collision File|collision]] models for type ''car'', scale of wheel collision model for type ''bike'', 1.0 for original size of wheel and collision models<br>Only available for types ''car'' and ''bike'', has no effect if used on type ''boat''
        CGlass::AskForObjectToBeRenderedInGlass(entity);
|-
        entity->m_nFlags.bIsVisible = false;
|<center>LODModel</center>||ID number of LOD model, can be any valid vehicle model<br>Only available for type ''plane''
    }
}
}}
|}
|}


''SA Format comming soon''
== Difference between GTA III and GTA IV engines ==
 
[[Grand Theft Auto IV]] not only uses different formats to the previous games, it also does not use IDs to identify objects anymore. While [[Grand Theft Auto III]] era games use an ID as an index inside an array of definitions, GTA IV uses the hashes of the model name as a key inside a hash table. For more information about this see [[Map System]].
===HIER===
 
''SA Format only''
 
This is (e.g.) used in default.ide in the 'data\'-folder
Normal structure is like this:
 
  ID, model, texture, null, float (normally 2000.00)
 
The meaning of these lines isn't known yet, but it seems to be a kind of bodyparts for the player.


===TXDP===
== Tools ==
;Texture Archive Parent
* [[KEd]] &ndash; By JernejL
''SA and GTA 4 format''
* [[MEd]] &ndash; By Tonywob
TextureName, TextureParentName
* [http://www.gtagarage.com/mods/show.php?id=4817 IDEditor] &ndash; By Xmen
Both parameters are names of texture archives (<code>.txd</code>). The second archive (the "parent") virtually extends the first one. Practically, the game looks up a texture in the primary archive, and if it's not there and a parent txd has been assigned, it checks for the texture in the parent archive. This way shared archives can be created, which contain often used textures, without the need to create duplicates or split up a model just for that purpose.
* [http://www.gtaforums.com/index.php?showtopic=402942 IDE-IV in GTA-IV script centre] &ndash; by Gforce
* [http://www.aschratt.com/fileview.php?file=1004 FlagValue Calculator] &ndash; By Aschratt - Calculates all flagvalues (even those unknown).


===2DFX===
== See also ==
Used to place lights, particles, and ped behaviors on objects
* [[Item Placement]]
 
* [[Map System]]
''GTA III and VC format''
* [[Dynamic Object]]
 
''Type 0: Lights''
ID, X, Y, Z, R, G, B, unknown (0 or 200), 1, Corona, Shadow, Distance, Outer range, Size, Inner range, IDE flag, Wet, Flare, Dust
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
|-
|<center>R, G, B</center>||color of the light and everything associated it in RGB format
|-
|<center>Corona</center>||corona associated to the light defined in <code>particle.txd</code>, usually "coronastar" for lighta
|-
|<center>Shadow</center>||shadow associated to the light?, usually "shad_exp"
|-
|<center>Distance</center>||view distance of the light, is limited by the draw distance of the host object
|-
|<center>Outer range</center>||the range the light can cast on objects, cars, and peds
|-
|<center>Size</center>||the size of the corona, can be a float or integer, size 0 means no visible corona but effect of light still visible
|-
|<center>Inner range</center>||the range the light can cast on the ground
|-
|<center>IDE flag</center>||IDE flag, only the time-dependent flags are useable
|-
|<center>Flash</center>||sets the [[2DFX#Types of Flashes|type of flashing]]
|-
|<center>Wet</center>||sets the particle to be "reflective" on wet grounds
|-
|<center>Flare</center>||sets the particle to create a lens flare on the screen, similar to what the sun does<br>0 - no lens flare, 1 - lens flare effect
|-
|<center>Dust</center>||sets the intensity of light reflecting off dust, values 4 to 7 have visible effects
|}


''Type 1: Particle''
== References ==
ID, X, Y, Z, R, G, B, unknown (63 or 200), 2, Particle, unk1, unk2, unk3, Size
<references />


{| width="100%" class="prettytable collapsible collapsed"
== External links ==
!width="250px"|Identifier
* [http://www.gtaforums.com/index.php?showtopic=102833 GTAVC IDE Definitions] - topic by ODIE covering specific details of IDE files in GTA VC
!Description
* [http://www.gtaforums.com/index.php?showtopic=118193 GTA3/VC Map File Documentation and Troubleshooting] - topic by Opius covering general features of IDE files in GTA3 and GTA VC
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
|-
|<center>R, G, B</center>||useless values
|-
|<center>Particle</center>||[[2DFX#Types of Particles|particle type]]
|-
|<center>Size</center>||the size of the particle
|}
 
''Type 3: Peds (Vice City only)''
ID, X, Y, Z, R, G, B, unknown (200), 3, Behavior, unk1, unk2, unk3, RotX, RotY, RotZ
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] section
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
|-
|<center>R, G, B</center>||useless values
|-
|<center>Animation</center>||[[2DFX#Types of Behaviors|behavior type]]
|-
|<center>unk1, unk2, unk3</center>||unknown, useless values?
|-
|<center>RotX, RotY, RotZ</center>||rotation of ped when animation is playing
|}
 
''Type 4: Sun Reflections (Vice City only)''
ID, X, Y, Z, R, G, B, unknown (120), 4
 
{| width="100%" class="prettytable collapsible collapsed"
!width="250px"|Identifier
!Description
|-
|<center>ID</center>||associated to existing object ID defined in [[OBJS]] or [[TOBJ]] section
|-
|<center>X, Y, Z</center>||X, Y, and Z coordinates relative to the center of the object
|-
|<center>R, G, B</center>||useless values
|}
 
Please note that the 2dfx Section is moved to the DFF Files by using R*'s custom section IDs in SA!
 
Please also note that the 2dfx Lights Section is present within GTA-IV [[WDR]] map models
 
===PATH===
'''Ped and Car Paths''', defines paths relative to the objects. Only used in ''GTA III'', quite complicated format and hardly usable without a editing program (such as [[Ked]]).
 
===TREE===
''GTA4 only''
 
===TANM===
''GTA4 only''
 
===MLO===
''GTA4 only''
 
===AMAT===
''GTA4 only''
 
Modelname, Flag1, Flag2
 
==Procobj.ide==
 
===OBJS===
 
''GTA IV format''
 
ModelName, TextureName, DrawDistance, Flag1, Flag2, (Bounds min)X, Y, Z, (Bounds max)X, Y, Z, (Bounds Sphere)X,Y,Z, Radius, WDD
 
;ModelName: name of the .wdr [[model file]], without extension (string)
;TextureName: set to 'null' by default in procobj.ide
;DrawDistance: [[draw distance]] in [[unit]]s, one for each sub object (float)
;Flag1: object flag, defining special behavior
;Flag2: object flag, defining special behavior, default 0 (integer)
;Bounds Min: Lower Left vertex of a model bounding box
;Bounds Max: Upper Right vertex of a model bounding box
;Bounds Sphere: X,Y,Z Coords
;Radius: Of Bounds Sphere
;WDD: set to 'null' by default in procobj.ide
 
==Tools==
* {{GTAG|4817|IDEditor}} - By {{U|Xmen}}
*  - by {{U|Gforce}}
* [http://www.aschratt.com/fileview.php?file=1004 FlagValue Calculator] - By {{U|Aschratt}} - Calculates all Flagvalues (even those unknown)
 
==External links==
* [http://gta-worldmods.t-n-network.de/forum/thread.php?threadid=3382 ID Flagvalue Decoding Project] - project to decode all missing flag values
* [http://gta-worldmods.t-n-network.de/forum/thread.php?threadid=3382 ID Flagvalue Decoding Project] - project to decode all missing flag values


{{fdl}}
{{fdl}}
 
{{3-navi}}
{{modding}}
{{VC-navi}}
[[Category:Map Formats]]
[[Category:Map Formats]]
[[Category:GTA III Modifications]]
[[Category:GTA Vice City]]
[[Category:Modifications]]

Latest revision as of 14:43, 21 July 2018

Item Definition
IDE Sections:
2DFX AMAT ANIM CARS HIER MLO OBJS
PATH PEDS TANM TOBJ TREE TXDP WEAP

Item definition files, usually identified by the file extension .ide, are used to declare many different aspects for the map system or to specify special behavior rules for one of the aspects. They are stored in plain text format, so that they can be opened by any text editing program (like Notepad), but there are also some tools to simplify editing.

Overview

The item definition files are split up into several sections. There is no order on how you arrange the sections and sections do not need to appear in the file.

Format and syntax description

Line comments are indicated by the character # (number sign) and empty lines are allowed. They can be placed anywhere in the file. The game reads up to a maximum of 256 characters for each line and ignores the rest if the line is longer. Each section starts with a section identifier (usually four characters long, e.g. objs, tobj, etc.) indicating how the content of the section gets interpreted by the game. The identifier is followed by the definition entries. Each entry takes one line and every line follows a specific format which are described in the articles handling the sections in detail (see below). The end of any section is indicated by the terminating string end. Both the section identifier and terminating string are case sensitive. Lines within sections are always formatted in the same way differing only in the number of parameters describing the semantical content of the line. Data are usually separated by the character , (comma) but can be separated by  (space). Tabs and spaces anywhere in the beginning of the line, between data, or after the data are omitted by the game and can be used to improve readability for human eyes. The games' parser uses an invariant culture to parse numerical values and strings, which means strings are ASCII encrypted and the decimal separator is . (period).

Example

# line comment
objs
# default style in objs section
200, ind_land101, pjs, 1, 127, 0
# valid style
	    200 ind_land101 pjs 1 127 0
end

Format

The following table contains all known sections in the item definition. The supported games column lists games that support the sections but it doesn't necessarily means they're functional in the games.

Section Supported games Description
objs GTA III GTA Vice City GTA San Andreas GTA IV Defines simple objects. They can be placed into the world through the inst section of the item placement files.
tobj GTA III GTA Vice City GTA San Andreas GTA IV Defines time objects. The section functions similarly to objs but has two additional parameters defining the in-game time range the object can get rendered. These objects can be placed into the world through the inst section of the item placement files.
hier GTA III GTA Vice City GTA San Andreas GTA IV Defines clump objects for use in cutscenes.
cars GTA III GTA Vice City GTA San Andreas GTA IV Defines vehicle objects.
peds GTA III GTA Vice City GTA San Andreas GTA IV Defines pedestrian objects (random NPC's).
path GTA III GTA San Andreas Adds path nodes to defined objects. This section is unstable in Vice City.
2dfx GTA III GTA Vice City GTA San Andreas GTA IV Adds particle effects and simple ped behaviors to defined objects.
weap GTA Vice City GTA San Andreas GTA IV Defines weapon objects.
anim GTA San Andreas GTA IV Defines animated objects. The section functions similarly to objs but has one additional parameter indicating an IFP or WAD animation file to assign an animation to the object. These objects can be placed into the world through the inst section of the item placement files.
txdp GTA San Andreas GTA IV Used to virtually extend texture dictionaries.
tanm GTA IV Used to combine tobj and anim sections.
Those objects get placed inside the inst section of the WPL.
tree This section is read in GTA IV but is not functional.
vnod GTA IV
link GTA IV
mlo GTA IV Used to create interiors. This section does also contain information about portals (previous enex connections) and dimensions of the interior which influences certain aspects, like the weather, for example. All objects are placed relative to an offset placed using mlo+ inside the IPL or WPL file.
amat GTA IV This is Audio Materials. Possible Used to make a sound effect at the model. Usually used for dynamic objects.
lodm This is read in GTA IV but section is not functional.
agrps GTA IV
hand VC Xbox/Mobile

IDE Flags

Flags are used in order to specify the behaviour of objects. They are interpreted as signed 32-bit integer values where each bit describes a boolean value of a different aspect.

GTA III

Bits Dec Hex Name Description Examples
0 1 0x1 - Cull model if player doesn't look at it? Read, but ignored. Fences
1 2[1] 0x2 DO_NOT_FADE Do not fade the object when it is being loaded into or out of view. Some lampposts
2 4[1] 0x4 DRAW_LAST Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. Trees
3 8 0x8 ADDITIVE Render with additive blending. Previous flag must be enabled too.
4 16[1] 0x10 IS_SUBWAY Model is a tunnel, i.e. set the object as invisible unless the player enters cull zone flag 128. This flag works only with static models. Tunnels, some dynamic objects
5 32 0x20 IGNORE_LIGHTING Don't use static lighting, we want dynamic if it's possible. Some lampposts and trafficlights
6 64[1] 0x40 NO_ZBUFFER_WRITE Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Not implemented in the PS2 version. Shadow

GTA Vice City

Bits Dec Hex Name Description Examples
0 1 0x1 IS_ROAD Identifies objects to draw "wet reflections" on them. Roads
1 2 0x2 DO_NOT_FADE Do not fade the object when it is being loaded into or out of view. Some night objects, North Point Mall
2 4 0x4 DRAW_LAST Model is transparent. Render this object after all opaque objects, allowing transparencies of other objects to be visible through this object. Fencse, trees
3 8 0x8 ADDITIVE Render with additive blending. Previous flag will be enabled automatically. Night windows
4 16 0x10 - Read, but not used. _dy, _dt objects
5 32 0x20 IGNORE_LIGHTING Don't use static lighting, we want dynamic if it's possible. Interior objects
6 64 0x40 NO_ZBUFFER_WRITE Model is a shadow. Disable writing to z-buffer when rendering it, allowing transparencies of other objects, shadows, and lights to be visible through this object. Tree shadows
7 128 0x80 DONT_RECEIVE_SHADOWS Do not draw dynamic shadows on this object. Small objects, pickups, lamps, trees
8 256 0x100 IGNORE_DRAW_DISTANCE Ignore draw distance for this object (sets its "level" (island id) to 0). LOD models, North Bridge
9 512 0x200 IS_GLASS_TYPE_1 Breakable glass type 1: glass object changes its textures when breaking. Small windows
10 1024 0x400 IS_GLASS_TYPE_2 Breakable glass type 2: glass object doesn't change its textures when breaking. Large windows

Reference table

Bits Dec Hex Name Model info flag Ref address Ref description
0 1 0x01 IS_ROAD 0x04 0x4CA1D7 CRenderer::RenderRoads()
if (CModelInfo::GetModelInfo(entity->m_nModelIndex)->m_nFlags & IS_ROAD)
    entity->Render();
1 2 0x02 DO_NOT_FADE 0x20 0x4C7E03 CRenderer::ShouldModelBeStreamed(CEntity *,CVector const&)
if (model->m_nFlags & DO_NOT_FADE) {
    if (distance >= model->GetLargestLodDistance() + 30.0f)
        return true;
}
else if ( distance >= model->GetLargestLodDistance() + 50.0f)
    return true;
2 4 0x04 DRAW_LAST 0x40 0x56F4F3 CSimpleModelInfo::SetupBigBuilding(int,int)
if (model->m_nFlags & DRAW_LAST) {
    model->m_nFlags &= ~DRAW_LAST;
    dbgprint("%s was draw last\n", model->m_szName);
}
3 8 0x08 ADDITIVE 0x80 0x582590 CVisibilityPlugins::RenderFadingAtomic(RpAtomic *,float)
if (model->m_nFlags & ADDITIVE)
    RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDONE);
4 16 0x10 - 0x100 - -
5 32 0x20 IGNORE_LIGHTING 0x200 0x56F7C4 CSimpleModelInfo::SetAtomic(int,RpAtomic *)
if (model->m_nFlags & IGNORE_LIGHTING)
    atomic->geometry->flags &= ~rpGEOMETRYLIGHT;
6 64 0x40 NO_ZBUFFER_WRITE 0x400 0x581390 CVisibilityPlugins::RenderFadingEntities(CLinkList<CVisibilityPlugins::AlphaObjectInfo> &)
if (model->m_nType == MODEL_INFO_SIMPLE && model->m_nFlags & NO_ZBUFFER_WRITE)
    RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
7 128 0x80 DONT_RECEIVE_SHADOWS 0x800 0x48AF21 CFileLoader::LoadObjectInstance(char const*)
if (model->m_nFlags & DONT_RECEIVE_SHADOWS)
    entity->m_nFlags.bDontCastShadowsOn = true;
8 256 0x100 IGNORE_DRAW_DISTANCE 0x1000 0x487CDE CEntity::SetupBigBuilding()
if (model->m_afLodDistances[0] > 2500.0f || model->m_nFlags & IGNORE_DRAW_DISTANCE)
    entity->m_nLevel = 0;
9 512 0x200 IS_GLASS_TYPE_1 0x2000 0x488CCD CEntity::PreRender(), probably in-lined CModelInfo::IsGlassModel(int) @0x488CAA
bool CModelInfo::IsGlassModel(int modelId) {
    CBaseModelInfo *model = CModelInfo::GetModelInfo(modelId);
    if (model->m_nType == MODEL_INFO_SIMPLE || model->m_nType == MODEL_INFO_TIME) {
        CSimpleModelInfo *simpleModel = reinterpret_cast<CSimpleModelInfo *>(model);
        return simpleModel->m_nFlags & IS_GLASS_TYPE_1 || simpleModel->m_nFlags & IS_GLASS_TYPE_2;
    }
    return false;
}
10 1024 0x400 IS_GLASS_TYPE_2 0x4000 0x488CE7 CEntity::PreRender()
if (CModelInfo::IsGlassModel(modelId)) {
    if (!(CModelInfo::GetModelInfo(modelId)->m_nFlags & IS_GLASS_TYPE_2) ) {
        CGlass::AskForObjectToBeRenderedInGlass(entity);
        entity->m_nFlags.bIsVisible = false;
    }
}

Difference between GTA III and GTA IV engines

Grand Theft Auto IV not only uses different formats to the previous games, it also does not use IDs to identify objects anymore. While Grand Theft Auto III era games use an ID as an index inside an array of definitions, GTA IV uses the hashes of the model name as a key inside a hash table. For more information about this see Map System.

Tools

See also

References

External links

Copyrighted

This page is licensed under the GNU Free Documentation Licence. This page has a separate license to the CC-BY-SA that applies to most of Grand Theft Wiki.

The full text of the GNU FDL v1.2 is here. Click the "History" button to see the full list of authors. See Grand Theft Wiki:Copyright for more detail on our copyright policy.

GNU Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
See Grand Theft Wiki:Copyright for more information.