Prevent biters from attacking something

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Prevent biters from attacking something

Post by TheSAguy »

Is there a way to make biters totally not attack something?
I'd like them to totally ignore rail.

Thanks.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14944
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Prevent biters from attacking something

Post by Rseding91 »

If you mark the entity as indestructible they won't attack it. https://forums.factorio.com/wiki/inde ... structible
If you want to get ahold of me I'm almost always on Discord.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1449
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Re: Prevent biters from attacking something

Post by TheSAguy »

I added the below, but did not seem to work. It also did not crash though :)

Code: Select all

	data.raw["straight-rail"]["straight-rail"].destructible = false
	data.raw["curved-rail"]["curved-rail"].destructible = false
What is the correct syntax?
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Prevent biters from attacking something

Post by Adil »

It's not prototype field, it's entity field. You need to do that when they are built.
Other way to try would be to remove "player-creation" from the prototype flags in definition or rails.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: Prevent biters from attacking something

Post by Afforess »

TheSAguy wrote:Is there a way to make biters totally not attack something?
I'd like them to totally ignore rail.

Thanks.
I think you want to create a new force, (by default there are 3 forces, player, neutral, biter) and assign the rail entities to the new force. Alternatively, assign the rails to the neutral force. Biters should ignore entities not part of the player force.

Note: I have not tested this, I only speculate forces will work (as delineating ownership is their purpose)
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Prevent biters from attacking something

Post by prg »

Afforess wrote:
TheSAguy wrote:Is there a way to make biters totally not attack something?
I'd like them to totally ignore rail.

Thanks.
I think you want to create a new force, (by default there are 3 forces, player, neutral, biter) and assign the rail entities to the new force. Alternatively, assign the rails to the neutral force. Biters should ignore entities not part of the player force.

Note: I have not tested this, I only speculate forces will work (as delineating ownership is their purpose)
Biters will still chew their way through neutral/non-player entities to get to their target. So this might work for rail because that won't be in the way, but not for other structures that might block the biter's path.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
User avatar
Afforess
Filter Inserter
Filter Inserter
Posts: 422
Joined: Tue May 05, 2015 6:07 pm
Contact:

Re: Prevent biters from attacking something

Post by Afforess »

prg wrote: Biters will still chew their way through neutral/non-player entities to get to their target. So this might work for rail because that won't be in the way, but not for other structures that might block the biter's path.
Huh, is that actually an actual "chewing" behavior? I always thought biters just damaged structures that they passed too closely to.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Prevent biters from attacking something

Post by Oxyd »

Afforess wrote:
prg wrote: Biters will still chew their way through neutral/non-player entities to get to their target. So this might work for rail because that won't be in the way, but not for other structures that might block the biter's path.
Huh, is that actually an actual "chewing" behavior? I always thought biters just damaged structures that they passed too closely to.
They have to actually attack something if they want to damage it, yes. They don't tear down walls by just looking at them funny.
Post Reply

Return to “Modding help”