Multiple collision boxes for each collision mask
Posted: Sun May 14, 2017 7:31 pm
Ive had a problem for a while where there is no way (that ive found) to add entities that dont snap to the grid, but you can still move between when you place them (apart from making them not collide with the player at all).
With a grid it is fairly simple (you just make the collision box slightly smaller than the grid, so there is a gap), but with entities that dont snap, this is not possible
If there was a way to have a seperate collision box for each mask, then you could have a smaller box for players, and a larger one for objects, so there would be a minimum distance you could have between entities (im sure that there are also other uses for this too)
I was thinking that if the current way collision masks work already supports this, it would probably be a simple change, but would allow for quite a few things you couldn't previously do with mods
A possible way to add entities with multiple collision boxes could be:
With a grid it is fairly simple (you just make the collision box slightly smaller than the grid, so there is a gap), but with entities that dont snap, this is not possible
If there was a way to have a seperate collision box for each mask, then you could have a smaller box for players, and a larger one for objects, so there would be a minimum distance you could have between entities (im sure that there are also other uses for this too)
I was thinking that if the current way collision masks work already supports this, it would probably be a simple change, but would allow for quite a few things you couldn't previously do with mods
A possible way to add entities with multiple collision boxes could be:
Code: Select all
As well as:
collision_box = { { -0.8, -0.8 }, { 0.8, 0.8 } }
Also have another option:
collision_boxes = {
object-layer = { { -0.8, -0.8 }, { 0.8, 0.8 } },
player-layer = { { -0.6, -0.6 }, { 0.6, 0.6 } }
}