Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling a stitch from Unity #330

Open
wearywitness opened this issue Jun 22, 2017 · 4 comments
Open

Calling a stitch from Unity #330

wearywitness opened this issue Jun 22, 2017 · 4 comments

Comments

@wearywitness
Copy link

I'm able to call a knot inside C# in Unity through this:
Choice choice = _inkstory.currentChoices[0];
currentpathname = choice.sourcePath.Substring(0, choice.sourcePath.IndexOf("."));
_inkstory.ChoosePathString(currentpathname);
This successfully diverts the story anytime to the knot named currentpathname.

But is there a way to get the knot name with the stitch and call the stitch in it later on?

Thanks in advance...

@joethephish
Copy link
Member

You should be able to simply call _inkStory.ChoosePathString("yourKnotName.yourStitchName"). Unless there's something more specific to your situation I don't understand? Not sure why you're splitting up the path using the dot separator?

@wearywitness
Copy link
Author

That's one part of the answer. Thank you.

I also need to receive the name for the stitch from ink to unity.
For example:
string currentpathname = choice.sourcePath.Substring(0, choice.sourcePath.IndexOf("."));
gives me the name of the knot. But how do I receive the name of the stitch as well.

@joethephish
Copy link
Member

In general, the scheme will be something like knotName.stitchName.otherInternalStuff. So, if you know that there should be a stitch name, then it will be the second component. However, if you're not in a stitch, it may be in the form knotName.otherInternalStuff, so you can't really know for sure.

@wearywitness
Copy link
Author

So will it be:
currentpathname = choice.sourcePath.knotName.stitchName?

Sorry, I am a bit new to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants