func-godot/func_godot_plugin

Trenchbroom groups use absolute positioning instead of relative when built

cybernaut4 opened this issue · 2 comments

Situation

I use TrenchBroom group's hierarchy. With this, I can write point entities that operate with various types of sibling entities within the group.

My scene is comprised of more than one map: each represents a single floor.

Problem

Every node is positioned correctly, save for the group hierarchies which use absolute positioning in the scene instead of being relative to FuncGodotMap's.

✔Building from (0,0,0):
image

❌Building from anywhere else (0,97,-32):
image

Solution

Have the group hierarchies position relatively to the FuncGodotMap node.

Workarounds

1 - Scenes

It's possible to put each FuncGodotMap in their own scenes. This way the scene will have each their own absolute positioning for group hierarchies, but switching between them too often can be disorienting after a while (eg. to check if the structure coincides with each other after building them).

2 - Zero positioning

  1. Move the additional FuncGodotMap to position zero.
  2. Hide the main FuncGodotMap.
  3. Build it (as many times as needed).
  4. Once you're done building/iterating/working (with) it, return the aforementioned FuncGodotMap to its intended place and show the main FuncGodotMap.

Looking into it, it looks like the groups are all actually positioned at the FuncGodotMap's position and what's really going on is the mesh generation is happening at the offset position for other layers. It gets a little weirder when the groups are inside layers. Layers themselves are placed at the FuncGodotMap's position.

Unfortunately, the fix seems like it'll be more complicated than just "have group hierarchies' position relative to FuncGodotMap's".

Resolved by 9a8da22