Ezzz-dev/OTHire

Another NPC Issue regarding conversation

Closed this issue · 7 comments

when you speak to npc for quests, if they have around 5 different things to say based on one trigger word they will only say the last thing and skip the rest.

Sounds like bad scripting. Post the NPC script you're having issues with and let us have a look!

@JasonRox18
can you post a NPC script that handles this issue?

here's an example;- it says the last message only
elseif msgcontains(msg, 'pipe') or msgcontains(msg, 'Pipe') then
npcHandler:say("Oh, there's a waterpipe in one of my cells? ...", 10)
npcHandler:say("I guess my last prisoner forgot it there.", 15)
talk_state = 0

here's my edit with 'false' which allows the npc to say everything but all at once, no delay between sending
msgcontains(msg, 'prisoner') or msgcontains(msg, 'Prisoner') then
npcHandler:say("My last prisoner? Hmm. ...", false)
npcHandler:say("I think he was some guy from Darama. Can't remember his name. ...", false)
npcHandler:say("He was here just for one night, because he got drunk and annoyed our citizens. ...", false)
npcHandler:say("Obviously he wasn't pleased with this place, because he headed for Thais the next day. ...", false)
npcHandler:say("Something tells me that he won't stay out of trouble for too long.", false)
talk_state = 0

i believe this is where the problem is, the delay which should be a value but is a true or false option instead in the npc handler as below;-

function NpcHandler:say(message, shallDelay) if(shallDelay == nil) then shallDelay = true end if(NPCHANDLER_TALKDELAY == TALKDELAY_NONE or shallDelay == false) then selfSay(message) return end self.talkDelay.message = message self.talkDelay.time = os.time()+self.talkDelayTime end

Actual code doesn't handle more than one reply, regardless of delay, code should be added to handle those sort of issues.

i want to learn.. were shouldd i start @peonso