Forged Alliance Forever Forged Alliance Forever Forums 2016-03-17T16:51:31+02:00 /feed.php?f=53&t=12018 2016-03-16T08:49:40+02:00 2016-03-16T08:49:40+02:00 /viewtopic.php?t=12018&p=122882#p122882 <![CDATA[Re: Cloud Leveling]]>
Code:
[9a300742] 2016-03-16 06:48:56: Fatal exception of type MWException


??

I have no account and it won't let me make one...

Statistics: Posted by Lionhardt — 16 Mar 2016, 08:49


]]>
2016-03-15T23:36:52+02:00 2016-03-15T23:36:52+02:00 /viewtopic.php?t=12018&p=122866#p122866 <![CDATA[Re: Cloud Leveling]]> http://wiki.faforever.com/index.php?title=Map_Editor

You could also add part how to work with world machine to generate heightmap

Statistics: Posted by speed2 — 15 Mar 2016, 23:36


]]>
2016-03-15T23:27:27+02:00 2016-03-15T23:27:27+02:00 /viewtopic.php?t=12018&p=122865#p122865 <![CDATA[Re: Cloud Leveling]]> http://supcom.wikia.com/wiki/Main_Page

Statistics: Posted by Lionhardt — 15 Mar 2016, 23:27


]]>
2016-03-15T23:11:26+02:00 2016-03-15T23:11:26+02:00 /viewtopic.php?t=12018&p=122862#p122862 <![CDATA[Re: Cloud Leveling]]> Thanks in advance :D

Statistics: Posted by speed2 — 15 Mar 2016, 23:11


]]>
2016-03-17T16:51:31+02:00 2016-03-15T23:03:56+02:00 /viewtopic.php?t=12018&p=122861#p122861 <![CDATA[Cloud Leveling]]>
Code:
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


]]>