Page 5 of 17

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Mon Apr 18, 2016 9:48 pm
by Qon
Crashes when clicking the icon. viewtopic.php?f=92&t=23680&p=150264#p150264
Factorio 0.12.29
UP 1.1.19
Mod iconizer 1.0.0

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Sat Apr 23, 2016 6:46 am
by Roktaal
Is it possible to add replacing of stone/concrete tiles?

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Sat Apr 23, 2016 7:41 pm
by kds71
Qon wrote:Crashes when clicking the icon. viewtopic.php?f=92&t=23680&p=150264#p150264
Factorio 0.12.29
UP 1.1.19
Mod iconizer 1.0.0
Hm it looks like there is a confilct with Mod iconicer, I've never used it, so it is hard to tell what is going on. I'll try to look into it.
Roktaal wrote:Is it possible to add replacing of stone/concrete tiles?
Hm it should be, since tiles can be marked for deconstruction and basically the Upgrade Planner is the same as the Deconstruction Planner. I don't know yet why my mod doesn't allow to mark tiles, but it should be easy to fix.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Sat Apr 23, 2016 7:47 pm
by Roktaal
kds71 wrote:
Qon wrote:Crashes when clicking the icon. viewtopic.php?f=92&t=23680&p=150264#p150264
Factorio 0.12.29
UP 1.1.19
Mod iconizer 1.0.0
Hm it looks like there is a confilct with Mod iconicer, I've never used it, so it is hard to tell what is going on. I'll try to look into it.
Yes, that was a problem with Mod Iconizer v1.0.0 and it is fixed in latest version

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Mon Apr 25, 2016 12:09 am
by Devious Null
I found and fixed a bug in this mod, and I thought I should contribute it back for everyone.

In a multiplayer game I was playing, the game reliably crashed when an object was marked for deconstruction while another player was dead. In specific, this was caused by the automated deconstruction orders given by the Treefarm mod (viewtopic.php?f=44&t=19124), but I believe any deconstruction orders would trigger the bug. I fixed it by adding a nil-check.

Code: Select all

diff -ru source/upgrade-planner_1.1.9/control.lua modified/upgrade-planner_1.1.9/control.lua
--- source/upgrade-planner_1.1.9/control.lua	2016-01-30 00:37:04.357526600 -0600
+++ modified/upgrade-planner_1.1.9/control.lua	2016-04-24 18:59:57.140407600 -0500
@@ -553,7 +553,7 @@
 
         stack = game.players[i].cursor_stack
 
-        if stack.valid_for_read then
+        if stack ~= nil and stack.valid_for_read then
             if stack.name == "upgrade-planner" then
                 if upgrade or deconstruction then
                     entity.cancel_deconstruction(entity.force)
If you have any questions about this patch, please feel free to ask.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Mon Apr 25, 2016 1:55 am
by Dirayiou
Any chance of this mod working with 12.3? Would really love to give this one a go.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Mon Apr 25, 2016 10:33 am
by kds71
Devious Null wrote:If you have any questions about this patch, please feel free to ask.
Ah, I didn't know that stacks is nil when player is dead. I'll try to fix it soon.
Dirayiou wrote:Any chance of this mod working with 12.3? Would really love to give this one a go.
I don't understand, why can't you update your Factorio to a newer version? 12.3 was released a long time ago. Or perhaps do you mean v0.12.30? If so, then this mod should work fine.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 1:05 am
by Dirayiou
I'm on 12.5 now and it's still not working. I'm probably just doing something wrong. My other 15ish mods work just fine though.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 1:08 am
by Roktaal
Thread title says it all. This mod requires at least Factorio 0.12.16. Update your client to latest version and everything will be fine

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 7:55 am
by Koub
Roktaal wrote:Update your client to latest version and everything will be fine
Except maybe some of your aother 15ish mods will stop working :)

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 8:57 am
by Roktaal
Koub wrote:
Roktaal wrote:Update your client to latest version and everything will be fine
Except maybe some of your aother 15ish mods will stop working :)
Oh yea then he will have to update the client and all his mods. If some the mods he is using is not updated by the author then he will have to learn lua and update them himself :idea: :mrgreen:

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 3:32 pm
by kds71
Dirayiou wrote:I'm on 12.5 now and it's still not working. I'm probably just doing something wrong. My other 15ish mods work just fine though.
Hm I should have the previous versions of this mods somewhere, so if you really don't want to update Factorio to the latest version, I can look for it and upload it here - just let me know. However, I would recommend to update Factorio instead.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Tue Apr 26, 2016 4:22 pm
by Dirayiou
Koub wrote:
Roktaal wrote:Update your client to latest version and everything will be fine
Except maybe some of your aother 15ish mods will stop working :)
So what can I do here?

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Wed Apr 27, 2016 7:46 pm
by Dirayiou
kds71 wrote:
Dirayiou wrote:I'm on 12.5 now and it's still not working. I'm probably just doing something wrong. My other 15ish mods work just fine though.
Hm I should have the previous versions of this mods somewhere, so if you really don't want to update Factorio to the latest version, I can look for it and upload it here - just let me know. However, I would recommend to update Factorio instead.
I plan to do a full on update (mods and all) hopefully this weekend. but if you could point me to a version of Upgrade Planner that works on 12.5 in the meantime that would be fantastic.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Wed Apr 27, 2016 8:37 pm
by Dirayiou
So I did a bit of tinkering and got the mod to load up. I can make the planner itself and the GUI is there. However when I use the mod I get this error.


