Can an entity have no collision box?

Place to get help with not working mods / modding interface.
Post Reply
sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Can an entity have no collision box?

Post 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}},

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Can an entity have no collision box?

Post 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.

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Can an entity have no collision box?

Post by sparr »

Is there a way to specify that the collision box should not apply to the player / vehicle / biters?

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Can an entity have no collision box?

Post 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.

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Can an entity have no collision box?

Post 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!

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Can an entity have no collision box?

Post 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]."

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

Re: Can an entity have no collision box?

Post 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).

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Can an entity have no collision box?

Post by ficolas »

Aaaah. Pipes cant have no colision box because their connection are based in the colisin box I think

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Can an entity have no collision box?

Post 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.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Can an entity have no collision box?

Post 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.

sparr
Smart Inserter
Smart Inserter
Posts: 1329
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: Can an entity have no collision box?

Post 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?

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Can an entity have no collision box?

Post 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.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Can an entity have no collision box?

Post by kovarex »

I added documentation for the collision mask property:
https://forums.factorio.com/wiki/inde ... ision_mask

Post Reply

Return to “Modding help”