Jump to content

ixjf

Members
  • Posts

    647
  • Joined

  • Last visited

Everything posted by ixjf

  1. Pre-built desktop PCs are usually overpriced and unbalanced, clearly that's one of them. I would not recommend buying one. Is the monitor part of the peripherals, or just keyboard and mouse?
  2. PCPartPicker is a nice website to make a build. Also, users can share their builds and receive feedback. Anyway, it kind of depends on how heavy the games and video editing are, but don't expect too much for $500. Also, does that budget include peripherals?
  3. http://msdn.microsoft.com/en-us/library ... 27(v=vs.85).aspx Yes, indeed, that would slightly improve rendering speed if the render target isn't updated very often, or often but not often enough that a render target would not help. But a texture copy operation is still very expensive, so you have to decide whether a giant amount of draw calls plus a texture copy operation (and creating a new texture and copying the data to it, which could take longer because of compression) over a lot less work, slightly slower rendering speed but better quality, and recreating the texture whenever the device is restored (which is the usual way, and also the simplest), is actually worth it.
  4. How can it possibly speed up drawing? Also I still don't understand how would it stop you from having to recreate resources, unless you copied the texture data back and forth between the system and the GPU memory every update, which is already a very expensive operation by itself, let alone be done 30-60 times a second.
  5. Render targets are simply 2D textures that you can draw to, therefore drawing a thousand rectangles to it once and then drawing the render target instead will obviously only draw it once. @IIYAMA, using dxGetTexturePixels is lame. There is onClientRestore, which is triggered whenever the game resets the D3D device (which is what causes specific types of resources to be destroyed - this includes render targets) to restore from a device lost state (e.g. minimize, loss of focus).
  6. ... or download the Lua binaries for Windows, which isn't all that heavy.
  7. What stat name? They're variables holding values returned by getAccountData.
  8. Actually, there is, through getlocal from the debug library, but the function you want to query the locals from must be active.
  9. You CAN access local functions from within the same file, just like a local variable (again, functions are stored in variables - function foo () end is syntatic sugar for foo = function () end, just like local function foo () end is syntatic sugar for local foo = function () end). Now, functions within functions are called closures, and local functions within another function are logically not accessible outside of it.
  10. I agree on this. However, I'd rather add new functions than adding an "is_string" parameter (or add a 'mode' parameter whose values could be either 'legacy' (default, current behavior) or 'raw').
  11. __newindex is triggered when one attempts to set the value of an index that doesn't yet exist in the table. __index is triggered when attempting to access the value of an index that doesn't exist in the table. That's why in my code the actual table data is stored internally in the metatable, so that __newindex is triggered every time you try to set the value of an index (since there is no such key in the actual table, it triggers the event).
  12. Yes, it is. Here's some quick code I wrote: local tablecount_mt = { __n = 0, __data = {}, __index = function ( t, k ) local metatable = getmetatable ( t ) if k == "__count" then return metatable.__n end return metatable.__data[k] end, __newindex = function ( t, k, v ) local metatable = getmetatable ( t ) if metatable.__data[k] then if v == nil then metatable.__n = metatable.__n - 1 else metatable.__n = metatable.__n + 1 end else metatable.__n = metatable.__n + 1 end metatable.__data[k] = v end } local myt = {} setmetatable ( myt, tablecount_mt ) myt["hi"] = "world" -- myt.__count == 1 myt["world"] = "hello" -- myt.__count == 2 myt["test1"] = "hi" -- myt.__count == 3 myt["world"] = nil -- myt.__count == 2 myt["hi"] = nil -- myt.__count == 1 myt["test2"] = 2 -- myt.__count == 2 print ( myt["test2"] ) It stores the table data in another table within the metatable, so __newindex is called for entries that were already added, which makes it possible to tell when an index was set to nil. Basically, what this code does is when you attempt to add a new index or change an index, it checks if the data already exists, if it does: it decrements the table size by one if the new value is nil, or increments by one if it isn't. If the data doesn't exist yet, it just increments the table size by one. Then, it stores the new data in the internal table. In the __index metatable event, we check if we're trying to access the index '__count' and returns the internal table size variable if so. Else, it just looks up the key in the internal data table.
  13. '\n' is one of the many escape characters.
  14. I edited my previous message by the time you posted this, take a look.
  15. Everything. Don't ever do that. Use a database management system. MTA supports the SQLite library and MySQL. But just for the record, you should call fileSetPos to set the position where reads and writes will take place.
  16. The builds provided are for testing purposes only. Jusonex stated above that the Awesomium branch will eventually be merged to the trunk and it will be part of MTA, once it is stable.
  17. ixjf

    MTA on GTA V

    Yes but someone already started doing GTA V MP Mod don't know how. http://v-multiplayer.org This is another multiplayer developed by some of the old IV:MP developers. That is going nowhere for sure.
  18. You can't export functions and coroutines (and most likely userdata too, unless it is recreated in the new Lua state pointing to the same memory address). Other types like number, string and table, however, can be copied.
  19. No point. [b]ping nerdgaming.org[/b] Pinging nerdgaming.org [[b]192.99.212.222[/b]] with 32 bytes of data: Reply from [b]192.99.212.222[/b]: bytes=32 time=154ms TTL=48 Reply from [b]192.99.212.222[/b]: bytes=32 time=272ms TTL=48 Reply from [b]192.99.212.222[/b]: bytes=32 time=148ms TTL=48 Reply from [b]192.99.212.222[/b]: bytes=32 time=179ms TTL=48 Ping statistics for 192.99.212.222: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 148ms, Maximum = 272ms, Average = 188ms And there are endless other options to find out the IP address any given domain points to.
  20. You can use midnightStar's filesystem module. Install it (follow the exact steps on the module's page), call createFilesystemInterface, create a translator with root in your resource's directory and use scanDir, scanDirEx or getFiles, depending on what you want.
  21. I'm not telling you to use that library, I mentioned it so you can see how to do it the native way. That's just the way it has to go due to the MTA OOP design.
  22. Take a look at sbx320's classlib.
  23. ixjf

    local function

    Local variables (this includes functions, because they're stored in variables too - function foo () is syntatic sugar for foo = function()) are indeed faster to access because they're stored on the stack. On the other hand, to access globals you must do a hash table lookup (in the environment table).
  24. Good luck holding a big community using someone else's work, even worse, leaked work.
  25. I assume that if you compare 3D positions between that collision shape and the vehicle's collision shape (see getElementColShape), that'd work. I wouldn't trust isElementWithinColShape to check if it's actually within the collision shape because it most likely also works the way you described above.
×
×
  • Create New...