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

Receiving an error while editing firstitems.xml

Ranyo13

ManCausingMayhem
Joined
Aug 22, 2009
Messages
981
Reaction score
38
Greetings otlanders,

I really need help with my edited first items script in the mods folder,
I have edited my first items.xml on a TFS 0.3.6 Cryingdamson V5 [8.6] to this shape:

EDIT: Here's the original one. All I have done is removed the "if's" and edited a lot (almost all) of items because I made new characters start with level "1" without vocations.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<description><![CDATA[
		Custom Fist Items
	]]></description>
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
 items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation
			-- BackPack -- Rope -- in Backpack
			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)
			-- Brass Armor -- Body
			doPlayerAddItem(cid, 2465, 1)
			-- Steel Helmet -- Head
			doPlayerAddItem(cid, 2457, 1)
			-- Bonelord Shield -- Right Hand
			doPlayerAddItem(cid, 2518, 1)
 
		-- Sorcerer (Weapon) -- Hand
		if isSorcerer(cid) then
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")
 
		-- Druid (Weapon) -- Hand
		elseif isDruid(cid) then
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")
 
		-- Paladin - Warrior (Weapon) -- Hand
		elseif isPaladin(cid) then
			doPlayerAddItem(cid, 2389, 20) -- Spear -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")
 
		-- Knight (Weapon) -- Hand
		elseif isKnight(cid) then
			doPlayerAddItem(cid, 8602, 1) -- Jagged Sword -- Left Hand
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." now have the first items of "..getPlayerVocationName(cid)..".")
		end
 
		-- All Vocation
			-- Brass Legs -- in Feet
			doPlayerAddItem(cid, 2478, 1)
			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2643, 1)
			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2661, 1)
			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 2152, 1)
			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 7618, 10)
			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2554, 1)
			-- Crystal Ring -- in Ring
			doPlayerAddItem(cid, 2124, 1)
			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 7620, 15)
 
		-- Knight (Weapon) -- in Backpack
		if isKnight(cid) then
			doPlayerAddItem(cid, 8601, 1) -- Steel Axe
			doPlayerAddItem(cid, 2439, 1) -- Daramanian mace
		end
 
	setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>

One i edited, please start fixing this one, not the above so I won't repeat editing item ids.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<description><![CDATA[
		Custom Fist Items
	]]></description>
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
 items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation

			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)	-- BackPack -- Rope -- in Backpack
			doPlayerAddItem(cid, 2467, 1) 	-- Leather Armor -- Body
			doPlayerAddItem(cid, 2461, 1)	-- Leather Helmet -- Head
			doPlayerAddItem(cid, 2512, 1) -- Wooden Shield -- Right Hand
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod
			doPlayerAddItem(cid, 2389, 1) -- Spear
			doPlayerAddItem(cid, 2382, 1) -- Combat Knife
			doPlayerAddItem(cid, 2478, 1)			-- Leather Legs -- in Feet
			doPlayerAddItem(cid, 2649, 1)			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2661, 1)			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2152, 1)			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 7618, 5)			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 2554, 1)			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2168, 1)			-- Life Ring -- in Ring
			doPlayerAddItem(cid, 7620, 5)			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 2050, 1)			-- Torch -- in Backpack
			doPlayerAddItem(cid, 2380, 1) -- Hand Axe
			doPlayerAddItem(cid, 2404, 1) -- Combat Knife
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." has received the first items of a "..getPlayerVocationName(cid)..".")
		end
 
	setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>

And now i receive this error while logging in the game server:

Code:
[05/09/2012 18:38:36] [Lua Error] 
[05/09/2012 18:38:36] [string "loadBuffer"]:33: '<eof>' expected near 'end'

Please help me with this as soon as possible and look further into the script for more errors if you can!
Thanks in advance,
Ranyo13
 
Last edited:
If you want use mine... its from .4 tho..

XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" enabled="yes">
<config name="firstitems_config"><![CDATA[
STORAGE = 30001
commonItems = {
{itemid=2160, count=1, inContainer = true}, -- 25 platinum coins
{itemid=2643}, -- leather boots
{itemid=2173} -- aol
}
firstItems = {
{ --Sorcerer	
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2190}, -- wand of vortex
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2648} -- chain legs
},
{ -- Druid
{itemid=1988}, -- backpack
{itemid=2175}, -- spellbook
{itemid=2182}, -- snakebite rod
{itemid=8819}, -- magician's robe
{itemid=8820}, -- mage hat
{itemid=2648} -- chain legs
},
{ -- Paladin
{itemid=1988}, -- backpack
{itemid=2525}, -- dwarven shield
{itemid=2389, count=3}, -- 3 spears
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
},
{ -- Knight
{itemid=1988}, -- backpack
{itemid=2525}, -- dwarven shield
{itemid=2383}, -- spike sword
{itemid=2463}, -- plate armor
{itemid=2457}, -- steel helmet
{itemid=2647} -- plate legs
}
}
]]></config>
<event type="login" name="FirstItems" event="script"><![CDATA[
domodlib('firstitems_config')
 
for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end
 
function onLogin(cid)
if getPlayerGroupId(cid) < 4 and getPlayerStorageValue(cid, STORAGE) < 1 and firstItems[getPlayerVocation(cid)] then
for _, v in ipairs(firstItems[getPlayerVocation(cid)]) do
if isItemContainer(v.itemid) then
backpack = doPlayerAddItem(cid, v.itemid, 1)
elseif v.inContainer then
doAddContainerItem(backpack, v.itemid, v.count or 1)
else
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
end
setPlayerStorageValue(cid, STORAGE, 1)
end
return true
end
]]></event>
</mod>
 
That thing is a sloppy fucking mess... Ill let someone else fix it -.- Or you can use a working one.. its the same fuckin difference either way your going to end up with the same thing. (a working script)
 
try
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<description><=!=[=C=D=A=T=A=[
		Custom Fist Items
	]=]=></description>
	<config name="firstitems_config"><=!=[=C=D=A=T=A=[
		config = {
			storage = 40046,
 items = {}
		}
	]=]=></config>
	<event type="login" name="FirstItems" event="buffer"><=!=[=C=D=A=T=A=[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation

			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)	-- BackPack -- Rope -- in Backpack
			doPlayerAddItem(cid, 2467, 1) 	-- Leather Armor -- Body
			doPlayerAddItem(cid, 2461, 1)	-- Leather Helmet -- Head
			doPlayerAddItem(cid, 2512, 1) -- Wooden Shield -- Right Hand
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod
			doPlayerAddItem(cid, 2389, 1) -- Spear
			doPlayerAddItem(cid, 2382, 1) -- Combat Knife
			doPlayerAddItem(cid, 2478, 1)			-- Leather Legs -- in Feet
			doPlayerAddItem(cid, 2649, 1)			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2661, 1)			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2152, 1)			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 7618, 5)			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 2554, 1)			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2168, 1)			-- Life Ring -- in Ring
			doPlayerAddItem(cid, 7620, 5)			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 2050, 1)			-- Torch -- in Backpack
			doPlayerAddItem(cid, 2380, 1) -- Hand Axe
			doPlayerAddItem(cid, 2404, 1) -- Combat Knife
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." has received the first items of a "..getPlayerVocationName(cid)..".")
		end
return true
end
 
	setPlayerStorageValue(cid, config.storage, 1)
	]=]=></event>
</mod>



[/CODE]
 
I get this error when I try your script vendeliko.
Code:
[06/09/2012 00:32:14] > Loading firstitems.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/firstitems.xml
[06/09/2012 00:32:14] Line: 12, Info: StartTag: invalid element name

EDIT: I removed those weird equals (=) you have added to the script and reloaded and that's what i get now:
Code:
[06/09/2012 01:23:53] [Lua Error] 
[06/09/2012 01:23:53] [string "loadBuffer"]:33: '<eof>' expected near 'end'
 
Last edited:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
			items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation
 
			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)	-- BackPack -- Rope -- in Backpack
			doPlayerAddItem(cid, 2467, 1) 	-- Leather Armor -- Body
			doPlayerAddItem(cid, 2461, 1)	-- Leather Helmet -- Head
			doPlayerAddItem(cid, 2512, 1) -- Wooden Shield -- Right Hand
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod
			doPlayerAddItem(cid, 2389, 1) -- Spear
			doPlayerAddItem(cid, 2382, 1) -- Combat Knife
			doPlayerAddItem(cid, 2478, 1)			-- Leather Legs -- in Feet
			doPlayerAddItem(cid, 2649, 1)			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2661, 1)			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2152, 1)			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 7618, 5)			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 2554, 1)			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2168, 1)			-- Life Ring -- in Ring
			doPlayerAddItem(cid, 7620, 5)			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 2050, 1)			-- Torch -- in Backpack
			doPlayerAddItem(cid, 2380, 1) -- Hand Axe
			doPlayerAddItem(cid, 2404, 1) -- Combat Knife
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." has received the first items of a "..getPlayerVocationName(cid)..".")
				setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>
 
