Page 1 of 1

Switching state of node doesn't impact journal and hud

Posted: Wed Aug 14, 2024 2:28 pm
by Daffy
Hello,
when I changed the quest node state (lets say from active to inactive) then in runtime view I can see this works, but in HUD and journal the entry is without any changes. I want to achieve that if I will switch quest node state from active to inactive it should go gray text in HUD and journal.

Anyone know how to achieve this?
I can enable and disable new entry in HUD and journal, but making them active/inactive does nothing to it

Re: Switching state of node doesn't impact journal and hud

Posted: Wed Aug 14, 2024 2:51 pm
by Tony Li
Hi,

If you want the inactive text to be a different color, you can use rich text codes:

colorGray.png
colorGray.png (218.13 KiB) Viewed 982 times

Or make a subclass of BodyTextQuestContent named something like InactiveBodyTextQuestContent, such as:

Code: Select all

public class InactiveBodyTextQuestContent : BodyTextQuestContent
{
    public override string runtimeText = $"<color=gray>{base.runtimeText}</color>";
}
and use this type of quest content instead of BodyTextQuestContent in your Inactive section.

Re: Switching state of node doesn't impact journal and hud

Posted: Thu Aug 15, 2024 5:10 am
by Daffy
I still think there is a huge bug.

I discovered something strange:
I have string asset to put into the body text in journal active and inactive.
Switching the states is working, but the text in journal doesnt go to gray. But if the state is inactive from begining then the text will be gray...
So I created another string asset. So asset string1 is in active state journal and asset string2 is in inactive state journal.
This one also doesnt work BUT if I add any character in string in asset string2 (even space or enter) then this will work. So active and inactive state needs to have two separate string assets, and they need to have different strings.

Re: Switching state of node doesn't impact journal and hud

Posted: Thu Aug 15, 2024 4:54 pm
by Tony Li
Hi,

If you're saying the <color=gray> issue is a bug, try a different color such as <color=#404040>. Here's an example:

QM_GrayHUD_2024-08-15.unitypackage

The scene uses a copy of the Harvest Carrots quest that shows some HUD elements in gray text. If you play the scene and accept the Harvest Carrots quest, it will look like:

gray.png
gray.png (708.62 KiB) Viewed 915 times

Note: I didn't add this quest to the quest database, so the example scene isn't set up to work with saving/loading. It's only intended to demonstrate the gray text.

Re: Switching state of node doesn't impact journal and hud

Posted: Mon Aug 26, 2024 7:20 am
by Daffy
I think you should re-read my post again. The bug is still there. I put example
"I discovered something strange:
I have string asset to put into the body text in journal active and inactive.
Switching the states is working, but the text in journal doesnt go to gray. But if the state is inactive from begining then the text will be gray...
So I created another string asset. So asset string1 is in active state journal and asset string2 is in inactive state journal.
This one also doesnt work BUT if I add any character in string in asset string2 (even space or enter) then this will work. So active and inactive state needs to have two separate string assets, and they need to have different strings."


The string asset can have simple one word lets say "clean". The same asset string cant be use of active and inactive.
I need to create second string asset with the same text to make one for active and second for inactive. But even this this will still not be working. I need to make a difference in string assets so the active will be "clean" and for inactive will be "active " (space at the end).

Re: Switching state of node doesn't impact journal and hud

Posted: Mon Aug 26, 2024 7:21 am
by Daffy
Maybe we can make a discord video call? Or something like that. I will show you what is happening. It will be 100x faster than 2 week discussion on forum

Re: Switching state of node doesn't impact journal and hud

Posted: Mon Aug 26, 2024 7:58 am
by Daffy
And still your solution is not working. It doesnt make a text grey. Like I said there is strange bug.
I create a script as you said, choose for inactive HUD and put string asset. It looks like even if the node state is switch to inactive (which you can see on screenshot) the HUD isn't refreshing it. The text is still white.

Re: Switching state of node doesn't impact journal and hud

Posted: Mon Aug 26, 2024 5:09 pm
by Tony Li
Hi,

Can you confirm that the example I provided (in this post) works? I can confirm that it works here.