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

Lua [movements] Snow tiles

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hey, I had problem with snow tiles - server was starting up with a lot of footprint and solution is here:
I had:
Code:
<movevent type="StepIn" fromid="6580" toid="6594" event="script" value="snow.lua"/>
and changed it to:
Code:
<movevent type="StepIn" itemid="6594" event="script" value="snow.lua"/>

Now server starts with normal tiles :)
But I have next problem - with movements. Only when I stand on item ID 670 then snow tile is transformed to footprint.
Normal snow tiles are from 6580 to 6593. I want to change that if player stand on tile from 6580-6593 and 670 then this tile is transformed to footprint.

movements.xml
Code:
	<movevent type="StepIn" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepIn" itemid="6594" event="script" value="snow.lua"/>

snow.lua
Code:
TILE_SNOW = 670
TILE_FOOTPRINT_I = 6594
TILE_FOOTPRINT_II = 6598

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(isPlayerGhost(cid)) then
		return true
	end

	if(item.itemid == TILE_SNOW) then
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
		doDecayItem(item.uid)
	elseif(item.itemid == TILE_FOOTPRINT_I) then
		doTransformItem(item.uid, TILE_FOOTPRINT_II)
		doDecayItem(item.uid)
	else
		doTransformItem(item.uid, TILE_FOOTPRINT_I)
	end

	return true
end

Does anyone know how to change it?
 
Last edited:
Well on your new movements xml you have deleted the snow ID's that you want to work, to make it do what your saying you need to go back to the first code that you had otherwise the id's aren't registered to change into footprints. Like I said on the other thread, I have a very similar problem to yours, I didn't have time to look through it properly last night with what Limos said but tonight I should have time. Hopefully it can be fixed
 
Ye, I deleted the snow ID's that I want to work in movements.xml because it was bugged.. it was sufficient that one person enters into the normal snow tile and all the fields of snow turned into footprints... does anyone know how to fix it?
 
Well if you can provide us with the footprint tile ids for the new snow tiles then we can make a proper script for you

To do this use the find function in your editor and search for the decay value with the ids so that we can make it so that it decays to the proper id

Without this then the steps will all decay to one id defeating the purpose of what you want =d
 
Snow tiles: 670 and 6580-6593
footprint: 6594-6608

some years ago i had:
movements.xml
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>

<movevent type="StepOut" itemid="6594" event="script" value="6594.lua"/>
<movevent type="StepOut" itemid="6595" event="script" value="6595.lua"/>
<movevent type="StepOut" itemid="6596" event="script" value="6596.lua"/>
<movevent type="StepOut" itemid="6597" event="script" value="6597.lua"/>
<movevent type="StepOut" itemid="6599" event="script" value="6599.lua"/>
<movevent type="StepOut" itemid="6600" event="script" value="6600.lua"/>
<movevent type="StepOut" itemid="6601" event="script" value="6601.lua"/>
<movevent type="StepOut" itemid="6602" event="script" value="6602.lua"/>
<movevent type="StepOut" itemid="6603" event="script" value="6603.lua"/>
<movevent type="StepOut" itemid="6604" event="script" value="6604.lua"/>
<movevent type="StepOut" itemid="6605" event="script" value="6605.lua"/>
<movevent type="StepOut" itemid="6606" event="script" value="6606.lua"/>
<movevent type="StepOut" itemid="6607" event="script" value="6607.lua"/>
<movevent type="StepOut" itemid="6608" event="script" value="6608.lua"/>

snow.lua
Code:
function onStepOut(cid, item, position, fromPosition)
        if isPlayerGhost(cid) == TRUE then
                return TRUE
        end

        addEvent(transformBack, 30000, {oldItemID = item.itemid, _position = position})
        if item.itemid == 670 then
                doTransformItem(item.uid, 6594)
        else
                doTransformItem(item.uid, item.itemid + 15)
        end
        return TRUE
end

function transformBack(parameters)
        parameters._position.stackpos = 0
        doTransformItem(getThingfromPos(parameters._position).uid, parameters.oldItemID)
        return TRUE
end

6594.lua
Code:
function onStepOut(cid, item, position, fromPosition)
        if isPlayerGhost(cid) == TRUE then
                return TRUE
        end

        addEvent(transformBack, 30000, {oldItemID = 670, _position = position})
        if item.itemid == 6594 then
                doTransformItem(item.uid, 6598)
				doDecayItem(item.uid)
        end
        return TRUE
end

function transformBack(parameters)
        parameters._position.stackpos = 0
        doTransformItem(getThingfromPos(parameters._position).uid, parameters.oldItemID)
        return TRUE
end

6595-6608.lua: (all similar, the change is 6595/6596/6597/6599 etc)
Code:
function onStepOut(cid, item, position, fromPosition)
        if isPlayerGhost(cid) == TRUE then
                return TRUE
        end

        addEvent(transformBack, 30000, {oldItemID = item.itemid - 15, _position = position})
        if item.itemid == 6595 then
                doTransformItem(item.uid, 6598)
				doDecayItem(item.uid)
        end
        return TRUE
end

function transformBack(parameters)
        parameters._position.stackpos = 0
        doTransformItem(getThingfromPos(parameters._position).uid, parameters.oldItemID)
        return TRUE
end

And everything was ok, now it doesn't work :/
 
LUA:
function transformBack(parameters)
        parameters._position.stackpos = 0
        doTransformItem(getThingfromPos(parameters._position).uid, parameters.oldItemID)
        return TRUE
end

function onStepOut(cid, item, position, fromPosition)
        if isPlayerGhost(cid) == TRUE then
                return TRUE
        end
        
        local parameters = {oldItemID = item.itemid, _position = position}
        addEvent(transformBack, 30000, parameters)
        doTransformItem(item.uid, 6598)
        return TRUE
end

- - - Updated - - -

Put these in your movements.xml
XML:
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>

Remove these from your movements.xml
XML:
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>

<movevent type="StepOut" itemid="6594" event="script" value="6594.lua"/>
<movevent type="StepOut" itemid="6595" event="script" value="6595.lua"/>
<movevent type="StepOut" itemid="6596" event="script" value="6596.lua"/>
<movevent type="StepOut" itemid="6597" event="script" value="6597.lua"/>
<movevent type="StepOut" itemid="6599" event="script" value="6599.lua"/>
<movevent type="StepOut" itemid="6600" event="script" value="6600.lua"/>
<movevent type="StepOut" itemid="6601" event="script" value="6601.lua"/>
<movevent type="StepOut" itemid="6602" event="script" value="6602.lua"/>
<movevent type="StepOut" itemid="6603" event="script" value="6603.lua"/>
<movevent type="StepOut" itemid="6604" event="script" value="6604.lua"/>
<movevent type="StepOut" itemid="6605" event="script" value="6605.lua"/>
<movevent type="StepOut" itemid="6606" event="script" value="6606.lua"/>
<movevent type="StepOut" itemid="6607" event="script" value="6607.lua"/>
<movevent type="StepOut" itemid="6608" event="script" value="6608.lua"/>
 
Last edited:
Back
Top