• 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.2 itemEx bug on certain items.

Status
Not open for further replies.

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,452
Solutions
1
Reaction score
625
Location
Estonia
I'm doing house building feature for my game and was just testing if all works fine.
Doing that found a TFS bug instead.
when I try to get itemEx, I get a table with 0 values..

Its not really big thing as I can use toPos to create the userdata with top visible thing, But sill. a bug in my book.
wallID 1025

s27i2q.jpg

EDIT: how did I fix it in Lua
Code:
if not itemEx or type(itemEx) ~= "userdata" then
        local tile = Tile(topos)
        if not tile then return end
        itemEx = tile:getTopVisibleThing()
        if not itemEx then return end
    end
 
Last edited:
I'm doing house building feature for my game and was just testing if all works fine.
Doing that found a TFS bug instead.
when I try to get itemEx, I get a table with 0 values..

Its not really big thing as I can use toPos to create the userdata with top visible thing, But sill. a bug in my book.
wallID 1025



EDIT: how did I fix it in Lua
Code:
if not itemEx or type(itemEx) ~= "userdata" then
        local tile = Tile(topos)
        if not tile then return end
        itemEx = tile:getTopVisibleThing()
        if not itemEx then return end
    end
thats wierd
 
but if you use the wall
item is the item you're using
itemEx is the item you are targeting with if (aka crosshair)
no?
 
Yes. "itemEx", now renamed "target" in sources is the target item or creature.
 
Yes. "itemEx", now renamed "target" in sources is the target item or creature.
pretty sure you can rename any function arguments and they'll still work, as long as they are in the same order
i tried it earlier how he did it and it printed all args for me, dunno why his itemEx wont work
 
Sure it does, I just emphasize that itemEx is not just item, but can also be a creature. Seems he solved it by himself.
 
Status
Not open for further replies.
Back
Top