Page 1 of 1

Option in prototype for units to be immune to belt movement

Posted: Tue May 09, 2017 10:19 am
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!

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

Posted: Fri May 12, 2017 2:27 pm
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.

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

Posted: Fri May 12, 2017 2:31 pm
by kyranzor
So perhaps all LuaEntities should be able to access this particular property then? Or at least the Vehicle and Unit LuaEntity subclasses..

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

Posted: Fri May 12, 2017 3:38 pm
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"
  }

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

Posted: Fri May 12, 2017 5:02 pm
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.

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

Posted: Sat May 13, 2017 12:50 pm
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.

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

Posted: Sat May 13, 2017 12:55 pm
by kyranzor
A major use case is my Robot Army units which are essentially reskinned spitters with custom projectiles.

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

Posted: Wed Apr 29, 2020 3:18 am
by kizrak
Hello Engineers!
Has this been implemented? I would also like access to this, either via prototype, or API run-time flag.
Thanks!

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

Posted: Wed Apr 29, 2020 5:56 am
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

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

Posted: Sat May 02, 2020 3:27 am
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?

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

Posted: Sat May 02, 2020 5:39 am
by Optera

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

Posted: Tue May 05, 2020 8:22 pm
by kizrak
Thanks Optera !