PDA

View Full Version : getCustomObject() is not returning "thickness".... ?



Tragic
11-02-2017, 12:34 AM
Hi there... I think I may have found a small bug.

I'm trying to write code for a tool, where you build a token, drop it on the tool and then paste a heap of urls into a texttool, and it will spawn a heap of objects for each line of the url code. The idea was to use the collision event to store all the data of the "template" token you have made and then use that to spawn all the other objects, taking the new URLs from the text tool.

Problem is that one of the parameters in the custom tile object can not be accessed at all.. it is just not inside the table when you do "getCustomObject()"


for key, value in pairs(obj.getCustomObject()) do
print(key, " : ", value)
end

This code is supposed to print out all the keys and their values but for a "custom token".. this is my result.

https://snag.gy/VQnO92.jpg

so...


print(obj.getCustomObject().thickness)

is returning "nil".

(note: for my tool, in the meantime I will be cloning the template objects and just changing the URL. I think this will work just fine.. but the getCustomObject() should probably return this value?)

felix
11-08-2017, 01:12 PM
I've just done some test, any TILE seems to return thickness correctly by using getCustomObject()

But for TOKENS, it doesn't return thickness that way and i'm not even sure there's another way to do it.

Even though the documentation says the function returns "Thickness of the Custom Tile or Custom Token".

Either is a bug or we are overlooking something.

If it's not too late, try replacing your tokens by tiles, it seems to work that way.