Make player unable to place an entity

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Diamonde123
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 22, 2020 1:42 pm
Contact:

Make player unable to place an entity

Post by Diamonde123 »

Please help, i want to make possible to place an entity only near another building (distibutor) . I made a script that destroys entity if it cant find the distributor nearby, but I want to do it properly, make player unable to place entity anywhere exept near ditributor

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Make player unable to place an entity

Post by eradicator »

Impossible. The engine doesn't support prototype based placement restrictions.

And in two years nobody has reacted to my initial proposal ;(.
viewtopic.php?t=54014
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

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

Re: Make player unable to place an entity

Post by darkfrei »

Hidden resource patch, you can build mining drills on the resource patches only. Pro: green rectangle about the right place.

Replace this placeholder with the entity that you need.

Post Reply

Return to “Modding discussion”