Element/Object: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Tag: Manual revert
 
(29 intermediate revisions by 13 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
The object class represents a static, 3-D model in the GTA world. Objects can only represent models created by the server, they cannot represent models that are part of the GTA's default landscape. Examples of objects include building models, roads, and terrain.
The object class represents dynamic and static 3D models placed in the GTA world.


The element type of this class is '''"object"'''.
The element type of this class is '''"object"'''.
{{ObjectInfo}}
==[[File:Folder-saved-search.svg|48px]] Object Models==
[[Object_IDs|List of Object Model IDs]]


==XML syntax==
==XML syntax==
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<object id="" model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ=""/>
<object model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" interior="" dimension="" scale="" collisions="" alpha="" frozen="" />
</syntaxhighlight>
</syntaxhighlight>


===Required Attributes===
===Required Attributes===
* '''model''': The object ID of the object being created. Since GTA has thousands of objects, these are hard to document on the wiki. Instead, they can be found using the object browser in the map editor.
* '''model''': The ID of the object being created.
* '''posX''': A float representing the X position of the object.
* '''posX''': A float representing the X position of the object.
* '''posY''': A float representing the Y position of the object.
* '''posY''': A float representing the Y position of the object.
Line 16: Line 20:


===Optional Attributes===
===Optional Attributes===
* '''rotX''': A float representing the X rotation of the object.
* '''rotX''': A float representing the X rotation of the object in degrees.
* '''rotY''': A float representing the Y rotation of the object.
* '''rotY''': A float representing the Y rotation of the object in degrees.
* '''rotZ''': A float representing the Z rotation of the object.
* '''rotZ''': A float representing the Z rotation of the object in degrees.
* '''interior''': The interior world the object is in.
* '''dimension''': The object's dimension number.
{{New feature|3.0110|1.1|
* '''scale''': The object's scale.
* '''collisions''': Enable/Disable object collisions.
* '''alpha''': Changes the object alpha.
* '''frozen''': Sets whether the object should be frozen (also known as static)
}}


==Related scripting functions==
==Related scripting functions==
{{Object functions}}
'''Client'''
{{Client object functions}}
[[Category:Element Types]]
 
[[en:Element/Object]]
[[ru:Element/Object]]
[[hu:Element/Object]]
[[it:Elemento/Oggetto]]

Latest revision as of 12:48, 4 November 2024

The object class represents dynamic and static 3D models placed in the GTA world.

The element type of this class is "object".

Dialog-warning.svg Important info about Objects

  • Objects only represent models created by a script, they do not represent objects that are part of GTA's default landscape (these belong to the "building pool").
  • There is a distinction in GTA: San Andreas between static and dynamic models. The alternative createBuilding function allows you to create objects that are non-dynamic.
  • The createObject function can also create non-dynamic objects, but for optimization reasons it is recommended to spawn Buildings when creating static objects that don't rely on the Dimension system (buildings don't use the same MTA object-streaming system).

Folder-saved-search.svg Object Models

List of Object Model IDs

XML syntax

<object model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" interior="" dimension="" scale="" collisions="" alpha="" frozen="" />

Required Attributes

  • model: The ID of the object being created.
  • posX: A float representing the X position of the object.
  • posY: A float representing the Y position of the object.
  • posZ: A float representing the Z position of the object.

Optional Attributes

  • rotX: A float representing the X rotation of the object in degrees.
  • rotY: A float representing the Y rotation of the object in degrees.
  • rotZ: A float representing the Z rotation of the object in degrees.
  • interior: The interior world the object is in.
  • dimension: The object's dimension number.
  • scale: The object's scale.
  • collisions: Enable/Disable object collisions.
  • alpha: Changes the object alpha.
  • frozen: Sets whether the object should be frozen (also known as static)

Related scripting functions

Client