Page 1 of 1
Getting current tags in external function call (ink integration)
Posted: Tue Oct 15, 2024 3:38 pm
by nehvaleem
I am wondering is it possible to get the current tags of a line that has attached external function call using ink integration?
Code: Select all
* [Sentry: We might be ronin, but we still walk the path of honor.] {SetCharacterAttribute("sentry","ronin",1, true)} # LineTag_002_0201_6B477ABA_Sentry
I don't want to alter my SetCharacterAttribute calls, but instead in the SetCharacterAttribute call I would love to get current text and tags.
But when I do it the direct way I am getting empty strings only.
Code: Select all
Debug.Log($"Curernt tags: {string.Join(",", activeStory.currentTags)}");
this gives me empty results, despite the activeStory being ok. Am I missing something?
Re: Getting current tags in external function call (ink integration)
Posted: Tue Oct 15, 2024 7:34 pm
by Tony Li
Hi,
Is activeStory the one in DialogueSystemInkIntegration? If so, then as you said it should be valid, and the tags should be correct. Are the tags perhaps being applied to the line before or after that one?
Re: Getting current tags in external function call (ink integration)
Posted: Wed Oct 16, 2024 11:37 am
by nehvaleem
Yes, the activeStory is as follows:
Code: Select all
var activeStory = stories[0];
if (!activeStory || lastInkConversation == null) return;
Debug.Log($"tags: {string.Join(",",activeStory.currentTags)}, text: {activeStory.currentText}");
And in this case the both tags and currenttext returns empty string. I am using the tags for example in OnPrepareConversationLine and it is working there without any issues. Every line in my file has tags, so I should be able to get "something" and not empty strings. I am using 2.2.45 if that matters.
Re: Getting current tags in external function call (ink integration)
Posted: Wed Oct 16, 2024 11:51 am
by Tony Li
Hi,
I don't know. I'll need to look into this. The integration isn't doing anything particularly special with tags or activeStory, as you can see because it's good in OnPrepareConversationLine.
In your SetCharacterAttribute() method, does the rest of activeStory look correct?
Re: Getting current tags in external function call (ink integration)
Posted: Wed Oct 16, 2024 11:58 am
by nehvaleem
In your SetCharacterAttribute() method, does the rest of activeStory look correct?
I don't think it does. But it is exactly the same way as I accessing it in different places (like in OnPrepareConversationLine) that's why I am kind of lost here
Re: Getting current tags in external function call (ink integration)
Posted: Wed Oct 16, 2024 12:09 pm
by Tony Li
I'll try to reproduce the issue and see if I can figure out what's going on.
Re: Getting current tags in external function call (ink integration)
Posted: Wed Oct 16, 2024 5:43 pm
by Tony Li
Hi,
It looks like Ink processes things in order, so at the time SetCharacterAttribute() is called the story will not have the tag #LineTag_002_0201_6B477ABA_Sentry:
Code: Select all
* [Sentry: We might be ronin, but we still walk the path of honor.] {SetCharacterAttribute("sentry","ronin",1, true)} # LineTag_002_0201_6B477ABA_Sentry
Try putting the tag first, like:
Code: Select all
#LineTag_002_0201_6B477ABA_Sentry
* [Sentry: We might be ronin, but we still walk the path of honor.] {SetCharacterAttribute("sentry","ronin",1, true)}
This worked in my simpler test.