forbi construction of signal rails

Place to get help with not working mods / modding interface.
Post Reply
Hermios
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Sat Aug 13, 2016 2:57 pm
Contact:

forbi construction of signal rails

Post by Hermios »

Hi
I created some items of kind "signal rails", so they can only be built on rails.
I created too my own type of rails. Is there a possibility to restrict the build of my signal rails ton only my type of rails (This is red when the cursor is not on my type of rail, and asking for build doesn't work)?

Thanks

Niko

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: forbi construction of signal rails

Post by matjojo »

using the api website: http://lua-api.factorio.com/0.14.21/Lua ... otype.html

you can see all(?) the entity tags you can give an entity.

you can try changing the collision box of your rails and your signals so that they go into each other like a puzzle?

maybe even add a new collision mask to the normal rails, and make your signals collide with it, and then not add it to your own rails? this sounds like the easiest and best working option to me.

keep us updated!

Hermios
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Sat Aug 13, 2016 2:57 pm
Contact:

Re: forbi construction of signal rails

Post by Hermios »

Hey Matjojo
your idea seems very good.
However, how can I set a specific layer, only for rail and my signal? I don't want the rail to collide with something else. are the layers predefined, or I can add my own one?

Thanks

Niko

matjojo
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed Jun 17, 2015 6:08 pm
Contact:

Re: forbi construction of signal rails

Post by matjojo »

yes, if I understand correctly you need to add a new collision_mask in the data-loading phase of startup. Look in the game files for where and how this is done, call it something like special-signal-denied, and make the base rails and your signals collide with it by adding it to the data.raw table in the prototype-loading phase(for the base rails, for your own signals you can just add it to the prototype defenitions).

Hermios
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Sat Aug 13, 2016 2:57 pm
Contact:

Re: forbi construction of signal rails

Post by Hermios »

Hi Mate
sorry, I didn't find those layouts in the core nor the base. It seems that this is hardcoded, and I cannot add any further layout :( Do you have any experience from someone who did that?

Post Reply

Return to “Modding help”