[9a300742] 2016-03-16 06:48:56: Fatal exception of type MWException
Statistics: Posted by Lionhardt — 16 Mar 2016, 08:49
Statistics: Posted by speed2 — 15 Mar 2016, 23:36
Statistics: Posted by Lionhardt — 15 Mar 2016, 23:27
Statistics: Posted by speed2 — 15 Mar 2016, 23:11
import sys
from sys import argv , stderr
def level_clouds(fileIn, fileOut, targetHeight):
with open(fileIn, "r") as fileIn:
fileIn = fileIn.readlines()
with open(fileOut, "w") as fileOut:
for i, line in enumerate(fileIn):
if "'cloudHeight'" in line:
for j in range(0,10):
if "position" in fileIn[i+j]:
markerHeight = float(fileIn[i+j].split(", ")[1])
break
left = line.split("FLOAT( ")[0]
line = left+"FLOAT( "+str(targetHeight - markerHeight)+" ),\n"
fileOut.write(line)
if __name__ == '__main__':
if not len(argv) == 4:
stderr.write("usgae:\npython level_clouds.py <input map_save.lua> <output> <desired cloud height>\n")
sys.exit()
else:
level_clouds(argv[1] , argv[2] , float(argv[3]))
Statistics: Posted by Lionhardt — 15 Mar 2016, 23:03