Sorry, we don't support your browser.  Install a modern browser
This post is closed.

tryObjectEnter is only called for one object when dropping a set of objects into a bag#150

was true for filterObjectEnter too

3 years ago

The return value is applied to all.

3 years ago
Changed the status to
Research
3 years ago

Here’s a report I put on the “community bug tracker” a while back:

Describe the bug
Dragging a group of objects to a container tests filterObjectEnter on one, then applies that value to all.

Steps to reproduce the behavior:

Create a bag with filterObjectEnter that rejects the first time, accepts the second (script below).
Create a handful of random objects.
Select the group of objects and drag all to the bag.
Observe a single call to filterObjectEnter, all objects are rejected.
Drag same group to the bag again.
Observe a single call to filterObjectEnter, all objects are accepted.

Expected behavior
The filter method should be called separately for each object.

function filterObjectEnter(enter_object)
_n = (_n or 0) + 1
local result = (_n % 2) == 0
print(‘filter: ‘ .. _n .. ‘ ‘ .. tostring(result))
return result
end

Tabletop Simulator Info (please complete the following information):

OS: macOS
Version 12.4.3

3 years ago
Changed the status to
In Progress
3 years ago
Changed the status to
Completed
3 years ago

This bug appears to still be present. Putting this script on a bag:

function tryObjectEnter(object)
    print(object.getGUID())
    return false
end

then dropping a set of drag-selected objects onto the bag shows only one print, and all objects are rejected. Flipping the return to true shows only one print then all objects are inserted.

3 years ago
B
Changed the status to
Planned
3 years ago
B
Changed the status to
In Progress
3 years ago
Changed the status to
Completed
3 years ago