inkle / inkle/ink

[Discussion] conditional choice text evaluation

Open
#75 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

So I've noticed that if you embed logic in the text of a conditional choice, that logic will be evaluated even if the conditional is false:
- {false} [{myVar += 1}]

This means that the choice text is evaluated even though the conditional dictates the choice will not be available.

I 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)?

I 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:

~ temp hasEnoughFood = Food() > 10
- {hasEnoughFood} [{ShowFoodChoice(0, -10, "eat food")}]

{AlterFood(-10)}
- [starve]

The 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".

This 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.

EDIT: it printed my *'s as bullet points

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.