Still trying to finish off this script I am working on and I have run into a strange problem, that is all though my script.
Basically, even using exact position / rotation and scale values (taken from copying data from a save file)... objects are getting placed slightly differently than I am expecting.
Now in most cases this is not an issue. As I move the objects slightly above where they are supposed to go and then they drop, as they drop they snap to the snap point below them.
Still there are a few objects that are causing problems, mainly map objects. These objects I wish to come in locked and when they come in everything's all strange. Now there are some other locked objects that have the same problem but it is undetectable by the player so I never noticed it until I found the map errors.

Here is an example of the problem on an object I do not care about... see how it is kinda "inside" the table?
See even though the values are taken either from the file or from that helper object tool Markimus wrote (I tried up to 9 decimal places) form the object when it is stitting on the ground properly, the object when it is locked onto the table is kinda wonky.

Same object after unlocking it
If I make the object move above the ground plain of the table it locks in mid air and freezes there.
Now as I understand it there is a system in place called "callback" but I do not really know how to use it. Is there a way to have the object lock after completely finishing its movement, so I could move it to the spot form the bag, maybe a tiny but off the table, it drops, and THEN freezes.
At the moment my code just freezes it instantly as soon as it is placed.
Code:
if TrueBag ~= nil then
local takeParams = {}
local function cb() end
takeParams.callback = "cb"
takeParams.callback_owner = self
for i = 1, #TrueBag:getObjects() do
if coreMissionBags[bm][i] ~= nil then
if coreMissionBags[bm][i].locked ~= nil then
table.insert(lockObj, TrueBag:takeObject(coreMissionBags[bm][i]))
elseif coreMissionBags[bm][i].shuffle ~= nil then
table.insert(shuffleObj, TrueBag:takeObject(coreMissionBags[bm][i]))
elseif coreMissionBags[bm][i].drawsigs ~= nil then
signelDrawPile = TrueBag:takeObject(coreMissionBags[bm][i])
elseif coreMissionBags[bm][i] ~= nil then
TrueBag.takeObject(coreMissionBags[bm][i])
end -- END IF
end -- END NIL TEST
end -- End For Loop
if lockObj[1] ~= nil then
for i=1, #lockObj, 1 do
lockObj[i]:setLock(true)
end
end
if shuffleObj[1] ~= nil then
for i=1, #shuffleObj, 1 do
shuffleObj[i]:shuffle()
end
end
if signelDrawPile ~= nil then
signelDrawPile:shuffle()
signelDrawPile:setLock(true)
end
if coreMissionSignels[bm] ~= nil then
for i = 1, #coreMissionSignels[bm] do
signelDrawPile.takeObject(coreMissionSignels[bm][i])
end
end
end -- END 1st IF Statment of if bag was empty
[url]http://pastebin.com/8iC6REfA[/url]
This is my code for drawing the objects from the bag....
Basically I have a variable value in addition to the position/rotation called "locked" (as well as others for drawing and shuffeling).. during the get form bag stuff, it looks for that flag "locked" and if it is locked adds the objectID into a variable called lockObj... then as long as that variable is not equal to nil it will loop through it and lock all the objects it contains. (or shuffle them or draw from them or w/e)
So.. assuming my 1 week of self taught coding makes any sense.. can anyone point me to a way to fix this strange error?
See this video for visual examples... in it I show the error in the map tiles using the tool for position data and then I paste in "exact" data copied directly from the save file where I manually placed everything.
[url]http://screencast-o-matic.com/watch/cbnXn76iIk[/url]