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.
Making an NPC change dialog after transaction
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.
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.
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
- 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
Simple.
Pretty simple. You just have to link anoither page to the 'nextpage' of the response, where is the GiveItem action located.
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.";
}
}
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
Re: Making an NPC change dialog after transaction
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?ramon.dexter wrote:Simple.
Pretty simple. You just have to link anoither page to the 'nextpage' of the response, where is the GiveItem action located.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."; } }
- 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
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.
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.
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
Re: Making an NPC change dialog after transaction
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?";
}
}
Code: Select all
Actor BlueKey : BlueCard replaces BlueCard
EDIT: By the way, thank you for helping me with this, I do appreciate it.
- 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
I see one issue.
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.
Code: Select all
conversation
{
//Conman Clown with Blue Key
id = 3;
actor = "ConmanClown";
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.