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

Solved TFS 1.0 don't load onStepIn with uid?

hellboy

Intermediate OT User
Joined
Apr 6, 2008
Messages
544
Solutions
6
Reaction score
121
Location
player:getTown()
onAddItem work like a charm, but onStepIn looks like is never used by engine (when I step in on this item, I don't get any warning or additional print. I should get 'Step In' in console)

xml file
Code:
        <movevent event="AddItem" tileitem="1" uniqueid="1000" script="places/sorcerers_guild.lua"/>
        <moveevent event="StepIn" uniqueid="1000" script="places/sorcerers_guild.lua"/>
        <moveevent event="StepIn" uniqueid="1001" script="places/sorcerers_guild.lua"/>

places/sorcerers_guild.lua
Code:
local pos_table = {
        [1000] = {pos = {x = 54, y = 107, z = 6}, lvl = 1}, -- 20
        [1001] = {pos = {x = 54, y = 107, z = 5}, lvl = 1} -- 25
}
print('Loading ADDITEM and STEPIN')
function onStepIn(cid, item, position, fromPosition)
        print('Step In')
        local player = Player(cid)

        if player and player:getLevel() >= (pos_table[item.uid]).lvl then
                player:teleportTo((pos_table[item.uid]).pos)
                Position((pos_table[item.uid]).pos):sendMagicEffect(CONST_ME_TELEPORT)
        end
        return true
end

function onAddItem(moveitem, tileitem, position)
        if moveitem.itemid == 5901 then
                local movedItem = Item(moveitem.uid)
                movedItem:remove()
                Game.createItem(2363, 1, position)
                Position(position):sendMagicEffect(CONST_ME_HITBYFIRE)
        end
        return true
end

Engine output after turning on serwer:
Code:
The Forgotten Server - Version 1.0
Compilied on Jun  8 2014 12:21:58 for arch x86

A server developed by Mark Samman
Visit our forum for updates, support, and resources: http://otland.net/.

>> Loading config
>> Establishing database connection... MySQL 5.5.37
>> Running database manager
>> Loading vocations
>> Loading items
>> Loading script systems
Loading ADDITEM and STEPIN
Loading ADDITEM and STEPIN
>> Loading monsters
>> Loading outfits
>> Checking world type... PVP
>> Loading map
> Map size: 683x385.
Duplicate uniqueId 1002
> Map loading time: 0.625 seconds.
>> Initializing gamestate
>> Loaded all modules, server starting up...
> Warning: The Forgotten Server has been executed as root user, please consider running it as a normal user.
>> Kalathar Reborn Server Online!

Any idea?
 
Back
Top