Skip to main content
Topic: How to finding slope of a tile? (Read 1765 times) previous topic - next topic

How to finding slope of a tile?

Since I don't know German, I'm having difficulty in locating the code that finds the type of slope for a tile.  My own computer actually does not have internet access currently, so I can't just browse the internet for a translation.  (I use a thumb drive to transfer the ST source and pak files, in case you were wondering.) 

On a side note, I've been able to modify simworld.cc to keep the "apron" around the edge of the map from being lowered so as to keep the original heights from the height-map generation, but do not know how to apply the graphic for the "rocks and dirt" that appears in most paks when creating an artificial slope (ie, one raising purely in one of the four main comp**** directions).  Yes, I actually want the ground to be 6+ tile heights tall on the edge of the map, compared to the surrounding "ocean". 

Coders, any help please?

Re: How to finding slope of a tile?

Reply #1
This can be found all in boden/grund.cc: grund_t::slope is the slope of a tile. It is a bitfield: 0/1 for each corner of the tile.

The vertical slope graphics are computed in grund_t::calc_back_bild(), these graphics belong to the tile in front of them. But there is the restriction that these graphics have max height 2 compared to the base height of the tile in front of them.

But if you want to use these graphics at the border of the map, it will not work: since there are no tiles outside of the map to keep track of the graphics. Here, it would be better to modify simview.cc:
karte_ansicht_t::display(bool force_dirty) directly, where the outside of the map (ie the ocean) is drawn.
Parsley, sage, rosemary, and maggikraut.