Random Chitchat 2012-2016
I think it does fill the chunk with air, but since you don't un-set the "default" flags, MCServer then overwrites whateer you did with the normal chunk generator data.
You should fill the chunk using cChunkDesc:FillBlocks(), then use cChunkDesc::SetUseDefaultBiomes(false), cChunkDesc::SetUseDefaultHeight(false), cChunkDesc::SetUseDefaultComposition(false), cChunkDesc::SetUseDefaultStructures(false) and cChunkDesc::SetUseDefaultFinish(false). This way you'll turn off the parts of the generator that you don't want (i. e. all of them).
Thanks given by:
it works thanks. but now i have the problem that the server spams out with the error:
Code:
UnboundRelGetBlock(): requesting a block with a_RelY out of range: 16777215
once a chunk is generated.
also is there a way to find the ChunkX and ChunkZ at certain coordinates? like if i do World:GetChunkX(BlockX, BlockY) becouse then i can find the chunks coordinates at the spawn
Thanks given by:
Put a breakpoint in the cChunk::UnboundRelGetBlock() function and find out who's calling it with such a wild value.

in c++:
ChunkX = BlockX >> 4;
ChunkZ = BlockZ >> 4;

Dunno if Lua has the same bit-wise shift operator. We should definitely export some helper function for that
Thanks given by:
yea uhm whats a breakpoint Wink i also found that it only spammed if i am using /regeneratechunk.
EDIT:
and now its not spamming anymore without me doing anything ;P
Thanks given by:
Breakpoint is one of the most useful tools in debugging.
http://en.wikipedia.org/wiki/Breakpoint
In Visual studio, just hit F9 to toggle a breakpoint on the line with the caret. The program then pauses when it reaches the line, and you can see all sorts of things about it - what functions have been called to lead to that point, their parameters, what are the variables' values etc. Obviously you need to do that in Visual Studio and you need a debugging version of MCServer for that.
Thanks given by:
but how would it look in lua? i was thinking about
ChunkX = math.modf(BlockX / 16) 
ChunkZ = math.modf(BlockZ / 16)
becouse one chunk is 16 blocks long
Thanks given by:
Use floor instead of mod
Thanks given by:
But would that work with negative numbers?
Thanks given by:
i've finished the limit world thing and made it configurable within the console but now i want to add a reload/restart button in the webadmin. the only problem i have now is that
		cRoot:Get():ServerCommand("restart")
does not work.
also
cRoot:Get():ServerCommand("stop") 
doesn't work and becouse of that the /stop command in-game does not work.
Thanks given by:
(03-11-2013, 11:34 PM)STR_Warrior Wrote: But would that work with negative numbers?

yes
Thanks given by:




Users browsing this thread: 94 Guest(s)