How to insert a flatten switch in your scenery.cfg to deal with intruding mesh

kelticheart

Charter Member
How to insert a flatten switch in your scenery.cfg to deal with intruding mesh

A good day to everybody! :wavey:

Since this subject every so often keeps coming up in these pages, I decided to post again as a separate thread the explanation I just gave in Wulf190's thread about his problem with Martin Wright's Cliffs of Dover scenery.

Martin's Cliffs are treated by CFS2 as any other scenery object, that is a builiding, a tree, a vehicle, etc., which "sits" on top of the exhisting terrain mesh instead of blending in.

One way of dealing with an object floating partly in midair is entering a flatten switch in the scenery.cfg file at the specific layer regarding that particular scenery. This switch will "flatten" the area where a given object sits, thus keeping the object down to the ground.

Here's how my ETO scenery.cfg looks like at the Gary Burn's BoB airfields, which include the Cliffs of Dover entry:

[Area.056]
Title=Burn's Battle of Britain Airfields
Local=..\CFS2_Scenery\EUROPEAN_WF\CFS2BoB
Active=TRUE
Layer=56
Required=FALSE
Remote=
; Cliffs of Dover flatten
Flatten.0=0, N51 7.65, E1 19.76, N51 9.14, E1 22.43, N51 11.28, E1 24.00, N51 7.65, E1 24.37

And here's an explanation of the topic, sent to me back in March 2006 by our good Bearcat246:

"Another possible remedy is to use the MSCFS2 readme instructions to construct a flatten area with coordinates that match the altitude and area perimeter of the offended base, then put this 4-sided switch into the scenery.cfg layer of the Coastal flattens, like so:

[Area.009]
Title=CFS2 Coast Pacific
Local=..\CFS2_Scenery\ENHANCED TERRAIN\CFS2 Coast Pacific
Flatten.0=112.24,N51 12.88,E1 20.50,N51 12.74,E1 18.92,N51 14.22,E1 17.46,N51 13.80,E1 20.21
Remote=
Active=TRUE
Required=FALSE
Layer=9


You can use up to 10 flatten switches per area.XXX layer and up to 4 switches per base site. So if you use 4 switches total to do two bases in a given layer, you'll only have two left for the entire layer. But generally, it only really takes one switch to do an entire base if its not a sprawling complex."

The sintax of the flatten switch goes as follows:

Flatten.{switch number, 0 through 9}= {flatten altitude in feet}, {coordinates of the four corners of the area to be flattened, taken from Mission Builder overview of the area. Just point your mouse arrow and read altitude and the coords in the lower left corner of MB screen},

The coordinates must be listed in the switch in a clockwise sequence, starting from whichever corner you prefer. Each coordinate group must be separated by commas, leaving the last one out. Look at the above two examples to understand what I mean.

I hope this help, I double posted this in order to help people who would like saving this page as a future reference when installing new sceneries.

Cheers!
KH
:ernae:
 
I'm definetly saving this thread. Iv'e got a water hill due to mesh in some scenery I'm working on. Thanks Kelti.

BLONDI:cost1:
 
Hi all.

Using a flatten switch is similar to driving a tack with a sledge hammer. The area must be rectangular and aligned NSEW.

Using SCASM code, you can make a simple flatten BGL to place along with your other BGLS, and it will flatten anything in a previously loaded folder. It can be a complex shape, and doesn't need any particular alignment.

Code:
Header(    1    63.802575    63.780803    20.308845    20.258140    )
LatRange(    63.780803   63.802575    )

Area16n
 Elevation (    100
        63.794919    20.258140
        63.785648    20.268288
        63.780803    20.287888
        63.781640    20.308432
        63.789955    20.308845
        63.801439    20.291948
        63.802575    20.260162
    )
End16
The Header and LatRange are a tad tricky:
Code:
Header(   1  TopLat   BottomLat   RightLon   LeftLon  )

LatRange(   BottomLat  TopLat  )
Compile it with SCASM. The elevation in the above example is 100 meters. If you want sea level, make it 0. Make the poly points as either clockwise or counter-clockwise. I used decimal degrees, but scasm allows other formats as well ( 40.5 N40.5 N40:30.0000 N40:30:0.0000 ).

S40.5 can also be -40.5 W93.763 can also be -93.763

You can add more polys by adding new Area16n/End16 sections ( just be sure to adjust the Header and the LatRange ).

Somewhere on the web there may be a utility named FSTFlatten, but I seem to remember some problems with it... and it requires counter-clockwise point entry.

Dick
 
Many Thanks.....

to our experts on this scenery stuff. I suffer from brain drain at the slightest provocation and this thread is definitely a keeper.

Thanks again guys!

Cheers!:salute:
 
I agree.

Hi all.

Using a flatten switch is similar to driving a tack with a sledge hammer. The area must be rectangular and aligned NSEW.......

Absolutely. :salute:

Thank you for giving us your help!

Flatten switches are a quick and dirty way to take care of some scenery conflicts with installed mesh. More specifically, they are good to people without programming skills. Or, like yours truly, who's familiar with programming concepts, but his programming knowledge belongs to the Jurassic computing age to the point of being totally useless in CFS2 case.

When I am forced to use a flatten switch, I always hope someone with more abilities, as it just happened with Mask Rider's new GSL Marianas, creates the correct masks, flattens and excludes as part of a given scenery.

As you just rightly pointed out, the proper place for scenery adjustyments is among the *.bgl files belonging to an addon scenery pack.

On the other hand, I must say that flatten switches can yield some surprises. A given square must not necessarily be perfectly rectangular. The above Cliffs of Dover switch is actually shaped like an irregular trapezoid and it does not follow a NSEW alignment, but it works just as well. Although very limited, since we can only work with four corners, sometimes it does a temporary, yet sufficiently satisfying, job.

At any rate you wetted my appetite, Dick: where can a SCASM compiler, with user's instructions, be found?

Cheers!
KH
:ernae:
 
I recently made an airport using FSSC as a learning exercise. I also added a flatten box around the air strip. I’m no SCASM expert but it seems to me the code added for the flatten is as follows:

[Flat Area]
Name=DenPasarFlatten
AreaType=1
Extra1=.9146342
Extra3=1

[Point]
X=-588
Y=242.81

[Point]
X=506
Y=-385.19

[Point]
X=590
Y=-237.19

[Point]
X=-488
Y=405.38

I realize that many (most?) here already know this, but I’ll just throw it out as it may help another newbie like myself. Also, FSSC is Maskrider preference as I remember.
 
Oops

It hit me as soon as I Posted. My above code snippet is from a .scn file and is not a SCASM file (.sca).

The square brachets are a Win ini file thingy ("Section" followed by "Keys") and have no part in SCASM syntax.
 
Back
Top