Inverted collision masks and multiple collision boxes/masks per entity
Posted: Wed Jul 03, 2024 1:53 am
Allowing one entity to have multiple collision boxes with independent collision masks would streamline the creation of entities with more complex placement restrictions. Similarly, allowing the inversion of one or more of these collision masks would allow for a greater range of placement restrictions than just "not-colliding-with-itself" currently allows.
Some examples of complex placement restrictions are:
This would be greatly appreciated, even though a lot of the new territory it opens up can already be done via script; this change alone would make these complex requirements easier to maintain, both on the inter-mod compatibility front and the general implementation complexity front.
Thanks.
Some examples of complex placement restrictions are:
- Exclusion zones, as seen on some mods' wind turbines (Py and Nullius both have examples)
- Inclusion zones, where certain entities must be placed in proximity to another entity
- Non-rectangular collision boxes (dunno why you'd want this, but it's something to note)
- Create entity A, which has one collision box, usually the most commonly applicable one.
- Create a dummy entity B, which has another collision box, usually consisting of just one layer
- Add the layer B collides with to A's collision mask
- When an A is created, use a script to place a B, ignoring its collision mask.
- When an A is destroyed, use a script to remove its B.
- Other A's collide with the placed B's, preventing placement too close to other As.
This would be greatly appreciated, even though a lot of the new territory it opens up can already be done via script; this change alone would make these complex requirements easier to maintain, both on the inter-mod compatibility front and the general implementation complexity front.
Thanks.