Hello,
I've just recently been looking at some other mods' code and realized my idea for a mod may not work due to collision boxes only able to be defined as boxes.
Is there a way to define a circle collision area instead of a box?
I just wanted to ask and make sure before I started a Mod Interface request.
Thanks,
voxelv
Collision Boxes? Is there a Collision circle option?
Re: Collision Boxes? Is there a Collision circle option?
No, nothing in Factorio does circle collision.
If you want to get ahold of me I'm almost always on Discord.
Re: Collision Boxes? Is there a Collision circle option?
Thanks for the info. I don't suppose there would be an event such as "on_entity_enter_radius" or equivalent would there?No, nothing in Factorio does circle collision.
Thanks,
voxelv
Re: Collision Boxes? Is there a Collision circle option?
Nope.voxelv wrote:Thanks for the info. I don't suppose there would be an event such as "on_entity_enter_radius" or equivalent would there?No, nothing in Factorio does circle collision.
Thanks,
voxelv
If you want to get ahold of me I'm almost always on Discord.
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Collision Boxes? Is there a Collision circle option?
What exactly are you trying to do? Depending on that, a workaround might be doable.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Collision Boxes? Is there a Collision circle option?
Depending on the radius, a work arround may be possible. Create yourself an invisible, unselectable item with a 1x1 collision box. When the item with your circular radius is placed, add a series of these 1x1 items in a circle around the item. When the item is mined, remove the 1x1 items.
I have done it in my C&C mod (yet to be released) for things like the repair pad and refinery that don't have an NxM footprint. The only issues is that it does not take the 1x1 items into account while you are placing your structure, but it's easy to detect a collision and cancel the construction.
I have done it in my C&C mod (yet to be released) for things like the repair pad and refinery that don't have an NxM footprint. The only issues is that it does not take the 1x1 items into account while you are placing your structure, but it's easy to detect a collision and cancel the construction.
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Collision Boxes? Is there a Collision circle option?
Make sure you handle the possibility of picking up items if you use them. I think you mean entities tho.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Collision Boxes? Is there a Collision circle option?
yes, "Entity" not "Item.
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: Collision Boxes? Is there a Collision circle option?
You could place a land-mine and edit the trigger_radius to whatever you want. Then you just have to change the action so when a person enters the radius of the land-mine it spawns another entity. You can then use the event on_trigger_created_entity to catch the event in lua.voxelv wrote:Thanks for the info. I don't suppose there would be an event such as "on_entity_enter_radius" or equivalent would there?No, nothing in Factorio does circle collision.
Thanks,
voxelv
Waste of bytes : P