PDA

View Full Version : Would it be possible???



MaskRider
July 3rd, 2009, 16:56
To write some sort of bat file that would:



Extract the source file from a G2K generated VTP1.bgl.
Run Sander's or Rhumba's VTP1 fix on the source file.
Recompile the fixed source file as a fixed VTP1.bgl with its original file name?

???

Thanks,
Chris

simonu
July 4th, 2009, 16:45
When you compile a G2k project G2k creates temporary asembler files in its root directory. Look for "Ground2K$_VTP1Line.ASM" in the Ground2k folder drop that into fixVTP1.vbs.
Heres the script for a batch file that does the job, I'm sure you will understand it, you might like to edit it to suit your needs. It assumes that you have BGLC and fixVTP1 in your Ground2k folder.

Copy Ground2K$_VTP1Line.ASM MyProject.ASM
fixVTP1 MyProject.ASM
Pause 10000 // Wait for the fix to run
Ren MyProject_Fixed.ASM MyProject_8.ASM
BGLC MyProject_8.ASM
Del MyProject.ASM

Copy the above into a new txt file and save as "fixVTP.bat".
This script will leave the G2kTemporary file intact and work on a copy, it will compile the fixed copy and then delete the unfixed assembler. You could of course have the fix run straight on the original assembler and rename the fixed version of that, you will see how to do that now. The pause is essential because the fix takes a while, when the fix is done you will see a message in the dos window say "press any key to continue" press away and the script will complete.
You can add a line to Del ete the MyProject_8.ASM as well if you wish, (I prefer to keep them as I sometimes change the texture used and its easy to do with the assembler; the TextureNames section is at the bottom of the file.)

MaskRider
July 4th, 2009, 19:59
Thanks Simonu! Yes I have fixVTP1 and bglc.exe in my G2K folder.

What I do right now is open, one at a time, the 7 and 8 bgls in LWMViewer, export the source files to my G2K folder. Then I follow the process as per your steps 2 thru 5.

I will give it a try right now!

MaskRider
July 4th, 2009, 20:16
Hiya Simonu. I get it to run up to getting a fixed ASM files. I get the little window that says to press any key to continue. When I do so the program wraps up. But I get no renamed fixed ASM file and no new bgl.

Here is how I have the bat rewritten.

Copy Ground2K$_VTP1Line.ASM randiki-lines.ASM
fixVTP1 randiki-lines.ASM
Pause 10000 // Wait for the fix to run
Ren randiki-lines-Fixed.ASM randiki-lines_8.ASM
BGLC randiki-lines_8.ASM
Del randiki-lines_8.ASM

Chris

simonu
July 5th, 2009, 09:36
Chris I cant see any fault with your script and it works on my XP system, try Copy instead of Ren and Del the extra file, or maybe try using a shorter name string.
Having done some experaments I have found the 10000 value in the "Pause" line is irrelevant, I wasnt sure last night, my programming was learned an a ZX81 many years ago!

MaskRider
July 5th, 2009, 13:25
Hmmm.. that is weird. I tried shortening the name and changing ren to copy and still no joy. No results after the pause.

Thanks, simonu

simonu
July 5th, 2009, 13:46
Got it, looked harder at your script

Copy Ground2K$_VTP1Line.ASM randiki-lines.ASM
fixVTP1 randiki-lines.ASM
Pause 10000 // Wait for the fix to run
Ren randiki-lines-Fixed.ASM randiki-lines_8.ASM < error in this line
BGLC randiki-lines_8.ASM
Del randiki-lines_8.ASM

fixVTP output has an underscore not a hyphen try this

Copy Ground2K$_VTP1Line.ASM randiki-lines.ASM
fixVTP1 randiki-lines.ASM
Pause
Ren randiki-lines_Fixed.ASM randiki-lines_8.ASM
BGLC randiki-lines_8.ASM
Del randiki-lines_8.ASM

MaskRider
July 5th, 2009, 15:28
That did it!

I am embarrassed that I missed that.

Again, thanks very much, simonu!

Chris

simonu
July 5th, 2009, 16:15
no problem, and hey, dont be embarressed, all the best programmers make that sort of mistake.

MaskRider
July 6th, 2009, 19:36
Love those bat files, simonu. Made one each for the 7s and 8s. Saves a lot of time.

Thanks again,
Chris