Erambo
New Member
- Joined
- Oct 5, 2022
- Messages
- 2
- Reaction score
- 0
Hello Otlanders,
Issue:
"You cannot use this object" - result when trying to use torch (itemId:
Desc:
There are some lack of id's in
Additional newbie question:
If it is really broken, so does the default datapack contain more of these things? Appreciate for any additional info.
Best regards!
transform.lua
part of items.xml
Default datapack from Nekiro TFS 1.5 7.72 branch
Issue:
"You cannot use this object" - result when trying to use torch (itemId:
2050
)Desc:
There are some lack of id's in
transform.lua
I guess... Even that, when I've added id's for torch, it works but just to mid step, then the torch burned endlessly, probably I added id's in wrong way or something but more important for me is: it is really broken in default datapack for TFS 1.5 7.72 or I'm doing something wrong? Additional newbie question:
If it is really broken, so does the default datapack contain more of these things? Appreciate for any additional info.
Best regards!
transform.lua
Lua:
local transformItems = {
[1479] = 1480, [1480] = 1479, -- street lamp
[1634] = 1635, [1635] = 1634, -- table
[1636] = 1637, [1637] = 1636, -- table
[1638] = 1639, [1639] = 1638, -- table
[1640] = 1641, [1641] = 1640, -- table
[1786] = 1787, [1787] = 1786, -- oven
[1788] = 1789, [1789] = 1788, -- oven
[1790] = 1791, [1791] = 1790, -- oven
[1792] = 1793, [1793] = 1792, -- oven
[1945] = 1946, [1946] = 1945, -- lever
[2037] = 2038, [2038] = 2037, -- wall lamp
[2039] = 2040, [2040] = 2039, -- wall lamp
[2058] = 2059, [2059] = 2058, -- torch bearer
[2060] = 2061, [2061] = 2060, -- torch bearer
[2064] = 2065, [2065] = 2064, -- table lamp
[2066] = 2067, [2067] = 2066, -- wall lamp
[2068] = 2069, [2069] = 2068, -- wall lamp
[2096] = 2097, [2097] = 2096, -- pumpkinhead
[2578] = 2579, -- trap
[3697] = 3698, [3698] = 3697, -- sacred statue
[3699] = 3700, [3700] = 3699, -- sacred statue
[3743] = 4404, [4404] = 3743, -- bamboo lamp
[3943] = 3944, [3944] = 3943, -- torch bearer
[3945] = 3946, [3946] = 3945, -- torch bearer
[3947] = 3948, [3948] = 3947, -- wall lamp
[3949] = 3950, [3950] = 3949, -- wall lamp
}
local transformTo = Action()
function transformTo.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local transformIds = transformItems[item:getId()]
if not transformIds then
return false
end
item:transform(transformIds)
return true
end
for i, v in pairs(transformItems) do
transformTo:id(i)
end
transformTo:register()
part of items.xml
XML:
<item id="2050" article="a" name="torch">
<attribute key="weight" value="500"/>
<attribute key="stopduration" value="1"/>
</item>
<item id="2051" article="a" name="lit torch">
<attribute key="weight" value="500"/>
<attribute key="decayTo" value="2053"/>
<attribute key="duration" value="600"/>
</item>
<item id="2052" article="a" name="torch">
<attribute key="weight" value="450"/>
<attribute key="stopduration" value="1"/>
</item>
<item id="2053" article="a" name="lit torch">
<attribute key="weight" value="450"/>
<attribute key="decayTo" value="2055"/>
<attribute key="duration" value="300"/>
</item>
<item id="2054" article="a" name="torch">
<attribute key="weight" value="400"/>
<attribute key="stopduration" value="1"/>
</item>
<item id="2055" article="a" name="lit torch">
<attribute key="weight" value="400"/>
<attribute key="decayTo" value="2056"/>
<attribute key="duration" value="300"/>
</item>
<item id="2056" article="a" name="burnt down torch">
<attribute key="weight" value="350"/>
</item>