Enhancements to radius_visualisation_specification

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
abarrett
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu May 25, 2017 1:08 pm
Contact:

Enhancements to radius_visualisation_specification

Post by abarrett »

Proposed Change 1
Extend EntityPrototype.radius_visualisation_specification to support multiple RadiusVisualisationSpecification definitions.

Motivation
This change would achieve multiple things:
  1. It would allow for improved compatibility between mods because different mods could add to the radius_visualisation_specification array instead of only being able to overwrite it.
  2. Multiple sprites could be added to held objects, each with their own offset, distance, etc. Currently this can partially be achieved by using Sprite.layers, but the offset, distance, etc. properties are always shared, limiting its usefulness.
Backwards Compatibility
Backwards compatibility can be achieved by making the new type EntityPrototype.radius_visualisation_specification :: RadiusVisualisationSpecification or [RadiusVisualisationSpecification], retaining the ability to specify a single struct.
Proposed Change 2
Update RadiusVisualisationSpecification to allow its sprite to support rotation when the held entity changes orientation.

This could be achieved by changing the type of RadiusVisualisationSpecification.sprite to Sprite4Way, or perhaps to one of the other multi-sprite types.

Motivation
This would allow a different sprite to be shown when the entity is rotated in-hand. For example, an arrow could be displayed next to a held entity with the arrow changing direction to follow the entity’s orientation.

Backwards Compatibility
If the type were to be RadiusVisualisationSpecification.sprite :: Sprite4Way, backwards compatibility would be inherently maintained because existing Sprite definitions fulfill the Sprite4Way contract.
Conclusion
My personal goal that led to these suggestions was to add support for Advanced Fluid Handling in the existing mod Show Max Underground Distance. AFH's pipes support many, many different kinds of pipe connections at different offsets and it does not currently seem to be possible to display them with the current API options.

If either of the above proposals were to be implemented it would suffice for my needs, but I believe the combination of both would offer the most flexibility and potential for other interesting mods to be developed.

Post Reply

Return to “Modding interface requests”