Dialogue Problem

i’m having a dialogue problem here
when the player collide with one npc it turns all the npcs dialogue with the same first npc dialogue
like this :

heres the events that i used:

and the same events for the other npc with just a little bit of changes(like collisions etc).
I was thinking of attaching IDs for the NPC’s so any other ideas please

1 Like

I can already see the problem in your code: The NPC value seems to be given to all characters on screen, because there is no way that the game can differentiate between different NPCs if it isn’t told which ones are which. Check your code for the other NPC and make sure that the target object in the conditions column is named differently from the first NPC. Try something like “NPC_2”. There might be a way to differentiate NPCs using a string variable, but I don’t have the skill to do anything like that. Someone else on here might.

i see what are talking about. To be honest i dont have any idea too how to do it

@ZeroX4 a hand here please :sweat_smile:

Right click any event choose add and for each object

I’m sorry I didn’t understand ?

Using this event you can set it to some object
So whatever you set in this event will happen only to object of this type IF condition is satisfied

So if you have player is in collision with object display text above object
It will happen only to object in which player is collision with and not to all of them

i did it bust i still have the same problem here :


but still when the player is in collision with other npc id doesn’t show anything

but with the first npc it works normal

Can you try moving it outside the “for each” event, then using the “not” condition and inserting the collision event inside it? (do not invert the collision event)

i tried it but it’s the same .
is there any other Dialogue system methods that i can use ??
btw i used this method https://www.youtube.com/watch?v=UI4QEAviHnU&t=805s4

so here is some updates:
when the player collides with the first npc it gives the first problem and after finishing the dialogue if the player goes to the second npc it gives him the last dialogue that the npc should say like this

i tried going to him first but the game glitches and freezes when pressing the “e” button
heres a reorded video explaining what’s going on :https://youtu.be/NVOV2hzXYKA

Instead of inverting condition
Add condition and type in search bar NOT

Add not and put that in for each then in NOT put not inverted condition to hide object

And in your case for each should apply to object you collide with

i’m really sorry but i didnt understand what should i do ?

Are you using any form of link system to link each dialog box to its own NPC?

[Events…]: Action “link dialogBox to NPC
[Events…]: Condition “take account all dialogBox linked to NPC

Because I would recommend you to do that

I was thinking of of it but i don’t know how to do it