How make entity placeable only near rails?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
tvardero
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Oct 24, 2016 12:18 pm
Contact:

How make entity placeable only near rails?

Post by tvardero »

Hi all,

I'm looking for any idea how make entity placeable only near rails and how show rail-signal spots overlay when holding entity in hand.
It's not rail-signal type, it's electric-pole type. (I'm just trying to make railroad overhead line).
Should I use "filter-directions" flag? How work with it?

Thanks in advance.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How make entity placeable only near rails?

Post by darkfrei »

On place holder_entity replace it with pole_entity.

User avatar
tvardero
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Oct 24, 2016 12:18 pm
Contact:

Re: How make entity placeable only near rails?

Post by tvardero »

darkfrei wrote:On place holder_entity replace it with pole_entity.
I'll check it soon, thank you!

User avatar
tvardero
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Oct 24, 2016 12:18 pm
Contact:

Re: How make entity placeable only near rails?

Post by tvardero »

darkfrei wrote:On place holder_entity replace it with pole_entity.
so... what is a "holder-entity"? where is it?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How make entity placeable only near rails?

Post by darkfrei »

tvardero wrote:
darkfrei wrote:On place holder_entity replace it with pole_entity.
so... what is a "holder-entity"? where is it?

Code: Select all

It's not rail-signal type, it's electric-pole type.
So, on_place rail-signal-with-custom-name get positions, destroy this rail-signal and place your electric-pole instead.

User avatar
tvardero
Burner Inserter
Burner Inserter
Posts: 15
Joined: Mon Oct 24, 2016 12:18 pm
Contact:

Re: How make entity placeable only near rails?

Post by tvardero »

darkfrei wrote:
tvardero wrote:
darkfrei wrote:On place holder_entity replace it with pole_entity.
so... what is a "holder-entity"? where is it?

Code: Select all

It's not rail-signal type, it's electric-pole type.
So, on_place rail-signal-with-custom-name get positions, destroy this rail-signal and place your electric-pole instead.
Now I understand this. Thank you!

Post Reply

Return to “Modding help”