Add client-side function to retrieve world models from memory pools (getStreamedWorldModels) - #5318
Open
iManGaaX wants to merge 8 commits into
Open
Conversation
Added GetStreamedWorldModels function to retrieve world model data.
Removed GetStreamedWorldModels function and its implementation.
Removed declaration for GetStreamedWorldModels.
Added GetStreamedWorldModels function to retrieve world model data and populate Lua table.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new client-side Lua function (
getStreamedWorldModels) to query and retrieve world buildings and objects directly from the game's internal pools, filtering out MTA-managed entities and un-streamed RenderWare objects.Function API Reference
table getStreamedWorldModels ( void )type(string): The entity category ("building" or "object").model(number): The model ID of the world object.x,y,z(number): The 3D world coordinates of the object.rx,ry,rz(number): The rotation angles (Euler angles in degrees) of the object.interior(number): The interior/area code of the object.ipl(number): The IPL file index.lodModel(number): The model ID of the associated LOD variant (or 0 if none).lod(boolean): Flag indicating whether the entity has an LOD pointer (m_pLod != nullptr).collisions(boolean): Flag indicating if the object uses collision.isStatic(boolean): Flag indicating if the object is static.visible(boolean): Flag indicating if the object is visible.type == "object"):health(number): The health value of the object.scale(number): The scale factor of the object.Motivation
Provides developers with a reliable and efficient way to interact with original GTA:SA world models for custom tool development, map editors, or specialized interaction frameworks without conflicting with existing MTA elements.
Test plan
2026-09-04.18-30-02.mp4
Test Script:
The following Lua script was used to verify the functionality, filter out LOD models, spawn test objects locally within a 100-meter radius, and render accurate transformation-based bounding boxes for video demonstration:
Checklist