Cloud Leveling

Interesting mapping tools and mapping help.

Moderator: Morax

Cloud Leveling

Postby Lionhardt » 15 Mar 2016, 23:03

The ones who have used clouds will have noticed, that the cloud height that is defined in the weather generator is a height relative to the markers height. Therefore if the different weather generators have different heights you will end up with clouds at various heights. I wrote quick script that levels all clouds, maybe somebody finds this useful.

Code: Select all
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]))
Last edited by Lionhardt on 17 Mar 2016, 16:51, edited 1 time in total.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Cloud Leveling

Postby speed2 » 15 Mar 2016, 23:11

How about updating wiki with this stuff togetherr how to make clouds, how to make them not annoyingly blocking view etc?
Thanks in advance :D
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: Cloud Leveling

Postby Lionhardt » 15 Mar 2016, 23:27

Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Cloud Leveling

Postby speed2 » 15 Mar 2016, 23:36

No, this FAF updated version I wrote http://wiki.faforever.com/index.php?title=Map_Editor

You could also add part how to work with world machine to generate heightmap
User avatar
speed2
Contributor
 
Posts: 3189
Joined: 05 Jan 2013, 15:11
Has liked: 636 times
Been liked: 1119 times
FAF User Name: speed2

Re: Cloud Leveling

Postby Lionhardt » 16 Mar 2016, 08:49

Code: Select all
[9a300742] 2016-03-16 06:48:56: Fatal exception of type MWException


??

I have no account and it won't let me make one...
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest