Page 1 of 2

Version 0.12.11

Posted: Fri Oct 16, 2015 1:24 pm
by FactorioBot
Warning: Most of the mods will be broken by this release, most of the problems can be solved by find and replace of "game.on_" to "script.on_" in the mod script files.
  • Features
    • Added --no-auto-pause: When running as a server, --no-auto-pause will prevent stopping the game when no players are connected.
  • Optimisations
    • Optimised the particle performance. Helps during heavy fights.
  • Changes
    • Showing the log file location when the game crashes, so it is eaiser to find when reporting the bug.
    • The "graphics.force-opengl" option default value is true when AMD graphics card is present.
  • Bugfixes
  • Scripting
    • Changed LuaSurface::set_multi_command signature. Now the function takes a table with following keys: command(required), unit_count(required), force(optional), unit_search_distance(optional) This solves issue with not finding any enemies to attack: https://forums.factorio.com/forum/vie ... =7&t=16541
    • Removed game.on_save function. There should be no need for it and it was causing too many problems.
    • Lua on_load function is not called when saving the game anymore. It is called only on actual load now.
    • Lua API calls on_load, on_init, on_configuration_changed, on_event and generate_event_name have been moved to a new namespace called script (so from now use script.on_load(...)). This will break many mods! The callback registered in on_load function doesn't have access to the game API. This is to avoid common desyncs. The on_init and on_configuration_changed still retain the access to the game API.
    • on_configuration_changed is fired when the map version changes, a mod version changes, a mod is added, or a mod is removed and passes "data": Pushes old_version="x.x.x", new_version="x.x.x" when loading map versions other than the current version When a mod version is changed it appears as a table of mod changes: {["Mod name"] = {old_version="x.x.x", new_version="x.x.x"}, ...} When a mod is added it appears as: ["Mod name"] = {old_version=nil, new_version="x.x.x"} When a mod is removed it appears as: ["Mod name"] = {old_version="x.x.x", new_version=nil}
    • Changed LuaGameScript::makefile to LuaGameScript::write_file and added an optional third parameter bool to append.
  • Modding
    • Replaced entity type "rail" with types "straight-rail" and "curved-rail". Property "bending_type" is optional for rail entities, but is still mandatory for rail remnants.
Use the automatic updater if you can (check experimental updates in other settings) or download full installation at http://www.factorio.com/download/experimental.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 1:40 pm
by oLaudix
Any idea why stuff like

Code: Select all

for i,p in ipairs(game.players) do
suddenly throws error that 'game' is nil value after the update? Its the only thing that breaks my mods now and I don't really know why.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 1:49 pm
by Oxyd
oLaudix wrote:Any idea why stuff like

Code: Select all

for i,p in ipairs(game.players) do
suddenly throws error that 'game' is nil value after the update? Its the only thing that breaks my mods now and I don't really know why.
FactorioBot wrote:
  • Scripting
    • The callback registered in on_load function doesn't have access to the game API. This is to avoid common desyncs. The on_init and on_configuration_changed still retain the access to the game API.
Maybe?

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 2:04 pm
by oLaudix
Then can someone tell me how can i fix error in line 22 of Module Inserter mod? Because i have no clue how those changes affected that part of code.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 2:09 pm
by Zeblote
oLaudix wrote:Then can someone tell me how can i fix error in line 22 of Module Inserter mod? Because i have no clue how those changes affected that part of code.
Well, posting the script in question would help... :D

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 2:25 pm
by kovarex
oLaudix wrote:Any idea why stuff like

Code: Select all

for i,p in ipairs(game.players) do
suddenly throws error that 'game' is nil value after the update? Its the only thing that breaks my mods now and I don't really know why.
This is probably in the on_load method. And yes, this was exactly the goal, to disable the access to the game object in this event. There is no good reason for it, and it brings only possible toruble.

If you want to do some migration, you can use the event on_configuration_changed

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 4:05 pm
by oLaudix
kovarex wrote:This is probably in the on_load method. And yes, this was exactly the goal, to disable the access to the game object in this event. There is no good reason for it, and it brings only possible toruble.
If you want to do some migration, you can use the event on_configuration_changed
So the last line in this code:

Code: Select all

require "defines"
require "util"

MAX_CONFIG_SIZE = 6
MAX_STORAGE_SIZE = 12
DEBUG = false

require "gui"


types = {["mining-drill"]=true,["assembling-machine"]=true,lab=true, ["rocket-silo"] = true, furnace=true, beacon=true}

typeToSlot = {}
typeToSlot.lab = defines.inventory.lab_modules
typeToSlot["assembling-machine"] = defines.inventory.assembling_machine_modules
typeToSlot["mining-drill"] = defines.inventory.mining_drill_modules
typeToSlot["furnace"] = defines.inventory.assembling_machine_modules
typeToSlot["rocket-silo"] = defines.inventory.assembling_machine_modules
typeToSlot["beacon"] = 1

nameToSlots = {}
local metaitem = game.forces.player.recipes["mi-meta"].ingredients
Is not working due to changed to on_load? I don't get how is it possible.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 5:03 pm
by Choumiko
oLaudix wrote:Then can someone tell me how can i fix error in line 22 of Module Inserter mod? Because i have no clue how those changes affected that part of code.
Should be fixed: https://forums.factorio.com/forum/vie ... 97&t=15184
Let me know over there if you run into any issues.

I have to say, i like the changes (or will like them once i'm finished updating my mods :D )
One thing that may be missing is a way to let a mod know what mods are in a save if you add that mod later on.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 5:12 pm
by kovarex
Choumiko wrote:
oLaudix wrote:Then can someone tell me how can i fix error in line 22 of Module Inserter mod? Because i have no clue how those changes affected that part of code.
Should be fixed: https://forums.factorio.com/forum/vie ... 97&t=15184
Let me know over there if you run into any issues.

I have to say, i like the changes (or will like them once i'm finished updating my mods :D )
One thing that may be missing is a way to let a mod know what mods are in a save if you add that mod later on.
the on_configuration_changed actually gives quite detailed information about mod additions/removals/version changes, it just needs to be documented.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 5:16 pm
by kovarex
oLaudix wrote:
kovarex wrote:This is probably in the on_load method. And yes, this was exactly the goal, to disable the access to the game object in this event. There is no good reason for it, and it brings only possible toruble.
If you want to do some migration, you can use the event on_configuration_changed
So the last line in this code:

Code: Select all

require "defines"
require "util"

MAX_CONFIG_SIZE = 6
MAX_STORAGE_SIZE = 12
DEBUG = false

require "gui"


types = {["mining-drill"]=true,["assembling-machine"]=true,lab=true, ["rocket-silo"] = true, furnace=true, beacon=true}

typeToSlot = {}
typeToSlot.lab = defines.inventory.lab_modules
typeToSlot["assembling-machine"] = defines.inventory.assembling_machine_modules
typeToSlot["mining-drill"] = defines.inventory.mining_drill_modules
typeToSlot["furnace"] = defines.inventory.assembling_machine_modules
typeToSlot["rocket-silo"] = defines.inventory.assembling_machine_modules
typeToSlot["beacon"] = 1

nameToSlots = {}
local metaitem = game.forces.player.recipes["mi-meta"].ingredients
Is not working due to changed to on_load? I don't get how is it possible.
Well, this line is not possible to use in the root of the script anymore.

Code: Select all

local metaitem = game.forces.player.recipes["mi-meta"].ingredients
Either you set it up in on_init or on_mod_configuration_changed and put it into global, or you just get it locally when you need.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 5:23 pm
by oLaudix
Choumiko wrote: Let me know over there if you run into any issues.
I was thinking about putting in in on_init but I was just trying to understand why is it not working. Neverthless what I like about this update is that i can finally listen to ambience music without hearing all those AMs making noise while doing nothing :S And that on_load is not running on save (I'm looking at you Foreman).

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 5:52 pm
by orzelek
Was something changed with locales in this update?

I noticed that some of bob's mods lost locale entries completely after updating game to 0.12.11. I didn't find anything relevant in release notes.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 7:12 pm
by bobingabout
Load game, updates detected.
Updated Scenario pack 0.12.10 to 0.12.11
no base game updates from 0.12.9.

I'm going to have to redownload the whole game.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 7:24 pm
by jeroon
Same here, got one install that went from 0.12.10 to .11 just fine.

A different install was still on 0.12.7 (I guess), and I got this update window:

Image

After this, the game updates to 0.12.9, and no new updates are available.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 7:38 pm
by bobingabout
Yeah, now that I've finally updated to 0.12.11, and fixed my clock mod... ALL locale entries added by my mod aren't being loaded.

All locale entry files are named "names.cfg" (was a pretty standardised naming convention dating right back to 0.9.8 when I first made my mods)

It apears (even though there arn't any changelog details listing it) that locale name entry files need to be the same name of ANY active mod (I tried base.cfg and boblogistics.cfg specifically in my logistics mod, and both worked)

I suppose this may not be a bug, but you should probably put this in the changelog if it is intended.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 7:53 pm
by jorgenRe
Thanks for the update! No hard feelings for the broken mods! Because now i umm can actually crete som lua code again, and not have to do the 3D modeling and texturing i really should be doing :lol: !

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 7:57 pm
by kovarex
I don't know what changes with locale are there. Could you post a link to mod that worked before and doesn't work now, so I can understand what exactly is the issue?

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 8:40 pm
by Outsider
For some reason i'm not getting the automated update prompt, tried restarting several times and still doesn't show up, do we have to redownload for this release?

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 8:43 pm
by kovarex
I know there were some errors with the updater, and Cube said it will work properly from 0.12.11 again, so yes, it is possible that you might need to redownload manually.

Re: Version 0.12.11

Posted: Fri Oct 16, 2015 9:04 pm
by Outsider
kovarex wrote:I know there were some errors with the updater, and Cube said it will work properly from 0.12.11 again, so yes, it is possible that you might need to redownload manually.
Thanks, not sure what's going on but i'm getting a 404 on the download link https://www.factorio.com/get-download/0 ... n64-manual

EDIT: nvm works now, was an authentication issue