[REQUEST] Paint area

  • The API is great! Although having named arguments instead of "paramInt1", "paramInt2", etc. is counter productive... It would be better to have them named so we actually know what they are...


    Aside from that, the World Edit script makes it possible to flatten a piece of land, etc., and put grass (well, make the area "green") where there is dirt, however when a player makes a nice slope (in dirt...) with the rake, it is not possible to make that slope "green" (in grass). Would it be possible to have a paint method? Instead of filling the area with data, just change the current blocks data to the specified value?


    Something like :


    world:paintTerrainInArea(c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12], blockID);

  • Although having named arguments instead of "paramInt1", "paramInt2", etc. is counter productive... It would be better to have them named so we actually know what they are...


    That's a result of decompiling ;) Of course we do not work with these misleading names. The official wiki will have productive names.


    Instead of filling the area with data, just change the current blocks data to the specified value?


    That makes sense, we will implement it ;)

  • Or you can just implement something like getTerrainBlockData(coordinates) etc. and leave paint-like requests to lua scripters =)


    The problem with that is that the current implementation will broadcast changes when calling world:setTerrainDataInArea. Providing a way to get block data and modify then would also require exposing the broadcast API, which opens a door to all sorts of flood scripts and such. It is just unwise to do so.


    This is similar to the world:placeBlock method, which only allows to place a single block, then broadcast the change to all users and the server. Implementing a script that would fill an entire area of blocks this way would probably saturate the network, or worst.


    On the other side, it could be possible to change all that by implementing a queue that would push chunks of modifications automatically, preventing any flood from a user (i.e. would detect and discard when trying to send too much data). Then, world:placeBlocks(...area coords, blockId) and world:getTerrainBlockData(coordinates) could be possible, as modifying the single block data would send modifications into the queue, thus modifying block data in batch would be fine.

  • Filling a whole area has the same cost (concerning network traffic) as changing a single block. But it would be a good idea to add a way to queue single "placeBlock" call. Especially when it will be a big modification (with lots of placeBlock-calls), compressing the message could also make sense (currently only big packets are being compressed).
    We will put it on our todo list :)


    Btw, about flood scripts: This is indeed a problem, but only if the server wants to flood a client. Since all scripts are running serverside, the client could not flood the server with Lua.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!