Bonsai Posted September 6, 2016 Share Posted September 6, 2016 Hey, there are some objects that are double sided by default, and apparently stay like that even if they have the "doublesided" attribute in a .map file set to false. So when I load those objects myself, the default doublesided attribute is overwritten, since it says false in the map file, which makes them look different to how they are in the SA map. Is there any way to know which objects have this? I couldn't find anything about this neither in the MTA resources nor the MTA source code. Bonsai Link to comment
qaisjp Posted September 7, 2016 Share Posted September 7, 2016 2 minutes ago, Bonsai said: So when I load those objects myself How are these being loaded? 2 minutes ago, Bonsai said: there are some objects that are double sided by default, and apparently stay like that even if they have the "doublesided" attribute in a .map file set to false. Is this when you first create an object in the map editor? 3 minutes ago, Bonsai said: the default doublesided attribute is overwritten, since it says false in the map file What happens when you reload the map in the map editor? The object.doubleSided attribute should be forced to the .map value, shouldn't it? 4 minutes ago, Bonsai said: Is there any way to know which objects have this? I'm not sure about this. I have a small hunch that this info is embedded in the dff/txd itself, but I don't actually know, If my assumptions are correct (with this being a map editor issue), then this could be solved by forcing the double sided attribute to false when first creating the object. 1 Link to comment
Bonsai Posted September 7, 2016 Author Share Posted September 7, 2016 (edited) No, its not about the map editor. I'm just loading maps with a custom map loader, going through the map file and create the objects later on. But e.g. this glassy object: It looks the same from inside: When loading it with the default race resource, it looks like that too, having the double sided attribute set to false in the map file. So when I load that object myself, the map file says doublesided is false, so I set it to false using setElementDoubleSided function. And I guess that makes it only having one side visible, while actually both should. So I think however MTA loads objects, there is something being done that I don't know about, to solve this. Or maybe thats not the problem at all, but its the only thing that makes sense to me, since forcing doublesided to be true makes it look normal, but the map file says it should be false. Bonsai Edited September 7, 2016 by Bonsai Link to comment
qaisjp Posted September 7, 2016 Share Posted September 7, 2016 Are you using loadMapData 1 Link to comment
Bonsai Posted September 7, 2016 Author Share Posted September 7, 2016 No, that wouldn't work. Its simply created by createObject and similar functions. Link to comment
Walid Posted September 7, 2016 Share Posted September 7, 2016 (edited) Try to use sth like this function START_DOUBLE_SIDED_TRANSACTION() _createObject = createObject createObject = createObjectDoubleSided end function END_DOUBLE_SIDED_TRANSACTION() createObject = _createObject end function createObjectDoubleSided( ... ) local arg = {...} local temp = _createObject( unpack(arg) ) setElementDoubleSided(temp, true) --Enable / disable return temp end it's making createObject always set the object as double sided. START_DOUBLE_SIDED_TRANSACTION() -- put all your created object here -- createObject(7488,1282.599609375, 1002, -6.0999999046326, 0, 0, 122.98101806641) END_DOUBLE_SIDED_TRANSACTION() Edited September 7, 2016 by Walid 1 Link to comment
Anony# Posted September 7, 2016 Share Posted September 7, 2016 I was having the same problem. local objects = {{}, {"object",id="object(vgn_corpbuild3)(1)",doublesided="false",model="6873",interior="0",dimension="0",posX="2015.6341552734",posY="-4775.201171875",posZ="24.309450149536",rotX="270",rotY="180",rotZ="180"}} understand the logic logic. local object = createObject() if objects[2] == "true" then setElementDoubleSided(object,true) end do not use in all objects setElementDoubleSided(object,true) use only what is true doublesided="true" if objects[2] == "true" then 1 Link to comment
GTX Posted September 7, 2016 Share Posted September 7, 2016 I had problems with double siding also. My workaround was: if(objectData.doublesided == true) then element:setDoubleSided(true) end while element:setDoubleSided(objectData.doublesided) didn't work. It is a boolean, I checked. Maybe it works now, who knows. 1 Link to comment
Bonsai Posted September 7, 2016 Author Share Posted September 7, 2016 Wow, thanks for your answers. What Anony wrote really was the problem. If I only change the doublesided attribute if the map file says its "true", it works. So for objects, that are doublesided by default, the map file actually shows the wrong value. I was using isElementDoubleSided earlier when I started to think this might be the problem, but it returns false, even for the object shown in my other post, which actually is doublesided. Anyway, thanks all! It finally works normally now. Bonsai 1 Link to comment
Recommended Posts