{"action":"created","issue":{"url":"https://api.github.com/repos/OpenRA/OpenRA/issues/10975","repository_url":"https://api.github.com/repos/OpenRA/OpenRA","labels_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/10975/labels{/name}","comments_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/10975/comments","events_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/10975/events","html_url":"https://github.com/OpenRA/OpenRA/pull/10975","id":143521226,"number":10975,"title":"Add ScriptTags trait","user":{"login":"Phrohdoh","id":4861023,"avatar_url":"https://avatars.githubusercontent.com/u/4861023?v=3","gravatar_id":"","url":"https://api.github.com/users/Phrohdoh","html_url":"https://github.com/Phrohdoh","followers_url":"https://api.github.com/users/Phrohdoh/followers","following_url":"https://api.github.com/users/Phrohdoh/following{/other_user}","gists_url":"https://api.github.com/users/Phrohdoh/gists{/gist_id}","starred_url":"https://api.github.com/users/Phrohdoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phrohdoh/subscriptions","organizations_url":"https://api.github.com/users/Phrohdoh/orgs","repos_url":"https://api.github.com/users/Phrohdoh/repos","events_url":"https://api.github.com/users/Phrohdoh/events{/privacy}","received_events_url":"https://api.github.com/users/Phrohdoh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenRA/OpenRA/labels/PR:%20Changes%20requested","name":"PR: Changes requested","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-25T15:15:03Z","updated_at":"2016-03-28T21:09:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OpenRA/OpenRA/pulls/10975","html_url":"https://github.com/OpenRA/OpenRA/pull/10975","diff_url":"https://github.com/OpenRA/OpenRA/pull/10975.diff","patch_url":"https://github.com/OpenRA/OpenRA/pull/10975.patch"},"body":"This allows actors to be tagged with arbitrary strings.\r\nAlso includes `ScriptTagsInit` and `MapGlobal.ActorsWithTag`\r\n  which expose this functionality to map scripters.\r\n\r\n\r\nI am using this like such:\r\n```lua\r\n_paradrop_wps = {\r\n    ['a'] = Map.ActorsWithTag('paradrop_a'),\r\n    ['b'] = Map.ActorsWithTag('paradrop_b'),\r\n    ['c'] = Map.ActorsWithTag('paradrop_c'),\r\n    ['d'] = Map.ActorsWithTag('paradrop_d')\r\n}\r\n\r\n...\r\n\r\nSetupStartingForces = function(player)\r\n    local spawn2alpha = { 'a', 'b', 'c', 'd' }\r\n    for _, actor in ipairs(Map.NamedActors) do\r\n        local tag = 'owner_' .. spawn2alpha[player.Spawn]\r\n        if actor.HasTag(tag) then\r\n            actor.Owner = player\r\n        end\r\n    end\r\nend\r\n```\r\n\r\nref #10956"},"comment":{"url":"https://api.github.com/repos/OpenRA/OpenRA/issues/comments/202581896","html_url":"https://github.com/OpenRA/OpenRA/pull/10975#issuecomment-202581896","issue_url":"https://api.github.com/repos/OpenRA/OpenRA/issues/10975","id":202581896,"user":{"login":"Phrohdoh","id":4861023,"avatar_url":"https://avatars.githubusercontent.com/u/4861023?v=3","gravatar_id":"","url":"https://api.github.com/users/Phrohdoh","html_url":"https://github.com/Phrohdoh","followers_url":"https://api.github.com/users/Phrohdoh/followers","following_url":"https://api.github.com/users/Phrohdoh/following{/other_user}","gists_url":"https://api.github.com/users/Phrohdoh/gists{/gist_id}","starred_url":"https://api.github.com/users/Phrohdoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phrohdoh/subscriptions","organizations_url":"https://api.github.com/users/Phrohdoh/orgs","repos_url":"https://api.github.com/users/Phrohdoh/repos","events_url":"https://api.github.com/users/Phrohdoh/events{/privacy}","received_events_url":"https://api.github.com/users/Phrohdoh/received_events","type":"User","site_admin":false},"created_at":"2016-03-28T21:09:30Z","updated_at":"2016-03-28T21:09:30Z","body":"Rebased and renamed the trait."}}