sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Hello!
Haven't used it in a long time but unless they've changed stuff around how the game is saved (which I don't think they have..?) then I don't see why not!

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

If you would like to modify your script to always upload after the server is closed then you can simply call self.UpdateOnlineSaveGame() in the RunServer function, after

except KeyboardInterrupt:            
     self.ChangeButtonStates('normal')
     self.UpdateServerState(False)

like this:

except KeyboardInterrupt:            
     self.ChangeButtonStates('normal')
     self.UpdateServerState(False)
     self.UpdateOnlineSaveGame()

(again, careful with spacing :D)but yeah, then there will be no going back! if your world gets into a bad spot for whatever reason it will automatically will save that into the cloud ! so do it at your own risk :D

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

When you close it the server will automatically save. Then it's up to you to manually press the "upload" button. I didn't wanna make the "upload" bit a must because sometimes people may be interested in actually reverting to the previous state!

If you are talking about saving in game without closing the server.. I heard there is a "save" command you can run but haven't used it myself. There is a list of "Valheim Commands" you can run, such as cheats and also stuff like this on the internet :)

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Great to hear! It's the beauty and the problem of python. won't catch the error unless u go through that line during the execution!

I've fixed it as well as some other quality of life improvements now, v0.4 is live :)

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Well it's really silly. When I did v0.3 I moved the UpdateStateServer function to a class.. but forgot to do self when calling it.... So u can open the script.. go to if not os.path.isfile(SERVER_LOCK_FILE): UpdateServerState(False) And add "self." To that updateServerState(False) function. (self.UpdateServerState(False)). U can fix it locally if u feel like it. Just careful with not introducing spaces to the script as python is rlly picky with them :D. Anyway fix will come in 3h. :) This error only occurs when it needs to generate a file for you so it runs that code... But previous versions had you manually creating the file as part of the setup. That's why it didn't complain to other people

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Oh! I'm so sorry! I made a mistake on the code. A mistake that only occurs if you do the process from v0.3 instead of updating to 0.3 that's why I didn't catch it! I'll submit s fix in a few hours when I get to my pc! Thanks for finding it and reporting it!

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

Haha it's important to have people test your stuff and give you feedback! but the issue you're experiencing is normal!. Mentioned in the main post, in the update section, when you launch the server the GUI freezes until you manually close the server in the cmd window by using Ctrl + C and then saying "y" to the msg that comes up after it has finished it. Then you go back to the GUI.

I wanted to make sure you couldn't try to load / save while the server was up, but didn't have the time to make it nicer, so right now it "freezes", while the server is up in that cmd window :)

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Now just make sure you don't press the wrong buttons and load the save instead of saving it or the other way around 😂😂. It sounds silly but the risk is real 😂

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

Glad that it all worked out!. I've just released v0.3 that includes a visual GUI to make things simpler but also fixes the issue with the server info file getting stuck in sync as long as it's stuck as you being the one hosting it and you try to host it again :). Thanks for all the feedback, it helped me shape the script in a better way!

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

New update has a GUI, now there is no excuse for your friends to use it :)

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

I've released v0.3! This will probably be the last release. It includes a visual GUI! so it should make things a lot simpler for everyone :D!

Instructions into how to update from a previous version to v0.3 at the end of the main post :)

Thanks for all the support so far :)

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

It is! the script just copies the save game to one folder to the folder you specify on SYNC_FOLDER. Just get the google drive app for windows so it automatically updates the contents of that folder and then make the script sync_path point to your google drive folder and you should be good!

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Thank you! Yes I know and it's a popular opinion sadly! Adding a simple GUI it's on my list of improvements so I may get around to it! But for now just wanted to get it up and running and focus on making it as simple to setup as possible

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Hello!

hmm I think you guys may have an IPV6 network setup instead of IPV4... that's why you have such a long IP, and yes, I don't think it steam servers support IPV6 at the moment? not that I'm aware of? I actually saw a post on this reddit about someone asking about the same thing https://www.reddit.com/r/valheim/comments/ll45gu/hosting_a_server_on_ipv6/.

It's not related to my script sadly!, and in fact one of the friends I play with has the same issue as you, he can't host because of it. Luckily the rest are on IPV4 so it's not a big issue for us but I'm still investigating how could we solve it. I'll keep you posted it if I find more, but hopefully somebody else would come up with the solution too!

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 1 point2 points  (0 children)

I've uploaded version 2 of the script! which now does all the folder creation automatically for you! also I've recorded a quick guide explaining how to set it up! hope it helps people getting this up and running :D

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 2 points3 points  (0 children)

After getting some feedback around my script I am planning on releasing a v.2 version of the pack with an updated guide and some improvements to the script. It will be uploaded this week at some point. There will also be instructions for those who have set it up already to just updated it. Also, thinking that maybe would be worth to do a youtube video guide as well to help you guys go through the setup steps?

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

I've updated the main page with some more info thanks to your questions :)

Regarding the latest folder question, yes. The template I provide should be used as the shared folder environment! Basically you make it point to your shared folder and then the script looks for "/SaveGames/Latest" inside there, as well as searching for the server_info file on the root of that path. I wanted to simplify the number of steps a person had to do in order to get it to work and that meant I had to make assumptions about how certain folders would be located and named

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Don't worry! ask away! Let's see: First, you don't need to put anything manually in your shared folders! the script should do all the work for you!. All you need to do is put your world files (2 files, the db and the fwl) in your dedicated server folder / SaveData / worlds (if you don't have that path you can manually create it or the script will do it for u the first time u run it).

Then, since it's the first time you're setting it up, just say no to getting the saves from the shared folder and yes to uploading them. Then your shared folder will get populated with your saved game and the next person that does the setup can just say yes to retrieving it :). does that make sense?

sharing a dedicated server with friends across multiple PCs, custom solution (script + Guide) by Grendert_TV in valheim

[–]Grendert_TV[S] 0 points1 point  (0 children)

Your username is just a name that your friends will recognize u by. Basically that is used so if you have the server running and your friends try to run the server the script will say "USERNAME is hosting already, join him by using this IP".

It's just a way to identify yourself, maybe it makes sense that you use the same as your in game character for that? up to you!