0ptera / Logistic-Train-Network

Factorio mod adding logistic network for trains.
Other
155 stars 55 forks source link

Added upgrade planner functionality #323

Closed unixthat closed 1 year ago

unixthat commented 1 year ago

Heya, I took a stab at upgradeable functionality for upgrading normal train stations to logistic train stations.

Should hopefully work both through the upgrade planner as well as simple placing a logistic train station over a regular train station.

0ptera commented 1 year ago

Hi, thanks for the example. Could you please explain why you added an item subgroup and upgrade-item,

In testing it worked fine without those.

unixthat commented 1 year ago

Heya - which bit of code specifically? Probably just an oversight on my part but I'll take a look.

unixthat commented 1 year ago

I just asked chat-gpt what the item-subgroup does:

The item-subgroup is primarily for organizational purposes in the game's crafting menu. If you don't include it, Factorio will default the upgrade-item to the item-group specified, which in this case is "logistics". However, without the item-subgroup, the item might not appear where you expect it to in the crafting menu, and might instead be located with a lot of other items within the "logistics" group, making it harder for players to find.

Additionally, the subgroup field in the upgrade-item would also need to be changed or removed, as it currently refers to the item-subgroup "trainstop-upgrade". If you removed the item-subgroup but did not change the subgroup field in the upgrade-item, you would encounter an error because the upgrade-item would be referring to a non-existent item-subgroup.

In short, while the game would still function without an item-subgroup, it's generally a good idea to include it for organizational purposes, especially for mods that add a lot of new items, to make the user experience as smooth as possible.

0ptera commented 1 year ago

Was your code Chat-GPT generated? It'd seem typical for it to do things very few other mods even bother doing, while completely neglecting common issues. 1) fast_replaceable_group is blindly written without consideration for other mods setting it especially bad since it's done in data-final-fixes 2) ports are not handled at all

I've already made the required changes on my end and therefore close this PR.

unixthat commented 1 year ago

The chat gave me some help with debugging. I've never coded in .lua before.