Cronox, I get this now:
Code:
[07/09/2012 01:02:12] [Lua Error] 
[07/09/2012 01:02:12] [string "loadBuffer"]:35: '<eof>' expected near 'end'
 
try now
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
			items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation
 
			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1) -- BackPack -- Rope -- in Backpack
			doPlayerAddItem(cid, 2467, 1) -- Leather Armor -- Body
			doPlayerAddItem(cid, 2461, 1) -- Leather Helmet -- Head
			doPlayerAddItem(cid, 2512, 1) -- Wooden Shield -- Right Hand
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod
			doPlayerAddItem(cid, 2389, 1) -- Spear
			doPlayerAddItem(cid, 2382, 1) -- Combat Knife
			doPlayerAddItem(cid, 2478, 1) -- Leather Legs -- in Feet
			doPlayerAddItem(cid, 2649, 1) -- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2661, 1) -- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2152, 1) -- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 7618, 5) -- Health Potion -- in Backpack
			doPlayerAddItem(cid, 2554, 1) -- Shovel -- in Backpack
			doPlayerAddItem(cid, 2168, 1) -- Life Ring -- in Ring
			doPlayerAddItem(cid, 7620, 5) -- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 2050, 1) -- Torch -- in Backpack
			doPlayerAddItem(cid, 2380, 1) -- Hand Axe
			doPlayerAddItem(cid, 2404, 1) -- Combat Knife
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." has received the first items of a "..getPlayerVocationName(cid)..".")
				setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
		end
	]]></event>
</mod>
 
Just use a working firstitems.xml and change the items... It can't be that hard to use a working one -.- , ^ lol totaly forgot about samples. +1 for u
 
I just want to use mine because it doesn't require any vocations, either fix my script or just leave.
Don't go off topic please.
 
Check first post, I will only use my edited script, if you won't help me fix it, why are you even posting here then?
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="Kaiser" contact="[email protected]" enabled="yes">
	<description><![CDATA[
		Custom Fist Items
	]]></description>
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 40046,
 items = {}
		}
	]]></config>
	<event type="login" name="FirstItems" event="buffer"><![CDATA[
		domodlib('firstitems_config')
		if(getPlayerStorageValue(cid, config.storage) > 0) then
			return
		end
 
		for _, id in ipairs(config.items) do
			doPlayerAddItem(cid, id, 1)
		end
 
		-- All Vocation
 
			doAddContainerItem(doPlayerAddItem(cid, 1988, 1), 2120, 1)	-- BackPack -- Rope -- in Backpack
			doPlayerAddItem(cid, 2467, 1) 	-- Leather Armor -- Body
			doPlayerAddItem(cid, 2461, 1)	-- Leather Helmet -- Head
			doPlayerAddItem(cid, 2512, 1) -- Wooden Shield -- Right Hand
			doPlayerAddItem(cid, 2190, 1) -- Wand of Vortex
			doPlayerAddItem(cid, 2182, 1) -- Snake Bite Rod
			doPlayerAddItem(cid, 2389, 1) -- Spear
			doPlayerAddItem(cid, 2382, 1) -- Combat Knife
			doPlayerAddItem(cid, 2478, 1)			-- Leather Legs -- in Feet
			doPlayerAddItem(cid, 2649, 1)			-- Leather Boots -- in Boots
			doPlayerAddItem(cid, 2661, 1)			-- Scarf -- in Necklacke
			doPlayerAddItem(cid, 2152, 1)			-- Platinum Coin -- in Arrows
			doPlayerAddItem(cid, 7618, 5)			-- Health Potion -- in Backpack
			doPlayerAddItem(cid, 2554, 1)			-- Shovel -- in Backpack
			doPlayerAddItem(cid, 2168, 1)			-- Life Ring -- in Ring
			doPlayerAddItem(cid, 7620, 5)			-- Mana Potion -- in Backpack
			doPlayerAddItem(cid, 2050, 1)			-- Torch -- in Backpack
			doPlayerAddItem(cid, 2380, 1) -- Hand Axe
			doPlayerAddItem(cid, 2404, 1) -- Combat Knife
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT," "..getPlayerName(cid).." has received the first items of a "..getPlayerVocationName(cid)..".")

 
	setPlayerStorageValue(cid, config.storage, 1)
	]]></event>
</mod>
 
Itachi, same error:
Code:
[07/09/2012 14:10:52] [Lua Error] 
[07/09/2012 14:10:52] [string "loadBuffer"]:35: '<eof>' expected near 'end'
 
Back
Top