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

[MOD] help

soul4soul

Intermediate OT User
Joined
Aug 13, 2007
Messages
1,878
Solutions
3
Reaction score
130
Location
USA
apparently i need a lot of help with this script. none of the movements work. the actions use to work and i tried messing with it a little more and now all it does is crash my server. if i try to run the server with this mod it shutdowns.

also i have a question. which is suppose to be use <movements></movements> or <movevent></movevent> to script movements in mods?


Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Sister of Demons" version="1.0" author="Soul4Soul" contact="[email protected]" enabled="yes">
	<config name="tilesnwalls"><![CDATA[
	uniques =
	{
		[20025] =
		{
			amttypespace =
			{
				2,
				908,
				{x = 256, y = 318, z = 14},
				906,
				{x = 245, y = 295, z = 14}
			}
		},
		[20026] =
		{
			amttypespace =
			{
				1,
				906,
				{x = 249, y = 320, z = 14}
			}
		},
		[20027] =
		{
			amttypespace =
			{
				1,
				906,
				{x = 253, y = 320, z = 14}
			}
		},
		[20028] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 265, y = 306, z = 14}
			}
		},
		[20029] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 271, y = 306, z = 14}
			}
		},
		[20030] =
		{
			amttypespace =
			{
				2,
				908,
				{x = 256, y = 298, z = 14},
				908,
				{x = 265, y = 317, z = 14}
			}
		},
		[20031] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 247, y = 292, z = 14}
			}
		},
		[20032] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 271, y = 301, z = 14}
			}
		},
		[20033] =
		{
			amttypespace =
			{
				1,
				906,
				{x = 258, y = 296, z = 14}
			}
		},
		[20034] =
		{
			amttypespace =
			{
				1,
				906,
				{x = 272, y = 316, z = 14}
			}
		},
		[20035] =
		{
			amttypespace =
			{
				2,
				908,
				{x = 256, y = 293, z = 14},
				906,
				{x = 263, y = 296, z = 14}
			}
		},
		[20036] =
		{
			amttypespace =
			{
				1,
				906,
				{x = 268, y = 299, z = 14}
			}
		},
		[20037] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 256, y = 322, z = 14}
			}
		},
		[20038] =
		{
			amttypespace =
			{
				1,
				908,
				{x = 265, y = 302, z = 14}
			}
		},
		[20039] =
		{
			amttypespace =
			{
				2,
				908,
				{x = 259, y = 302, z = 14},
				908,
				{x = 265, y = 311, z = 14}
			}
		}
	}	
	]]></config>
	<action uniqueid="20005" event="script"><![CDATA[
		function onUse(cid, item, frompos, item2, topos)
			IdoftheItem = 6574 -- Id of the item that will be removed
			PositionOfTheItem = {x=269, y=395, z=8, stackpos=1} -- Position of the item, change the stackpos according to the place of the item
			newplayerpos = {x=274, y=402, z=8}
			CancelMsg = "The lever wont budge, try a different item." -- Msg the player will receive if don't have the required item
			if ((item.itemid == 1945) then
				GetItem = getThingfromPos(PositionOfTheItem)
				if (GetItem.itemid == IdoftheItem) then
					if (doRemoveItem(GetItem.uid, 1) == 1) then
					end
					doTeleportThing(cid,newplayerpos)
					doSendMagicEffect(newplayerpos,1)
					doTransformItem(item.uid, item.itemid+1)
				else
					doPlayerSendCancel(cid, CancelMsg)
				end
			elseif ((item.itemid == 1946) then
				doTransformItem(item.uid, item.itemid-1)
			else
				doPlayerSendCancel(cid, "An error occurred. Please contact the GOD.")
			end
			return 1
		end
	]]></action>
	<action  fromuid="20044" touid="20045"  event="script"><![CDATA[
		posstart = {x=233, y=375, z=12} --move items to here
		poss = {
			[1] = {x=230, y=375, z=12},
			[2] = {x=231, y=375, z=12},
			[3] = {x=230, y=376, z=12},
			[4] = {x=231, y=376, z=12}
			}

		lever = {
			[1] = {x=236, y=373, z=12},
			[2] = {x=225, y=378, z=12}
		}
		itemidtop = 5769
		itemidbottom = 5768
		function onUse(cid, item, fromPosition, itemEx, toPosition)
			if item.itemid == 1945 then
				doCreateItem(itemidtop,poss[1])
                doCreateItem(itemidtop,poss[2])
				doCreateItem(itemidbottom,poss[3])
                doCreateItem(itemidbottom,poss[4])
                for i=1,#lever do
                    if lever[i].x == fromPosition.x then
						o = i
                    end
                end
                if o == 1 then
                    b = 2
                else
                    b = 1
                end
                doTransformItem(item.uid,item.itemid+1)
                doTransformItem(getTileItemById(lever[b],1945).uid,1946)
			elseif item.itemid == 1946 then
                for p = 1,#poss do
					doRelocate(poss[p], posstart)
                end
                for z =1,#poss do
					poss[z].stackpos = 254
                    if getThingFromPos(poss[z]).itemid > 1000 then
						doRemoveItem(getThingFromPos(poss[z]).uid)
                    end
                    poss[z].stackpos = 1
                    if getThingFromPos(poss[z]).itemid > 1000 then
						doRemoveItem(getThingFromPos(poss[z]).uid)
                    end

                end
                for i=1,#lever do
                    if lever[i].x == toPosition.x then
						o = i
                    end
                end
                if o == 1 then
                    b = 2
                else
                    b = 1
                end
                doCreateItem(598,poss[1])
                doCreateItem(598,poss[2])
                doCreateItem(598,poss[3])
                doCreateItem(598,poss[4])
                doTransformItem(item.uid,item.itemid-1)
                doTransformItem(getTileItemById(lever[b],1946).uid,1945)
			end
			return TRUE
		end 
	]]></action>
	<movevent type="StepIn" actionid="20024" event="script"><![CDATA[
		local config = {
		level = 300,
		storage = 5026,
		entry =
		{
			{x = 222, y = 360, z = 13},
			{x = 220, y = 362, z = 13},
			{x = 220, y = 365, z = 13},
			{x = 220, y = 368, z = 13},
			{x = 224, y = 362, z = 13},
			{x = 224, y = 365, z = 13},
			{x = 224, y = 368, z = 13}
		},
		destination =
		{
			{x = 219, y = 348, z = 13},
			{x = 218, y = 348, z = 13},
			{x = 218, y = 349, z = 13},
			{x = 218, y = 350, z = 13},
			{x = 220, y = 348, z = 13},
			{x = 220, y = 349, z = 13},
			{x = 220, y = 350, z = 13}
		}
	}
	
	function onStepIn(cid, item, position, fromPosition)
		local players = {}
		for _, position in ipairs(config.entry) do
			local pid = getTopCreature(position).uid
			if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) 	< config.level) then
				doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
				return true
			end
	
			table.insert(players, pid)
		end
	
		for i, pid in ipairs(players) do
			doSendMagicEffect(config.entry[i], CONST_ME_POFF)
			doTeleportThing(pid, config.destination[i], false)
			doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
		end
	
		doRemoveItem(getThingfromPos({x = 222, y = 359, z = 13}).uid, 1)
		doCreateItem(3739,1,config.entry[1])
		doCreateItem(8834,1,config.entry[2])
		doCreateItem(8779,1,config.entry[3])
		doCreateItem(8626,1,config.entry[4])
		doCreateItem(8616,1,config.entry[5])
		doCreateItem(8422,1,config.entry[6])
		doCreateItem(9306,1,config.entry[7])
		return true
	end
	]]></movevent>
	<movevent type="StepIn"  actionid="20025-20043"  event="script"><![CDATA[		
	function onStepIn(cid, item, position, fromPosition)
		unique = uniques[item.uid]
		if(not unique) then
			return true
		end
		
		if unique.amttypespace[1] == 2 then
			pos1 = unique.amttypespace[3]
			pos2 = unique.amttypespace[5]
			doRemoveItem(getThingfromPos(pos1).uid, 1)
			doRemoveItem(getThingfromPos(pos2).uid, 1)
		elseif unique.amttypespace[1] == 1 then
			pos = unique.amttypespace[3]
			doRemoveItem(getThingfromPos(pos).uid, 1)
		end
		return true
	end 
	]]></movevent>
	<movevent type="StepOut"  actionid="20025-20043"  event="script"><![CDATA[
	function onStepOut(cid, item, position, fromPosition)
		unique = uniques[item.uid]
		if(not unique) then
			return true
		end
		
		if unique.amttypespace[1] == 2 then
			item1=unique.amttypespace[2]
			pos1 = unique.amttypespace[3]
			item2=unique.amttypespace[4]
			pos2 = unique.amttypespace[5]
			doCreateItem(item1, 1, pos1)
			doCreateItem(item2, 1, pos2)
		elseif unique.amttypespace[1] == 1 then
			item=unique.amttypespace[2]
			pos = unique.amttypespace[3]
			doCreateItem(item, 1, pos)
		end
		return true
	end  
	]]></movevent>
