[MOD 0.16] Upgrade planner
Re: [MOD 0.15] Upgrade planner
You're welcome
If I have a saved plan. (or in new saved plan)
If I use the trash can to delete a line it doesn't update; changing to another and back the items return.\
---
a fix someone requestd in my version - when droppihng an item over an existing item that causes an error, it is nicer to just restore the previous item instead of clearing the cell...
If I have a saved plan. (or in new saved plan)
If I use the trash can to delete a line it doesn't update; changing to another and back the items return.\
---
a fix someone requestd in my version - when droppihng an item over an existing item that causes an error, it is nicer to just restore the previous item instead of clearing the cell...
Re: [MOD 0.15] Upgrade planner
Okay, I have fixed that and implemented that rules won't be cleared when they errord3x0r wrote:You're welcome
If I have a saved plan. (or in new saved plan)
If I use the trash can to delete a line it doesn't update; changing to another and back the items return.\
---
a fix someone requestd in my version - when droppihng an item over an existing item that causes an error, it is nicer to just restore the previous item instead of clearing the cell...
Re: [MOD 0.15] Upgrade planner
Sorry
Changing the selected configuration doesn't update the plan, it stays at what the new update plan was.
(I made yellow-red, red-blue, blue-yellow) and it wouldn't change after doing the first one
---
EDIT:
Doesn't replace brick/concrete/hazard tiles. (checking on blueprint)
51.906 Error MainLoop.cpp:943: Exception at tick 116421: Error while running event upgrade-planner::on_gui_click (ID 1)
__upgrade-planner__/control.lua:942: bad argument #1 to 'pairs' (table expected, got nil)
Upgrading a blueprint with tiles on it.. (brick, cement&hazard, plan to upgrade brick->cement)
Mostly this was to add +1 for fixing replacing rails/tiles with blueprints... because if you shift-click the plan and it does upgrade the cement tiles to hazard for instance, then the bots will pick up the cement and not place hazard. viewtopic.php?f=213&t=50877
EDIT2:
Oh interesting on selected area just doesn't give you selected tiles in the event. Have to do an additional get_entities_filtered
Changing the selected configuration doesn't update the plan, it stays at what the new update plan was.
(I made yellow-red, red-blue, blue-yellow) and it wouldn't change after doing the first one
---
EDIT:
Doesn't replace brick/concrete/hazard tiles. (checking on blueprint)
51.906 Error MainLoop.cpp:943: Exception at tick 116421: Error while running event upgrade-planner::on_gui_click (ID 1)
__upgrade-planner__/control.lua:942: bad argument #1 to 'pairs' (table expected, got nil)
Upgrading a blueprint with tiles on it.. (brick, cement&hazard, plan to upgrade brick->cement)
Mostly this was to add +1 for fixing replacing rails/tiles with blueprints... because if you shift-click the plan and it does upgrade the cement tiles to hazard for instance, then the bots will pick up the cement and not place hazard. viewtopic.php?f=213&t=50877
EDIT2:
Oh interesting on selected area just doesn't give you selected tiles in the event. Have to do an additional get_entities_filtered
Re: [MOD 0.15] Upgrade planner
Upgrading tiles in the blueprints isn't a easy job, so i will save it for another dayd3x0r wrote:Sorry
Changing the selected configuration doesn't update the plan, it stays at what the new update plan was.
(I made yellow-red, red-blue, blue-yellow) and it wouldn't change after doing the first one
---
EDIT:
Doesn't replace brick/concrete/hazard tiles. (checking on blueprint)
51.906 Error MainLoop.cpp:943: Exception at tick 116421: Error while running event upgrade-planner::on_gui_click (ID 1)
__upgrade-planner__/control.lua:942: bad argument #1 to 'pairs' (table expected, got nil)
Upgrading a blueprint with tiles on it.. (brick, cement&hazard, plan to upgrade brick->cement)
Mostly this was to add +1 for fixing replacing rails/tiles with blueprints... because if you shift-click the plan and it does upgrade the cement tiles to hazard for instance, then the bots will pick up the cement and not place hazard. viewtopic.php?f=213&t=50877
EDIT2:
Oh interesting on selected area just doesn't give you selected tiles in the event. Have to do an additional get_entities_filtered
But i have fixed the crash
Re: [MOD 0.15] Upgrade planner
After updating today I can no longer remove trees by having a Raw Wood -> Deconstruction planner entry. On 0.15.
Re: [MOD 0.15] Upgrade planner
Looks great good jobKlonan wrote: Upgrading tiles in the blueprints isn't a easy job, so i will save it for another day
But i have fixed the crash
Re: [MOD 0.15] Upgrade planner
That option has been removed as outside the scope of the mod, to remove trees either use a filtered deconstruction planner and robots, or install a mod that can handle tree removal in a non-cheaty way. Nanobots, or Explosive Termites are both good options. If you are dead set on cheaty tree removal try the "Tree Eraser" mod.Wexler wrote:After updating today I can no longer remove trees by having a Raw Wood -> Deconstruction planner entry. On 0.15.
Re: [MOD 0.15] Upgrade planner
Doesn't save/restore inserter position (bob's adjustable inserters)
only when the type is inserter; accessing pifckup/drop_position when it's not an inserter throws an error...
only when the type is inserter; accessing pifckup/drop_position when it's not an inserter throws an error...
Code: Select all
-- before default surface.create_entity (last else on belt.type leadin checks) ( line 685, in 1.4.4)
if( belt.type == "inserter" ) then
inserter_pickup = belt.pickup_position;
inserter_drop = belt.drop_position;
end
-- later, in belt.valid else ... (line 774 in 1.4.4; before applying the above 4 lines)
if( new_item.type == "inserter" ) then
new_item.pickup_position = inserter_pickup;
new_item.drop_position = inserter_drop;
end
Re: [MOD 0.15] Upgrade planner
The mod supports upgrading adjustable inserters,
However there is a bug in the latest 0.15 where upgrading a blueprint with a inserter with a custom pickup/dropoff vector will cause a script error
If the fix doesn't make it to 0.15 i will release an update to prevent the crash
However there is a bug in the latest 0.15 where upgrading a blueprint with a inserter with a custom pickup/dropoff vector will cause a script error
If the fix doesn't make it to 0.15 i will release an update to prevent the crash
Re: [MOD 0.15] Upgrade planner
Hi Klonan,
Love your mod - but I'm suddenly recieving this error when trying to change item that are being upgraded.
Error while running event upgrade-planner::on_gui_click (ID 1)
Index out of range.
stack traceback:
__upgrade-planner__/control.lua:144: in function 'gui_open_frame'
__upgrade-planner__/control.lua:488: in function <__upgrade-planner__/control.lua:401>
The only upgrade planned (pretty new game) was raw wood to decontruction (shame that stopped working ) - Might have something to do with that.
(only problem in one save game)
Love your mod - but I'm suddenly recieving this error when trying to change item that are being upgraded.
Error while running event upgrade-planner::on_gui_click (ID 1)
Index out of range.
stack traceback:
__upgrade-planner__/control.lua:144: in function 'gui_open_frame'
__upgrade-planner__/control.lua:488: in function <__upgrade-planner__/control.lua:401>
The only upgrade planned (pretty new game) was raw wood to decontruction (shame that stopped working ) - Might have something to do with that.
(only problem in one save game)
Re: [MOD 0.15] Upgrade planner
Hi,Skovsende wrote:Hi Klonan,
Love your mod - but I'm suddenly recieving this error when trying to change item that are being upgraded.
Error while running event upgrade-planner::on_gui_click (ID 1)
Index out of range.
stack traceback:
__upgrade-planner__/control.lua:144: in function 'gui_open_frame'
__upgrade-planner__/control.lua:488: in function <__upgrade-planner__/control.lua:401>
The only upgrade planned (pretty new game) was raw wood to decontruction (shame that stopped working ) - Might have something to do with that.
(only problem in one save game)
Can you send me that save game?
Re: [MOD 0.15] Upgrade planner
As soon as I get home from workKlonan wrote:Hi,Skovsende wrote:Hi Klonan,
Love your mod - but I'm suddenly recieving this error when trying to change item that are being upgraded.
Error while running event upgrade-planner::on_gui_click (ID 1)
Index out of range.
stack traceback:
__upgrade-planner__/control.lua:144: in function 'gui_open_frame'
__upgrade-planner__/control.lua:488: in function <__upgrade-planner__/control.lua:401>
The only upgrade planned (pretty new game) was raw wood to decontruction (shame that stopped working ) - Might have something to do with that.
(only problem in one save game)
Can you send me that save game?
Re: [MOD 0.15] Upgrade planner
Hi,
I'm getting a crash with the messages in the attached image. This is the blueprint I'm working with: The mods I'm running: Thanks,
Jim
I'm getting a crash with the messages in the attached image. This is the blueprint I'm working with: The mods I'm running: Thanks,
Jim
Re: [MOD 0.15] Upgrade planner
Thanks for the report,jimmiles wrote:Hi,
I'm getting a crash with the messages in the attached image. This is the blueprint I'm working with: The mods I'm running: Thanks,
Jim
I looked into it, and my mod isn't the cause of the issue,
I am raising an event, with the valid entity,
The subterrain mod is then performing some logic on its 'neightbour' without verifying properly the neighbour exists
Code: Select all
function subterrainOnBuilt(event)
if settings.global["subterrain-belt-cost-multiplier"].value <= 0 then return nil end --don't cost belts
local entity = event.created_entity
local player = game.players[event.player_index]
local eName = entity.name
--check to see if the place is important
if not entity.belt_to_ground_type == "output" or (entity.belt_to_ground_type == "input" and not entity.neighbours) then
return
end
local otherEntity = entity.neighbours
local distance = getDistance(entity, otherEntity)
local cost = (math.floor(distance * settings.global["subterrain-belt-cost-multiplier"].value))
local respectiveBelts = string.gsub(eName, "subterranean", "transport")
local respectiveBelts_pretty = respectiveBelts:gsub("-", " ") .. "s"
otherEntity.force = "player" --set the force of the other side to player, to allow refund
if not checkCount(player, cost, respectiveBelts) then --they don't have enough of the aboveground belts for this distance
entity.destroy()
player.print("You don't have enough " .. respectiveBelts_pretty .. " in your inventory to create this length.")
restoreDeniedItem(player,eName)
else
player.remove_item{name = respectiveBelts, count = cost} --deduct the required belts from their inventory
end
end
Re: [MOD 0.15] Upgrade planner
Thank you!I looked into it, and my mod isn't the cause of the issue,
I am raising an event, with the valid entity,
The subterrain mod is then performing some logic on its 'neightbour' without verifying properly the neighbour exists
If mod my was the issue, it would error much sooner than this function
Re: [MOD 0.15] Upgrade planner
Link to the savegame: https://www.dropbox.com/s/ap9drk2cetlouxk/Save.zip?dl=0Skovsende wrote:As soon as I get home from workKlonan wrote:Hi,Skovsende wrote:Hi Klonan,
Love your mod - but I'm suddenly recieving this error when trying to change item that are being upgraded.
Error while running event upgrade-planner::on_gui_click (ID 1)
Index out of range.
stack traceback:
__upgrade-planner__/control.lua:144: in function 'gui_open_frame'
__upgrade-planner__/control.lua:488: in function <__upgrade-planner__/control.lua:401>
The only upgrade planned (pretty new game) was raw wood to decontruction (shame that stopped working ) - Might have something to do with that.
(only problem in one save game)
Can you send me that save game?
Link to the mod-pack: https://www.dropbox.com/s/s0lghbqgdempd ... k.zip?dl=0
Re: [MOD 0.15] Upgrade planner
Version 1.4.6 released:
- Added support for upgrading rails and curved rails
- Configs will be verified on configuration to check for item prototype changes
- Fixed error with old invalid configs
- Fixed error when dropdown index could become out of range
Re: [MOD 0.15] Upgrade planner
Shift-click upgrading rails just makes rails disappear.
viewtopic.php?f=213&t=50877 (affects deconstruction and using a blueprint over deconstructed entities)
viewtopic.php?f=213&t=50877 (affects deconstruction and using a blueprint over deconstructed entities)
Re: [MOD 0.15] Upgrade planner
upgrading a rail causes Bio Industries mod to crash... Normally when a rail is deconstructed, the event is sent with the name of the planner item, not the specific rail.
(this is a normal deconstructed scrap-rail)
60.510 Script @__Bio_Industries__/control.lua:530: tile name:scrap-rail
(this is the name logged when using the upgrade planner to replace a rail)
94.093 Script @__Bio_Industries__/control.lua:530: tile name:curved-scrap-rail
this causes the mod to fail...
94.177 Error MainLoop.cpp:940: Exception at tick 340740: Error while running event upgrade-planner::on_player_selected_area (ID 49)
Error while running event Bio_Industries::on_player_mined_item (ID 8)
__Bio_Industries__/control.lua:531: attempt to index field '?' (a nil value)
stack traceback:
__upgrade-planner__/control.lua:783: in function 'player_upgrade'
__upgrade-planner__/control.lua:562: in function 'on_selected_area'
__upgrade-planner__/control.lua:539: in function <__upgrade-planner__/control.lua:538>
This is the code that fails in bio Industries; because it's expecting an item_prototype name not an entity_prototype name... and again, normal deconstruction with deconstruction planner or by hand uses the item name not the prototype name.
local player = game.players[event.player_index]
local tile_name = event.item_stack.name
local tile = game.item_prototypes[tile_name].place_as_tile_result
Upgrade Builder and Planner source...
control.lua 783
script.raise_event(defines.events.on_player_mined_item,{player_index = player.index, item_stack = {name = n, count = 1}})
should reference
upgrade.item_from as the name, not belt.name
----
Also it will not return the proper number of rails on a curved rail replace; I should get back 4 rails and use 4 rails not just 1.
Edit: It's actually not giving me back any rails past the first one... and not using any rails. if I have none, i get back some 1... if I have 1 or more I don't back any more.
Control.lua:781
player.remove_item{name = upgrade.item_from, count = 1}
player.insert{name = upgrade.item_from, count = 1}
It's removing the same item it's restoring... so basically it doesn't use any item anymore.
(this is a normal deconstructed scrap-rail)
60.510 Script @__Bio_Industries__/control.lua:530: tile name:scrap-rail
(this is the name logged when using the upgrade planner to replace a rail)
94.093 Script @__Bio_Industries__/control.lua:530: tile name:curved-scrap-rail
this causes the mod to fail...
94.177 Error MainLoop.cpp:940: Exception at tick 340740: Error while running event upgrade-planner::on_player_selected_area (ID 49)
Error while running event Bio_Industries::on_player_mined_item (ID 8)
__Bio_Industries__/control.lua:531: attempt to index field '?' (a nil value)
stack traceback:
__upgrade-planner__/control.lua:783: in function 'player_upgrade'
__upgrade-planner__/control.lua:562: in function 'on_selected_area'
__upgrade-planner__/control.lua:539: in function <__upgrade-planner__/control.lua:538>
This is the code that fails in bio Industries; because it's expecting an item_prototype name not an entity_prototype name... and again, normal deconstruction with deconstruction planner or by hand uses the item name not the prototype name.
local player = game.players[event.player_index]
local tile_name = event.item_stack.name
local tile = game.item_prototypes[tile_name].place_as_tile_result
Upgrade Builder and Planner source...
control.lua 783
script.raise_event(defines.events.on_player_mined_item,{player_index = player.index, item_stack = {name = n, count = 1}})
should reference
upgrade.item_from as the name, not belt.name
----
Also it will not return the proper number of rails on a curved rail replace; I should get back 4 rails and use 4 rails not just 1.
Edit: It's actually not giving me back any rails past the first one... and not using any rails. if I have none, i get back some 1... if I have 1 or more I don't back any more.
Control.lua:781
player.remove_item{name = upgrade.item_from, count = 1}
player.insert{name = upgrade.item_from, count = 1}
It's removing the same item it's restoring... so basically it doesn't use any item anymore.
Re: [MOD 0.15] Upgrade planner
All fixed in 1.4.7d3x0r wrote:snip