Giter Site home page Giter Site logo

Comments (7)

abadonna avatar abadonna commented on May 27, 2024 2

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.

astrochili avatar astrochili commented on May 27, 2024 1

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.

astrochili avatar astrochili commented on May 27, 2024

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.

ZeAntwan avatar ZeAntwan commented on May 27, 2024

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.

astrochili avatar astrochili commented on May 27, 2024

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.

astrochili avatar astrochili commented on May 27, 2024

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.

ZeAntwan avatar ZeAntwan commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.