Jump to content

How to apply lod distance from .map file?


FuriouZ

Recommended Posts

Hello!

I wan't to make a script which applies EngineSetModelLODDistance for all mapped objects in .map file. Here's the question, how I can get all mapped objects from .map file? So i can apply a custom LOD Distance? It should be possible.. I don't wan't to convert .map files to lua, because people can steal them then.

Example map:

"editor_main"> 
    "object (vgsNwedchap2) (1)" breakable="true" interior="0" alpha="255" model="6963" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="314.5" posY="-1843.3" posZ="7.2" rotX="0" rotY="0" rotZ="0"> 
    "object (Arch_sign) (1)" breakable="true" interior="0" alpha="255" model="3715" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="310.39999" posY="-1879.6" posZ="10.5" rotX="0" rotY="0" rotZ="0"> 
    "object (vgsfrates07) (1)" breakable="true" interior="0" alpha="255" model="8078" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="310.39999" posY="-1859.5" posZ="6.1" rotX="0" rotY="0" rotZ="0"> 

  

Link to comment
Hello!

I wan't to make a script which applies EngineSetModelLODDistance for all mapped objects in .map file. Here's the question, how I can get all mapped objects from .map file? So i can apply a custom LOD Distance? It should be possible.. I don't wan't to convert .map files to lua, because people can steal them then.

Example map:

"editor_main"> 
    "object (vgsNwedchap2) (1)" breakable="true" interior="0" alpha="255" model="6963" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="314.5" posY="-1843.3" posZ="7.2" rotX="0" rotY="0" rotZ="0"> 
    "object (Arch_sign) (1)" breakable="true" interior="0" alpha="255" model="3715" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="310.39999" posY="-1879.6" posZ="10.5" rotX="0" rotY="0" rotZ="0"> 
    "object (vgsfrates07) (1)" breakable="true" interior="0" alpha="255" model="8078" doublesided="false" scale="1" dimension="0" MSTalpha="255" posX="310.39999" posY="-1859.5" posZ="6.1" rotX="0" rotY="0" rotZ="0"> 

  

People can't steal them if you compile your script.

First: https://forum.multitheftauto.com/viewtopic.php?f=93&t=62110

Then: https://luac.multitheftauto.com

Link to comment

Lets say you have a map resource named "realLife". So we simply do this:

  
local mapRes = getResourceFromName("realLife")  
  
if  getResourceState ( mapRes ) ~= "running" then  
return  
end  
  
local objects = getElementsByType ("object", getResourceRootElement(mapRes) ) -- this will get objects created by map resource 
  
  

if you're adding this script in a map resource then you just need this:

  
local objects = getElementsByType ("object", getResourceRootElement() ) -- this will get objects created by map resource 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...