mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 22:38:14 +00:00

The method of accessing terrain on the map has drastically changed. - wesnoth.get_terrain and wesnoth.set_terrain are both deprecated - wesnoth.terrain_mask still works but is moved into the wesnoth.map module and now takes the map object as the first parameter - The map's terrain is now accessed exclusively via indexing on the map object, ie map[{x,y}] - You set terrain by assigning a terrain code; the position of ^ in the terrain code now determines the merge mode - The replace_if_failed option is now manifested as a function that converts any terrain code into a special value that, when assigned to a location on the map, uses the replace if failed logic. The map object has a few attributes in it: - width and height are the total size, including borders - playable_width and playable_height are the values returned from wesnoth.get_map_size, which is now deprecated - border_size is the third value from wesnoth.get_map_size - data converts the map to a string - Special locations are now part of the map object. The length operator is deprecated. - other than that, wesnoth.map is treated as if it were the metatable of the map object