I think it would be a nice addition to be able to open a story to a specific line - especially for engines integration.
A use-case example - working with Unity, I allow designers to select a knot to associate with a dialogue component (so upon player interaction we play that specific knot).
I would like to add an "open knot" button in the Unity Inspector, as the story file can get quite long.
Unity provides opening an asset with a specific line number and column: https://docs.unity3d.com/ScriptReference/AssetDatabase.OpenAsset.html
I'm not entirely sure how they pass these, but I would think it's just additional command line arguments, e.g. "story.ink 21 9"
--
I've taken the liberty to peruse the Inky source code a bit! (hopefully that's not out of place, apologies if it is)
I believe the required changes would be:
main.js : 197 - check if after a file has been set to open, there's also a numerical argument
save that to something like "pendingPathToOpenLine"
pass it to ProjectWindow.open in line 209
in projectWindow.js : 37 - add a constructor overload that takes a line number and jumps to that on open
do some magic that makes Electron scroll to the correct line
I think it would be a nice addition to be able to open a story to a specific line - especially for engines integration. A use-case example - working with Unity, I allow designers to select a knot to associate with a dialogue component (so upon player interaction we play that specific knot). I would like to add an "open knot" button in the Unity Inspector, as the story file can get quite long. Unity provides opening an asset with a specific line number and column: https://docs.unity3d.com/ScriptReference/AssetDatabase.OpenAsset.html
I'm not entirely sure how they pass these, but I would think it's just additional command line arguments, e.g. "story.ink 21 9"
--
I've taken the liberty to peruse the Inky source code a bit! (hopefully that's not out of place, apologies if it is) I believe the required changes would be: