Lookup Anything

Lookup Anything

242k Downloads

[Tractor mod] Support of Custom TerrainFeature

jpparajeles opened this issue ยท 3 comments

commented

Hello, I currently have a mod that creates a Custom Terrain Feature, I'm not using any Harmony patches at the moment, so compatibility with the Tractor mod seems complicated at this point.

Could it be possible to create an Interface on the Tractor mod that allows an entrypoint for Custom Terrain features?. Something like

public interface ICustomAttachmentBehavior
{
    bool ApplyTool(IAttachment attachment, Tool? tool, int damage, Vector2 tileLocation)
}

This would require that IAttachment be made public so other people can access it

I'm willing to draft a PR with the approach if you think it would be a good addition, let me know if this is a good forum to discuss the technical details, if this is feasible

commented

Hi! One complication is that players configure which tool effects to apply. For example, they can enable axes chopping trees but disable scythes harvesting moss:

Image

For the sort of extensibility you're describing, we'd probably need an API to configure the tool effects too so they work like the rest of the tractor attachments.

commented

Yeah, configuration seems like a hard problem
At first glance, the following ideas could happen, none of them are perfect

  1. The remote mods have the configs
    • Pro: the settings follow under the implementers code
    • Con: It will make the configuration for the mod split in two ways
  2. There is a variable in the Tractor mod to define extra settings
    • Pro: single config
    • Con: Differences in the styles of the configs
    • Con: i18n may not be present for all languages in Tractor mod
  3. The external behavior exports the components to make the config from within the Tractor Mod
  • Pro: Should keep the style
  • Con: More complicated behavior
  • Con: i18n may not be present for all languages in Tractor mod

Option (1) would have lower changes to the tractor mod; however, having the config split has a heavy negative aspect. Otherwise, Option (2) would be the next best option, so we keep the order, or have an option at the end with a more verbose approach.

What do you think of these options? Do they make sense or is it more complicated than needed (due to its generic nature)?