Tabletop Simulator

Tabletop Simulator

Encoder
Updating Untapper for Encoder Ver 4
Hello, I've been working on integrating your new Encoder onto my table. My current untapper has the functionality to not untap frozen cards and to remove the exert effect whilst not untapping the card itself.

However when I've trying to port over your new encoder I keep getting the error "Object reference not set to an instance of an object". After some tinkering I have discovered that if I remove these lines with the -- from the scripting it allows the untapper to function:
-- if enc ~= nil then
-- if enc.call("APIobjectExist",{obj=v}) then
-- data = enc.call("APIgetOAData",{obj=v})
-- if data["mtg_frozen"] ~= nil then
-- if data["mtg_frozen"].enabled then
-- untaps = false
-- end
-- end
-- end
-- if data["mtg_exert"] ~= nil then
-- if data["mtg_exert"].enabled then
-- untaps = false
-- data["mtg_exert"].enabled = false
-- enc.call("APIsetOAData",{obj=v,data=data})
-- enc.call("APIrebuildButtons",{obj=v})
-- end
-- end
if untaps == true then
if data.flip=="no" then
v.setRotationSmooth({v.getRotation().x,self.getRotation().y,v.getRotation().z})

else
v.setRotationSmooth({v.getRotation().x,self.getRotation().y,v.getRotation().z})
end
else
untaps = true
-- end


I imagine that this is due to the new interface you have for the status module. If you do not mind could you offer some insight on how I could change the above lines to allow me to still keep the same functionality.

Finally I noticed that your status module has a possible mistake on line 11 where frozen is referred as mtg_erozen={name="Frozen", ......
< >
Showing 1-2 of 2 comments
Remixed Witch Dec 5, 2020 @ 4:50am 
Here is also a pastebin to the whole scripting
https://pastebin.com/E2P9dt52
Tipsy Hobbit  [developer] Dec 15, 2020 @ 4:33pm 
Yup, sorry about that.
There is a functional untapper on the workshop table, which you should be able to just copy paste the code over. Just remember to comment out the same lines as the older untapper did, otherwise it will spawn a corner piece each time the table is loaded.
< >
Showing 1-2 of 2 comments
Per page: 1530 50