Hi. I use TFS 1.5 downgrade by Nekiro to 8.0. I would like to add new greet and farewell keyword to npc like elves (ashari, asha thrazi). This is my npc.lua
NPC is not loaded when starting the engine. This error appears:
Lua Script Error: [Npc interface]
data/npc/scripts/ukea.lua
data/npc/scripts/ukea.lua:22: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
[C]: in function 'addGreetMessage'
data/npc/scripts/ukea.lua:22: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: ukea.lua
When I used downgrade version to 8.6, it worked ok. I was trying to do it with this method:
but also to no avail.
Secondly, any of my NPCs react to DECLINE message changes. All other message changes like GREET, FAREWELL, WALKAWAY etc work fine, except this one.
LUA:
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
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = 'Have you moved to a new home? I\'m the specialist for equipping it.'})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, text = 'I sell statues, tables, chairs, flowers, pillows, pottery, instruments, decorations, tapestries, and containers.'})
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({"heart pillow"}, 1685, 30, "heart pillow")
local focusModule = FocusModule:new()
focusModule:addGreetMessage({'hi', 'hello', 'ashari'})
focusModule:addFarewellMessage({'bye', 'farewell', 'asha thrazi'})
npcHandler:addModule(focusModule)
npcHandler:setMessage(MESSAGE_GREET, "Ashari, |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Asha Thrazi.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Asha Thrazi.")
npcHandler:setMessage(MESSAGE_DECLINE, "Hmm, but next time.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
NPC is not loaded when starting the engine. This error appears:
Lua Script Error: [Npc interface]
data/npc/scripts/ukea.lua
data/npc/scripts/ukea.lua:22: attempt to call method 'addGreetMessage' (a nil value)
stack traceback:
[C]: in function 'addGreetMessage'
data/npc/scripts/ukea.lua:22: in main chunk
[Warning - NpcScript::NpcScript] Can not load script: ukea.lua
When I used downgrade version to 8.6, it worked ok. I was trying to do it with this method:
Code:
keywordHandler:addGreetKeyword({'charach'}, {npcHandler = npcHandler, text = 'Ikem Charach maruk.'})
keywordHandler:addFarewellKeyword({'futchi'}, {npcHandler = npcHandler, text = 'Futchi!'})
Secondly, any of my NPCs react to DECLINE message changes. All other message changes like GREET, FAREWELL, WALKAWAY etc work fine, except this one.