Here is an old code (you can optimize it return the array directly instead of using a global with the new array functions !) :
Type CollisionPoint
ObjectID as integer
X#
Y#
Z#
nX#
nY#
nZ#
EndType
Global dim CollisionsPoints[20] as CollisionPoint
function MultipleObjectRayCast(X1#,Y1#,Z1#,X2#,Y2#,Z2#,Radius#)
CollisionCount=0
repeat
ObjectHit=ObjectSphereCast( 0, X1#,Y1#,Z1#,X2#,Y2#,Z2#,Radius#)
if GetObjectRayCastNumHits()>0
inc CollisionCount,1
CollisionsPoints[CollisionCount].ObjectID=GetObjectRayCastHitID(0)
CollisionsPoints[CollisionCount].X#=GetObjectRayCastX(0)
CollisionsPoints[CollisionCount].Y#=GetObjectRayCastY(0)
CollisionsPoints[CollisionCount].Z#=GetObjectRayCastZ(0)
CollisionsPoints[CollisionCount].nX#=GetObjectRayCastNormalX(0)
CollisionsPoints[CollisionCount].nY#=GetObjectRayCastNormalY(0)
CollisionsPoints[CollisionCount].nZ#=GetObjectRayCastNormalZ(0)
SetObjectCollisionMode(GetObjectRayCastHitID(0),0)
endif
until ObjectHit=0
for i=1 to CollisionCount
SetObjectCollisionMode(CollisionsPoints[i].ObjectID,1)
next
endfunction CollisionCount
//////////////////
// Now in your main loop program you can do :
/////////////////////////////////////////////
NBCollisions = MultipleObjectRayCast(OldX#,OldY#,OldZ#,NewX#,NewY#,NewZ#,0.1)
for i=1 to NBCollisions
print("ObjectID collided number "+str(i)+" :" +str(CollisionsPoints[i].ObjectID))
next i