Making an NPC change dialog after transaction

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:

Making an NPC change dialog after transaction

Post by Hidden Hands »

I have an NPC that has a key item and requires a lot of money before he gives it to you. But once you've got it, he needs to change what he says - instead of offering to sell you it again each time you speak to him. How do I do this please?

Thanks in advance.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Making an NPC change dialog after transaction

Post by ramon.dexter »

Simple.

Code: Select all

conversation
{
  ID = 1;
  Page//1
  {
    Name = "Name";
    Dialog = "What he tells you when he gives you key";
    Choice
    {
      Text = "I will accept the key";
      Nextpage = 2;
      Giveitem = "bigKey";
    }

  }
  Page//2
  {
    Name = "Name";
    Dialog = "What he tellsw you when you have the key.";
  }

}
Pretty simple. You just have to link anoither page to the 'nextpage' of the response, where is the GiveItem action located.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Making an NPC change dialog after transaction

Post by Hidden Hands »

ramon.dexter wrote:Simple.

Code: Select all

conversation
{
  ID = 1;
  Page//1
  {
    Name = "Name";
    Dialog = "What he tells you when he gives you key";
    Choice
    {
      Text = "I will accept the key";
      Nextpage = 2;
      Giveitem = "bigKey";
    }

  }
  Page//2
  {
    Name = "Name";
    Dialog = "What he tellsw you when you have the key.";
  }

}
Pretty simple. You just have to link anoither page to the 'nextpage' of the response, where is the GiveItem action located.
Strange errors are happening. None are noticed on game bootup. But when I talk the to NPC after the transaction now, zdoom crashes. Also, another error, when the NPC gives me the key, it doesn't unlock the door its for and instead still says I need a key.But if I put all keys cheat in, that works fine. Wtf?
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Making an NPC change dialog after transaction

Post by ramon.dexter »

Use gzdoom, development of zdoom was stopped. Or Qzdoom, if you want to use software renderer. But zdoom is outdated.

Also, as I wrote somewhere else, without your code, I cannto help with anything. The example provided by me upper is working. So I need to see your code. Also, your key code. It seems that you are missing some points.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Making an NPC change dialog after transaction

Post by Hidden Hands »

Code: Select all

conversation
{
    //Conman Clown with Blue Key
	id = 3;
	actor = "ConmanClown";
	page//1
	{
	     name = "Bilker the Clown";
		 dialog = "Uhhh... uh.... sorry there friend. I can't let you in the nursery because it is locked. I have a key, but it will cost you!";
		 choice
		 {
		     text = "Give me the key!";
                     nextpage = 2;
			 yesmessage = "Ohh lovely shiny bubbles... OKAY take the key and run along.";
			 giveitem = "BlueKey";
			 closedialog = true;
			 cost
			 {
			     item = "BubbleCur";
				 amount = 300;
			 }
			 displaycost = true; // Displays "For x" at the end of the option.
			 nomessage = "Sorry friend, come back when you have more bubbles.";
          }
		  
  }
  page//2
  {
    name = "Bilker the Clown";
    dialog = "Run along then, friend. What are you waiting for?";
  }

}
It doesn't crash anymore it works. Strange. Issue NOW is that the key not working. It works fine when I change "bluekey" to "bluecard" which makes no sense, because I already used

Code: Select all

Actor BlueKey : BlueCard replaces BlueCard
So I have no idea how to fix that.

EDIT: By the way, thank you for helping me with this, I do appreciate it.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Making an NPC change dialog after transaction

Post by ramon.dexter »

I see one issue.

Code: Select all

conversation
{
    //Conman Clown with Blue Key
   id = 3;
   actor = "ConmanClown";
It's either ID or actor. When you use ID (which I consider superior over actor), you are free to assign the ID to any actor in the map. Don't use "actor", when you use "ID".

The second issue might be the key. I'm using pretty different system for keys - my keys are simple actors inheriting from "custominventory" and check for the keys is coded in ACS.
Locked

Return to “Editing (Archive)”