Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAFC won't create project if you don't own the DLC #323

Closed
lehitom opened this issue Oct 22, 2024 · 13 comments
Closed

YAFC won't create project if you don't own the DLC #323

lehitom opened this issue Oct 22, 2024 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@lehitom
Copy link

lehitom commented Oct 22, 2024

YAFC CE v2.0.0
Factorio v2.0.8

When it attempts to create a project, it detects the expansion as active (I don't own it) and the mod list only contains the base game. After hitting disable and reload 4 times, it hits a critical error. This is a fresh install of the game as of 2.0.7, I moved my 1.1 files elsewhere.

image

@lehitom lehitom added the bug Something isn't working label Oct 22, 2024
@veger
Copy link
Collaborator

veger commented Oct 23, 2024

Yes... I saw that the space age mod is hard-coded enabled in 39e328b:

allMods = new Dictionary<string, ModInfo> { { "base", null! }, { "elevated-rails", null! }, { "quality", null! }, { "space-age", null! } };

I do not like this change myself, but the PR #320 got merged very quickly.

@shpaass Why don't we read the mod list and check if it is enabled or not? Same goes for hard-coded Quality, if people disable this (for reasons) they cannot use YAFC! (Maybe we need a separate ticket to discuss this, or we use this one?)

@shpaass
Copy link
Owner

shpaass commented Oct 23, 2024

The PR #320 got merged very quickly to have at least some support of Factorio 2.0.
I'm not against reading the mod list or making the quality optional.
We can discuss your concerns here, or if they don't fit the ticket, you can create a separate one.

@veger
Copy link
Collaborator

veger commented Oct 23, 2024

My proposal would be:

  1. read mod list and check for the DLC mods
  2. when they are found we can set some 'static' variable, so the rest of YAFC can easily add support for them
  3. we fix all hard-coded space-age and quality support by enabling them only when the corresponding mds are detected/loaded.
  4. (bonus) we could do the same (in the future) for py related stuff like TURD support?

If we all agree with this proposal, I guess we need to figure out some flexible way (plugins?) to add mod specific support/code for space-age, quality (and py).

@veger
Copy link
Collaborator

veger commented Oct 23, 2024

@lehitom For now, I would suggest to revert to the previous YAFC version, until we fixed this (it might take a little). I think the newest version only/mostly added v2.0 support, so there is not (much) you would miss out on.

@shpaass
Copy link
Owner

shpaass commented Oct 23, 2024

I would suggest to revert to the previous YAFC version

I think that Yafc 0.9.x doesn't work with Factorio 2.x, but that needs to be checked.

@veger
Copy link
Collaborator

veger commented Oct 23, 2024

Oh... there were some breaking changes for the base game as well? 😞
Then we need to quickly fix this ticket, so players without the DLC can use it again

@shpaass
Copy link
Owner

shpaass commented Oct 23, 2024

I'll be free in around 10 hours, but it will take time learning this part of Yafc.

@veger
Copy link
Collaborator

veger commented Oct 23, 2024

While waiting for the agreement or on counter proposals, I'll work on decoupling space-age/quality/elevated-rail from the base game. I guess we need to this at the least...

@veger veger self-assigned this Oct 23, 2024
@lehitom
Copy link
Author

lehitom commented Oct 23, 2024

Oh... there were some breaking changes for the base game as well? 😞 Then we need to quickly fix this ticket, so players without the DLC can use it again

Yup, just spun up my YAFC CE v0.9.1 with factorio 2.0.9 (Base only, don't own DLC) and I get a wall of red, not even a complete error.

image

@shpaass
Copy link
Owner

shpaass commented Oct 23, 2024

Yup, just spun up my YAFC CE v0.9.1 with factorio 2.0.9 (Base only, don't own DLC) and I get a wall of red, not even a complete error.

Yafc v0.9.1 is not meant to work with Factorio 2.x. Too much stuff changed in the game.

@veger
Copy link
Collaborator

veger commented Oct 23, 2024

There is nothing (code-wise) that requires the Space Age DLC/mods to be loaded. So removing the hard-coded loading of the Space Age DLC mods seemed to be enough.

So it does not seem to be necessary (for now) to think about keeping track of certain feature to be available or not. In a later stage when we want to support 'quality', 'spoiling', 'TURD', etc., we do need to think about it.

shpaass added a commit that referenced this issue Oct 28, 2024
I checked all of the #320 commits to see if they would a hard dependency
on the Space Age DLC. And I only found the one commit that adds the mods
by default.

As far as I could figure out, there is no need to forcefully add these
mods: when they are enabled in mod-list.json they get loaded. No other
code is depending on these mods, all related code adds support when it
is encountered when loading the mods.

I tested by loading both a Space Age and a non-Space Age project (with
the mods enabled/disabled) without issues.

So in the end the fix for #323 is fairly straightforward 😌
@veger
Copy link
Collaborator

veger commented Oct 29, 2024

This should have been fixed in the v2.1.0 release, could you verify so we can close the issue?

@lehitom
Copy link
Author

lehitom commented Oct 30, 2024

v2.1.0 release works just as good as the custom build I did of the original patch on shpass's branch. So all good here

Thanks again!

@shpaass shpaass closed this as completed Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants