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

TFS 1.X+ Where are movements functions? onEquipItem, onDeEquip...

Sacarus

Member
Joined
Mar 15, 2016
Messages
52
Reaction score
7
Hi, where may I find those functions that we can target in movements.xml? onEquipItem, onDeEquipItem, onStepInField..? (TFS 1.2)
(example: <movevent event="Equip" itemid="2195" slot="feet" function="onEquipItem" />)
Is it only in sources, movement.cpp>MoveEvent::EquipItem ??

Another question, duplicated move events specified in movements.xml, are bouth loaded or it doesnt work?
 
Those that you reference are using the source code. But you do have the option to make you're own lua script and call to it like you do in any other xml file.

Just replace:
XML:
function="onEquipItem"
with
XML:
script="YOURSCRIPTNAME.lua"

Then use these:
Lua:
    function onStepIn(creature, item, toPosition, fromPosition)
    function onStepOut(creature, item, toPosition, fromPosition)
    function onEquip(player, item, slot)
    function onDeEquip(player, item, slot)
    function onAddItem(moveitem, tileitem, pos)
    function onRemoveItem(moveitem, tileitem, pos)
 
Hm, ok. Just wanted to have a look at those functions to know if im gonna lose something if I change then to my own scripts. I imagined that equips have [function="onEquipItem"] for some reason, once they already have onEquip to trigger the event. Do u understand what I mean? I tested changing BOH script, i couldn't see anything wrong.
 
Hm, ok. Just wanted to have a look at those functions to know if im gonna lose something if I change then to my own scripts. I imagined that equips have [function="onEquipItem"] for some reason, once they already have onEquip to trigger the event. Do u understand what I mean? I tested changing BOH script, i couldn't see anything wrong.
If you know C++ then movements.cpp handles those functions.
 
Maybe, but i don't know how magic field script looks like, i dont know c++/lua so much to write it by myself from 0 xd And i dont want to replace already existing, just add some new (i wanted just copy current and change numbers)
 
Back
Top