You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!
SDF Editor is a program to edit BattleZone SDF files. These are building models, like the Hangar.
I was experimenting with abhang.sdf. I wanted to remove the part of the hangar that is flat and on the ground, because colliding with it while driving through the hangar was annoying. So, I selected it and pressed delete. I then saved the modified hangar to another location. I then placed it in my addon and ran the 1st mission. UE! I figured this part must somehow be critical, and rather than delete it, I would simply move it underground. I did so and tested it in BZ 1st mission. UE again! So as a control test, I re-opened stock abhang.sdf, made NO CHANGES, and re-saved the file from the editor and tested it in BZ 1st mission. UE! I had made no changes at all and the file was bad. Just to be sure, I copied stock model to addon. The game ran just fine.
In conclusion, when the SDF editor saves a file, it corrupts it. SDF Editor can still read the file, but BZ cannot.
I wrote a quick application to fix the incorrect header caused by the SDF editor. http://64digits.com/users/Big%20J/SDFRepair.7z It's the same as doing it yourself in a hex editor, but automated.
Ah, I know the problem... I forgot to make the file extension check case insensitive. Rename it to "absupp.sdf" and it should work.
This is part of the code. the only check that says the file is invalid would be the extension not being ".sdf".
Spoiler:
Code:
var f, file, extension, name; extension = ".sdf"; file = argument0; if (file == "") { exit; } if (filename_ext(file) == "") //if no extension { file += extension; //append it } name = filename_name(file); if (!file_exists(file)) //if file does not exist { echo("Failure. File '" + name + "' does not exist."); exit; } if (filename_ext(file) != extension) //if different extension { echo("Failure. File '" + name + "' does not appear to be a Battlezone SDF model file."); exit; } f = file_bin_open(file,2); //open the file for reading and writing if (error_occurred) { echo("Failure. " + name + " cannot be modified because it is set to read-only or is in use by another program."); } echo("Attempting to fix '" + file + "'..."); if (binaryGet(f,$18) != $4E) //check the problematic header { echo("Writing 0x4E at 0x18"); //console output binarySet(f,$18,$4E); file_bin_close(f); echo("Success. ('" + name + "' has been fixed.)"); } else { echo("Nothing to do. ('" + name + "' did not appear to need fixing.)"); }
Download it again if you want. It should be fixed now.
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum