Dogfish -> (1/6/2002 8:12:00 AM)
|
Hey All:
Glad to see all the interest. I think it's time for me to pass on what works with Spilc/Spile.
If you are interested in testing, you can use Spilc/Spile or get Warhorse or me to E-mail you a new mech.exe.
Spilc and Spile are programs written by Fred Chandla, who has done an amazing ammount of work to help modify games that weren't modifiable. They are available for download from his website. I think the link is in this post somewhere... if not I'll post it later.
Spile is a windows program and will run by clicking the icon. It works on all the SP games and their inspired offspring, SPWAW for instance.
Spilc however is a DOS program and clicking on it will run it, but you will get an error. The error simply means that it expects some command line parameters to be passed at the time that you invoke spilc. So, you have to run it from a DOS prompt and include a few params.
Spile deals with the file mech.exe, in SPWAW's case. This is the main executable in SPWAW. Imbedded in the code of mech.exe a table of all the icons used in the game. The number you see in the OOB's or the encyclopedia for the icon is used to point to a place in the table where 4 pieces of information are found. For each OOB icon number you have a number that reprsents the shp file where the icon is found, the number of that individual icon in the shp file, the number of the shp file where a turret is found, if the icon has one, and the number of the turret icon in the shp file, again if any.
That's it, that's what this is all about, finding 118 new slots in the mech.exe file where after testing it may be possible to write data about 118 new icons in the shp files.
Spile looks for a recognized data pattern at a variety of addresses, trying to find the table in the exe file of whatever game. When it finds it, it announces the address that it found it at, allows you to disply the table, and to write the table to a comma seperated variable file, or .csv file. This file can then be opened with excell and edited. In this case we want to write data to the 118 new icon slots, then we want to put the edited table back into the mech.exe file. All that's left after that is to play the game as normal looking for any problems. You can look at the table from time to time with spile, to see if anything you entered was overwritten by the game. It won't be nescessary to create a new csv file or a new mech.exe if you're just looking.
Ok, that's by way of introduction and backgound. This is how to do it. First open your SPWAW v7 folder, wherever it is. If you are comfortable with pathing in both Windows and DOS, you may want to work in this directory. To make it easy, and since people may have their SPWAW directories in different places, I'll use the desktop.
Right click on your SPWAWv7 mech.exe and drag it to the desktop. Make a copy there. Go back to your SPWAW directory and rename mech.exe to mech orig.exe. You can rename it anything you like but that's what I'm using. Put copies of Spilc and Spile on your desktop also. Again run them from wherever you like but I'm using the desktop.
Run spile, and click the button for file name. Select the mech.exe file on the desktop. Click the down arrow next to search bytes and select the one associated with SP2. Then click the search button. Allow a little time, depending on the speed of your machine. When Spile finds a table it will pop up an address in the address window. In this case it will be 162870. You could have entered the address and searched that way, but that only works for SPWAWv7, for other SP games it will be something different so a good idea to know how to do it this way. It should have also popped up 500 in entries. That's a start but change this 1231 and hit the load button. Spile will display the table. A good check that you have found the right one is seeing the word none under the turret columns. This is an interpretation that spile does. The word none is not written in the table but a hex FF is. Look at the byte columns. If you never see the word none, chances are you don't have the right table. Next to the write button you'll see SP2IL.CSV. This is the defalt file name that spilc will use to write the table as a csv file. Click the write button and close spile. You should find the file SP2IL.CSV on your desktop. If you have excell, open SP2IL with it. If you don't use your spreadsheet of choice.
There are a few things to notice in the sp2il table compared to the one you saw in Spile. First there are 4 lines or comments at the top of the page. The first column of numbers are excell's line number's and not related to the table. They can be confusing however, note the 5 place offset between these and the numbers in the next column. The offset of 5 is due to the 4 comment lines and the the fact that excell starts numbering at one, while the table starts with 0. Don't mistake the line number for the icon number when adding units or you'll be trying to find out why thing's aren't working. Note that the table uses 0 as the first shp file number and as the first icon within the shp file. This can throw a wrench into things also. But I'm getting ahead, these facts will be important later if you add icons, not for test purposes.
Remember the locations in the table that said none? You'll notice that in the csv table they are represented by the decimal number -1. This is how you would specify that your new icon does not have a turret.
For testing purposes we want to add data to the icon numbers 1113 to 1230. You can use any numbers but best if the correspond to an existing icon. You could check this by changing an OOb from time to time. I picked 3 or 4 from entries above on the page and copied them. If you know excell it doesn't take long to drag the numbers down a column.
After you have made the new entries, save the file and close excell. Open a DOS window. You'll get a DOS prompt: C:\Windows> Type cd desktop at the prompt. You'll have: C:\Windows\Desktop> Type spilc This will display the usage and params for spilc and tell you that you need to give it more params in order to work.
This time type: spilc 4 sp2il.csv mech.exe 162870 (note the 162870 is the address from spile, it works here but you would use a different number for a different exe file)
You will get a message saying exactly what you are about to do and asking you to answer Y/N that you want to do this. Answer Y. You'll get a message that spilc is changing mech.exe, then a "Done". Spilc will then close and return you to a DOS prompt. If you don't get back to a prompt cleanly then something is wrong. If you get a prompt, exit or close the window.
That's about it. You need to move a copy of the edited mech.exe to your SPWAWv7 folder. You may want to keep a copy, name it mech edited.exe or something. You'll want to clean up you desktop, I just make a new folder, put everthing we just used in it and drop it in the SPWAWv7 folder. If you need it again, and you might need it often if you are going to add icons, you just need to open the folder select all and move those things to your desktop.
If everthing went correctly, you should be able to run the game with no problems. If not delete the new mech.exe form you SPWAW v7 folder. Rename mech orig.exe to mech.exe. The game should be back to normal. And when you're up to trying it again, start over in the beginning.
Hope this helps, and thanx in advance for your time intesting.
|
|
|
|