U.F.O.


Use fulgoran objects or technologies to improve your factory

Content
2 days ago
2.0 - 2.1
110
Factorio: Space Age Icon Space Age Mod
Manufacturing Power

b [not a bug] Changing poles not meant to be modified

a month ago
(updated a month ago)
local flags = orig_pole.flags
if not (orig_pole.next_upgrade or (flags and flags["not-upgradable"])) then
    orig_pole.next_upgrade = adapted_name
end

This code is changing an electric pole that is an internal entity of my mod. The internal electric pole is defined with the flag "not-upgradable". So I am not sure this code is doing exactly what you want. But you can not set next_upgrade, if an entity has the flag "not_upgradable", it results in my mod having a load error.

I have a fix to prevent the load error, but the better fix is applied in your mod.

a month ago

Hhm – may be I am blind, but I can't figure out, what should be wrong. The intention is to set next_upgrade only if neither next_upgrade is already set nor "not-upgradable" has been set. Just to be sure, I refactored my code to make it testable and the tests show that the code works as intended.

So could you please explain, why do think the code is wrong?

P.S.: Due to the changes in the last version of my mod, none of of yours should be affected longer as they aren't part of the whitelist for prototypes to be adapted

a month ago

I debugged the issue more closely. Your code is not changing my mod's electric poles, it is changing the base big-electric-pole by adding a next_upgrade, which my mod then makes a copy. I changed my mod to remove the next_upgrade, for the internal poles.

a month ago

All right – looks like that I could close this issue, isn't it?

a month ago

Yes, you can close the issue. But other mods could have the same or similar issue.

a month ago

Yes, you can close the issue. But other mods could have the same or similar issue.

Obviously. My intention was to make it convenient for the players to upgrade from the base version to the adapted version of a pole. Do you know an alternate way to achieve that?

a month ago

To use the upgrade planner, next_upgrade is required.
So if your mod must use the base poles, there is no other option. But for maximum compatibility, make new poles.

a month ago

I already make new poles - based on the 4 vanilla poles + a few from certain mods, if these are present – and for these next_upgrade is set in the base poles 😉.

But thx for the hint and your time.

This thread has been locked.