09-10-2012, 06:16 AM
Can I have cWorld::ForEachChunkInRect() exported in Lua? This seems to be a good thing for plugins optimisation... And this will shrink lua code ammount Since it's already there, won't be a big deal, right?
Working on Portals, related questions
|
09-10-2012, 06:16 AM
Can I have cWorld::ForEachChunkInRect() exported in Lua? This seems to be a good thing for plugins optimisation... And this will shrink lua code ammount Since it's already there, won't be a big deal, right?
09-10-2012, 06:24 AM
Well that one is a bit more involved, since it is using a multi-callback - one callback for coords, one for heightmap, another for biome map, blocktypes, blockmeta, ... Have a look at cChunkDataCallback in ChunkDef.h. Now I don't know how to make that Lua-accessible easily - should the function take a gazillion arguments, one for each callback function? Or a Lua object with functions assigned to it for each callback? Also, my Lua hacking skills are not up to this megatask.
11-03-2012, 01:03 AM
Wonderful. I updated from r856 (yeah, it's been a while) to r1017. Guess what? Portals are broken. And I have NO IDEA why, because this code:
Code: Player:SendMessage("SOME YOUR PORTAL STATE BELONG TO US! "..PlayersData[_name].portal_state) So, somehow if (PlayersData[_name].portal_state == -1) then is not a valid statement. Although it is. As it should be. But it isn't. Using == "-1" helped, but make whole code somewhat messy. tonumber() had no effect. Any ideas on why the f*ck did it happened?
11-04-2012, 01:18 AM
Ok, seems like bug is fixed.
What it was: Somehow using file = io.open(PLUGIN:GetLocalDirectory().."/portals_portals.dat", "w+") with "w+" mode caused data to be corrupted upon re-writing. Using just "w" mode works just fine (or, at least, seems to be fine at first test). I'll do some more my lua magic and then will upload updated version, I guess. In case anyone suffers the bug and needs it immediately I can provide quick-fixed version.
11-07-2012, 05:29 AM
Alright, it's not fixed still. For no obvious reason table with portals data corrupts. I have no idea why right now.
|
« Next Oldest | Next Newest »
|