• 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!

Npc Input

alekito

Archlord - Retired
Joined
Oct 21, 2008
Messages
150
Reaction score
29
Location
Sweden
I kind of got an problem with my The Forgotten King npc, ive tried to make an "place spawn" with rme then i put 1 npc on my world map but when i try to start my server it tells me.

[21/08/2012 15:33:15] [Spawn::addMonster] Cannot find "The Forgotten King"


Would appreciate if anyone got some tips how to fix this :D
 
You don't probably have "The Forgotten King" inside "npc/scripts.xml" and/or "npc/scripts/the forgotten ling.lua". Just simply add that npc into those to places. It can be found by using the search function, rme adds real tibia npcs and therefor are you able to place them but they don't exist in the server.
 
well i have the forgotten king file inside data/npc .... but i got an promotion.lua inside my npc/scripts does that count?. you said that i should and/or put the forgotten ling.lua inside npc/scripts. Mind if i ask what kind of lua? and what it should contain
 
First of all I need to correct myself, "npc/scripts.xml" doesn't exist I meant "npc/the forgotten king.xml"

"npc/the forgotten king.xml" if it has something like this inside, then post your "promotion.lua script and I can check if it looks okay
XML:
script="promotion.lua"
 
this is my npc/forgotten king.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
-<npc floorchange="0" walkinterval="2000" script="promotion.lua" name="The Forgotten King"> <health max="100" now="100"/> <look addons="0" feet="7" legs="45" body="39" head="20" type="133"/> </npc>


this is my promotion.lua

Code:
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

local node1 = keywordHandler:addKeyword({'subclass'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want have promotion for 200000 gold coins?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 1300, promotion = 2, text = 'Congratulations!.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())
 
If this doesn't work I'm not sure what the error is.. Or it is something that I've missed in the file.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Forgotten King" script="promotion.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>

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

local node1 = keywordHandler:addKeyword({'subclass'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want have promotion for 200000 gold coins?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 1300, promotion = 1, text = 'Congratulations!.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

Try to import the npc's to the map again, and replace the npc. Otherwise I've not any clue where the error is..
 
i think i know what the problem is but dunno how to fix it .... i think its my data/world/spawn.xml file ... i tried to import it with rme and it said:

-- Error OT data file "c:\Users\ali\Desktop\cryingdamson 0.3.6 (8.60)V5\data\world\forgotten-spawn.xml" This is not valid OT npc/monster data file. --

tried to replace the spawns again and the npc but ít seems that only my monster works to implant not my npc.



Uppdated -

Fixed it thanks for the help
 
Last edited:
try this

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Forgotten King" script="scripts/promotion.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>
--
nvm, just saw you fixed it :)
 
First off, make sure you have imported the npc's from your server into your map. To do that go to File, Import, Import/monsters/npcs...then find your npc file and import all of them. If that is not the issue, you need to make sure RME is looking in the right place...for example: If RME is looking in Yourserver/data/npc for all of your npc's than you need to make sure that your npc's are not being held in another folder within your npc folder.

Example: Lets say "The Forgotten King" is in a folder INSIDE the npc folder called promo...It's location would be as follows...Yourserver/data/npc/promo. If RME is looking in Yourserver/data/npc, it will not find the npc in the "promo" folder. Im sure there is an easier way to explain this.... but i hope i helped.
 
Back
Top