Page 1 of 1

Can an entity have no collision box?

Posted: Tue Mar 04, 2014 7:53 pm
by sparr
I am trying to make an entity of an arbitrary type that can be walked/driven over. I know transport-belts are passable, but they seem to be a special case. I tried this and got an error (which I can reproduce and copy if necessary):

Code: Select all

collision_box = {{0.0, 0.0}, {0.0, 0.0}},

Re: Can an entity have no collision box?

Posted: Tue Mar 04, 2014 8:02 pm
by ficolas
Transport belts have colision box, but their colision box is different is not -colision-, but its the area where they can move stuff.
There are some entities that can also be walked throught like ores, but for entities like... Containers is not possible, there will allways be a small colision box, that is basically a dot, where entities cant be placed.

Re: Can an entity have no collision box?

Posted: Tue Mar 04, 2014 9:13 pm
by sparr
Is there a way to specify that the collision box should not apply to the player / vehicle / biters?

Re: Can an entity have no collision box?

Posted: Tue Mar 04, 2014 11:07 pm
by SilverWarior
I think you need to use "not-on-map" flag for this.
If you chech doodads and logistic robot declaration you will notice that both of them have this flad set and still have collision_bod declared.

Re: Can an entity have no collision box?

Posted: Tue Mar 04, 2014 11:31 pm
by sparr
SilverWarior wrote:I think you need to use "not-on-map" flag for this.
If you chech doodads and logistic robot declaration you will notice that both of them have this flad set and still have collision_bod declared.
Thanks, I'll try that!

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 3:00 am
by sparr
That doesn't seem to be relevant here. I checked and other entities like logistic-robot do have zero-size collision boxes, so presumably this should work. I did manage to copy the error message for a zero-size collision box and it's not directly applicable to the collision box so I filed a bug.

"Error while loading prototype "underground-pipe": Invalid pipe connections specification for offset [0, -1]."

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 8:10 am
by SilverWarior
sparr wrote:That doesn't seem to be relevant here. I checked and other entities like logistic-robot do have zero-size collision boxes, so presumably this should work.
Yes I saw that logistic-robot has zero-size colision but if you check the doodads information you will se that they don't have zero-sized colision box but you can still move through them.
And as you specified in the other thread you created it sems that conection reference might need colision box to work.So I think that using same aproach as it used for doodads would work (I didn't have enough time to test it myself).

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 2:44 pm
by ficolas
Aaaah. Pipes cant have no colision box because their connection are based in the colisin box I think

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 3:18 pm
by sparr
Update from the other thread: The collision box is important for other reasons. The correct way to make an entity not collide with specific things (such as the player) is to use the collision_mask. I will try to document this on the wiki as I figure it out.

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 4:38 pm
by ficolas
ground-tile
water-tile
resource-layer
floor-layer
item-layer
object-layer
player-layer
ghost-layer
doodat-layer

Are all the collision masks available. I dont think it is anywhere so thats why im placing it here.

Re: Can an entity have no collision box?

Posted: Wed Mar 05, 2014 4:51 pm
by sparr
Thanks. Do you have any info on what goes on each layer by default? Or how to make a specific entity appear on a specific layer?

Re: Can an entity have no collision box?

Posted: Tue Mar 18, 2014 4:10 pm
by ficolas
Have you figured out how to do it? Because I think it is harcoded for each type of entity.
And I would like to use it in my mod to do something :)

EDIT: HOW HAS THIS ACTUALLY WORKED? xD

Code: Select all

	collision_mask="potato",
Edit: I think the game threads a "potato" collision mask as a nil colision mask, so it doesnt collide with anything, because when changing another entity to "potato" collision box they dont collide.

Re: Can an entity have no collision box?

Posted: Tue Mar 18, 2014 4:31 pm
by kovarex
I added documentation for the collision mask property:
https://forums.factorio.com/wiki/inde ... ision_mask