I want to create a NPC walking to given position. I started from moving 1 sqm, but it doesn't work. Here is a full code:
After greeting and saying "go", NPC says "Yes, Sir!" and still stands (no erros in console).
Of course, I'd like to move NPC for longer distance. I searched and found this thread. However there is used
doSteerCreature function, which doesn't exists.
Any tips?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if (msgcontains(msg, 'go')) then
selfSay("Yes, Sir!")
local pos = getCreaturePosition(getNpcCid())
pos.x = pos.x + 1
selfMoveTo(pos)
-- I tried also moveToPosition(pos)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Of course, I'd like to move NPC for longer distance. I searched and found this thread. However there is used
doSteerCreature function, which doesn't exists.
Any tips?