{"action":"opened","issue":{"url":"https://api.github.com/repos/Nightfall/Instrumentality/issues/5","labels_url":"https://api.github.com/repos/Nightfall/Instrumentality/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Nightfall/Instrumentality/issues/5/comments","events_url":"https://api.github.com/repos/Nightfall/Instrumentality/issues/5/events","html_url":"https://github.com/Nightfall/Instrumentality/issues/5","id":101157933,"number":5,"title":"Animation scripting and In game editor","user":{"login":"Victorious3","id":3749322,"avatar_url":"https://avatars.githubusercontent.com/u/3749322?v=3","gravatar_id":"","url":"https://api.github.com/users/Victorious3","html_url":"https://github.com/Victorious3","followers_url":"https://api.github.com/users/Victorious3/followers","following_url":"https://api.github.com/users/Victorious3/following{/other_user}","gists_url":"https://api.github.com/users/Victorious3/gists{/gist_id}","starred_url":"https://api.github.com/users/Victorious3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Victorious3/subscriptions","organizations_url":"https://api.github.com/users/Victorious3/orgs","repos_url":"https://api.github.com/users/Victorious3/repos","events_url":"https://api.github.com/users/Victorious3/events{/privacy}","received_events_url":"https://api.github.com/users/Victorious3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-15T10:18:23Z","updated_at":"2015-08-15T10:18:23Z","closed_at":null,"body":"In order to compete with Custom Steve, those two are mandatory.\r\nAs a follow up to a discussion on IRC, I will sum op the basic points:\r\n\r\n1. Everything is backed by java\r\n2. Scripting is done with Lua or a similar scripting language that wraps 1\r\n3. The in game editor will support a basic interpolation based animation system that outputs the files of 2. In order to distinct between scripted animations (that would have to be converted to interpolation based), the animation file would be marked as being scripted, and thus allow closures as parameters\r\n\r\nAn implementation could look like this:\r\n```lua\r\nanimation \"anim_1\" {\r\n    animation \"anim_arms\" {\r\n       bone(\"arm_l\").rotate(0, 210, 0),\r\n       bone(\"arm_r\").rotate(0, -210, 0)\r\n    }.interpolation(linear).during(20),\r\n    bone(\"leg_l\").rotate(10, -10, 10),\r\n    play(anim_arms)\r\n}.repeat(10)\r\n```\r\n\r\nA scripted animation would be declared like this:\r\n```lua\r\nanimation_closure \"anim_2\" {\r\n    function ()\r\n        local y = rotation()\r\n        bone(\"arm_l\").rotate(0, y)\r\n    end\r\n}.repeat(5)\r\n```"}}