Jump to content

setElementStreamable broken?


MaddDogg

Recommended Posts

Hi!

I just tested around a bit with the function setElementStreamable in order to have some objects to be not streamed out after 300 units.

But for some reason, the function seems just to not work at all.

isElementStreamable correctly tells me that I deactivated streaming for the object, but still, the object gets streamed out after exactly 300 units.

I also used engineSetModelLODDistance and set the distance to 500, but this also didn't fix the problem.

So I wonder, if the function really works properly and deactivates the MTA streaming for that object.

I also found other posts saying that the function isn't working, as it should.

Here 's the script, I used to test it out:

addEventHandler("onClientPlayerSpawn",  getLocalPlayer(), 
    function () 
        obj1 = createObject(6959, 1415.36, -2493.79, 33.22, 0, 90, 0) 
        obj2 = createObject(6959, 1715.36, -2493.79, 33.22, 0, 90, 0) 
        setElementStreamable(obj1, false) 
        setElementStreamable(obj2, false) 
         
        engineSetModelLODDistance(6959, 500) 
    end 
, false) 
  
addCommandHandler("distobj", 
    function () 
        local x,y,z = getElementPosition(obj1) 
        local x2,y2,z2 = getElementPosition(obj2) 
        outputChatBox(tostring(getDistanceBetweenPoints3D(x,y,z,x2,y2,z2))) 
    end 
, false) 

This script creates two clientside objects at the LS airport, 300 units away from each other.

Then it deactivates streaming and even sets the lod distance to 500.

But when you go there, the other object will always stream out, when you go past the first.

Am I misunderstanding something here or is the function really broken?

I would really appreciate help, since I really need to deactivate the streamer for some things.

Thanks in advance!

Madd

Link to comment

you don't understand something for sure :)

to be brief: there is no way to make object to be visible from 2000 units.

edit:

by default - object is streamed in when one player is nearby. what means streamed - something like that psychics, health etc are counted for this object. if element is streamed out - that means none of player nor server are doing anything with this element - this means for example: car flipped on roof, but streamed out will not explode. car in air (falling down to ground) will stop in mid-air, and its position will be constant - until someone will get close enough to this car to be streamed again.

good example for objects stream:

you have BIG object (imagine its on X:0 Y:0), and on edge of this object there is car standing (X: 200, Y: 200). when you are getting out of streaming range of this object - but you are still in streaming range of car (example, you are on X: 300, Y: 300) - the car will felt down, because its still streamed it, but the object is not - and it will disappear, also its collisions will be removed until it gets streamed in. you can prevent such behavior with disabling streaming for that object.

LOD is only visual - you can set it to 10 - and the object will disappear very fast - but it will be still streamed it - and its collision will remain.

Link to comment

Hm yeah okay, I guessed that the 300 units limitation was caused by the streamer.

But it seems not so, so just disregard the above problem :P

But I have another problem:

I have a map with a lot of objects, which apparently exceed the streamer's max object limit.

So, the streamer just streams in the closest objects so that even after appr. 150 units, the objects are streamed out.

Now I would like to just exclude all my ground objects of my map from the streamer, so they would stay streamed in.

But still, if I deactivate the streamer for every ground object, they still stream out after 150 units, which they shouldn't, if the streamer didn't touch them.

So, why are my objects still streaming out after appr. 150 units, when they're not supposed to be managed by a streamer?

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