Jump to content

Mapping disappear


Emilio_M

Recommended Posts

Posted

Hi guys !

I want you today !

It is now several months that my objects disappear when I roll away ( not far ) see instead :

When it's correct : 74d70dae7bb43350bde99b79d57ccefc.png

When it's disappear : dfe01db4f9fa620fbc04883393c749e5.png

You see i'm not far.

I try to add this in client of sure :

    for k, obj in pairs(getElementsByType("object")) do 
        local model = getElementModel(obj) 
        engineSetModelLODDistance(model, 300) -- or try 1000 but not change 
    end 

I dont understand... I'm lost.

I want you ! and your help :D

Thank's all !

  • Moderators
Posted

how do you roll away? O_o

anyway take a look at:

https://wiki.multitheftauto.com/wiki/SetFarClipDistance

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

how many objects are streamed in?

-- client 
outputChatBox(#getElementsByType("object",root,true)) 
-- 3 argument makes sure it only includes streamed in objects. 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

Lol, then it isn't strange that it doesn't load the object fully. I asume the col is loaded and the texture isn't.

Anyway I didn't know mta supported so much streamed in elements. o_O

You definedly executed this clientside?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • MTA Team
Posted

That's not the amount of streamed in objects.

Use this:

  
count = 0 
objects = getElementsByType("object") 
  
for i = 1, #objects do 
    if isElementStreamedIn(objects[i]) then 
        count = count + 1 
    end 
end 
  
outputChatBox("Number of streamed-in objects: ".. count .." / ".. tostring(#objects)) 
  

  • Moderators
Posted

Of course it is, 3de argument:

streamedIn: If true, function will only return elements that are streamed in.  

https://wiki.multitheftauto.com/wiki/GetElementsByType

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
how many objects are streamed in?
-- client 
outputChatBox(#getElementsByType("object",root,true)) 
-- 3 argument makes sure it only includes streamed in objects. 

The correct response is 191. I think 18164 was not correct and it's not correct. 191 is the correct value. Sorry for this mistake.

EDIT : Do you think it's because my object isnt stream ? I have a small portion of my mapping who was created with createObject function. The remaining is created by .map files including my mapping concerned.

Thanks all.

  • Moderators
Posted

What if that is the only object in your map?

Will it still be invisible?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

Try a higher value then 300, so you are 100% sure it will be forcing the object to be visible.

A value 400 like will reduce the chance that it will drop lower then 300.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

engineSetModelLODDistance

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...