Ettico
February 26th, 2009, 12:56
I'm still working on a Qbasic program to supplement and improve Lowengrin's Dynamic Campaign Generator. The program is designed to be run after generating a DCG mission. When run, the program currently finds and fixes 4 known DCG bugs in the DCG mission file, and makes several other alterations, such as re-assigning unneeded AI CAP flights as strike escorts, implementing long range escorts, and allowing the player to change the player squadron loadouts, etc. The program does what it does so far without a hitch.
But now comes the hard part. There are 2 known DCG bugs that intermittently occur in the DCG campaign files. These bugs really need to be eliminated. The campaign files exist in a different folder from the DCG mission file. Getting at the mission file is easy enough. Just put the Qbasic interpreter and program in the same directory and run it from there. But getting at the campaign files requires changing to a different folder inside the program. Simple, right?
WRONG! Changing to the target folder is easy enough. Just put the folder containing the campaign files inside the same root folder and call it by name in the program - going down a folder is not a problem. But getting Qbasic back to it's root folder from there requires providing the program a path back to the root folder, in a form Qbasic (but probably one else in the world) understands.
I managed to solve the problem by executing a DOS command at the beginning of the program. The DOS command creates a text file containing the path to the root folder in the required strange form. The strange directory path is then extracted from the file and then used to return Qbasic back to it's root directory after it's confusing excursion into the netherworld of the DCG campaign files. The return path can't be hard coded because people have multiple installs in varying directories with varying folder names.
That done, my next step will be to concoct a routine to find and eliminate destroyed ship squadrons from the "ships" and "taskforces" files, to prevent DCG from continuing to order strikes on the destroyed ships. This is a long standing problem which has only been fixable by hand editing the destroyed ship squadrons and their waypoint paths out of the files. I have a plan for doing this, but the plan's viability relies partly on how DCG acts in certain situations when the "ships" and "taskforces" files are changed.
The next step will be to search for and fix a DCG bug which intermittently occurs in the "squadrons" file. But before I can figure out how to fix it, I'll have to get DCG to create the error so I can look at it.
If these final 2 steps can be completed, we will have a DCG that runs much more smoothly and realistically without the need for DCG file management expertise.
Still no luck finding a Qbasic compiler to convert the program into executable machine code. I located a later version of Qbasic which has a compiler. The compiler doesn't balk at compiling the code, but the resulting "DCGQB.exe" file fails to pass muster. Probably because of the way I wrote the code, but the error codes are greek to me.
But now comes the hard part. There are 2 known DCG bugs that intermittently occur in the DCG campaign files. These bugs really need to be eliminated. The campaign files exist in a different folder from the DCG mission file. Getting at the mission file is easy enough. Just put the Qbasic interpreter and program in the same directory and run it from there. But getting at the campaign files requires changing to a different folder inside the program. Simple, right?
WRONG! Changing to the target folder is easy enough. Just put the folder containing the campaign files inside the same root folder and call it by name in the program - going down a folder is not a problem. But getting Qbasic back to it's root folder from there requires providing the program a path back to the root folder, in a form Qbasic (but probably one else in the world) understands.
I managed to solve the problem by executing a DOS command at the beginning of the program. The DOS command creates a text file containing the path to the root folder in the required strange form. The strange directory path is then extracted from the file and then used to return Qbasic back to it's root directory after it's confusing excursion into the netherworld of the DCG campaign files. The return path can't be hard coded because people have multiple installs in varying directories with varying folder names.
That done, my next step will be to concoct a routine to find and eliminate destroyed ship squadrons from the "ships" and "taskforces" files, to prevent DCG from continuing to order strikes on the destroyed ships. This is a long standing problem which has only been fixable by hand editing the destroyed ship squadrons and their waypoint paths out of the files. I have a plan for doing this, but the plan's viability relies partly on how DCG acts in certain situations when the "ships" and "taskforces" files are changed.
The next step will be to search for and fix a DCG bug which intermittently occurs in the "squadrons" file. But before I can figure out how to fix it, I'll have to get DCG to create the error so I can look at it.
If these final 2 steps can be completed, we will have a DCG that runs much more smoothly and realistically without the need for DCG file management expertise.
Still no luck finding a Qbasic compiler to convert the program into executable machine code. I located a later version of Qbasic which has a compiler. The compiler doesn't balk at compiling the code, but the resulting "DCGQB.exe" file fails to pass muster. Probably because of the way I wrote the code, but the error codes are greek to me.