Talking to an NPC.

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Talking to an NPC.

Post by Hidden Hands »

I'm having a seriously difficult time with this. I cannot get my NPC to speak or interact with it. I had replaced the twitching human corpse on a pole with two stationary sprites of my NPC that I want to INTERACT with in order to have him speak to me. But I have no idea what to do. I have had a similar problem with coding merchants, but this is even more important and I have absolutely no idea where to begin.

I need:

To walk up to my NPC (he stands right at the beginning of MAP01) and interact with him (the same way you would to open a door or activate a switch) and have a dialogue box pop up on screen as you do so with text inside of what he says. Please help me with this as I can't really progress unless someone can help me do this. It's really important that he speaks before any monsters show up because his purpose is to give advice before the game begins.

So:
POL6A0
POL6B0
Both of these DOOM decoration sprites have been replaced with my own two frames of an NPC that just stands at the beginning of the level and I need to be able to interact with him for a simple dialogue box (player does not need to have any responses back - just need the NPC to simply speak one line of text or something as a sort of 'tip'). My game runs as Doom in Doom format.

Please can someone help me, it would save me so much bother and I really do need this. Thank you so much in advance.
User avatar
eppn5
Posts: 87
Joined: Thu Sep 22, 2016 6:43 am

Re: Talking to an NPC.

Post by eppn5 »

User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Talking to an NPC.

Post by Hidden Hands »

Looking into it now, thanks.

Can someone also please tell me the DECORATE SUMMON NAME of the impaled human twitching decoration?
User avatar
Caligari87
Admin
Posts: 6236
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Talking to an NPC.

Post by Caligari87 »

The wiki is your friend, it has DECORATE definitions for all the actors in every game. [wiki]Classes:Doom[/wiki]. Check the "Gore" section.

8-)
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Talking to an NPC.

Post by Hidden Hands »

Gotcha. Thanks man. It's Livestick. The problem now is getting the character to actually have a dialog box and speak. I can't seem to get this code to work correctly. I can't figure out why.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Talking to an NPC.

Post by ramon.dexter »

You don't really need actor names to use ZSDF. All you need, is to place actors, give them conversation ID's and then link the conversation via assigned ID's. No need to mess with actornames. And also, what kind of editor are you using? gzDoombuilder shows the actornames...
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Talking to an NPC.

Post by Hidden Hands »

Cannot believe the stupidest MISTAKE i EVER MADE in a game code. The only reason my code wasn't working was because I left out an "=" symbol before the script start...

Thanks to everyone here for the help though. It's very much appreciated.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Talking to an NPC.

Post by Hidden Hands »

Another little issue I was wondering if can be fixed - what do you do if you have two NPC's that use the same class and sprites etc (basically, the same character but placed in two different parts of the map) and you want each one to have different dialogue? Is this possible?
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Talking to an NPC.

Post by Nash »

Hidden Hands wrote:Another little issue I was wondering if can be fixed - what do you do if you have two NPC's that use the same class and sprites etc (basically, the same character but placed in two different parts of the map) and you want each one to have different dialogue? Is this possible?
1) Use "ID = <some number>" in the ZSDF (it has to be top level... I think it is supposed to be used in place of the "Actor" field but I could be wrong. You can try both or just one and see which one works)
2) Set the Thing's Conversation ID to use in GZDoom Builder on a per-Thing basis (right-click the specific Thing you want to give a different ConversationID for, Action/Tag/Misc tab, Conversation ID is in the "Behavior" section to the top right)

https://zdoom.org/wiki/Actor_properties#ConversationID
https://zdoom.org/wiki/ZDoom_Strife_Dialog_Format
https://github.com/rheit/zdoom/blob/mas ... _zdoom.txt
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Talking to an NPC.

Post by Hidden Hands »

Sorted. Thanks for the help, it's much appreciated.
Locked

Return to “Editing (Archive)”