{"action":"created","issue":{"url":"https://api.github.com/repos/inkle/ink/issues/131","repository_url":"https://api.github.com/repos/inkle/ink","labels_url":"https://api.github.com/repos/inkle/ink/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/inkle/ink/issues/131/comments","events_url":"https://api.github.com/repos/inkle/ink/issues/131/events","html_url":"https://github.com/inkle/ink/issues/131","id":166923178,"number":131,"title":"[Discussion] External functions use cases","user":{"login":"facelesspanda","id":13928490,"avatar_url":"https://avatars.githubusercontent.com/u/13928490?v=3","gravatar_id":"","url":"https://api.github.com/users/facelesspanda","html_url":"https://github.com/facelesspanda","followers_url":"https://api.github.com/users/facelesspanda/followers","following_url":"https://api.github.com/users/facelesspanda/following{/other_user}","gists_url":"https://api.github.com/users/facelesspanda/gists{/gist_id}","starred_url":"https://api.github.com/users/facelesspanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facelesspanda/subscriptions","organizations_url":"https://api.github.com/users/facelesspanda/orgs","repos_url":"https://api.github.com/users/facelesspanda/repos","events_url":"https://api.github.com/users/facelesspanda/events{/privacy}","received_events_url":"https://api.github.com/users/facelesspanda/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-21T21:33:38Z","updated_at":"2016-07-22T00:20:15Z","closed_at":null,"body":"Hello,\r\n\r\nI fail to understand the real value of externals functions.\r\n\r\nThe way I see it, Ink is a middleware language between the writer and the developpers: the writer writes the ink script, the developpers develop the game and in some ways call out for the ink script and get text to display, be it character dialogues, narration, or object descriptions.\r\n\r\nA team may settle conventions for parsed ink lines in the game (you can see this in the Unite presentation for Ink, where character dialogues are created with a `name:` pattern), but that should be it: the ink script should process a narration flow, provide narrative info to the game, and not much more.\r\n\r\nI can understand the use of ink functions, when you have complex character statistics that will change the narrative but not the gameplay, but external functions are functions that are executed by the actual game engine, so they resort to game development and game flow, thus have no narrative value (that I can see) and should not be called in a narrative script.\r\n\r\nThe examples that I can see here and there are examples such as `3 times 4 is {multiply(3, 4)}.` or `~image(\"file.jpg\")` but in both cases I fail to see the point of having a bound external function: Mathematical functions can be written in the ink file, and things like displaying an image could very well be done by a text parser at the reception of ink text info.\r\n\r\nAnyone with a light to help me see what I can't yet?"},"comment":{"url":"https://api.github.com/repos/inkle/ink/issues/comments/234422402","html_url":"https://github.com/inkle/ink/issues/131#issuecomment-234422402","issue_url":"https://api.github.com/repos/inkle/ink/issues/131","id":234422402,"user":{"login":"nullObjectPtr","id":11605299,"avatar_url":"https://avatars.githubusercontent.com/u/11605299?v=3","gravatar_id":"","url":"https://api.github.com/users/nullObjectPtr","html_url":"https://github.com/nullObjectPtr","followers_url":"https://api.github.com/users/nullObjectPtr/followers","following_url":"https://api.github.com/users/nullObjectPtr/following{/other_user}","gists_url":"https://api.github.com/users/nullObjectPtr/gists{/gist_id}","starred_url":"https://api.github.com/users/nullObjectPtr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nullObjectPtr/subscriptions","organizations_url":"https://api.github.com/users/nullObjectPtr/orgs","repos_url":"https://api.github.com/users/nullObjectPtr/repos","events_url":"https://api.github.com/users/nullObjectPtr/events{/privacy}","received_events_url":"https://api.github.com/users/nullObjectPtr/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T00:20:15Z","updated_at":"2016-07-22T00:20:15Z","body":"It really depends on the kind of game you are making. Simpler uses if ink may not have much need for external functions. \r\n\r\nGames that want a tighter interaction of dialog and gameplay would need them more. On the project I am working on, external functions are absolutely essential. They were one of the primary reasons we chose Ink over others as our narrative engine.\r\n\r\n1. Read info from an external gamestate.\r\n\r\nA (silly) use case:\r\nImage writing a dialog that was tailored to react to the health of a character. Characters close to death would get existential, and quote Jean-Paul Sartre all the time. A Character's health is modified during turn-based fight sequences, outside of ink control. An external function would be needed to read this data.\r\n\r\n2. Write info to external gamestate.\r\n\r\nUse case. A hard-to-reach part of a dialog tree would result in rewarding the character with 100 gold. Gold is spend in a shop on battle items, completely outside of the purview of ink."}}
{"actor":{"display_login":"nullObjectPtr"}}