otxserver icon indicating copy to clipboard operation
otxserver copied to clipboard

NPC with another NPC's speech

Open p0t1nh0 opened this issue 3 years ago • 14 comments

I think it's the weirdest problem I've ever seen happen on a server, I have no idea what it causes. Sometimes on my server, when I talk to an NPC it responds as if it were another, example: my NPC Djin sometimes responds as if it were my NPC Task, it's very strange, the console doesn't give any error. Then I say "bye" and say "hi" again and he responds normally, has anyone been through this? Using OTX 2.

I managed to reproduce the problem: a person is talking to an NPC, if I arrive and say "hi", he will say he is busy. If the person is still trapped in that NPC and I talk to another free NPC, he will say that there is a person before me, as if he was occupied. When the first person leaves the NPC and I talk to anyone else, the NPC's next speech will be that of the first NPC I spoke to, when he was serving a person.

https://www.youtube.com/watch?v=hxQvhAuAW6c&ab_channel=p0t1nh0

p0t1nh0 avatar Oct 25 '22 16:10 p0t1nh0

in the final compilations of 7.7 this was fixed... it will be a matter of reviewing that date and giving you the link and you compile said change

mattyx14 avatar Jan 10 '23 04:01 mattyx14

in the final compilations of 7.7 this was fixed... it will be a matter of reviewing that date and giving you the link and you compile said change

i cant find this fix Mattyx...tried to merge with new npc codes, new libs...do you have changelog to this fix?

p0t1nh0 avatar Feb 19 '23 15:02 p0t1nh0

This problem on 8.6 too

MohamedRefaat avatar Feb 20 '23 16:02 MohamedRefaat

in the final compilations of 7.7 this was fixed... it will be a matter of reviewing that date and giving you the link and you compile said change

Got link with changes Mattyx? If u can send to us, i know a lot of servers with this bug.

p0t1nh0 avatar Feb 20 '23 17:02 p0t1nh0

src use U?

mattyx14 avatar Feb 20 '23 17:02 mattyx14

src use U?

Something like this, same libs from NPC files:

https://github.com/brewsterl/RealOTX-7.72

p0t1nh0 avatar Feb 20 '23 17:02 p0t1nh0

try it https://fastupload.io/en/75oE9k7RWK4zIJz/file

mattyx14 avatar Feb 20 '23 22:02 mattyx14

try it https://fastupload.io/en/75oE9k7RWK4zIJz/file

Now i dont have queue problem anymore, but npc who use default.lua script dont sell anything.

Follow mine default.lua script for some NPCs:

``local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end

npcHandler:addModule(FocusModule:new())``

p0t1nh0 avatar Feb 20 '23 22:02 p0t1nh0

try it https://fastupload.io/en/75oE9k7RWK4zIJz/file

And NPC who use default.lua looks like this:

`

<parameters>
	<parameter key="module_shop" value="1" />
	<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell {exp scroll} (1h 50% more exp) for 15kk, {vip ticket} (1 day area vip) for 17kk." />
	<parameter key="shop_buyable" value="exp scroll,5161,15000000;vip ticket,2236,17000000" />
	</parameters>
`

p0t1nh0 avatar Feb 20 '23 22:02 p0t1nh0

try <parameter key="shop_buyable" value="exp scroll,5161,1,15000000;vip ticket,2236,1,17000000" />

mattyx14 avatar Feb 21 '23 06:02 mattyx14

try <parameter key="shop_buyable" value="exp scroll,5161,1,15000000;vip ticket,2236,1,17000000" />

Dont work, When npc use default.lua it dont answer, no errors on console. Another NPCs seems to work fine, just npcs who use default.lua (simply sellers) dont work with new lib files.

p0t1nh0 avatar Feb 21 '23 08:02 p0t1nh0

try <parameter key="shop_buyable" value="exp scroll,5161,1,15000000;vip ticket,2236,1,17000000" />

To make it clear, im using 7.72 protocol, i dont have "trade" option, just talking to NPC, i saw ur libs have "trade" option to talk. When i try to use trade:

2023-02-21 10:52:15 - [Error - NpcScript Interface] 2023-02-21 10:52:15 - data/npc/scripts/default.lua:onCreatureSay 2023-02-21 10:52:15 - Description: 2023-02-21 10:52:15 - data/npc/lib/npcsystem/modules.lua:1358: attempt to call global 'getShopOwner' (a nil value) 2023-02-21 10:52:15 - stack traceback: 2023-02-21 10:52:15 - data/npc/lib/npcsystem/modules.lua:1358: in function 'callback' 2023-02-21 10:52:15 - data/npc/lib/npcsystem/keywordhandler.lua:42: in function 'processMessage' 2023-02-21 10:52:15 - data/npc/lib/npcsystem/keywordhandler.lua:177: in function 'processNodeMessage' 2023-02-21 10:52:15 - data/npc/lib/npcsystem/keywordhandler.lua:136: in function 'processMessage' 2023-02-21 10:52:15 - data/npc/lib/npcsystem/npchandler.lua:377: in function 'onCreatureSay' 2023-02-21 10:52:15 - data/npc/scripts/default.lua:7: in function <data/npc/scripts/default.lua:7>

p0t1nh0 avatar Feb 21 '23 13:02 p0t1nh0

try <parameter key="shop_buyable" value="exp scroll,5161,1,15000000;vip ticket,2236,1,17000000" />

Can u help us to fix Mattyx?

p0t1nh0 avatar Feb 22 '23 10:02 p0t1nh0

try <parameter key="shop_buyable" value="exp scroll,5161,1,15000000;vip ticket,2236,1,17000000" />

can u help us Matt? Maybe just remove NPC queue?

p0t1nh0 avatar Mar 06 '23 00:03 p0t1nh0