m-chandler / factorio-spot-pricing

Factorio Deployment to AWS
MIT License
102 stars 27 forks source link

How do you actually load an existing save file? #27

Closed codefo-O closed 3 months ago

codefo-O commented 3 months ago

Hi,

How would one go about loading an existing world once all the data has been moved to where it needs to be.

I have gotten as far as getting the save file on the mounted EFS using the ec2 server. The file is availble in the docker container but how would be the best way to load it by using an autosave file not a custom named file? I was trying to restart factorio in the container using the "./bin/x64/factorio --start-server ./saves/my-save.zip" but that just causes ECS to relaunch the container. I just wanted to ask before i generate an autosave and upload it and see if the server picks it up.

m-chandler commented 3 months ago

Hello,

Please see my comment in https://github.com/m-chandler/factorio-spot-pricing/issues/26, it might help you.

Note that the factoriotools doco says it will simply load the latest save from the saves folder. So just touch the save you want to load to give it a newer date and it should load. You don't want to be running factorio manually from within the container. https://hub.docker.com/r/factoriotools/factorio

codefo-O commented 3 months ago

Yeah so I it works fine if you copy an autosave and delete the rest. But you can't load a manual save cause its not lauching the docker container. I know the issue I can fix the YAML and iwll link it back if it works. For now I have just copied over an autosave and it worked.

cabraham commented 3 months ago

Hi @codefo-O, not sure if this helps but the factorio executable has parameters that can be passed in via env variables. I used the SAVE_NAME to set the game and turned GENERATE_NEW_SAVE to false. Also I set LOAD_LATEST_SAVE to false. For my purposes this worked, but perhaps not as dynamic as some would like.

codefo-O commented 3 months ago

Hi @codefo-O, not sure if this helps but the factorio executable has parameters that can be passed in via env variables. I used the SAVE_NAME to set the game and turned GENERATE_NEW_SAVE to false. Also I set LOAD_LATEST_SAVE to false. For my purposes this worked, but perhaps not as dynamic as some would like.

Where did you set the env variables?

m-chandler commented 3 months ago

Hi guys, please see updated readme section Uploading an existing save..

I have just tested this myself. Sorry for the confusion.

My earlier instructions about stopping the container via the ECS console can be disregarded, this just results in an auto-save with a newer timestamp and thus your uploaded save will never load.

Closing this issue.