{"action":"created","issue":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3611","repository_url":"https://api.github.com/repos/wesnoth/wesnoth","labels_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3611/labels{/name}","comments_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3611/comments","events_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3611/events","html_url":"https://github.com/wesnoth/wesnoth/pull/3611","id":368814686,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxOTAzNzEy","number":3611,"title":"[WIP] add lua gamemap object for map generation.","user":{"login":"gfgtdf","id":4893136,"node_id":"MDQ6VXNlcjQ4OTMxMzY=","avatar_url":"https://avatars3.githubusercontent.com/u/4893136?v=4","gravatar_id":"","url":"https://api.github.com/users/gfgtdf","html_url":"https://github.com/gfgtdf","followers_url":"https://api.github.com/users/gfgtdf/followers","following_url":"https://api.github.com/users/gfgtdf/following{/other_user}","gists_url":"https://api.github.com/users/gfgtdf/gists{/gist_id}","starred_url":"https://api.github.com/users/gfgtdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfgtdf/subscriptions","organizations_url":"https://api.github.com/users/gfgtdf/orgs","repos_url":"https://api.github.com/users/gfgtdf/repos","events_url":"https://api.github.com/users/gfgtdf/events{/privacy}","received_events_url":"https://api.github.com/users/gfgtdf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-10T19:21:00Z","updated_at":"2018-10-11T14:27:41Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/wesnoth/wesnoth/pulls/3611","html_url":"https://github.com/wesnoth/wesnoth/pull/3611","diff_url":"https://github.com/wesnoth/wesnoth/pull/3611.diff","patch_url":"https://github.com/wesnoth/wesnoth/pull/3611.patch"},"body":"this pr does two things:\r\n\r\n1) Add a lua gamemap object whihc can be used in lua map generators which has the following funcions\r\n1.1) set_terrain, get_terrain, like the  usualy set/get_terrain functions, `map:set_location(loc, \"*^Gg\", \"overlay\")`\r\n1.2) a data fiels that basiciall serializes the map to a string `` local res = map.data\r\n1.3) get_locations, which accepts a custom lua filter table which is not wml, but similar to the usual filters\r\n```\r\n-- assuming lua helper functions f_terrain etc are defined properly.\r\nlocal locs = wesnoth.get_locations(\r\n  f_and(\r\n    f_terrain(\"Gg\"),\r\n    f_or(\r\n      f_adjacent(f_terrain(\"Mv\"), \"n\"),\r\n      f_x(\"0-1\")\r\n    )\r\n  )\r\n)\r\n```\r\nbut is easier to use form lua and has a clear tree structore that avoids certain hard to understand behviour of old location filter in particular wrt to `radius` and `not` etc.\r\n1.4) function to deal with startign locations.\r\n\r\n2) `wesnoth.generate_default_map` that invokes the default map generator from lua.\r\n\r\nOfc both things can easiyl be used together that is, by first letting the default mapgenerator do it's job and the do the finetuning with custom gamemap actions, this in in particual what some umc addons currently do and this code would make it very easy to do suhc things right in the mapgeneration code.\r\n"},"comment":{"url":"https://api.github.com/repos/wesnoth/wesnoth/issues/comments/428976378","html_url":"https://github.com/wesnoth/wesnoth/pull/3611#issuecomment-428976378","issue_url":"https://api.github.com/repos/wesnoth/wesnoth/issues/3611","id":428976378,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODk3NjM3OA==","user":{"login":"gfgtdf","id":4893136,"node_id":"MDQ6VXNlcjQ4OTMxMzY=","avatar_url":"https://avatars3.githubusercontent.com/u/4893136?v=4","gravatar_id":"","url":"https://api.github.com/users/gfgtdf","html_url":"https://github.com/gfgtdf","followers_url":"https://api.github.com/users/gfgtdf/followers","following_url":"https://api.github.com/users/gfgtdf/following{/other_user}","gists_url":"https://api.github.com/users/gfgtdf/gists{/gist_id}","starred_url":"https://api.github.com/users/gfgtdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfgtdf/subscriptions","organizations_url":"https://api.github.com/users/gfgtdf/orgs","repos_url":"https://api.github.com/users/gfgtdf/repos","events_url":"https://api.github.com/users/gfgtdf/events{/privacy}","received_events_url":"https://api.github.com/users/gfgtdf/received_events","type":"User","site_admin":false},"created_at":"2018-10-11T14:27:41Z","updated_at":"2018-10-11T14:27:41Z","author_association":"CONTRIBUTOR","body":"Ok the travis builds fail becasue the xcode projectiles are not updated for this, but that's nothing i can fix. \r\n\r\nThis pr curently targets 1.14 but it intended for master as soon as master is fixed, but also for a possible  1.14. featurerelease.\r\n\r\nminor changes to the filtersyntax still migth happen, but it is mostly complete."}}
{"actor":{"display_login":"gfgtdf"}}