MaddDogg Posted September 26, 2010 Share Posted September 26, 2010 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
dzek (varez) Posted September 26, 2010 Share Posted September 26, 2010 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
MaddDogg Posted September 26, 2010 Author Share Posted September 26, 2010 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 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
dzek (varez) Posted September 26, 2010 Share Posted September 26, 2010 set LOD value to max (300) and stream them out (notice that disabling streaming for much objects are not recommended) - this is all you can do. also the objects gets streamed out after X units from the center of object, not from the closest edge of object. see image: that rectangle is your object Link to comment
MaddDogg Posted September 26, 2010 Author Share Posted September 26, 2010 I did a check and the ground objects stream out, as soon as I am about 127.5 units away from them. This shouldn't happen with a deactivated streamer, should it? And yes, it is from the center of the object, I used getDistanceBetweenPoints3D for it. Link to comment
dzek (varez) Posted September 26, 2010 Share Posted September 26, 2010 it disappearing or getting streamed out? Link to comment
MaddDogg Posted September 26, 2010 Author Share Posted September 26, 2010 The script says, it's getting streamed out, although the streamer is deactivated. I could provide some screens, if you want. Link to comment
dzek (varez) Posted September 26, 2010 Share Posted September 26, 2010 better provide some example code so i can reproduce this on my pc Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now