OpenTomb
OpenTomb copied to clipboard
Lara collides with invisible meshes
Model 22 in TR1 has collision enabled which prevents Lara from going through.
EDIT: that seems to be not a camera target but some other service entity.
Turned out that "baddie" function now doesn't disable collisions either. An invisible collision shapes are left behind.
Baddies are fixed in 9609635438c724a024d2ce7461a4d4b52c729f17, but service entities still require fixing the script.
Model 22 is a spawn point. But how it determines what entity to spawn? Based on the level?
Yes, I think it's hardcoded... It contains no additional info, timer field is also empty (although Core never used timer field for another purposes very well until TR3 or TR4 anyway).
The automatic static mesh collision introduced in ee6e5ae01e9e44345c7c9d01313f0d367da73059 is not working any longer.
For some reason Lara can't fall into water at the exit from Tomb of Qualopec. I don't see any collision mesh there and she can jump forward. After that she can successfully re-enter and everything works normal from that point. I've seen such cases on other levels too.
Latter bug is probably related to collision detection. There's another funny bug, if you push action and then forward somewhere inbetween two squares with low ceiling, Lara will try to grab the ceiling!
Regarding static mesh collision, it stopped working before or after merge?
Before the merge, of course. No collision testing is possible after that.
The processing for staticmesh_script.lua
was added in e71d0bd8925eab82c735fd3d26ce1e15c3e562f1 but it didn't work because of a bug which was fixed in aae4b0e2873e4ddb2a23cc6ea40bf7589e1354ae. Since then automatic collision doesn't work because of a bug in that script. This code just overrides it:
if((static_tbl == nil) or (static_tbl[id] == nil)) then
return COLLISION_TYPE_STATIC, COLLISION_SHAPE_BOX, nil;
One simple workaround for this bug:
diff --git a/scripts/staticmesh/staticmesh_script.lua b/scripts/staticmesh/staticmesh_script.lua
index 308347f..5b84315 100644
--- a/scripts/staticmesh/staticmesh_script.lua
+++ b/scripts/staticmesh/staticmesh_script.lua
@@ -16,7 +16,7 @@ static_tbl = {}; -- Define static mesh property table.
function getStaticMeshProperties(id)
if((static_tbl == nil) or (static_tbl[id] == nil)) then
- return COLLISION_TYPE_STATIC, COLLISION_SHAPE_BOX, nil;
+ return nil, nil, nil;
else
local coll, shape, hide;
if(static_tbl[id].hide ~= nil) then hide = static_tbl[id].hide else hide = false end;
Fixed in 3f78f53.
Related to #50.
Seems, like this need back porting too.
It seems that setEntityCollision
doesn't affect statics anymore. These commands became no-ops in level scripts. Also, I see no way to disable collision for static 37 in Tomb of Tihocan.
EDIT: Ok. I can disable it through static_tbl
. We need to fix level scripts.
In Unfinished Business many statics doesn't have collision enabled.
static 37 fixed in https://github.com/opentomb/OpenTomb/commit/e0839706911e6727b1e70bf2aa8a557c19816dc5
Thanks. It's not a blocker anymore, But it's still a valid issue for other instances, e.g. in Lost Valley.