Tabletop Simulator

Tabletop Simulator

Utility Memory Bag
GrayGeist 24 Aug, 2020 @ 7:17am
Utility/Memory Bag - It cannot properly recall large objects & is bloating the bag
Hi all! Wanted to get a discussion started here.

While utilizing the Utility Memory Bag there are two issues that I have coming up and would kindly ask for help on. #2 stems from #1, so if we can somehow fix the first issue together, it should resolve both. Below is a link to the imgur that has pictures to help aid in this matter.

https://imgur.com/gallery/Wbf0mf9

1. When attempting to recall tokens (or objects) of "great" size, the objects will not automatically go into the bag but instead get "stuck outside" it when it's sucked toward the bag.

2. The bag will then "think" that it has successfully imported the object/token and the bag will contain the object even though, in reality, it's hovering outside the bag. In order to fix this you can push "recall" again which then sucks the hovering token into the bag, but now the bag has two tokens. This is bad for two reasons #1 bloat and #2 because the token will throw anything on your table not locked all over the place

Solution required: We need to figure out why the bag can't successfully Recall objects over a certain size or make it so the bag will automatically size down objects when recalling and size them back when "Placing" them back out.

Thank you all so much!

Please note: As a workaround I tried using a script that Mr. Stump wrote in response to someone in 2017 that should remove duplicates from the bag. When you load the map, it should go through all objects in the bag and remember their name. If it sees a duplicate name, it should use takeObject to pull it out. A callback then deletes it and prints a message telling you what was deleted. He edited it to yield for 6 frames between taking each object. This did not work as it ended up spawning the very large objects above the table and being unable to delete them but the code is below:

Failed Workaround SCRIPT

function onLoad()
function deleteThingsCoroutine()
local objNameList = {}
for _, obj in ipairs(self.getObjects()) do
if obj.name ~= "" then
if objNameList[obj.name] == nil then
objNameList[obj.name] = true
else
self.takeObject({
position={0,5,0}, guid=obj.guid,
callback="deleteThis", callback_owner=self
})
coroutine.yield(0) coroutine.yield(0) coroutine.yield(0)
coroutine.yield(0) coroutine.yield(0) coroutine.yield(0)
end
end
end
return 1
end
startLuaCoroutine(self, "deleteThingsCoroutine")
end

function deleteThis(obj)
print("Deleting: "..obj.getName())
destroyObject(obj)
end
< >
Showing 1-2 of 2 comments
cowgoesmoo33 28 Aug, 2020 @ 6:29pm 
For anyone having this issue, here is a workaround.
In buttonClick_recall(), add obj.destruct() like so:

if obj ~= nil then self.putObject(obj) obj.destruct() end
directsun  [developer] 20 Sep, 2020 @ 4:21pm 
I cant reproduce this. Can you share a game file or object with me?
< >
Showing 1-2 of 2 comments
Per page: 1530 50