Page 1 of 1

[0.12.10] Supply Challenge: 'story' nil value

Posted: Mon Oct 05, 2015 5:25 am
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 12891 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.

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

Posted: Mon Oct 05, 2015 10:43 am
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)

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

Posted: Mon Oct 05, 2015 10:44 am
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.

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

Posted: Mon Oct 05, 2015 10:48 am
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

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

Posted: Mon Oct 05, 2015 11:13 am
by kovarex
Did you update the scenario pack?

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

Posted: Mon Oct 05, 2015 11:16 am
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.

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

Posted: Tue Oct 06, 2015 5:47 am
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))

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

Posted: Thu Oct 08, 2015 12:07 pm
by kovarex
The supply challange scripting is fixed for the next release. I also fixed the story calculation formula, thx for the notice.

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

Posted: Sat Oct 17, 2015 8:20 pm
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 12698 times
I can send you a patch if you're interested.

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

Posted: Thu Oct 22, 2015 9:47 pm
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:

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

Posted: Fri Oct 23, 2015 6:02 am
by kovarex
The solution should be update of the scenario pack.

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

Posted: Fri Oct 23, 2015 9:52 pm
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.

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

Posted: Fri Oct 23, 2015 9:55 pm
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

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

Posted: Fri Oct 23, 2015 9:59 pm
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

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

Posted: Fri Oct 23, 2015 10:17 pm
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.

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

Posted: Fri Oct 23, 2015 10:21 pm
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"