"Error while running the event handler:
__upgrade-planner__/control.lua:394:
LuaitemPrototype doesnt' contain key
localised_name."

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Thu Apr 28, 2016 7:32 am
by kds71
Dirayiou wrote:So I did a bit of tinkering and got the mod to load up. I can make the planner itself and the GUI is there. However when I use the mod I get this error.


"Error while running the event handler:
__upgrade-planner__/control.lua:394:
LuaitemPrototype doesnt' contain key
localised_name."
Hey, sorry for the delay. Sadly, I can't find an old version of my mod, it looks like I deleted it... and I didn't use any version control for this mod ;(

LuaEntityPrototype::localised_name was introduced in Factorio v0.12.11, in previous versions you have to use game.get_localised_item_name. To fix your issue you will have to apply the following changes to the control.lua file:

In line 46 replace:

Code: Select all

    return game.item_prototypes[global["config-tmp"][player.name][index][type]].localised_name
with:

Code: Select all

    return game.get_localised_item_name(global["config-tmp"][player.name][index][type])
In line 394 replace:

Code: Select all

    ruleset_grid["upgrade-planner-" .. type .. "-" .. index].caption = game.item_prototypes[stack.name].localised_name
with:

Code: Select all

    ruleset_grid["upgrade-planner-" .. type .. "-" .. index].caption = game.get_localised_item_name(stack.name)
I still recommend to upgrade your Factorio and all mods you have instead :) You are missing new features and bug fixes by not doing so.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Sat Apr 30, 2016 1:31 am
by Dirayiou
kds71 wrote:
Dirayiou wrote:So I did a bit of tinkering and got the mod to load up. I can make the planner itself and the GUI is there. However when I use the mod I get this error.


"Error while running the event handler:
__upgrade-planner__/control.lua:394:
LuaitemPrototype doesnt' contain key
localised_name."
Hey, sorry for the delay. Sadly, I can't find an old version of my mod, it looks like I deleted it... and I didn't use any version control for this mod ;(

LuaEntityPrototype::localised_name was introduced in Factorio v0.12.11, in previous versions you have to use game.get_localised_item_name. To fix your issue you will have to apply the following changes to the control.lua file:

In line 46 replace:

Code: Select all

    return game.item_prototypes[global["config-tmp"][player.name][index][type]].localised_name
with:

Code: Select all

    return game.get_localised_item_name(global["config-tmp"][player.name][index][type])
In line 394 replace:

Code: Select all

    ruleset_grid["upgrade-planner-" .. type .. "-" .. index].caption = game.item_prototypes[stack.name].localised_name
with:

Code: Select all

    ruleset_grid["upgrade-planner-" .. type .. "-" .. index].caption = game.get_localised_item_name(stack.name)
I still recommend to upgrade your Factorio and all mods you have instead :) You are missing new features and bug fixes by not doing so.
Don't worry about the delay. I appreciate you taking the time to help me. Atempting the fix as suggested. will post an update. and I will be updating it all hopefully in the next few days.

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Sat Apr 30, 2016 1:53 am
by Dirayiou
Works flawlessly now! Get the occasional lag every now and then when I select larger areas but that's most likely just my laptop!

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Thu May 05, 2016 8:07 pm
by Zjarek
There seems to be a bug with handling deconstruction planner if one of the players is dead. Here is bug report that interested me: https://www.reddit.com/r/factorio/comme ... ur_server/ .

Basically if a player is dead LuaPlayer.cursor_stack is nil and the game crashes when trying to access property cursor_stack.valid_for_read on line 556 in control.lua. I haven't tested it with this combination of mods (too much time to setup treefarm or convince friends to install mod just to crash a game), but quick test convinced me that this is a problem: http://imgur.com/m7GT4Yw .

Re: [MOD 0.12.16] Upgrade planner - v1.1.9

Posted: Fri May 06, 2016 9:38 pm
by malk0lm
This is a crashing issue for 12.33.

Code: Select all

 619.738 Error MultiplayerManager.cpp:110: MultiplayerManager failed: "Error while running the event handler: __upgrade-planner__/control.lua:556: attempt to index local 'stack' (a nil value)"
I'll attempt to modify the source locally based on the reddit post and see what happens.