Jump to content

Antibird

Members
  • Posts

    177
  • Joined

  • Last visited

Everything posted by Antibird

  1. Antibird

    metatables

    Hello there. I never dealt with metatables in LUA scripting, but now I've got a need to track changes in some table that stores some data, so I came up with idea of using metatables ( the '__newindex' event ). I've got acquainted to theory, but my basic test script doesn't work and I gave up trying to find what's wrong to it. I'd be very glad it somebody could guide me for a bit. Thankyou! test = { x = 1, y = 3, z = 5 } mt = { __newindex = function( t, key ) outputConsole( "hit" ) end } --This line should output 'hit' in console 3 times after "check" command been used, right? setmetatable( test, mt ) addCommandHandler( "check", function() test.x = 2 test.y = 4 test.z = 6 outputConsole( test.x.." "..test.y.." "..test.z ) end )
  2. Right then, thanks for letting me know.
  3. Right then, thanks for letting me know.
  4. Well, that's a pity: http://bugs.mtasa.com/view.php?id=5188 What makes it weird is the fact of me actually having several maps put 15-20 k far from center (client-side created -or- moved after .map creation) and some aren't affected by this 'issue', but some others are. What if I have my own "streamer" and my maps are created client-side and I can handle things by myself? But MTA streamer limitations makes all those useless, I found no ways to avoid it.
  5. Well, that's a pity: http://bugs.mtasa.com/view.php?id=5188 What makes it weird is the fact of me actually having several maps put 15-20 k far from center (client-side created -or- moved after .map creation) and some aren't affected by this 'issue', but some others are. What if I have my own "streamer" and my maps are created client-side and I can handle things by myself? But MTA streamer limitations makes all those useless, I found no ways to avoid it.
  6. Thank you for suggesting eAi, but you've just described the way my world is made and works The part of project I'm working on since MTA dp 2.2. Right at the moment I actually need 3 things: 1. 1st is the topic subject. Making a world of "tiles" 60x60 km (kUnits) is more preferable than doing the same with 16x16 ( <- 8 km "edge" fit ) 2. The way to hide out (destroy, delete, non-display, remove collisions, whatever else ) the SA native landscape to "clear up" new areas for other purposes (custom landscapes and so on) OR If case of this point fail, I'd need handling functions ( which I hope to come in v 1.2 ) to extend aircrafts height limit and make new tile above the SA. 3. Is the topic second subject, the one about glass weird transparency. Thank you once again, those who participated in discussion. If anyone of MTA team could give an answer of which of my requests may be solved one day, I'd be really thankful for it. Well, even if something is impossible to implement, still I'd like to know to think up a solution by myself probably.
  7. Thank you for suggesting eAi, but you've just described the way my world is made and works The part of project I'm working on since MTA dp 2.2. Right at the moment I actually need 3 things: 1. 1st is the topic subject. Making a world of "tiles" 60x60 km (kUnits) is more preferable than doing the same with 16x16 ( <- 8 km "edge" fit ) 2. The way to hide out (destroy, delete, non-display, remove collisions, whatever else ) the SA native landscape to "clear up" new areas for other purposes (custom landscapes and so on) OR If case of this point fail, I'd need handling functions ( which I hope to come in v 1.2 ) to extend aircrafts height limit and make new tile above the SA. 3. Is the topic second subject, the one about glass weird transparency. Thank you once again, those who participated in discussion. If anyone of MTA team could give an answer of which of my requests may be solved one day, I'd be really thankful for it. Well, even if something is impossible to implement, still I'd like to know to think up a solution by myself probably.
  8. I say thank you, Captain robhol for such a useful calculation. Not sure if it make any sense here and now, but I'm one of those who likes flying in virtual environments and MTA gives me a wonderful chance to make my own. That's just my own motivation. Anyway, I'll just put my little problem on bug-tracker I guess.
  9. I say thank you, Captain robhol for such a useful calculation. Not sure if it make any sense here and now, but I'm one of those who likes flying in virtual environments and MTA gives me a wonderful chance to make my own. That's just my own motivation. Anyway, I'll just put my little problem on bug-tracker I guess.
  10. By some reasons I need all that space, the "shaking" bug is not a problem at all actually while staying within some optimal limits away of SA, but the objects "blinking" is a critical thing for me to deal with ( and the "glass" problem). If only you could fix that by somehow or suggest any kind of solution.. well.
  11. By some reasons I need all that space, the "shaking" bug is not a problem at all actually while staying within some optimal limits away of SA, but the objects "blinking" is a critical thing for me to deal with ( and the "glass" problem). If only you could fix that by somehow or suggest any kind of solution.. well.
  12. Yep, this is a headache. It's quite comfortable to stay within 30-40k away of the 'world center' thought. Also noticeable not only on movement, but when rotating the camera too.
  13. Yep, this is a headache. It's quite comfortable to stay within 30-40k away of the 'world center' thought. Also noticeable not only on movement, but when rotating the camera too.
  14. BUMP Both problems still exist. The "unpleasant issues" 50p was talking about might be a random disappearing/reappearing of map objects for 'far placed' maps. I have no idea either this is because of MTA streamer or anything else, just would like to ask if MTA devs will ever try to fight this issue. Second one is water/clouds invisibility while looking through the vehicle window. Switching on the vehicle light helps to avoid it, but there should be an "ordinary" solution. Once again, the bug never appeared in MTA 'dp' versions. Should both requests been put on bugtracker, by the way?
  15. BUMP Both problems still exist. The "unpleasant issues" 50p was talking about might be a random disappearing/reappearing of map objects for 'far placed' maps. I have no idea either this is because of MTA streamer or anything else, just would like to ask if MTA devs will ever try to fight this issue. Second one is water/clouds invisibility while looking through the vehicle window. Switching on the vehicle light helps to avoid it, but there should be an "ordinary" solution. Once again, the bug never appeared in MTA 'dp' versions. Should both requests been put on bugtracker, by the way?
  16. Not actually that same, Kayl. I need a set of some custom data produced by one player to be synced to another player with as least time intervals as possible while keeping server stable and saving bandwidth of other players. Element data, only needed by two, but not the others. Just a question: what loads the server more, synchronizing the data via events system with looping through all players server-side, or via one-line setElementData()? P.S. I definitely agree with and idea of having a "setElementSyncer" - like function, could help making some features in a much more easier way.
  17. The most simple way is: https://wiki.multitheftauto.com/wiki/SetControlState I think.
  18. Antibird

    dofile()

    There they are. Thank you for answering anyway.
  19. Antibird

    dofile()

    Hello there. To simplify manipulations with my different hud modes, I've decided to make a separate .lua files for each of them and then use dofile() function to load it all "with just one click". When nothing appeared to work, I've searched through this forum and found that dofile() is "blocked by MTA": https://forum.multitheftauto.com/viewtop ... le#p285545 I've failed to think up any workaround rather than put all code I needed to execute into one function and load it in a very ordinary way. This does the job, but I wonder of 2 things: 1. Will dofile() be available one day? 2. I don't know much about LUA basic functions, so maybe there's a way to replace dofile() with something else can open a file and run the code wrote in it?
  20. https://wiki.multitheftauto.com/wiki/Set ... hedOffsets Hello. The function is in server-side functions list only, it's own page says the function can be use both server and client sides and example is for client script only. But actually it doesn't work server-side, so I'd like to ask is this function really supposed to work that way? Then, if it only works client-side, what a matter of using it, because offsets updated client-side aren't synced to anybody else. Can anybody please help me sort things out?
  21. I have a pretty similar goal to achieve, so I would like to use this topic to ask if nobody mind. Saying shortly I have a data "A" attached to a vehicle. The data is then changing client-side by vehicles driver. What I need is to sync changed data to a passenger of the same vehicle. Sounds easy, but I need the data to be synced every second, since it's changing that quick. That is where i expect troubles to appear when more and more people is going to use the synchronization. Will it be more efficient to use events system, or there's no matter how to kill the server with 50 requests in a second? Or maybe I'm worrying for nothing and this procedure won't stress the server and waste too much of bandwidth? I can't carry out such an experiment, that is why I have to ask for advice.
  22. Thanks, makes it clear. But also means I need to use some kind of workaround to place objects so far.. I guess no one is going to remove the limitation? May I also ask another question. When you look through the window of a vehicle (like cockpit camera), the water and clouds disappear. It definitely was Ok in MTA dp2.2 and it is Ok in SAMP for example. Can this be solved by somehow?
  23. Hey there. This might be a bug I guess.. When I'm trying to create object or vehicle at the x/y of ( 0, 8000 ) everything goes well. However when I Increase the distance from the center of SA, like by setting "y" or "x" to 8500 or 9000 or further, it creates the element at about ~8200 all the time. Those "weird 8200" works in every direction, making a border around SA, giving me no chances to build up anything which doesn't fit that distance. Same for vehicles. Doesn't matter if it was created by script during the game or by *map file on resource start. Objects or vehicles can be moved further than 8200 after creation, but newly created appears to be placed within border. I've tried that with several different resources so guess this hopefully can't be my own failure. Looking for anyone explaining me what's wrong. P.S. 1. The "Z" value can be set to as many as you like. Only x and y causes the problem. 2. There is no problem with objects created client-side !
  24. Thank you for answering. But: where exactly do you suggest to add timer? I've tried to make a delay between retrieving elements table in line 6 and all the rest that goes next, but result was the same: in a couple of seconds I've seen "got: 0".
  25. Hello. I have some questions to ask and hope anybody can answer them. Here they are: 1. Is there any ways of increasing the draw distance for vehicles and objects? The engineSetModelLODDistance function is the only one which is suppose to do what I need, but I have some problems using that, well, it just doesn't work for me. I'm replacing the Shamal default model with some better one and it does well. Then I apply the engineSetModelLODDistance( 519, dist ) and just nothing happens. Regardless of what I use as the "dist" parameter, the plane disappears at the same distance all the time, neither 50 units, not 250 has any matter. 2. Is using getElementsWithinColShape client-side should detect objects created on server startup by *map files? Here's the code: addCommandHandler( "check", function() outputChatBox( "checking.." ) local x, y, z = getElementPosition( getLocalPlayer() ) local col = createColSphere( x, y, z, 1000 ) local elements = getElementsWithinColShape( col ) outputChatBox( "got: "..#elements ) -- outputs the number of elements inside the collision sphere for i, v in ipairs( elements ) do outputChatBox( getElementType( v ) ) end end ) and I'm always giving with "got: 0" in chatbox. 3. Not about draw distance, but still. Are MTA developers going to increase the maximum height the planes can fly at? Removing that limit of 800 units would be just great. Thankyou!
×
×
  • Create New...