Page 1 of 1

The ability to "stretch" placing any entity

Posted: Sat Oct 08, 2022 7:33 am
by Johnson1893
If you put a pole, and, without releasing the button, move the mouse - the poles are placed at a distance of the maximum distance of the wire. Not each right after previous.
At the moment, this only works with electric-pole entity type proptotype.
I propose to make this a general property of every entity proptotype.

For example, I would like to be able to place roboports like this, and make a mod in which the player could adjust the distance of the roboports placed in this way.

Re: The ability to "stretch" placing any entity

Posted: Sat Oct 08, 2022 7:49 am
by Stringweasel
+1

I propose an additional an addiobal flag to most entites:
  • distance_between_drag_placing
This would be zero by default, but electric poles would default to the wire distance for example.

My use case is placing Fluidic Power electric poles, which are generators internally. If you click drag they are placed right next to each other. I would like to change that to be closer to how electric poles are placed.

Re: The ability to "stretch" placing any entity

Posted: Sat Oct 08, 2022 11:01 am
by mrvn
There is far more to this than wire distance though. The electric poles remember the last place they could be placed and the entities they would power. Then when next location either doesn't have the wire reach or doesn't power all remembered entities the previous location gets a pole.

So for your fluidic power electric poles you have to make the entity-to-place an electric pole prototype and then you can mess with it in the entity build events.

Note: undergound belts / pipes also have this but pairwise.

Re: The ability to "stretch" placing any entity

Posted: Sat Oct 08, 2022 11:56 am
by Stringweasel
mrvn wrote: Sat Oct 08, 2022 11:01 am There is far more to this than wire distance though
For this interface request I do not care for the special electric pole placing behaviour. All I would like is be able to apart the placement of entities when dragging. And this might be a generic enough request to considered, whereas the pole placement logic is likely quite complicated.
mrvn wrote: Sat Oct 08, 2022 11:01 am So for your fluidic power electric poles you have to make the entity-to-place an electric pole prototype and then you can mess with it in the entity build events.
In Fluidic Power's case this would not work for other reasons.

Re: The ability to "stretch" placing any entity

Posted: Sun Oct 09, 2022 6:42 pm
by that_1_nerd
You could make the interface work in this way.
It could accept 3 different values
Default to no spacing: i.g nill
Define maximum distance: i.g integer 5
Or you could pass in a function that executed on title_changed to allow more complex operations and check to be run and defined...