Dialogue Plugin

Any idea how to get rid of crash on:

E:\UE_5.0\Engine\Source\Runtime\CoreUObject\Private\Misc\GCObjectReferencer.cpp line 165

"Please make sure all FGCObject derived classes have a unique name by overriding FGCObject::GetReferencerName() function. "

In editor it just spams the message log with call stack but when running debug from vs it will break on this error which is annoying. Tried implementing FGCObject methods in DialogueViewportWidget (object being collected) as error suggest but that didn’t help.

Please provide repro steps. What version of the plugin you’re using, what version of the engine, what OS, and what do you do in the Editor to reproduce it.

ue5.0 and plugin from the launcher, win10.
steps:
Open .sln, in visual studio
select ‘debug game editor’ in ‘solution configurations’ dropdown
hit f5
in editor open any dialogue asset
hit play button

Thanks. It can be fixed by adding the following code in DialogueEditor.h on line 44:

	virtual FString GetReferencerName() const override
	{
		return TEXT("FDialogueEditor");
	}

I’ll send an update to the marketplace today, it’ll probably get processed some time around Monday.

that worked, thanks

I have a new, proper crash but this time I don’t expect a fix since it doesn’t happen in blank project I’ve created to verify the cause, just letting you know :stuck_out_tongue:

[2022.04.20-06.40.42:000][961]LogWindows: Error: Assertion failed: [File:D:\build++UE5\Sync\Engine\Source\Developer\MessageLog\Private\Model\MessageLogListingModel.cpp] [Line: 68]
[2022.04.20-06.40.42:000][961]LogWindows: Error: GameplayTasksComponent /Game/09-Maps/UEDPIE_0_HomeIslandDetails.HomeIslandDetails:PersistentLevel.ChildActorNpc_GEN_VARIABLE_NPC_C_CAT_0.GameplayTasksComponent Object from PIE level still referenced. Shortest path from root: (standalone) Dialogue /Game/02-Blueprints/NPCs/MarcelleDialogue.MarcelleDialogue
[2022.04.20-06.40.42:000][961]LogWindows: Error: → UObject* UDialogue::Data.Events = GetMissionDialogueEvent_C /Game/02-Blueprints/NPCs/MarcelleDialogue.MarcelleDialogue:GetMissionDialogueEvent_C_0
[2022.04.20-06.40.42:000][961]LogWindows: Error: → Function /Game/02-Blueprints/NPCs/DialogueEvents/GetMissionDialogueEvent.GetMissionDialogueEvent_C:ExecuteUbergraph_GetMissionDialogueEvent::AddReferencedObjects( MarcelleNPC_C /Game/09-Maps/UEDPIE_0_HomeIslandDetails.HomeIslandDetails:PersistentLevel.MarcelleNPC_C_1)
[2022.04.20-06.40.42:001][961]LogWindows: Error: ^ FPersistentFrameCollectorArchive::operator<<() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp:3801]
[2022.04.20-06.40.42:001][961]LogWindows: Error: ^ FStructuredArchiveSlot::operator<<() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Serialization\StructuredArchive.cpp:508]
[2022.04.20-06.40.42:001][961]LogWindows: Error: ^ FInterfaceProperty::SerializeItem() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\PropertyInterface.cpp:143]
[2022.04.20-06.40.42:001][961]LogWindows: Error: ^ UStruct::SerializeBin() [D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:1077]

Happens when in event trying to use a passed npc ref (doesn’t have to be like on screenshot, happens also when trying to call interface method on it without setting the variable). Doesn’t crash right away but when exiting PIE.

If you can’t reproduce it in an empty project, I wouldn’t mind taking a look at your complete project. You can upload it to google drive and send it by email or PM.

nah, I would mind sending it to someone and got it to do what I need without using that ref :stuck_out_tongue:

Looks like modifying the dialogue events’ variable at runtime modifies it for the asset itself? Shouldn’t the dialogue object be instanced when playing rather than use the same instance that is edited?

Dialogues and Dialogue Events are UObjects. UObjects are static files with game data for all intents and purposes. I’ve given them a reference to the “World”, which allows them to use nodes like “get all actors of class”, which in turn could make you mistake them for actors, but they’re not. They don’t exist in the level, which means they have no separate runtime instances. UObjects have only one instance, it’s the file itself. So no, you can’t modify them, consider them read-only. You have to change your architectural approach if you were modifying them on runtime.

I didn’t really intended to, just noticed that I can and that change propagates from pie session to editor :stuck_out_tongue: Imo this was related to my problems with gc on session end, which went away when I modified the code to create copy of UDialogue & it’s events for game world.

How i can make the player “submit” he name?

Hey, love the plugin! How do I make it so that the first response from the NPC can change based on a condition? I have already tried to set it up but it doesn’t work :frowning: It always goes to the right-hand box even though the left-hand box has a condition that is ‘true’

Edit: Nevermind, my condition was causing the bug! Will leave this here incase anyone wants to see how to make this work :slight_smile:

Hi, I’m trying to locate this structure, I made a modification to the conditions, now if you fail in a condition the answer will appear but in red and cannot be pressed, but I want to decide what will appear in red or what will not appear.
image
i want to add a boolean on it

@Davi117 Sure. Check out the documentation, paragraph “7.8 Adding more variables to nodes”.

1 Like

Just wondering if there is a way to use an event condition to change the name variable in the dialogue? Can access it fine, but there’s no set name available. I want to use it to change an NPCs name half way through a conversation after the player discovers their name.
Any help appreciated!

It’s important to understand that dialogue files can’t be edited at runtime. They’re your cooked game data, much like a mesh file. Dialogues are data assets, and data assets aren’t editable at runtime. Imagine if they were: on your first playthrough you see some data, then you change it, and on your second playthrough you would see a different data. To prevent that, data assets aren’t editable.

If you’re going to reveal a different NPC name a lot, here’s what I’d do:

  • add a second text field for a name to a dialogue file (documentation paragraph 7.8)
  • create a dialogue event that tells your widget to start using the second name

But if you’re only going to change the name of the NPC once or twice, then simply add an event that sets the name to something else in the widget, without creating a second name field.

Thanks for the response, I think I was over thinking it a bit! Didn’t even consider just changing it in the widget. Thanks =)

I was following the tutorial for the typewriter effect but I can’t find the GetFirstChars node in blueprints. Is the tutorial not up to date anymore or am I missing something?

What version are you on? It was introduced in 4.27

1 Like