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

problem with snow tiles onStepOut

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
dd.jpg
Code:
function onStepOut(cid, item, position, fromPosition)
    if isPlayer(cid) and not isPlayerGhost(cid) then
        if item.itemid == 670 then
            doTransformItem(item.uid, 6594)
        else
            doTransformItem(item.uid, item.itemid + 15)
        end
        doDecayItem(item.uid)
    end
    return true
end
<!-- Snow footprint tiles -->
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" itemid="6580-6593" event="script" value="snow.lua"/>
 
@Mauzim

Let's play with the idea that Hartass's suggestion makes sense ... and that there's something a bit messed up with your OT setup, since you'd expect this bug to have been noticed by other people long ago.

You should take a look at the definitions for those items in items.xml.

Here's one of them for TFS 1.0:

<item id="6594" name="snow">
<attribute key="description" value="Someone must have walked here recently." />
<attribute key="decayTo" value="670" />
<attribute key="duration" value="10" />
</item>

If you look back at your script you'll see the code that's supposed to turn "footprint" snow back into normal snow is:
doDecayItem(item.uid)
Note that this has no target item id to decay to, no wait time before it decays.

If Hartass is making sense (and the evidence is firmly on his side :), those parameters are being retrieved from items.xml, and there's a chance yours isn't correct. Another possibility is that snow.lua is incompatible with items.xml, and your server is looping between different "footprint snow" tiles (that would have the same symptoms).

If your items.xml is wrong, change it as suggested by Hartass. I'd suggest using duration=10 to start with though - if it's in seconds, 300 = 5 minutes which is a bit slow for a test.
If items.xml looks ok, you'll need to check that snow.lua and items.xml are consistent, or copy the snow parts of items.xml here so someone else can check for you.


@Hartass
Please keep answering these questions - I'm learning a lot about OT from your answers :)
 
Last edited:
@Hartass

Where's onStepOut(), and when is it called?

OP's first script does a weird transform from 670 to a tile that's outside the <movement ... /> he shows.
Is there any evidence he's even calling snow.lua to set the decay?
 
@Mauzim
I don't think you've provided all the information needed to solve your problem.

Are you saying that none of the <StepIn> or <StepOut> specifications in movement.xml are being executed? Or is just snow?

Is all snow instantly converted to "footprint snow" after server startup, or do you have to walk on it first?

Where did the script you included in your first post come from? Is it part of the server distribution, or did you modify an existing script?
 
scripts like depo tiles etc works normal problem is only with snow when i log in to server and step in snow tile then step out it do nothing and when i go away and back i see footprint snow in all items id what i setep out

first post script i improve by myself and it works good in tfs 4.0 but now im using otx and i have just this problem here

all items.xml are good i guess its problem doTransformItem or doDecayItem but idk
it works too not only step out item it works to all items in server

what about instanty after startup? I tryed orginal otx onstep in script and after restart i saw instantly footprint snow in all snow tiles here is it but its btw i still need onstep out my script working
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

HERE IS SCRIPT WHAT NEED FIX
function onStepOut(cid, item, position, fromPosition)
if isPlayer(cid) and not isPlayerGhost(cid) then
if item.itemid == 670 then
doTransformItem(item.uid, 6594)
else
doTransformItem(item.uid, item.itemid + 15)
end
doDecayItem(item.uid)
end
return true
end

<!-- Snow footprint tiles -->
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" itemid="6580-6593" event="script" value="snow.lua"/>
 
Last edited:
I'm still not clear on your symptoms. Please confirm:
1) When you restart the server, all snow tiles are converted to "snow footprint" tiles before any character does anything
2) After you've logged in to a running server, neither stepping into a snow tile has no effect on the graphic
3) After you've logged in to a running server, neither stepping out of a snow tile has no effect on the graphic
4a) "when i go away and back i see footprint snow in all items id what i setep out": - I don't understand what you mean by "when I go away and come back" - do you mean you leave a snow tile then return to it?
4b) "when i go away and back i see footprint snow in all items id what i setep out" - does this mean after a few steps every snow tile in the game converts to "footprint snow"?

