Check, if a ghost collides with a real entity

Place to get help with not working mods / modding interface.
Post Reply
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Check, if a ghost collides with a real entity

Post by jodokus31 »

If I revive a ghost, it seems that colliding entities are deconstructed and returned.
https://lua-api.factorio.com/latest/Lua ... ity.revive

I want to ask, if I can determine before reviving, if it would collide with any real entities, that would be deconstructed
Maybe something like: ghost.collides_with_other_real_entities

If was unable to find anything myself, so far, but I'm probably just blind.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Check, if a ghost collides with a real entity

Post by Rseding91 »

I think you might be misunderstanding what revive does. It won't mark anything for deconstruction when called.
Any items the new real entity collided with or nil if the ghost could not be revived.
This means any type="item-on-ground" entities that were in the way that it picks up off the ground as a result of reviving the entity. Those items never collide with built entities and are always picked up when something is built on top of them.
If you want to get ahold of me I'm almost always on Discord.

User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1603
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Check, if a ghost collides with a real entity

Post by jodokus31 »

Rseding91 wrote:
Fri Jan 13, 2023 5:42 pm
I think you might be misunderstanding what revive does. It won't mark anything for deconstruction when called.
Any items the new real entity collided with or nil if the ghost could not be revived.
This means any type="item-on-ground" entities that were in the way that it picks up off the ground as a result of reviving the entity. Those items never collide with built entities and are always picked up when something is built on top of them.
Yes, Indeed, I understood that wrong.
Items on the ground makes a lot more sense.
Thanks for clarifying.

Post Reply

Return to “Modding help”