{"action":"opened","issue":{"url":"https://api.github.com/repos/inkle/ink/issues/75","repository_url":"https://api.github.com/repos/inkle/ink","labels_url":"https://api.github.com/repos/inkle/ink/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/inkle/ink/issues/75/comments","events_url":"https://api.github.com/repos/inkle/ink/issues/75/events","html_url":"https://github.com/inkle/ink/issues/75","id":153073716,"number":75,"title":"[Discussion] conditional choice text evaluation","user":{"login":"crustforever","id":6498456,"avatar_url":"https://avatars.githubusercontent.com/u/6498456?v=3","gravatar_id":"","url":"https://api.github.com/users/crustforever","html_url":"https://github.com/crustforever","followers_url":"https://api.github.com/users/crustforever/followers","following_url":"https://api.github.com/users/crustforever/following{/other_user}","gists_url":"https://api.github.com/users/crustforever/gists{/gist_id}","starred_url":"https://api.github.com/users/crustforever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crustforever/subscriptions","organizations_url":"https://api.github.com/users/crustforever/orgs","repos_url":"https://api.github.com/users/crustforever/repos","events_url":"https://api.github.com/users/crustforever/events{/privacy}","received_events_url":"https://api.github.com/users/crustforever/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-04T17:44:34Z","updated_at":"2016-05-04T17:44:34Z","closed_at":null,"body":"So I've noticed that if you embed a function in the text of a conditional choice, that function will be called even if the conditional is false:\r\n\r\n* {false} [{myVar += 1}]\r\n\r\nThis means that the choice text is evaluated even though the conditional dictates the choice will not be available.\r\n\r\nI am wondering if this behavior could be changed to postpone evaluation of the choice text until after the conditional (or perhaps there is a reason it can't or shouldnt be changed)?\r\n\r\nI know that it doesn't make a whole lot of sense to put game state changes in the choice text, as they will happen whether that choice is picked or not, but here's an example from my game that shows a situation where it could be desirable because of external function bindings:\r\n\r\n~ temp hasEnoughFood = Food() > 10\r\n\r\n* {hasEnoughFood} [{ShowFoodChoice(0, -10, \"eat food\")}]\r\n     {AlterFood(-10)}\r\n* [starve]\r\n\r\nThe key part here is the ShowFoodChoice external function.  That is a function that replaces the 0th choice label that would be created in the GUI with a special choice label in the GUI that visually shows the player the amount of food being used (10 in this instance) and also prints the text \"eat food\".\r\n\r\nThis is not a perfect example, and I know that I could just put the ShowFoodChoice function in the conditional part and pass the boolean into it, but I'm just curious as to what you guys think of the evaluation of logic inside conditional choice text."}}