Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: flbr on April 28, 2020, 03:58:33 pm

Title: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flbr on April 28, 2020, 03:58:33 pm
Updated to DFPlex v0.2.1

I've been working on a small script to automate white-rabbit's awesome plugin to allow multiplayer DF, and though I posted a link to my script in the comments I've been advised to consolidate the info for it.

Here's (http://www.bay12forums.com/smf/index.php?topic=176070.0) white-rabbit's post
And here (https://drive.google.com/file/d/1vbIMbhigyN8he6qX915C5ngzIdpxPwGL/view?usp=sharing) is the download for my script (for windows 10, x64 bit)

To use it just drop it into the place where you want it to download df and run it, but make sure not to have
in the same directory. (you also shouldn't have spaces in the names of the parent directories)

Run the script, and when it asks for your graphics and color choice just type in the name of the graphics/color you want.
Then you should be good to go!

Spoiler: Dependencies (click to show/hide)

Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: Bumber on April 28, 2020, 10:40:51 pm
I probably should've mentioned earlier that the file deletion in your script didn't work for me. Empty folders from the dfterm expand-archive remained. Announcements.txt.txt didn't replace announcements.txt. Not sure if it was a permissions issue or what.

For Windows 7/8 users, you'll need to update Powershell to 5.1: https://www.microsoft.com/en-us/download/details.aspx?id=54616
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flbr on April 30, 2020, 11:53:11 am
The announcements problem should be fixed (just a typo on my part) and I'll continue to try and figure out that deleting problem
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flbr on May 05, 2020, 05:29:18 pm
Aw yeah, now you can select your desired graphics and color set in the command line  8)
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: white-rabbit on May 06, 2020, 01:30:56 pm
Aw yeah, now you can select your desired graphics and color set in the command line  8)

ooooh, very cool.  8)
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flabort on May 18, 2020, 08:17:27 pm
New version of patch, ready to update script?
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flbr on May 23, 2020, 06:38:49 pm
Updated! I keep getting a `Connection error`, but I'm not sure if that's just me, so let me know how it's working for you
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: troycall on May 27, 2020, 12:33:41 am
I also get "connection error", I'm hosting on Windows 10 x64.

I used firefox and it worked for localhost/lan, I also used google chrome which worked for none of them, and I used edge which worked for lan/localhost
But over the internet it doesn't work, even though like I said I forwarded the ports, the page loads but it says "connecting" then just says retry.

After further investigation, it seems the windows build never "attaches" to the port 1234, even if you change that port to any other port, it never attaches to that specific port, by attach I mean it never "Listens" to that port.

Note that i port forwarded and everything correctly, and I double checked so it's not a firewall or port forward issue, the issue is for Windows, the application never attaches to the secondary port, which by default is 1234. the [STATICPORT] attaches correctly though, which is port 8000 by default.

Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: troycall on May 28, 2020, 02:44:51 am
fibr mind updating this to the latest DFPlex version? would be awesome if you can.
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: flbr on May 31, 2020, 08:34:25 pm
Should be good to go!
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: Jmz2020 on July 26, 2020, 01:34:29 am
Thanks for the hard work - one small issue, you have a typo in the script on line 25:
PowerShell Expand-Archive -Force -Path "%CD%\dfplex-v0.2-Windows64.zip" -DestinationPath "%CD%"
should read
PowerShell Expand-Archive -Force -Path "%CD%\dfplex-v0.2.1-Windows64.zip" -DestinationPath "%CD%"

Keep up the good work
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: wooks on August 11, 2020, 01:48:53 pm
The top file structure you place this into needs to not have spaces since the bat doesn't sanitize the file path for them.

It also doesn't display the colorFileNames correctly when it prompts for a color like it does with the tile set names. Pardon my ignorance, but I don't know what its asking me for exactly.
To future readers: you can just type "default" its referencing a file inside of the DFplex download dfplex-v###-###\hack\www\colors

Oddly, although the colors come through fine in the dwarf fortress instance, in the browser plugin they seem green-washed for some reason. Perhaps you could fix that by adjusting this color parameter.
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: Bumber on August 11, 2020, 06:29:10 pm
To future readers: you can just type "default" its referencing a file inside of the DFplex download dfplex-v###-###\hack\www\colors

Oddly, although the colors come through fine in the dwarf fortress instance, in the browser plugin they seem green-washed for some reason. Perhaps you could fix that by adjusting this color parameter.

I think the vanilla DF colors are "curses", not "default".
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: Bumber on August 13, 2020, 06:30:20 pm
Reposting this here:
Create a text file containing the following, and save it as restart.bat in your DF directory:
Code: (restart.bat) [Select]
:restart
start /wait cmd /c "Dwarf Fortress.exe"
goto restart

Open restart.bat instead of Dwarf Fortress.exe on the server. This restarts DF any time it closes, until the restart.bat command prompt window is closed. I think you'll have to wait until the opening animation finishes, because IIRC trying to skip it via browser causes the game to freeze.

For automatically restarting the server if it crashes. I'll leave it to somebody else to post a Linux/Mac equivalent.

Maybe somebody could write a DFHack script that skips the opening animation and loads directly into the fort, to avoid people messing with stuff.
Title: Re: Script to automate the download of white-rabbit's Co-op Dwarfmode
Post by: pope34 on March 01, 2021, 01:09:28 pm
Yo reworked your code to not have dependencies anymore, you can put quotations around things to allow folders to have spaces as well. Removed those textures and color thingys, they seemed to cause light stability issues. Only works in windows 10 cause it utilizes the tar command.
https://drive.google.com/file/d/1zaP4Uu6sopx3N7ZgkPK8UghHBDT269X9/view?usp=sharing