WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
87 stars 19 forks source link

(Feature request) `--list-actions` #217

Closed plut closed 9 months ago

plut commented 2 years ago

Here is a suggestion: --list-actions tp2file component — Displays, in a machine-readable format, all the actions that would be performed by installing this component, without performing any of them (a la make -n); including (at least) all the COPY and COPY_EXISTING actions (and, if possible, the locations of most 2DA patches).

Use case: this would be helpful in automatically determining mod compatibility, using the following scenarios:

I have some sample code for this (I declared a global boolean in util.ml and checked it inside open_for_writing_internal); however, given that (a) this does not currently work very well and (b) I have not written a single line in Caml for 20 years now, I prefer letting more seasoned authors have a try at it first.

FredrikLindgren commented 9 months ago

Considering I'm a little late in replying, I'll just leave this here and close this issue. If the feature is still desired, discussion can take place here (and I'll re-open) or in a new issue.

The request should be technically possible (though I would think you could just let the TP2 parser have at it, and get a list of TP2 actions back), however, I think you may be a bit optimistic about what can be inferred from the result. Overlapping COPY targets does not necessarily mean the mods are incompatible, if, for instance, the overwriting mod overwrites with a specifically tailored resource based on a conditional. Other times, the overwriting is no big deal because the overwritten mod can deal with it. Conversely, patching does not mean two mods are compatible as two mods can make conceptually incompatible patches, or one "overpatch" another.

This is certainly picking nits and if the feature is still desirable, I can look into implementing it.