Questions:
A) After server restart, do the "footprint snow" tiles decay back to ordinary snow tiles after a while?

Comments:
  • It seems likely that whatever this problem is, it's been caused by your customized script(s))
  • The fact that every snow tile transforms to "footprint snow" tells us there's some logic running somewhere that affects every snow tile on the map. There are no loops that could do this in in any of the code you've shown us so far.
  • It's happening at two different times - server startup and possibly (but not 100% certainly) onStepout() - so we need to find what those two have in common (perhaps snow.lua)
  • There are no It would help if we know of a single operation that can convert every occurrence of an item to a different item in a single operation. (anyone reading this - can it be done with something like "doTransformItem(item.itemid, 6594)" ? )
 
I'm still not clear on your symptoms. Please confirm:
1) When you restart the server, all snow tiles are converted to "snow footprint" tiles before any character does anything
2) After you've logged in to a running server, neither stepping into a snow tile has no effect on the graphic
3) After you've logged in to a running server, neither stepping out of a snow tile has no effect on the graphic
4a) "when i go away and back i see footprint snow in all items id what i setep out": - I don't understand what you mean by "when I go away and come back" - do you mean you leave a snow tile then return to it?
4b) "when i go away and back i see footprint snow in all items id what i setep out" - does this mean after a few steps every snow tile in the game converts to "footprint snow"?

Questions:
A) After server restart, do the "footprint snow" tiles decay back to ordinary snow tiles after a while?

Comments:
  • It seems likely that whatever this problem is, it's been caused by your customized script(s))
  • The fact that every snow tile transforms to "footprint snow" tells us there's some logic running somewhere that affects every snow tile on the map. There are no loops that could do this in in any of the code you've shown us so far.
  • It's happening at two different times - server startup and possibly (but not 100% certainly) onStepout() - so we need to find what those two have in common (perhaps snow.lua)
  • There are no It would help if we know of a single operation that can convert every occurrence of an item to a different item in a single operation. (anyone reading this - can it be done with something like "doTransformItem(item.itemid, 6594)" ? )
dude there is only one problem step out working to all items cuz im testing it in many ways and decay and transform have effect only when i walk away and back or log in log out its like refresh or stairs up stairs down i guess this refresh is problem cuz server have too many work if transfor all items like this i need fix this script to work only with 1 item where step out
 
Last edited:
Perhaps there's only one problem, but:

1) You're still the only one who understands the symptoms, because your descriptions are very hard to understand
2) There's no obvious mechanism for what you're describing (at least as far as I can understand your descriptions)
3) It's not clear that the script you included here is really the cause of the problem

Another way to look at it: what possible means is there on OT for turning every single snow tile into a "footprint snow" tile?

You're suggesting it's in the scripts you've included here, but where? There are no loops, and AFAIK function calls with item.uid as a parameter will only affect a single tile ... so how is the whole map being affected?
 
I'd still like to know why the original version was able to change all the tiles in one operation. If it's "works as designed" it might come in useful.

And what the new one actually does to fix it ...

  • As far as I can see the changes to items.xml are already in TFS 1.0.
  • My movements.xml has a different format.
    • Mine look like: <movevent event="StepOut" itemid="670" script="snow.lua"/>
    • The solution's look like: <movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
  • snow.lua looks similar - the biggest change seems to the call sig of doDecayItem()
    • From: doDecayItem(item.uid)
    • To: doDecayItem(doCreateItem(6594, fromPosition)) (sig is doDecayItem(item) )
 
items.xml
Code:
<item id="6594" name="snow">
        <attribute key="description" value="Someone must have walked here recently." />
        <attribute key="decayTo" value="670" />
        <attribute key="duration" value="10" />
    </item>

and

Code:
<item id="670" name="snow" />
 
Back
Top