inkle / inkle/ink

Choices inside conditionals prevent knot from receiving divert more than once

Open
#478 5 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

### Working: Choice without conditional

If I create a story like this, it functions as expected whenever I divert to "test_case" using the Unity Ink Player:

```
=== test_case ===
Test prompt shown every time.
+ Choice 1
Response 1
+ Choice 2
Response 2
- (continue)
Ending text intended to be shown every time.
-> END
```

![image](https://user-images.githubusercontent.com/4694583/46184489-ad165f00-c28a-11e8-9716-c6c7bd4df52f.png)

### Not working: Choice with conditional

Now, if I want to make the prompt shown only the first time it is diverted to, I might do something like this:

```
=== test_case ===
{ test_case == 1:
Test prompt shown first time only.
+ Choice 1
Response 1
+ Choice 2
Response 2
}
- (continue)
Ending text intended to be shown every time.
-> END
```

This works okay for the first run divert to 'test_case'. Unfortunately on the second and all following diverts, this causes something strange to happen where Ink believes it is out of content:

![image](https://user-images.githubusercontent.com/4694583/46184575-11392300-c28b-11e8-82c7-4b5ef6e6a872.png)

It doesn't report it inside the console or Ink Player, but in my own project, Ink generates a

> RUNTIME ERROR: ran out of content. Do you need a '-> DONE' or '-> END'?

### Working: Conditional without choice

If I remove the choice inside the conditional, it works fine:

```
=== test_case ===
{ test_case == 1:
Test text shown first time only.
}
- (continue)
Ending text intended to be shown every time.
-> END
```

![image](https://user-images.githubusercontent.com/4694583/46184857-5447c600-c28c-11e8-98ef-db3c0e0e7b19.png)

---

Tested on Version 0.8.2

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two ink stories in the issue through the Unity Ink Player, diverting to test_case repeatedly and comparing the conditional choice with the conditional text case. Start by tracing how conditional content containing choices is evaluated, then verify that repeated diverts reach the ending without the reported "ran out of content" runtime error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.