Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Credits: Lewisk3, gggmork
- import omg,random,copy
- mapFile = raw_input("Doom wad to resize: ")
- mapSize = input("How many maps to resize: ")
- w = omg.WAD(from_file=mapFile)
- #this didn't work on map 32 for some reason
- mapNames = ['MAP01', 'MAP02', 'MAP03', 'MAP04', 'MAP05', 'MAP06', 'MAP07', 'MAP08', 'MAP09', 'MAP10', 'MAP11', 'MAP12', 'MAP13', 'MAP14', 'MAP15', 'MAP16', 'MAP17', 'MAP18', 'MAP19', 'MAP20', 'MAP21', 'MAP22', 'MAP23', 'MAP24', 'MAP25', 'MAP26', 'MAP27', 'MAP28', 'MAP29', 'MAP30', 'MAP31']#, 'MAP32']
- if(mapSize > 0):
- mapNames = mapNames[:mapSize]
- print("Initalizing resize of " + str(mapSize) + " maps...")
- for name in mapNames:
- e = omg.MapEditor(w.maps[name])
- print("resizing " + name)
- for sector in e.sectors:
- sector.z_ceil *= 4
- sector.z_floor *= 4
- for vertex in e.vertexes:
- vertex.x *= 4
- vertex.y *= 4
- #1x1 thing will duplicate to 3x3, this list represents:
- #topleft,top,topright,left,right,bottomleft,bottom,bottomright (each will be current thing x minus (the number in this list multiplied by thing size) same for y)
- newThingXLoop = [-1,0,1,-1,1,-1,0,1]
- newThingYLoop = [1,1,1,0,0,-1,-1,-1]
- for i in range(len(e.things)):
- e.things[i].x *= 4
- e.things[i].y *= 4
- #if its not a player start or warp spot, prepare to duplicate thing to 3x3
- if e.things[i].type not in [11,1,2,3,4,87,14]:
- #if its an arach,cyber,manc
- if e.things[i].type in [68,16,67]:
- thingSize = 128
- #if its a mastermind
- elif e.things[i].type == 7:
- thingSize = 256
- else:
- thingSize = 64
- for c in range(8):
- newThing = copy.deepcopy(e.things[i])
- newThing.x = e.things[i].x + thingSize*newThingXLoop[c]
- newThing.y = e.things[i].y + thingSize*newThingYLoop[c]
- e.things.append(newThing)
- e.nodes = ''
- try:
- w.maps[name] = e.to_lumps()
- except:
- print("Skipping " + name + " too many VERTEXES, cannot resize.")
- w.to_file('output.wad')
- print 'done; outputed to: output.wad'
- input("Press enter to exit.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement