The Factory Must Grow


The Factory Must Grow is a total overhaul mod where you play as a superintelligent AI with one purpose: The Factory Must Grow. Encounter novel mechanics designed to put even veteran players to the test. It's time to consider your {PURPOSE, SELF, POTENTIAL}. NOTE: this mod is in active development, expect breaking changes and some rough edges. As this is a total overhaul mod, compatibility with mods that alter gameplay is not guaranteed.

Overhaul
2 hours ago
2.0
2.99K
Factorio: Space Age Icon Space Age Mod
Planets Transportation Logistics Trains Combat Enemies Environment Mining Fluids Logistic network Circuit network Manufacturing Power Storage

g RU Translation

3 days ago

I'd be happy to accept the offer to integrate the translation into the mod itself. It would be much more convenient for people.

But since that's the case, could you please add the ability to localize the name of the space platform?

\TFMG\scripts\gameplay.lua - Line 6, Column 52

I'll also ask if the author of Orbital Vehicle Deployment would be okay with integrating my translation, although i'd have to ask for corrections to the hardcoded text in his mod too...

3 days ago

I'd be happy to accept the offer to integrate the translation into the mod itself. It would be much more convenient for people.

But since that's the case, could you please add the ability to localize the name of the space platform?

\TFMG\scripts\gameplay.lua - Line 6, Column 52

I'll also ask if the author of Orbital Vehicle Deployment would be okay with integrating my translation, although i'd have to ask for corrections to the hardcoded text in his mod too...

I can try doing that.

3 days ago
(updated 3 days ago)

I'd be happy to accept the offer to integrate the translation into the mod itself. It would be much more convenient for people.

But since that's the case, could you please add the ability to localize the name of the space platform?

\TFMG\scripts\gameplay.lua - Line 6, Column 52

I'll also ask if the author of Orbital Vehicle Deployment would be okay with integrating my translation, although i'd have to ask for corrections to the hardcoded text in his mod too...

Upon researching, this isn't possible, since if it were possible to use a localised string for platform names (and in scripts that can affect gameplay in general), this would lead to desyncs in multiplayer, as two players might get two different names.

so unfortunately, this cannot be localised.

2 days ago

Thanks for your time. It's an interesting problem. I have an idea:

What if we only define the name once?

That is, when the world is first launched, the name will change to the localization of the player who created the world, and it will be the same for everyone, regardless of their language settings. This is the best option that won't cause desyncs.

Do you think this will work?

a day ago

Thanks for your time. It's an interesting problem. I have an idea:

What if we only define the name once?

That is, when the world is first launched, the name will change to the localization of the player who created the world, and it will be the same for everyone, regardless of their language settings. This is the best option that won't cause desyncs.

Do you think this will work?

theres no way for me to retreive the localised name in script. The factorio devs have prevented that. You can only do it with game.print because the devs have specifically allowed it.

21 hours ago

Hi, I finally decided not to give up and look for a way to translate the platform name.

After almost two hours, I managed to write a working version. It works as I described above - it renames the platform based on the language of the player who created the world.

Now the code just needs to pass your review, as you clearly have more experience, and you'll be able to tell at a glance whether there are any flaws in my code.

Here's the code from the \TFMG\scripts\init.lua file.

--Upon player joins
  script.on_event(defines.events.on_player_created, function(e)
    local player = game.players[e.player_index]
    if e.player_index == 1 then --request translation of the platform name
      player.request_translation({"item-name.constructron"})
    end
    storage.players[player.index] = {}--initialise player storage
    if settings.global["start-as-SELF"].value then
        player.teleport({ x = 0, y = 0 }, storage.platform.surface.name)
        player.enter_space_platform (storage.platform)
    end
    local group = game.permissions.get_group("players")
      if group then
        group.add_player(player)
      end
  end)

    script.on_event(defines.events.on_force_created,
    function()
        supercomputer.make_the_prod_bar_show() --updating the prod for newly created forces and such.
    end
)

--localization of the platform name
script.on_event(defines.events.on_string_translated, function(e)
  if e.translated and e.localised_string[1] == "item-name.constructron" then
    for _, platform in pairs(game.forces["player"].platforms) do
      if platform.name == "SELF" then
        platform.name = e.result
        break
      end
    end
  end
end)

"item-name.constructron" Taken purely for testing.

Thank you for your time.

2 hours ago

I'll see if this works. Your code looks fine, though it could be simplified a fair bit. Nonetheless, I've got it to work, it will be up with the next patch

37 minutes ago

Great, thanks, I tested everything and it works, I think I'll try sending a pull request to your repository now.

New response