Construction Drones deprecated

by Klonan

Adds ground based personal construction robots.

Content
3 years ago
0.17 - 1.0
350
Logistic network

b Incorrect implementation of localised_name

5 years ago

As a string is fine, until I add localisation for other languages

5 years ago

But it create compatibility issues, seems.
Could you do something for solve it?

5 years ago
(updated 5 years ago)

Vanilla, and all other mods I've integrated my mods with since I started modding in v0.12 have not used a string in localised_name.

Ever.

This is very easy for you to fix. I've edited your code to prove it. Everywhere you have a line that says

foo.localised_name = name

change it to

foo.localised_name = {name}

And add a language file. :)

5 years ago

Easy doesn't matter

I will do proper locale later, if you mod crashes, it is an error on your mod behalf, as the game fully supports setting it as a string.

5 years ago

Well it's a shame that an official Wube person is choosing to implement this way, when it's the first time I've seen it done. And it would be oh so simple to fix, just a few minutes work.

5 years ago

The point is that string is a valid value type for this property. If it wasn't supposed to work with strings, then Klonan wouldn't tell you your mod is bugged.

5 years ago

I understand that. But as soon as he decides to localise it (which is the intention), it will be an array. It's a edge case that I'd rather not have to deal with, that's all.

5 years ago

So when he "fixes" it in this mod, some other mod that isn't localized and uses string will make Recycling Machines throw an error instead.

Better to just handle the edge case, from a practical standpoint. You only have to write that patch once, instead of bothering every mod author whose code makes yours puke.

5 years ago

If you link me to your source code I can suggest a solution for you

5 years ago

@dgw. As II say, this is the first mod sine I launched mine in 0.12 that has caused this error. I think perhaps that modders, even if they have only 1 language, still use the locale features in factorio.

@Klonan It's a 2 line change in my mod. I know how to fix it. I can do the same for you if you like. :)

It's the principle that's all. My mod's failing because your mod is 'hard coding' instead of localising.

5 years ago

Your mod is failing on something that any mod can rightfully do.

5 years ago
(updated 5 years ago)

Problem solved. I've removed the "Construction drones" mod and then the game wont create problems anymore.
Choices of users.
But, IMHO, better try to solve any problem together than create more to other, if you want your mod appreciated.
I like "Recycling Machines" more than "Construction drones" and I follow my favorite mod.
Done and no more problems.
Sorry for have caused this discussion and I hope you work for a better game instead of fighting for this...
After all I love "Recycling Machines" from the 0.14, when I bought the game and I go on with it.

5 years ago
(updated 5 years ago)

As I said in the forums, you didn't cause any trouble. I have updated my mod to support this edge case.

    if item.localised_name then
        if type(item.localised_name) == "table" then
           -- This is a table. I need the first v
          result = item.localised_name[1]
        else
          -- Oh my days, it's a string. Valid but highly unusual. Means that the mod does not support locale
          -- and is hardcoded to a single language. Tsk.
          -- Fixes https://github.com/DRY411S/Recycling-Machines/issues/52
          result = item.localised_name
          return {"recipe-name.recycledparts",result} 
        end

...

It was an interesting debate.

New response