Post by Jason777 on Mar 17, 2011 12:47:27 GMT -5
I am giving an old tutorial I made a new home seeing as how the forums it was originally part of is gone to me
**MAKING CUSTOM SWORDS AND/OR ITEMS**
A Tutorial by Jason777
For those of you who thought this was going to be a lot more time-consuming than display list porting, boy are you wrong! This takes about 3 minutes at the least!
[glow=red,2,300]**I will be doing this on the OoT Debug ROM**[/glow]
Before you begin this tutorial you must meet these assumptions:
^^ Ok, if you meet all of the above continue....
So, you have created a really epic (BUT LOW-POLY) sword and you want use it in-game for OoT (and MM), this tutorial will teach just how it’s done!
Here is the usage for obj2area's counterpart, wotf.py, which is used to create F3DEX2 display lists from wavefront OBJ
Usage: wotf.py [options] [object file]
Options:
-s [float] : set vertex scale
-sa [float] [float] [float] : set x/y/z vertex scale
-st [float] : set uv scale
-b [hex/oct/dec val] : set bank to use for output file
-a [hex/oct/dec val] : set start offset to start writing data to
-o [string] : output filename
-h, --help : help message
We will be using the options -s, -b, -a, -o. We will not be using -sa, -st. Option -sa is for more specific scaling dealing with XYZ and option -st is for texture scaling. Alright, so on to creating the batch (BAT) file!
-- Open up Notepad or something of similar use --
The length of Biggoron's Sword in millimeters is around 6300 (I use the millimeters template, sorry ) so use that measurement to fix your scale. The bank of most models is 06- there is a list of bank values you could use following this paragraph. The address we want to begin writing data is 0x37800 since that is the end of Adult link's ZOBJ file. The ouput can be anything we want like "custom_sword.bin". At the end of BAT file we have the name of the file that we want to convert.
Here is a list of bank values you could use:
In the end our BAT file should look like this:
EXPLANATION:
Save As--> WOTF.bat
Alright now place your OBJ, MTL, and texture folder all into the folder that holds wotf.py and obj2area. Run WOTF.bat and wotf.py will open to make the conversion. When wotf.py is finished it will give you this "Display List: XXXXXX", jot down whatever the "XXXXXX" is because we will need that for later.
Now, open up the newly made BIN file in a hex editor. Go To 0x37800 (or whatever you put in the BAT file for option -a) and copy everything from there to the very end of the file since that is the actual data. Then, Open up object_link_boy.zobj (the adult link ZOBJ) and go to 0x37800 (Which is the very end of the file). PASTE INSERT (not PASTE WRITE) the data you copied from the BIN file at then end. You are finished inserting the data into adult Link so that way if you go into UoT and you open up the ZOBJ, you will find your custom weapon as the very last display list.
It is time that we replaced one of the already existing swords (or another weapon if you want) with our sword. Go to 0x238C8 (Display list start) in the ZOBJ to replace the high-poly Biggoron's Sword. When you are at 0x238C8 you should see an E7 command:
What we are going to be modifying is the data right after that 8th byte. We are going to be placing a DE command to append display lists to that one. Here is the format for the DE command we will be placing:
After typing that DE command, we are going to want to place another DE command right after it so that way Link's hand is attached to it when he draws it. Here is the format for the DE command we will be placing:
Next, we want to place a DF command (marks the end of a display list) right after that last DE command so that way the Biggoron Sword doesn't load up along with your model and Link's fist. Here is how we would write a DF command:
Here is an example of how the start of the display list to the high-poly Biggoron Sword should look like after you are done modifying it (wotf.py provided me with a display list offset start of 0x391EC):
^^ If it looks exactly like that except with a different XX XX XX value then you're doing it right. Alright, we're done modifying the adult link ZOBJ; you can save. Be sure to save the file as something else and name it something you can remember like "custom_sword.zobj".
Now, we are on the final step- inserting the new adult Link ZOBJ at free space in the ROM and then changing its original entry in the file table to its new location.
Okay, open up the full Debug OoT ROM in the hex editor. Copy your entire modified ZOBJ and PASTE WRITE it at free space in the ROM (use 0x35CE040 if you don't know where else) and write down it's ending offset because we need it for the next step. Scroll all the way to the very beginning of the ROM now (I get an error when trying to search sometimes if I don't do this). Next, you will want to search for adult link's original offsets. Type this and search:
We want is the second result NOT the first. The second result should look like this (which is the start and end offsets combined):
We want to change that to whatever the start and end offsets of you modified ZOBJ is.
Here is an example of how it’s done. Let's say it starts at 0x35CE040 and ends at 0x38DF071, here’s how I would overwrite the original ones:
^^ If it fits those 8 bytes correctly than you're finished! Save your ROM and test out your new Weapon!! Of course if you model is extremely detailed and it doesn't load then... BUMMER
**OPTIONAL EPICNESS**
You have done everything that is absolutely necessary to make custom weapons, BUT here is how to really make it look LEGIT once you get the hang of it
Okay! You have completed the tutorial! Is the tutorial easily understood? Do I need to give download links? Do you need me to post pictures? If you have any questions and/or comments feel free to post them.
**MAKING CUSTOM SWORDS AND/OR ITEMS**
A Tutorial by Jason777
For those of you who thought this was going to be a lot more time-consuming than display list porting, boy are you wrong! This takes about 3 minutes at the least!
[glow=red,2,300]**I will be doing this on the OoT Debug ROM**[/glow]
Before you begin this tutorial you must meet these assumptions:
*You already have created your sword and exported it in the OBJ format
*You have the OBJ, MTL, and corresponding texture folder in the same folder as wotf.py or obj2area
*The sword cannot be too detailed or else it'll cause the game to crash (faces/polys around 1000-1500)
*You know the correct scale or size
*You know the correct rotations (To fix up the model afterwards)
*You have Python Version 2.5.2 installed (to be able to run python scripts/programs)
*The textures on your model must be 32x32 24-bit BMP's or 32x32 PNG's (higher releases of Obj2Area support bigger and smaller texture sizes, but... I'm using release2)
*You have a little knowledge of hex editing and display lists
*You know how to create a batch file :P
*You have a Hex Editor (I recommend HxD)
*You have Obj2Area
*You have and have configured Rice's Video Plugin (To prevent graphic / video errors on emu’s)
^^ Ok, if you meet all of the above continue....
So, you have created a really epic (BUT LOW-POLY) sword and you want use it in-game for OoT (and MM), this tutorial will teach just how it’s done!
Here is the usage for obj2area's counterpart, wotf.py, which is used to create F3DEX2 display lists from wavefront OBJ
Usage: wotf.py [options] [object file]
Options:
-s [float] : set vertex scale
-sa [float] [float] [float] : set x/y/z vertex scale
-st [float] : set uv scale
-b [hex/oct/dec val] : set bank to use for output file
-a [hex/oct/dec val] : set start offset to start writing data to
-o [string] : output filename
-h, --help : help message
We will be using the options -s, -b, -a, -o. We will not be using -sa, -st. Option -sa is for more specific scaling dealing with XYZ and option -st is for texture scaling. Alright, so on to creating the batch (BAT) file!
-- Open up Notepad or something of similar use --
The length of Biggoron's Sword in millimeters is around 6300 (I use the millimeters template, sorry ) so use that measurement to fix your scale. The bank of most models is 06- there is a list of bank values you could use following this paragraph. The address we want to begin writing data is 0x37800 since that is the end of Adult link's ZOBJ file. The ouput can be anything we want like "custom_sword.bin". At the end of BAT file we have the name of the file that we want to convert.
Here is a list of bank values you could use:
Bank Values:
06 inline obj
05 gameplay_field_keep OR gameplay_dangeon_keep
04 gameplay_keep.zdata
03 inline map
02 inline scene
In the end our BAT file should look like this:
wotf.py -s 1 -b 06 -a 0x37800 -o custom_sword.bin Example.obj
EXPLANATION:
-s : Our scale is 1
-b : Our bank is 06
-a : Our address to start writing to is 0x37800
-o : Our output filename is custom_sword.bin
Our file we are converting is Example.obj
Save As--> WOTF.bat
Alright now place your OBJ, MTL, and texture folder all into the folder that holds wotf.py and obj2area. Run WOTF.bat and wotf.py will open to make the conversion. When wotf.py is finished it will give you this "Display List: XXXXXX", jot down whatever the "XXXXXX" is because we will need that for later.
Now, open up the newly made BIN file in a hex editor. Go To 0x37800 (or whatever you put in the BAT file for option -a) and copy everything from there to the very end of the file since that is the actual data. Then, Open up object_link_boy.zobj (the adult link ZOBJ) and go to 0x37800 (Which is the very end of the file). PASTE INSERT (not PASTE WRITE) the data you copied from the BIN file at then end. You are finished inserting the data into adult Link so that way if you go into UoT and you open up the ZOBJ, you will find your custom weapon as the very last display list.
It is time that we replaced one of the already existing swords (or another weapon if you want) with our sword. Go to 0x238C8 (Display list start) in the ZOBJ to replace the high-poly Biggoron's Sword. When you are at 0x238C8 you should see an E7 command:
E7 00 00 00 00 00 00 00 ; this marks the beginning of a display list most of the time
What we are going to be modifying is the data right after that 8th byte. We are going to be placing a DE command to append display lists to that one. Here is the format for the DE command we will be placing:
DE 00 00 00 BB XX XX XX
BB = Bank ; we will be using 06
XX XX XX = Display List to attach ; wotf.py gave you this
After typing that DE command, we are going to want to place another DE command right after it so that way Link's hand is attached to it when he draws it. Here is the format for the DE command we will be placing:
DE 00 00 00 BB YY YY YY
BB = Bank ; we will be using 06 AGAIN
YY YY YY = Display List to attach ; adult link's high-poly left fist is 0x21CE8
Next, we want to place a DF command (marks the end of a display list) right after that last DE command so that way the Biggoron Sword doesn't load up along with your model and Link's fist. Here is how we would write a DF command:
DF 00 00 00 00 00 00 00
Here is an example of how the start of the display list to the high-poly Biggoron Sword should look like after you are done modifying it (wotf.py provided me with a display list offset start of 0x391EC):
E7 00 00 00 00 00 00 00 DE 00 00 00 06 03 91 EC DE 00 00 00 06 02 1E C8 DF 00 00 00 00 00 00 00
^^ If it looks exactly like that except with a different XX XX XX value then you're doing it right. Alright, we're done modifying the adult link ZOBJ; you can save. Be sure to save the file as something else and name it something you can remember like "custom_sword.zobj".
Now, we are on the final step- inserting the new adult Link ZOBJ at free space in the ROM and then changing its original entry in the file table to its new location.
Okay, open up the full Debug OoT ROM in the hex editor. Copy your entire modified ZOBJ and PASTE WRITE it at free space in the ROM (use 0x35CE040 if you don't know where else) and write down it's ending offset because we need it for the next step. Scroll all the way to the very beginning of the ROM now (I get an error when trying to search sometimes if I don't do this). Next, you will want to search for adult link's original offsets. Type this and search:
00FDC00001013800
We want is the second result NOT the first. The second result should look like this (which is the start and end offsets combined):
00 FD C0 00 01 01 38 00
We want to change that to whatever the start and end offsets of you modified ZOBJ is.
Here is an example of how it’s done. Let's say it starts at 0x35CE040 and ends at 0x38DF071, here’s how I would overwrite the original ones:
03 5C E0 40 03 8D F0 71
^^ If it fits those 8 bytes correctly than you're finished! Save your ROM and test out your new Weapon!! Of course if you model is extremely detailed and it doesn't load then... BUMMER
**OPTIONAL EPICNESS**
You have done everything that is absolutely necessary to make custom weapons, BUT here is how to really make it look LEGIT once you get the hang of it
* Correct the rotational values on you model if it needs it
* Replace the low-poly version of the original item with your model
* Replace the original icon texture with one of you own using ZLE
* Replace the GI object with your model
* Make you item unique by adding effects to it
Okay! You have completed the tutorial! Is the tutorial easily understood? Do I need to give download links? Do you need me to post pictures? If you have any questions and/or comments feel free to post them.