[MOD 0.16] Upgrade planner

Topics and discussion about specific mods
Qon
Smart Inserter
Smart Inserter
Posts: 2164
Joined: Thu Mar 17, 2016 6:27 am
Contact:

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

Post 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
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
User avatar
Roktaal
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sat Mar 26, 2016 6:42 pm
Contact:

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

Post by Roktaal »

Is it possible to add replacing of stone/concrete tiles?
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
User avatar
Roktaal
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sat Mar 26, 2016 6:42 pm
Contact:

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

Post 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
User avatar
Devious Null
Burner Inserter
Burner Inserter
Posts: 8
Joined: Fri Apr 22, 2016 9:06 pm
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post by Dirayiou »

Any chance of this mod working with 12.3? Would really love to give this one a go.
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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.
User avatar
Roktaal
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sat Mar 26, 2016 6:42 pm
Contact:

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

Post 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
Koub
Global Moderator
Global Moderator
Posts: 7751
Joined: Fri May 30, 2014 8:54 am
Contact:

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

Post 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 :)
Koub - Please consider English is not my native language.
User avatar
Roktaal
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Sat Mar 26, 2016 6:42 pm
Contact:

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

Post 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:
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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?
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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."
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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.
Dirayiou
Burner Inserter
Burner Inserter
Posts: 7
Joined: Mon Apr 25, 2016 1:52 am
Contact:

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

Post 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!
Zjarek
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Apr 16, 2016 9:10 pm
Contact:

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

Post 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 .
User avatar
malk0lm
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Wed Apr 27, 2016 9:45 pm
Contact:

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

Post 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.
Post Reply

Return to “Mods”