Element/Building: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (add info about map limits)
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
The building class represents static, 3D models in the GTA world. Examples of buildings include building models, roads, and terrain. Buildings, unlike objects, can contain '''glass''' and '''shadows'''.
The building class represents '''static''' 3D models in the GTA world. There is a distinction in GTA: San Andreas between static and dynamic models. Examples of buildings include building models, roads, and terrain. Objects created as [[Building|Buildings]] can contain '''glass''' and '''shadows''', unlike those created as [[Object|Objects]].


The element type of this class is '''"building"'''.
The element type of this class is '''"building"'''.
{{BuildingInfo}}


Buildings cannot be created with dynamic object model IDs (like a door that opens when you push it), they are meant to be used for static objects, mainly buildings as the name suggests. For example, [https://dev.prineside.com/en/gtasa_samp_model_id/model/1502-Gen_doorINT04/ object ID 1502 (Gen_doorINT04) is a dynamic object model]. On the other hand, [https://dev.prineside.com/en/gtasa_samp_model_id/model/3556-compmedhos3_LAe/ object ID 3556 (compmedhos3_LAe) is non-dynamic], you can use it with [[createBuilding]].
==Object Models==
 
[[Object_IDs|List of Object Model IDs]]
Buildings can only be created inside regular GTA:SA Map Boundaries (X between -3000 and 3000; Y between -3000 and 3000). Use [[createObject]] to spawn objects outside these normal limits.
 
Created buildings can have '''LOD models''', which is possible using [[createBuilding]] to spawn the LOD building, then [[setLowLODElement]] to associate it with a non-LOD building element created beforehand. LOD model distance changed with [[engineSetModelLODDistance]] affects buildings too.


==Related scripting functions==
==Related scripting functions==

Latest revision as of 10:51, 14 October 2024

The building class represents static 3D models in the GTA world. There is a distinction in GTA: San Andreas between static and dynamic models. Examples of buildings include building models, roads, and terrain. Objects created as Buildings can contain glass and shadows, unlike those created as Objects.

The element type of this class is "building".

Important information about buildings:

  • Buildings are essentially the same as objects, but internally (in GTA: San Andreas game logic) they use a separate streaming system that is not affected by MTA objects, which can be created in any dimension unlike buildings. In terms of performance, using buildings for exterior mapping is more optimized than objects. Gains in FPS can be noticed in areas where a lot of objects were replaced with buildings of this new system.
  • Buildings can only be created inside regular GTA:SA Map Boundaries (X between -3000 and 3000; Y between -3000 and 3000). Use createObject to spawn objects outside these normal limits.
  • Created buildings can have LOD models, which is possible using createBuilding to spawn the LOD building, then setLowLODElement to associate it with a non-LOD building element created beforehand. LOD model distance changed with engineSetModelLODDistance affects buildings too.

Object Models

List of Object Model IDs

Related scripting functions