Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: export suggestion  (Read 731 times)

genmac

  • Bay Watcher
    • View Profile
export suggestion
« on: August 14, 2006, 11:27:00 am »

Can we get a command line ... command to generate a region?  With dwarffort.exe returning a value on exit?  I'd like to setup a batch file to generate a new region every day or so and stick it on a website, since generating them yourself is such a pain in the ass  :)
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: export suggestion
« Reply #1 on: August 14, 2006, 12:19:00 pm »

It doesn't seem like it would be hard to add, although I'd have to refresh my memory on command lines.  There's a string pointer being fed into WinMain(), maybe it's as simple as parsing that.

It would be nice to have some way to churn them out while sleeping -- the next time I get around to augmenting civ history generation or world map creation in a way that the old saves can't mimic, I'll need to put up some new world files.  It might also include an option to generate the images at the same time.

Logged
The Toad, a Natural Resource:  Preserve yours today!

flap

  • Bay Watcher
    • View Profile
Re: export suggestion
« Reply #2 on: August 14, 2006, 12:34:00 pm »

Which means that the saves won't be compatible ? So we definitaly must not get too attached to our little fortress... It si little world !
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: export suggestion
« Reply #3 on: August 14, 2006, 12:44:00 pm »

The saves should still be compatible, but they just might be missing a few things in the towns or in the legends.  Once it gets to the point where you absolutely have to see them, you can regen the world.
Logged
The Toad, a Natural Resource:  Preserve yours today!

genmac

  • Bay Watcher
    • View Profile
Re: export suggestion
« Reply #4 on: August 14, 2006, 12:55:00 pm »

LPSTR lpCmdLine: The command line arguments as a single string <-- yessir

If we could designate the names or something that would be neat, or at least have some way of keeping track - ideally I'd like to run an event every 12 or 24 hours to generate a new region via a batch file, wait for dwarf fortress to return a value like 1 for success, then use the batch file to zip it up and move it to my server's web folder.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: export suggestion
« Reply #5 on: August 14, 2006, 01:27:00 pm »

It's pretty strict about the naming convention region#.sav and region# folder right now, but if your batch file can send in a number in the string, it could use that number.
Logged
The Toad, a Natural Resource:  Preserve yours today!

genmac

  • Bay Watcher
    • View Profile
Re: export suggestion
« Reply #6 on: August 14, 2006, 01:34:00 pm »

Yeah that wouldn't be a problem.  Probably be calling the batch file from PHP or some other scriptiness.  I'll post the website (its got some game tips and whatnot) once I get off work.  I'd like to have auto generated regions for download - and allow players to comment and vote on them
Logged

genmac

  • Bay Watcher
    • View Profile
Re: export suggestion
« Reply #7 on: August 15, 2006, 04:50:00 pm »

I wouldn't mind it being graphical either - basically all I want to do be able to do is go:

dwarffort.exe gen 746

Let it do its thing, and then I'll have my batch file move the files and zip them up and insert an entry into the database so I never have to touch it  :)

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: export suggestion
« Reply #8 on: August 15, 2006, 05:00:00 pm »

So popping up the window briefly is fine?  I was a bit troubled about how to set it up, since windowless the image spitter wouldn't work.
Logged
The Toad, a Natural Resource:  Preserve yours today!

genmac

  • Bay Watcher
    • View Profile
Re: export suggestion
« Reply #9 on: August 15, 2006, 05:33:00 pm »

yeah I think that should be fine - I might have to call it from a script that way, but that'll work.  A quick and dirty solution is fine by me as long as it exits after generation and I can number the regions.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: export suggestion
« Reply #10 on: August 15, 2006, 08:16:00 pm »

Okay, I have something that worked with a simple bat over here.  The next release will have a command_line.txt instruction file, and you can let me know if I need to change it somehow.  It currently displays generation, but that will allow you to exit more easily if it messes up.
Logged
The Toad, a Natural Resource:  Preserve yours today!