Hello, I have a short question:
How can I destroy the NPC after I completed the whole Conversation?
I have a Close Button that closes a conversation whenever I want.
So with the Script I have right now the NPC is also being destroyed when I just close it.
Destroy NPC after Dialogue is completed
-
- Posts: 18
- Joined: Wed Jun 19, 2024 2:44 pm
Re: Destroy NPC after Dialogue is completed
Hi,
You could destroy it (or mark it for destruction) in the final dialogue entry of the conversation. For example, use the SendMessage() sequencer command. Say your NPC is the speaker of the final entry, and it has a script with a MarkForDestruction() method. Then set the final entry's Sequence to:
You could destroy it (or mark it for destruction) in the final dialogue entry of the conversation. For example, use the SendMessage() sequencer command. Say your NPC is the speaker of the final entry, and it has a script with a MarkForDestruction() method. Then set the final entry's Sequence to:
Code: Select all
{{default}}; SendMessage(MarkForDestruction)
-
- Posts: 18
- Joined: Wed Jun 19, 2024 2:44 pm
Re: Destroy NPC after Dialogue is completed
Hey Tony, thanks for the reply.
Is there a way I can do that without having to do it for every single NPC?
Sometimes a NPC has up to 4 Options for a dialogue to end.
Is there a way I can do that without having to do it for every single NPC?
Sometimes a NPC has up to 4 Options for a dialogue to end.
Re: Destroy NPC after Dialogue is completed
Maybe in your custom close button mark that the NPC shouldn't be destroyed.
-
- Posts: 18
- Joined: Wed Jun 19, 2024 2:44 pm
Re: Destroy NPC after Dialogue is completed
After trying out some things I finally found a solution that worked