C:\TopoMC>buildworld.py --region Badlands --world Worlds/Badlands Creating world from region Badlands Traceback (most recent call last): File "C:\TopoMC\BuildWorld.py", line 119, insys.exit(main(sys.argv)) File "C:\TopoMC\BuildWorld.py", line 88, in main mcmap.initWorld(args.world, minX, minZ, maxX, maxZ, processes) File "C:\TopoMC\mcmap.py", line 64, in initWorld arrayData[arrayKey] = SharedMemArray(zeros((chunkWidth,chunkWidth,chunkHeight),dtype=uint8)) File "C:\TopoMC\multinumpy.py", line 108, in __init__ self.data = ndarray_to_shmem(arr) File "C:\TopoMC\multinumpy.py", line 44, in ndarray_to_shmem arr.size) File "C:\Python26\lib\multiprocessing\__init__.py", line 241, in RawArray return RawArray(typecode_or_type, size_or_initializer) File "C:\Python26\lib\multiprocessing\sharedctypes.py", line 57, in RawArray return _new_value(type_) File "C:\Python26\lib\multiprocessing\sharedctypes.py", line 37, in _new_value wrapper = heap.BufferWrapper(size) File "C:\Python26\lib\multiprocessing\heap.py", line 190, in __init__ block = BufferWrapper._heap.malloc(size) File "C:\Python26\lib\multiprocessing\heap.py", line 170, in malloc (arena, start, stop) = self._malloc(size) File "C:\Python26\lib\multiprocessing\heap.py", line 92, in _malloc arena = Arena(length) File "C:\Python26\lib\multiprocessing\heap.py", line 38, in __init__ self.buffer = mmap.mmap(-1, self.size, tagname=self.name) WindowsError: [Error 8] Not enough storage is available to process this command
pymclevel: Minecraft Levels for Python
#41
Posted 26 February 2011 - 12:53 AM
#42
Posted 22 March 2011 - 04:51 PM
Traceback (most recent call last): File "./BuildWorld.py", line 47, inIf I create a chunk and write to it and am done with it, how do I make it save to the region file or at least close the open file descriptors? Thanks!File "./BuildWorld.py", line 41, in main File "/home/jmt/git/TopoMC/mcarray.py", line 127, in loadArrays File "/home/jmt/git/TopoMC/mcarray.py", line 112, in loadArray File "../pymclevel/mclevel.py", line 3795, in createChunk File "../pymclevel/mclevel.py", line 1792, in __init__ File "../pymclevel/mclevel.py", line 1898, in create File "../pymclevel/mclevel.py", line 1906, in save File "../pymclevel/mclevel.py", line 2870, in _saveChunk File "../pymclevel/mclevel.py", line 2310, in saveChunk File "../pymclevel/mclevel.py", line 2366, in _saveChunk File "../pymclevel/mclevel.py", line 2155, in file File "../pymclevel/mclevel.py", line 2149, in IOError: [Errno 24] Too many open files: 'Worlds/Portland/region/r.9.-8.mcr'
#43
Posted 22 March 2011 - 06:10 PM
#44
Posted 22 March 2011 - 07:41 PM
Jack.
ETA: corrected array dimensions
#45
Posted 22 March 2011 - 08:41 PM
#46
Posted 22 March 2011 - 09:31 PM
codewarrior said:
Jack.
#47
Posted 27 March 2011 - 12:46 AM
#48
Posted 23 July 2011 - 12:37 AM
treeBlocks = (mychunk.Blocks==world_0.materials.Leaves.ID) #0 treeBlocks |= (mychunk.Blocks==world_0.materials.Wood.ID) chunk.Data[treeBlocks] = 2 #1 #2
#0: I think this searches all blocks in that chunk and does a comparison to materials.X.ID, which results in a 3 dimensional array using numPy (I haven't used that yet, but type() returns <type 'numpy.ndarray'>) of True/False. The True/False values type() returns numpy.bool_, does that some how contain a reference to the block? Or does it later loop all X/Y/Z cords, and If treeblock[x][z][y] == True: change block ID?
#1: The '= 2' turns the selected chunk into birch trees. I don't understand where the number two comes in. If I change it to something else, lets say 10, it will turn all the trees into regular trees.
#2: How does [treeBlocks] end up changing all of the blocks? Could you point me to where in the code it does that?
Thanks for any help.
#49
Posted 23 July 2011 - 01:25 AM
akaGrim, on 23 July 2011 - 12:37 AM, said:
treeBlocks = (mychunk.Blocks==world_0.materials.Leaves.ID) #0 treeBlocks |= (mychunk.Blocks==world_0.materials.Wood.ID) chunk.Data[treeBlocks] = 2 #1 #2
#0: I think this searches all blocks in that chunk and does a comparison to materials.X.ID, which results in a 3 dimensional array using numPy (I haven't used that yet, but type() returns <type 'numpy.ndarray'>) of True/False. The True/False values type() returns numpy.bool_, does that some how contain a reference to the block? Or does it later loop all X/Y/Z cords, and If treeblock[x][z][y] == True: change block ID?
#1: The '= 2' turns the selected chunk into birch trees. I don't understand where the number two comes in. If I change it to something else, lets say 10, it will turn all the trees into regular trees.
#2: How does [treeBlocks] end up changing all of the blocks? Could you point me to where in the code it does that?
Thanks for any help.
#0: That's right. You're comparing an array to a number and returning a boolean array with one element for each element in the original array. It's the same shape as the original array which means you can use the boolarray in indexing operations to access only the parts of the original array where the boolarray is true. It doesn't contain a reference to the original array or its elements, but what's important is being the same shape (x,y,z dimensions) so that numpy can correlate the elements in one array with those in the other array.
#2: [treeBlocks] is the numpy array indexing operator. In this instance, you're telling it to choose elements of the array based on the true/false values in treeBlocks. It will set only the elements of chunk.Data where the corresponding element of treeBlocks is true. (Specifically, it's the set-array-item operator, since you're typing chunk.Data[treeBlocks] = <something> in the same statement. If you were to just write chunk.Data[treeBlocks], the result of that would be a 1-D array of the elements of chunk.Data where treeBlocks is true. This is a subtle difference.)
#1: It could be better written as chunk.Data[treeBlocks] = world_0.materials.BirchWood.blockData. The Data array has "extra data" for each block in the Blocks array to define the wood species, wool color, or other things depending on the block type.
#50
Posted 23 July 2011 - 06:07 PM
#51
Posted 24 July 2011 - 02:54 AM
akaGrim, on 23 July 2011 - 06:07 PM, said:
You have to set chunk.Blocks[treeBlocks] to change the block type to Lava (Still), and then set chunk.Data to change the lava's level to 0, which means a full source block. If you want the game to process the lava and make it flow the next time you play, use LavaActive instead.
chunk.Blocks[treeBlocks] = alphaMaterials.LavaStill.ID chunk.Data[treeBlocks] = 0
#53
Posted 25 July 2011 - 04:31 AM
akaGrim, on 25 July 2011 - 03:27 AM, said:
NameError: name 'alphaMaterials' is not defined
#54
Posted 25 July 2011 - 08:06 PM
xolotl, on 25 July 2011 - 04:31 AM, said:
I figured it out myself this morning. mclevel does a 'from materials import alphaMaterials' so I just used mclevel.alphaMaterials and then it worked.
#55
Posted 12 August 2011 - 04:07 PM
http://pastebin.127001.org/1741
Here's a screenshot of the test run I did where I turned 10% of all the air blocks into lapis (and stopped the script before it had processed all the chunks, obviously)
http://img.127001.or...-lot-of-ore.png
#56
Posted 27 August 2011 - 03:17 PM
i posted a thread
http://www.minecraft..._1#entry7662782
#57
Posted 31 August 2011 - 04:53 PM
Jack.
#58
Posted 31 August 2011 - 05:22 PM
world1.copyBlocksFrom(world2, world2.bounds, destinationPoint)
#59
Posted 01 September 2011 - 03:01 PM
Quick question: Is there a way to specify which generator gets used? (Skylands vs Nether vs Normal)
The volume of a pizza of thickness a and radius z can be described by the following formula: pi*z*z*a
#60
Posted 01 September 2011 - 03:14 PM
Eggplant!, on 01 September 2011 - 03:01 PM, said:
Quick question: Is there a way to specify which generator gets used? (Skylands vs Nether vs Normal)
There's no way to explicitly ask for Nether terrain, but it will be generated whenever you ask it to generate chunks into a Nether level. If you want to have Nether terrain on Earth, you'll have to explicitly use copyBlocksFrom to put it there.
The above is notoriously incompatible with Bukkit since Bukkit changes the directory layout of multidimensional worlds.








