Sign up Calendar Latest Topics

  Author   Comment  

Posts: 168
Reply with quote  #1 
I'm fiddling around with an idea about creating a campaign-style mission that will save your progress to a log file, and then a batch file will concatenate the log file with some other header/footer text files to create a new xml script. 

I'd like to launch the batch file via the spawn_external_program command, but I'm having trouble getting it to execute a batch file or a simple copy command. Attempting to execute a batch file directly doesn't appear to be working.

Has anyone mucked around with this before? Is it possible to use spawn_external_program to execute simple DOS commands? If so, how did you manage it?

I suspect I may have to execute a shell program like DOSBox or vDos to do this, but that will likely involve mounting drives/directories, or at least trying to tell the shell what directory the mission script is in, and I can't really predict that on someone else's computer.


Posts: 168
Reply with quote  #2 
Ok, so... I managed to figure this out. You can open up a DOS shell via cmd.exe, I just didn't have the correct directory. Here's the command in XML:

<spawn_external_program id="Shell1" name="C:\WINDOWS\system32\cmd.exe" arguments="cmd" />

From there, you can tell cmd to execute simple DOS commands, run a batch file, etc., by adding to the "arguments" attribute. It spawns in the Artemis directory, so you can get at the Missions folder from there.

The log command can be used to write xml tags into the mission LOG.txt, so if you combine this with some simple DOS commands... I should be able to export a bunch of variables into the log, then combine the log with a header .txt and a footer .txt to create a new mission script. This should allow me to create a "savegame" file, storing the position and status of the player's ship along with a bunch of variables about what ships/stations still exist. I'm not quite sure if I can overwrite the existing mission script, but I could also write the savegame to a different Mission directory: MISS_A and MISS_B. Players could save their progress and then pick up where they left off by switching between MISS_A and MISS_B. 

I have some... ambitious plans... for this arrangement.

Mike Substelny

Avatar / Picture

Posts: 2,408
Reply with quote  #3 
That is quite ambitious!

Good luck!

Personally, I am holding out for Thom to give us a Save Game feature later in Artemis 3.0.

"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill

Posts: 311
Reply with quote  #4 
Mike - I like this idea!  I can see setting a game up on, Starting it, Pausing and Saving.  Then bring in a different crew and Restore from Saved game to start different crews on an even playing field.  {sector, whatever....} 

on TeamSpeak as GrayBeard {the Grim}  ;-) 
on Twitter as   @GrayberdTheGrim 

Chief Engineer of the Fulminata, one of the Pirates Of BeechWood! 

Avatar / Picture

Posts: 1,301
Reply with quote  #5 
Thats amazing!]
-Captain of the TSN Gungnir JN-001
-Eastern Front online group member
-My continuing bridge build:
Previous Topic | Next Topic

Quick Navigation:

Easily create a Forum Website with Website Toolbox.