• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fallen's NPC Maker v1.4 (using talkState)

I been working on it for 1 day now, hopefully it will get done by 2marrow or so, stay tuned!
 
Released!

Download sources + binaries: Npc Maker tar gz

Sources can be found under src, binaries can be found under bin.
Please read the README
 
@up

It dosent work lol?

Click add dosent work, don't understand anything. Nothing works.
 
& it writes a new file with the name in the same folder as npc maker :p
 
this is not XML, this is LUA, please check topic name (using talkState)
 
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)
local talkState = {}
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


function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid)
	then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	end

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

It created the file, but it's nothing in it? I tried some (player: hi / npc: hello world!)
 
did you add anything? it works fine here:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)
local talkState = {}
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


function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid)
	then
		return false
	end

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	if msgcontains(msg,"trade") and talkState[talkUser] == 0
	then
		npcHandler:say("Hi, %s, Welcome!", cid)
		talkState[talkUser] = 1
	end

end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Code:
New talk state: 1
Old talk state: 0
Message Required: hi
Message to be sent: Hello world!
File name: mark.lua

add, finalize.

Must be something I don't understand :p
 
Back
Top