Option in prototype for units to be immune to belt movement

kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Option in prototype for units to be immune to belt movement

Post by kyranzor »

Request a simple true/false flag for a unit prototype, to be able to ignore/resist being moved by belts.

I have issues with my robot army units being shifted around by player's factory belts and this change would go a long way to enhancing user experience. Because right now it's just frustrating and causes unit_groups to have members splintered away from the group, carried away by belts and getting stuck in the middle of complex factories.

I can't remember if my flying units had this issue too, but this ability to ignore belt interaction and combined with no collision box + a new simple pathing request option that goes over walls/water will fix a lot of issues for me and my mod users.

Appreciate anything you can do!
dauphin
Inserter
Inserter
Posts: 38
Joined: Fri Aug 19, 2016 1:59 am
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by dauphin »

This would be really great for the Aircraft mod. Aircraft being affected by belts feels really silly, but it's unavoidable currently since they have to use the standard ground vehicle prototype.
kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kyranzor »

So perhaps all LuaEntities should be able to access this particular property then? Or at least the Vehicle and Unit LuaEntity subclasses..
321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by 321freddy »

There is already an equipment in the game called "belt-immunity-equipment". It's disabled by default but if you put it in your power armour you are immune to belt movement.
I guess you could add an 1x1 equipment grid to your entities and insert this equipment into it.

From base/prototypes/equipment/equipment.lua:

Code: Select all

{
    type = "belt-immunity-equipment",
    name = "belt-immunity-equipment",
    sprite =
    {
      filename = "__base__/graphics/equipment/belt-immunity-equipment.png",
      width = 32,
      height = 32,
      priority = "medium"
    },
    shape =
    {
      width = 1,
      height = 1,
      type = "full"
    },
    energy_source =
    {
      type = "electric",
      buffer_capacity = "100kJ",
      input_flow_limit = "240kW",
      drain = "100kW",
      usage_priority = "primary-input"
    },
    categories = {"armor"},
    order = "b-i-c"
  }
kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kyranzor »

321freddy wrote:you could add an 1x1 equipment grid to your entities and insert this equipment into it.
I wish! That's one of my other API requests, is being able to enable an inventory or equipment grid for any unit type entity. looks like a hack would be to use the equipment grid to put a custom belt immunity item (with no power requirement) in the unit.
321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by 321freddy »

kyranzor wrote:being able to enable an inventory or equipment grid for any unit type entity
That would be awesome but it sadly doesn't really make much sense. Why would a biter need an equipment grid?
You can add equipment grids to cars, tanks and locomotives already, maybe you can utilise this somehow?

On the other hand you can use on_tick to detect if a unit has been moved by a belt and teleport it back but that would probably cost too much performance.
kyranzor
Filter Inserter
Filter Inserter
Posts: 499
Joined: Fri Oct 31, 2014 4:52 pm
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kyranzor »

A major use case is my Robot Army units which are essentially reskinned spitters with custom projectiles.
User avatar
kizrak
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kizrak »

Hello Engineers!
Has this been implemented? I would also like access to this, either via prototype, or API run-time flag.
Thanks!
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by Optera »

kizrak wrote: Wed Apr 29, 2020 3:18 am Hello Engineers!
Has this been implemented? I would also like access to this, either via prototype, or API run-time flag.
Thanks!
Please check the documentation before posting. This was implemented a long time ago.
https://wiki.factorio.com/Prototype/Car ... t_immunity
User avatar
kizrak
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kizrak »

Maybe I missed "unit" vs "player". I see that "cars" and "units" (Entity that attacks players.) can have has_belt_immunity [If the unit is immune to movement by belts]. What I'm looking for is for the player/character.

My apologies for the misinterpretation. Has something like this been implemented for player/characters that I have also overlooked? If not, should I make a separate Modding Interface Request?
User avatar
kizrak
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Option in prototype for units to be immune to belt movement

Post by kizrak »

Thanks Optera !
Post Reply

Return to “Implemented mod requests”