shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
81 stars 21 forks source link

[pY] Yafc crashes with "enable all feature flags" #322

Closed WarlordFTW closed 1 week ago

WarlordFTW commented 2 weeks ago

error with Pyanodons:

(pycoalprocessing, prototypes/technologies/stacking-belts.lua):1: attempt to index global 'feature_flags' (a nil value)
stack traceback:
[C]: in function '__index'
(pycoalprocessing, prototypes/technologies/stacking-belts.lua):1: in main chunk
[C]: in function 'require'
(pycoalprocessing, data-updates.lua):7: in main chunk

I no longer get error when removing enable all feature flags because belt stacking is gone. But in this case, most of the tech is still inaccessible and none of the sciencepacks have recipes.

I've attached the mod settings and mod-list in the zip file

mod-settings.zip

SWeini commented 1 week ago

regarding the feature_flags global, this is its documentation https://lua-api.factorio.com/latest/types/FeatureFlags.html

we somehow need to populate it with all the required feature flags from loaded mods I couldn't find updated documentation of info.json, but space-age mod for example includes this:

"quality_required": true, "space_travel_required": true, "spoiling_required": true, "freezing_required": true, "segmented_units_required": true, "expansion_shaders_required": true,

from what I remember the devs saying in the beta discord, the feature flags are only enabled if at least one mod requires it - therefore the need to have the enable-all-feature-flags mod

the whole system is made so that mods like py (that don't need the expansion) can check feature_flags and add additional stuff when the player is using the additional features