@AmenMoses
Thanks again!
My script works partly. When the object with this script collides with a tree, I have an error "attempt to concatenate an upvalue 'object_indic' (a nil value). I thought I did everything not to have a nil value in Text(). Can you, please, correct my code to make the Text() function show the latest object collided with, the coordinates and force.
local U = require "scriptbank\\utillib"
local P = require "scriptbank\\physlib"
local object_indic, x_indic, y_indic, z_indic, force_indic = 0, 0, 0, 0, 0
function coord_init(e)
Include( "utillib.lua" )
Include("physlib.lua")
P.AddEntityCollisionCheck( e )
end
function coord_main(e)
--local Ent = g_Entity[ e ]
if P.GetEntityObjectCollisionDetails( e ) == nil then
Text(5,10,3,"no collision")
else
local object, x_col, y_col, z_col, force = P.GetEntityObjectCollisionDetails( e )
object_indic = object
x_indic = x_col
y_indic = y_col
z_indic = z_col
force_indic = force
end
Text(5,12,3,"object " .. object_indic)
Text(5,14,3,"x " .. x_indic)
Text(5,16,3, "y " .. y_indic)
Text(5,18,3,"z " .. z_indic)
Text(5,20,3,"force " .. force_indic)
end