Calling All Customizers - Part 2: Custom Doors

Status
Not open for further replies.

tass23

Moderator
First off, I want to thank Lord Grey Wolf for his input and guidance on this one. I would also like to thank Safera for being a cheerleader and helping out as well. Thanks you two :)

Okay, so you wanna add new doors to your shard, awesome, I can help you do that. This will be a little bit more concise compared to doing the walls. You'll need to edit client files, server files and server scripts to get this done, so be aware you WILL have to patch the changes out to your players. First thing I want you to see is how doors are setup in UO. Look at the UODoors image attached to this post as a reference. I'd suggest following the same path I took to get the job accomplished.

1. Lets start with getting our door graphics OUT of the art.mul and artidx.mul using UOFiddler. I picked the Metal Door that has 16 graphics to it. You can see how they all fit together in the image I attached. Click on the Items tab. The itemID starts at 1653 (0x0675) and stops at 1668 (0x0684).

2. Export each graphic (keeping the itemID name so you won't get confused) and save them to a folder together.

3. Open each door graphic and create your new door style on top of the old one. I like to use Photoshop for creating graphic designs, but whatever you preference is, your door style needs to conform to the same dimensions as the old one, do not go into the black area or the door won't "hang" correctly.

4. Save each new door with the same name as the old, BUT in a different folder.

5. Select an area in Fiddler with plenty of empty space for adding 16 new graphics. I started at 11241.

6. Replace each unused graphic with a new door graphic in the same order as the metal door. This is VERY important, so I'll say it again: REPLACE EACH UNUSED GRAPHIC WITH A NEW DOOR GRAPHIC IN THE SAME ORDER AS THE METAL DOOR. Sorry for that, but it is important and you'll see why in a minute.

7. Right-click on each new graphic and select Select in Tiledata, then click the Tiledata tab. You can go through and set all the flags on the new graphics so they all match the original metal door flags. I like to have two Fiddler programs open at the same time for this step. Make sure as you move from one door graphic to the next that you click SAVE CHANGES, or you'll lose everything you just typed in for that entry.

8. With all the flags set and the text entered, click on the Save Tiledata button. This step creates a new tiledata.mul for the client and server files.

9. Go back to the Items tab and right-click and select SAVE. This step creates a new art.mul and artidx.mul for the client and the server files.

10. You have to tell UO all about your new door graphics. To do this, you'll need to edit two text files you can find in the client folder: doors.txt and suppinfo.txt. I briefly covered those in my previous post, so I'm not going into detail again. I will however, tell you to locate the metal door itemID (1653) and copy that entire section to be used for your new door.

11. Go to the bottom of the Door list (end of the text file), start a new line and paste what you copied.

12. Now you need to edit those lines so they match your itemIDs for the new door. First, increment the Category by 1. This is where things can get a tad tricky if you're not paying attention. Notice that the metal door doesn't start with 1653 as the first entry, it actually starts with 1657. Don't ask me, I did NOT write this code. You need to look at your new door graphics and match 1657 with the new itemID for your new door. If you're following my lead, that itemID is 11245. UO sort of shortcuts here a bit, instead of listing each and every itemID for the door, they only have every other itemID listed. Because each door must open and close. So UO says okay, 11245 is the closedID so 11246 MUST BE the openID. This breaks your door graphics into sets of two now. The entire entry should look like this:
Code:
 11245 11247 11241 11243 11249 11251 11253 11255
See the sets of two? Good, moving on.

13. Save your doors.txt file and open the suppinfo.txt file. This looks a little more complicated than the last one, but it's not too bad. Again, search for the metal door itemID (1653) and copy it's entire section.

14. Go to the bottom of the text file, start a new line and paste. Now we have to go through and change itemIDs again, but that's ALL we have to do here. Once you're done, save and close the file. Your itemIDs look like this DOWN the column
Code:
 11241, 11243, 11245, 11247, 11249, 11251, 11253, 11255

15. Okay, now moving over to the server scripts, we have a couple of edits here. Search for the HouseFoundation.cs file. Search for this class:
Code:
 public void AddFixtures( Mobile from, MultiTileEntry[] list )
Scroll down a bit and you'll start seeing entries for GenericHouseDoor. UO calls ALL house doors generichousedoor, just fyi. Scroll down until you see something like this:
Code:
else if( itemID >= 0x314 && itemID < 0x364 )
{
int type = (itemID - 0x314) / 16;
DoorFacing facing = (DoorFacing)(((itemID - 0x314) / 2) % 8);
door = new GenericHouseDoor( facing, 0x314 + ( type * 16 ), 0xED, 0xF4 );
}
This is an entry for an original OSI house door. Copy the entire else if statement.

16. Right after that closing tag, paste the else if statement you copied there (add region tags if you like to find your spot quicker in the future).

17. Go through the code and change the itemIDs to match your new door. Match the facing direction with the proper closedID. Your completed code should look like this:
Code:
#region Custom Door 1
else if( itemID >= 0x2BE9 && itemID < 0x2BF9 ) //Ancient Elven Tree Door
{
DoorFacing facing = (DoorFacing)(((itemID - 0x2BE9) / 2) % 8);
door = new GenericHouseDoor( facing, 0x2BE9, 0xEB, 0xF2 );
}
#endregion

18. We're almost done, yay!!! Last thing we have to edit is towards the bottom of the file. Look for
Code:
 public static bool IsFixture( int itemID )
IF YOU SKIP THIS STEP YOUR DOORS WILL TURN OUT TO BE WALLS AND NEVER OPEN.

19. Scroll down just a tad more and you'll see this code:
Code:
else if( itemID >= 0x2A05 && itemID < 0x2A1D )
return true;

20. Copy that else if statement, start a new line underneath it and paste.

21. Now we have to change the itemIDs in the if statement to account for our new door. We want to include the first door graphic itemID, but the itemID of the graphic AFTER our last door graphic to make our statement true. The code should look like this:
Code:
#region Custom Door 1
else if( itemID >= 0x2BE9 && itemID < 0x2BF9 )
return true;
#endregion

22. Patch doors.txt, suppinfo.txt, art.mul, artidx.mul and tiledata.mul to your players (and your server files) AND copy doors.txt and suppinfo.txt into the Components folder in your server scripts. There's been too many alterations over the past year, so I can't say exactly where it is, but it should be inside the Data folder.

23. Restart your shard and rejoice in your brand new custom door!
 

Attachments

  • UODoors.jpg
    UODoors.jpg
    689.7 KB · Views: 35
Last edited:
Status
Not open for further replies.