Comments (7)
Just checked the original Unity asset.
If ContinueMaximally() method is called - external function called first, same behaviour as in Narrator.
If Continue() method is called and only 1 paragraph is returned - external function called as @ZeAntwan wants it to be called ...
It's pretty straightforward, story starts to read ink script, and if it needs to return result - story just stops, so in case of single paragraph - it just returned and in case of multiple - every function calls processed and paragraphs are being generating until story finally finds the choice.
from narrator.
That's definitely how it works now. The continue(x)
function just returns already prepared paragraphs.
If it doesn't work that way in the other frameworks, it's probably a Narrator design bug 😔.
You can also check out this implementation that works with compiled js files - https://github.com/abadonna/defold-ink/tree/main/ink
from narrator.
Hi!
As I understand it, you mean that after calling story:begin()
or story:choose(answer)
there is a complete internal paragraphs execution with all external functions called, and then the host game can pop paragraphs from the ready-to-read stack. So there is no way to place an external call between paragraph output. Am I right?
from narrator.
Yes, I think that matches the issue I'm having. So far, I've only tried using story:continue()
and was expecting that doing story:continue(1)
would only process one line, and not the whole paragraph before returning a line. I haven't tried choose to see if something similar happen (but would expect it to after looking at the code and my understanding of it).
And I will double check, but I believe this applies to any kind of variable operation too, so setting a value anywhere in the paragraph, will set the value when the knot is jumped to instead of wait for it to be "read".
In my example, the "phonebook" function should add something only once the line is read, which seems to be the behaviour of most other ink libraries I'm using for C# (but I could be wrong)
(Note: for my specific purpose, I found a workaround using tags, but result in kind of duplicated logic for my use where I would tag a line with the function call to then handle it manually, so not the cleanest or most reliable solution)
from narrator.
We've had a little chat with @abadonna about this and to be honest, we're not sure if other plugins do things differently.
Yes, it would have to be tested to make that claim. But logical reasoning about the liquid nature of paragraphs, when often without code execution it is not clear where the paragraphs are and where they are not, up to the fact that functions themselves can return a whole set of paragraphs... give the impression that the current behaviour is correct.
And for your idea, indeed, tags are suitable. Or splitting into blocks by an additional intermediate choice, which is "especially" automatically handled in the game. The second way seems to be the most architecturally correct for your example.
from narrator.
Thanks for checking that out.
That's very interesting, sounds like not an obvious difference in behaviour. It turns out if calling continue(1) 3 times is not the same as calling contnue(3) 🤯
On the other hand, Ink has always had room for ambiguity 🙃
from narrator.
Thanks for looking into it, and sorry I did not provide the test. I'm using Godot, which uses a port of the Unity/C# implementation of it and that might be what threw me off.
It's always been a fight for me to understand how to "properly" use ink when trying to do adventure or dialogue box bas games that show dialogues line by line.
With that said, like you mentioned, while I still need to go a bit deeper, I might be able to manage using tags for now 🙂
from narrator.
Related Issues (17)
- String constants are not converted to lua. HOT 2
- Add script_api file for Defold HOT 1
- It is impossible to fetch the current paragraph HOT 1
- Threads
- Divert target as a variable type
- Assigning string evaluations to variables
- Multiple parallel flows
- Choice's title can't contain vars, inline conditions or alternatives HOT 3
- Choice can't have few conditions like * { a } { b }.
- Add function`TURNS()` and `TURNS_SINCE()`
- Not possible to use custom order of numeric values in List like `4, 7, 12...`
- VARS declared before first knot not listed under global variables table entry HOT 1
- A comment in the middle divides the paragraph
- Example doesn't show how bindings/observe work HOT 2
- Convert camelCase to snake_case
- Inline condition results must be not trimmed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from narrator.