</mod>
 
Last edited:
change all the:
Code:
<movevent type="StepIn" *fromuniqueid="20025" touniqueid="20043" *event="buffer"><![CDATA[
to:
Code:
<movevent type="StepIn" actionid="20025-20043" event="script"><![CDATA[
movements use actionid's not unique also u were doing "fromuniqueid" and "touniqueid" wrong, i didn't read the whole script so good luck
-
also don't use buffer unless its without your function:
example:
Code:
<movevent type="StepIn" actionid="5030" event="buffer"><![CDATA[
	return doPlayerAddItem(cid, 10, 23)
]]></movevent>
also wtf is this:
Code:
[B][COLOR="Red"]end[/COLOR][/B]]]></config>
?
 
Last edited:
do they have to be action ids?

also i didnt everything u said i even changed it to action ids same thing happens i took a pic of the error
 

Attachments

Last edited:
instead of using [.lua][./lua] use [.code][./code]
so i dont have to tab it and ill try and fix

do they have to be action ids?

also i didnt everything u said i even changed it to action ids same thing happens i took a pic of the error
edited my main post, go try now
 
Last edited:
updated my main post using code tags. updated it "-" and nothing. oh also the first two action scripts did work in the past. i assume they still do i havent edited them. none of the movements have worked for me
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Sister of Demons" version="1.0" author="Soul4Soul" contact="[email protected]" enabled="yes">
	<config name="tilesnwalls"><![CDATA[
		uniques =
		{
			[20025] =
			{
				amttypespace =
				{
					2,
					908,
					{x = 256, y = 318, z = 14},
					906,
					{x = 245, y = 295, z = 14}
				}
			},
			[20026] =
			{
				amttypespace =
				{
					1,
					906,
					{x = 249, y = 320, z = 14}
				}
			},
			[20027] =
			{
				amttypespace =
				{
					1,
					906,
					{x = 253, y = 320, z = 14}
				}
			},
			[20028] =
			{
				amttypespace =
				{
					1,
					908,
					{x = 265, y = 306, z = 14}
				}
			},
			[20029] =
			{
				amttypespace =
				{
					1,
					908,
					{x = 271, y = 306, z = 14}
				}
			},
			[20030] =
			{
				amttypespace =
				{
					2,
					908,
					{x = 256, y = 298, z = 14},
					908,
					{x = 265, y = 317, z = 14}
				}
			},
			[20031] =
			{
				amttypespace =
				{
					1,
					908,
					{x = 247, y = 292, z = 14}
				}
			},
			[20032] =
			{
				amttypespace =
				{
					1,
					908,
					{x = 271, y = 301, z = 14}
				}
			},
			[20033] =
			{
				amttypespace =
				{
					1,
					906,
					{x = 258, y = 296, z = 14}
				}
			},
			[20034] =
			{
				amttypespace =
				{
					1,
					906,
					{x = 272, y = 316, z = 14}
				}
			},
			[20035] =
			{
				amttypespace =
				{
					2,
					908,
					{x = 256, y = 293, z = 14},
					906,
					{x = 263, y = 296, z = 14}
				}
			},
			[20036] =
			{
				amttypespace =
				{
					1,
					906,
					{x = 268, y = 299, z = 14}
				}
			},
			[20037] =
			{
				amttypespace =
				{
					1,
					908,
					{x = 256, y = 322, z = 14}
				}
				},
			[20038] =
			{
				amttypespace =
				{
					1,
						908,
					{x = 265, y = 302, z = 14}
				}
			},
			[20039] =
			{
				amttypespace =
				{
					2,
					908,
					{x = 259, y = 302, z = 14},
					908,
					{x = 265, y = 311, z = 14}
				}
			}
		}	
		]]></config>
	<action uniqueid="20005" event="script"><![CDATA[
		function onUse(cid, item, frompos, item2, topos)
			local IdoftheItem = 6574 -- Id of the item that will be removed
			local PositionOfTheItem = {x=269, y=395, z=8, stackpos=1} -- Position of the item, change the stackpos according to the place of the item
			local newplayerpos = {x=274, y=402, z=8}
			local CancelMsg = "The lever wont budge, try a different item." -- Msg the player will receive if don't have the required item
			if item.itemid == 1945 then
				local GetItem = getThingfromPos(PositionOfTheItem)
				if GetItem.itemid == IdoftheItem then
					if doRemoveItem(GetItem.uid, 1) == 1 then
						doTeleportThing(cid,newplayerpos)
						doSendMagicEffect(newplayerpos,1)
						doTransformItem(item.uid, item.itemid+1)
					end
				else
					doPlayerSendCancel(cid, CancelMsg)
				end
			elseif item.itemid == 1946 then
				doTransformItem(item.uid, item.itemid-1)
			else
				doPlayerSendCancel(cid, "An error occurred. Please contact the GOD.")
			end
			return true
		end
	]]></action>
	<action  fromuid="20044" touid="20045"  event="script"><![CDATA[
		local posstart = {x=233, y=375, z=12} --move items to here
		local poss = {
			[1] = {x=230, y=375, z=12},
			[2] = {x=231, y=375, z=12},
			[3] = {x=230, y=376, z=12},
			[4] = {x=231, y=376, z=12}
			}

		local lever = {
			[1] = {x=236, y=373, z=12},
			[2] = {x=225, y=378, z=12}
		}
		local itemidtop = 5769
		local itemidbottom = 5768
		function onUse(cid, item, fromPosition, itemEx, toPosition)
			if item.itemid == 1945 then
				doCreateItem(itemidtop,poss[1])
                		doCreateItem(itemidtop,poss[2])
				doCreateItem(itemidbottom,poss[3])
                		doCreateItem(itemidbottom,poss[4])
                		for i=1,#lever do
           				if lever[i].x == fromPosition.x then
						o = i
                    			end
       				end
                		if o == 1 then
                    			b = 2
                		else
                 			b = 1
                		end
                		doTransformItem(item.uid,item.itemid+1)
               		 	doTransformItem(getTileItemById(lever[b],1945).uid,1946)
			elseif item.itemid == 1946 then
                		for p = 1,#poss do
					doRelocate(poss[p], posstart)
                		end
                		for z =1,#poss do
					poss[z].stackpos = 254
                			if getThingFromPos(poss[z]).itemid > 1000 then
						doRemoveItem(getThingFromPos(poss[z]).uid)
                    			end
                    			poss[z].stackpos = 1
                    			if getThingFromPos(poss[z]).itemid > 1000 then
						doRemoveItem(getThingFromPos(poss[z]).uid)
              				end
				end
                		for i=1,#lever do
               				if lever[i].x == toPosition.x then
						o = i
                			end
                		end
                		if o == 1 then
               				b = 2
               			else
                			b = 1
                		end
                		doCreateItem(598,poss[1])
                		doCreateItem(598,poss[2])
                		doCreateItem(598,poss[3])
                		doCreateItem(598,poss[4])
                		doTransformItem(item.uid,item.itemid-1)
                		doTransformItem(getTileItemById(lever[b],1946).uid,1945)
				end
				return true
			end 
	]]></action>
	<movevent type="StepIn" actionid="20024" event="script"><![CDATA[
		local config = {
			level = 300,
			storage = 5026,
			entry =
			{
				{x = 222, y = 360, z = 13},
				{x = 220, y = 362, z = 13},
				{x = 220, y = 365, z = 13},
				{x = 220, y = 368, z = 13},
				{x = 224, y = 362, z = 13},
				{x = 224, y = 365, z = 13},
				{x = 224, y = 368, z = 13}
			},
			destination =
			{
				{x = 219, y = 348, z = 13},
				{x = 218, y = 348, z = 13},
				{x = 218, y = 349, z = 13},
				{x = 218, y = 350, z = 13},
				{x = 220, y = 348, z = 13},
				{x = 220, y = 349, z = 13},
				{x = 220, y = 350, z = 13}
			}
		}
		function onStepIn(cid, item, position, fromPosition)
			local players = {}
			for _, position in ipairs(config.entry) do
				local pid = getTopCreature(position).uid
				if(pid == 0 or not isPlayer(pid) or getCreatureStorage(pid, config.storage) > 0 or getPlayerLevel(pid) 	< config.level) then
					doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
					return true
				end
				table.insert(players, pid)
			end
			for i, pid in ipairs(players) do
				doSendMagicEffect(config.entry[i], CONST_ME_POFF)
				doTeleportThing(pid, config.destination[i], false)
				doSendMagicEffect(config.destination[i], CONST_ME_ENERGYAREA)
			end
			doRemoveItem(getThingfromPos({x = 222, y = 359, z = 13}).uid, 1)
			doCreateItem(3739,1,config.entry[1])
			doCreateItem(8834,1,config.entry[2])
			doCreateItem(8779,1,config.entry[3])
			doCreateItem(8626,1,config.entry[4])
			doCreateItem(8616,1,config.entry[5])
			doCreateItem(8422,1,config.entry[6])
			doCreateItem(9306,1,config.entry[7])
			return true
		end
	]]></movevent>
	<movevent type="StepIn"  actionid="20025-20043"  event="script"><![CDATA[
		domodlib("tilesnwalls")	
		function onStepIn(cid, item, position, fromPosition)
			local unique = uniques[item.uid]
			if(not unique) then
				return true
			end
			if unique.amttypespace[1] == 2 then
				pos1 = unique.amttypespace[3]
				pos2 = unique.amttypespace[5]
				doRemoveItem(getThingfromPos(pos1).uid, 1)
				doRemoveItem(getThingfromPos(pos2).uid, 1)
			elseif unique.amttypespace[1] == 1 then
				pos = unique.amttypespace[3]
				doRemoveItem(getThingfromPos(pos).uid, 1)
			end
			return true
		end 
	]]></movevent>
	<movevent type="StepOut"  actionid="20025-20043"  event="script"><![CDATA[
		domodlib("tilesnwalls")
		function onStepOut(cid, item, position, fromPosition)
			local unique = uniques[item.uid]
			if(not unique) then
				return true
			end
			if unique.amttypespace[1] == 2 then
				item1=unique.amttypespace[2]
				pos1 = unique.amttypespace[3]
				item2=unique.amttypespace[4]
				pos2 = unique.amttypespace[5]
				doCreateItem(item1, 1, pos1)
				doCreateItem(item2, 1, pos2)
			elseif unique.amttypespace[1] == 1 then
				item=unique.amttypespace[2]
				pos = unique.amttypespace[3]
				doCreateItem(item, 1, pos)
			end
			return true
		end  
	]]></movevent>
</mod>
 
alright thanks one more thing. iv been testing it. it loads now and i dont get any console errors. but the walls dont get removed. its suppose to be like a maze with hidden switch plates. when u step on them the wall is removed when u step out the wall is put back. and its done with multiple people.

addin stakepos=1 to the end of the coordinates should fix that right?
 
Back
Top