Skip to content

Retreiving text id ("#n": "g-x") at runtime for localisation #166

Description

@GieziJo

First off, just wanted to say thanks a lot for this amazing tool, we have been using it in our upcoming game Hermit, and it is just awesome to handle dialogues!

The one thing I am a big concerned about is localisation. After reading a lot of opinions I came to the conclusion that avoiding inline variables, using ids for each line and pairing this with a dictionary would be the way to go (here, here and inkle/ink#529).
I am not entirely convinced by the solutions provided in the linked articles to create these IDs though.

Looking at the generated .json, it seems like every text line already contains a tag, something of the sorts of "#n": "g-3". Pair this with the current knot and this creates a unique ID.

My question is thus:

Is it possible to retrieve this g-tag at runtime?

I'm thinking about something of the like of story.currentID (which does not exists).
I wouldn't mind adding this to the integration, but not sure where to do it.
In JsonSerialisation.cs I saw the lines

if (keyVal.Key == "#n") 
   container.name = keyVal.Value.ToString ();

But I haven't been able to figure out how the tag is then used.

Extracting all the lines from the json should be easy enough if that part is possible.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions