[0.12.10] Supply Challenge: 'story' nil value

This subforum contains all the issues which we already resolved.
Post Reply
codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

[0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

Attempting to start the Supply Challenge with both the game and scenario pack updated to 0.12.10 produces this error:
story bug.png
story bug.png (94.86 KiB) Viewed 11442 times
The error persists after removing the "scenario-pack" folder from Factorio\data and allowing the game to re-download the scenario pack.

I tried modifying the scenario's control.lua to resolve the problem. I got as far as being able to progress through the levels, but more errors occur when loading games saved from this scenario.

codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

This patch to control.lua fixes all of the problems I've found with the scenario. Starting a new game, completing levels, loading, and saving all work now.

Code: Select all

--- scenario-pack/scenarios/supply/control_orig.lua     Sun Oct  4 19:21:30 2015
+++ scenario-pack/scenarios/supply/control.lua  Sun Oct  4 23:05:04 2015
@@ -434,7 +434,7 @@

         if global.level < #levels + 1 then
           game.player.gui.top.frame.destroy()
-          mainstory:jumpto("level-start")
+          story_jump_to(global.mainstory, "level-start")
         end
       end
     },
@@ -446,17 +446,10 @@
   }
 }

-mainstory = story.Story:new(storytable)
-
-game.on_save(function()
-  global.storydata = mainstory:export()
-end)
-
-game.on_load(function()
-  mainstory:import(global.storydata)
-end)
+story_init_helpers(storytable)

 game.on_init(function()
+  global.mainstory = story_init()
   game.map_settings.pollution.enabled = false
   game.evolution_factor = 0
   global.chests = {}
@@ -472,5 +465,5 @@
 end)

 game.on_event(defines.events, function(event)
-  mainstory:update(event, "")
+  story_update(global.mainstory, event, "")
 end)

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by kovarex »

But patching it manually breaks the updater, so it shouldn't be done. Cube try to find out, why the scenario pack update wasn't made.

codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

kovarex wrote:But patching it manually breaks the updater, so it shouldn't be done.
If the updater is going to give me a broken scenario again, I'm fine with that. :P

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by kovarex »

Did you update the scenario pack?

codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

kovarex wrote:Did you update the scenario pack?
Yep. It was the first thing I tried.
codewarrior wrote:The error persists after removing the "scenario-pack" folder from Factorio\data and allowing the game to re-download the scenario pack.
Tried it again just now, same problem.

codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

While we're on the topic, here's another bug, one where too many points are awarded. This line computes the points to add when a level is completed:

Code: Select all

control.lua:415
    local pointsaddition = math.floor(secondsleft * pointspersecondstart - global.level * pointspersecondlevelsubtract)
It should do this to properly apply the decreasing points per second on later levels:

Code: Select all

    local pointsaddition = math.floor(secondsleft * (pointspersecondstart - global.level * pointspersecondlevelsubtract))

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by kovarex »

The supply challange scripting is fixed for the next release. I also fixed the story calculation formula, thx for the notice.

codewarrior
Long Handed Inserter
Long Handed Inserter
Posts: 64
Joined: Fri Aug 07, 2015 7:31 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by codewarrior »

Excellent.

For the record, my modified scenario did break the auto-updater as you said.

Upon starting Factorio, the update notification showed me updates for both the base game and the scenario pack. I clicked "Install Updates", it downloaded both update files, and then displayed an error saying "Scenario pack did not have expected data", and did not apply either update. While Factorio was still open, I removed the scenario pack and tried to install updates again. Then, I got an error saying "File scenario-pack/changelog.txt is missing", and Factorio closed itself. After reopening Factorio and trying "Install Updates" a third time, everything worked as expected.

BTW, I made further modifications to the supply challenge scenario:
scenario-mod.png
scenario-mod.png (120.69 KiB) Viewed 11249 times
I can send you a patch if you're interested.

Brambor
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by Brambor »

Hi there
I experience the same problem however I don't understand the solution that was posted here.
Currently I'm running 0.12.12
The only difference from problem described above is that it says 443 instead of 449 (in my case: ...lua:443...) as it can be seen in the picture below.
I tried diferent versions as well. I played it only once (some time ago) and I wanted to play it on my stream, unfortunately it didn't start as you can see here.
It hapens everytime when i try to play it. :cry:
Attachments
scenario supply &quot;Notice&quot;
scenario supply "Notice"
factorio bug (scenario).png (96.42 KiB) Viewed 11190 times

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by kovarex »

The solution should be update of the scenario pack.

Brambor
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by Brambor »

That doesn't work I tried it 5 times already. I also tried deleting only the scenario-pack (Factorio/data) and then update it, didn't work as well.
And another problem apperaed, My game doesn't know that there is ver 12.13 even if I "Check updates" in About it says "No new updates available.
When I delete the scenario-pack it downloads ver 0.11.16

I uninstalled and reinstaled the WHOLE game (Thanks God [you guys] I didn't lost my saves :D ty a lot) Then updated the scenario pack and it is still not working and it is still ver 0.11.16 I don't know if that is the newest if not then my game can't find the newest one.
Last edited by Brambor on Fri Oct 23, 2015 10:00 pm, edited 2 times in total.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by prg »

Brambor wrote:That doesn't work I tried it 5 times already. I also tried deleting only the scenario-pack (Factorio/data) and then update it, didn't work as well.
And another problem apperaed, My game doesn't know that there is ver 12.13 even if I "Check updates" in About it says "No new updates available.
When I delete the scenario-pack it downloads ver 0.11.16

I uninstalled and reinstaled the WHOLE game (Thanks God [you guys] I didn't lost my saves :D ty a lot) Then updated the scenario pack and it is still not working and it is still ver 0.11.16 I don't know if that is the newest if not then my game can't find the newest one.
Options -> Other -> Enable experimental updates
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Brambor
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by Brambor »

Thanks!
It is weird thou that when you download experimental release it is not turned on by default, is that a bug?
I mean When you download experimental release It then downloads you only 0.11.16 ver of supply pack
Last edited by Brambor on Fri Oct 23, 2015 10:18 pm, edited 1 time in total.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by prg »

Brambor wrote:Thanks!
It is weird thou that when you download experimental relase it is not turned on by default, is that a bug?
I mean When you download experimental relase It then downloads you only 0.11.16 ver of supply pack
Some experimental version will get declared stable eventually and would then need to be repackaged just to turn that option off by default again, guess that would be a bit too much of a hassle.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Brambor
Fast Inserter
Fast Inserter
Posts: 129
Joined: Thu May 07, 2015 1:52 pm
Contact:

Re: [0.12.10] Supply Challenge: 'story' nil value

Post by Brambor »

I'm just saying that for new players:
I will download the game (let's say 0.12.13) from a webpage. Because I bought the supply challenge It will ask if I want to download it, it will be downloaded but I cannot play it cause I will have 0.11.16 which is not compatible with my 0.12.13 base)

EDIT: maybe at least put into the Notice that you have 0.11.16 supply but 0.12.13 base or something like that, that there is experimental supply to your experimental base or that you have 0.11 supply wich probably will not be compatible with 0.12 base and you should go check options > other > download experimental content or something similar

EDIT: I'm writing that cause it took me hours to find the solution (and somebody has to write it) and it took days between problem-solution. It would be nice to people like me to write: Notice (error message) and under it: "maybe your 0.11 stable supply doesn't work with 0.12 experimental base, make sure you check 'Options -> Other -> Enable experimental updates' if you want to play them"

Post Reply

Return to “Resolved Problems and Bugs”