Switching state of node doesn't impact journal and hud

Announcements, support questions, and discussion for Quest Machine.
Post Reply
Daffy
Posts: 19
Joined: Wed Feb 06, 2019 1:17 pm

Switching state of node doesn't impact journal and hud

Post 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
Attachments
q3.png
q3.png (237.07 KiB) Viewed 1168 times
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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 1160 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.
Daffy
Posts: 19
Joined: Wed Feb 06, 2019 1:17 pm

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

Post 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.
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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 1093 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.
Daffy
Posts: 19
Joined: Wed Feb 06, 2019 1:17 pm

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

Post 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).
Daffy
Posts: 19
Joined: Wed Feb 06, 2019 1:17 pm

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

Post 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
Daffy
Posts: 19
Joined: Wed Feb 06, 2019 1:17 pm

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

Post 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.
Attachments
obraz_2024-08-26_135816517.png
obraz_2024-08-26_135816517.png (64.75 KiB) Viewed 435 times
eh1.png
eh1.png (684.15 KiB) Viewed 435 times
User avatar
Tony Li
Posts: 22085
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Hi,

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