示例#1
0
    print
    "done writing signs"
    with open("4.part", "wb") as f:
        for npc in data["npcs"]:
            set_npc(f, npc)
        set_npc(f, None)
    print
    "done writing npcs"
    with open("5.part", "wb") as f:
        set_trail(f, (1, data["header"]["name"], data["header"]["ID"]))
    print
    "done writing trail"
    name = "world1.wld"
    from binarysplit import join

    join(name, True)  #this just puts all the binary parts into one world file
    print
    "done joining world " + name  #yay!
    print
    "A world has been created!"

else:
    print("parsing header")
    world = World(path)
    print("parsing tiles")
    tiles = []
    for tile in world.tiles:
        tiles.append(tile)
    print("parsing chests")
    chests = []
    world.ready_chests()
示例#2
0
        ##        else:
        ##            ntile = tile
        ##    elif tile[2] > 0:
        ##        ntile = (tile[0], tile[1], -tile[2], tile[3])
        ##    else:
        ##        ntile = tile
        z += 1

        if not z % (100 * world.header["height"]):
            print
            "%6.2f%% done reading content" % (
                z * 100.0 / (world.header["width"] * world.header["height"]))
            x += 1
world.make_split()
from binarysplit import join

y = z
with open("1.part", "wb") as a:
    for t in tiles:
        set_tile(a, t)
        if not z % (world.header["height"] * 100):
            print
            "%6.2f%% done writing content" % (
                (y - z) * 100.0 /
                (world.header["width"] * world.header["height"]))
        z -= 1
print("done writing tiles")
join("world7.wld")
print
"done"
示例#3
0
        ##        if random()>0.01:
        ##            ntile = (1, tile[1], tile[2], tile[3])
        ##        else:
        ##            ntile = tile
        ##    elif tile[2] > 0:
        ##        ntile = (tile[0], tile[1], -tile[2], tile[3])
        ##    else:
        ##        ntile = tile
        z += 1

        if not z % (100 * world.header["height"]):
            print
            "%6.2f%% done reading content" % (z * 100.0 / (world.header["width"] * world.header["height"]))
            x += 1
world.make_split()
from binarysplit import join

y = z
with open("1.part", "wb") as a:
    for t in tiles:
        set_tile(a, t)
        if not z % (world.header["height"] * 100):
            print
            "%6.2f%% done writing content" % ((y - z) * 100.0 / (world.header["width"] * world.header["height"]))
        z -= 1
print("done writing tiles")
join("world7.wld")
print
"done"