1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
5/5, 3 ratings

Creating vehicles for UO

Summary of the tutorial

Revamp of Alambik's original tutorial on how to create a vehicle in UO for a player to ride in. Many thanks to those efforts!!

1 Introduction

Creating vehicles for UO
Originally, Alambik wrote this tutorial utilizing knowledge and programs that were available at that time. I have simply updated this information and used more up-to-date programs (UOFiddler, instead of Mulpatcher). This tutorial is not for everyone, as it pertains to changing client files, which requires a custom patch. When you have completed this tutorial, you will have a few files to copy to the client folder, but one of them is the Art.mul (which is around 120MB). For those dealing with UOP files, this tutorial was not tested using that format, but once you convert from UOP to MUL, everything still applies, you will just be converting the finished MUL back to UOP.

Alambik's OctoNuker!​

2 Designing your vehicle(s)

Initially you will need to locate a model for the vehicle you are going to use. This tutorial includes the BMP files for the Steam-powered Fire Engine, but use whatever vehicle model(s) you wish. You will need a total of 8 BMPs for each direction:
  • North N.png

  • Right (Northeast) NE.png

  • East E.png

  • Bottom (Southeast) SE.png

  • South S.png

  • Left (Southwest) SW.png

  • West W.png

  • Up (Northwest) NW.png

These graphics must all be BMPs. If you are familiar with 3D modeling and those related programs, like 3DS Max, you can render all the views you need fairly quickly. Otherwise, you will have to create your own graphics from scratch and create the proper views. The BMP files contained within this tutorial can be used as templates for creating new BMPs. Using a graphic editing program, like Photoshop (Paint works too), open each BMP file from the tutorial, and then "overlay" the new graphic by pasting it on top of the existing image. Do not change the canvas size, but you might have to resize the new graphic. You will have to play around with resizing as you go along. Make sure your vehicle is centered. You can use #000 or #FFF for background colors, as both will be transparent once you insert the graphics*. I recommend completing all 8 graphics, before moving on to the next step, which is inserting them into Tiledata (using UOFiddler).

*CAUTION: If your image contains the color(s) #FFF/#000, the graphic will be transparent in those spots (think about the stray pixels we have all noticed in UO graphics, same idea, only transparent). If your graphic editing program allows you to select a color range (Photoshop allows this to happen), you can select #FFF and/or #000, copy the pieces of the image that are highlighted, paste them in a new layer, and then change the color. When you export/save the graphic, saving it as a BMP merges all the layers together. (NOTE: Using a white #FFF background produced a white outline around the first vehicle, using black #000 worked much better)

3 Insert your design into UOFiddler

  • Open the folder containing your client files, and backup the following:
    • Art.mul/Art.uop
    • Artidx.mul
    • Tiledata.mul/Tiledata.uop
  • If you aren't using a client with UOP files, just backup the MUL files in the above list.
  • Open UOFiddler (at the time this tutorial was written, UOFiddler v4.6 was used).
  • Make sure your Path Settings are loading the correct client files (Settings->Path Settings, and then Set Manual Path*).
  • Click on the Items tab.
  • Click Search and type in: 0x3D3D (You should see an Unused tile image at this location, as well as at least 7 more Unused tile images after 0x3D3D to 0x3D44).
  • If you DO NOT see Unused tile images at this location, look around for a group of Unused tile images (they must be 8 consecutive images), and verify IN-GAME that tile is in fact Unused (Add static 0x3D3D)**, and search for that itemID in your entire server.

  • Right-click on the Unused image in 0x3D3D and select Replace.
  • Navigate to the folder with your BMPs for your vehicle.
  • The BMPs MUST be added in the following order:
    • 0x3D3D = North
    • 0x3D3E = Right (Northeast)
    • 0x3D3F = East
    • 0x3D40 = Bottom (Southeast)
    • 0x3D41 = South
    • 0x3D42 = Left (Southwest)
    • 0x3D43 = West
    • 0x3D44 = Up (Northwest)
  • Once all the BMPs have been added in the correct order, go back to the first location (0x3D3D), right-click again, and Save, and then wait a few minutes.
  • Right-click again, and Select in Tiledata tab.

  • Then click on the Tiledata tab, and you should already see the new graphic highlighted.
  • On the right side of the Tiledata window, you will see various Flags that can be set for tiles.
  • Enter a NAME for your graphic (yes all 8 graphics can be the same name), and put a checkmark in the HoverOver box, and then click Save Changes***.

  • Repeat Step 13 for each graphic (right-click from Items tab, Select in Tiledata, etc).

  • When all 8 graphics have been updated in Tiledata, click Save Tiledata.
  • Navigate to the directory where the newly altered Tiledata.mul was saved, and copy it into the folder for the client you are changing.
    • You can reload the files to see the changes right away in UOFiddler
*It could be that the version of UOFiddler being used at the time, had a bug, but Set Manual Path has to be done twice in order to populate all the fields for each file.

**Some tiles in UOFiddler might show as Unused, but in fact are tied to other graphics, animations, or effects. Adding the static in-game is a good way to determine if it is Unused or not, but always search through your server to make sure it isn't being used in a script.

*** You have to Save Changes after you edit each Tiledata entry, or it won't update the file.

4 Create a new vehicle script

Now we need to create a new script for the vehicle. An example is given for the Steam-powered Fire Engine (FireSteam.cs), that was a model from http://www.cadnav.com:
Code (C#):
  2. public class FireSteam: Vehicle*
  3. {
  4. [Constructable]
  5. public FireSteam() : base( 0x3D3D )**
  6. {
  7. Name = "a steam-powered fire engine";
  8. DiagonalOffset = 2;
  9. MaxSpeed = 3;
  10. MaxFuel = 2000;
  11. Fuel = MaxFuel;
  12. EarthAllowed = true;
  13. StarsAllowed = false;
  14. WaterAllowed = false;
  15. MountainAllowed = true;
  16. Size = 1;
  17. MaxSlope = 10;
  18. EngineSound = 542;
  19. StopSound = 502;
  20. StartSound = 1470;
  21. }
  22. }
*The new vehicle class must derivate from Vehicle base class.
**The constructor take as an argument the first slot number (North direction, 0x3D3D)

Here are the other properties:
  • MaxFuel: Maximum fuel a vehicle can contain. Each time the vehicle moves, it uses 1 fuel. Put 0 for infinite fuel.
  • Fuel: Fuel that the vehicle actually contains.
  • CanFly: For vehicles that fly.
  • FlyAltitude: For vehicles that fly, the flying altitude. It is recommended not to fly higher than +120.
  • MaxSlope: For earth vehicles the vertical maximum offset the vehicle can climb (how steep of an angle the vehicle can climb).
  • WaterAllowed: Allows vehicle to move over water.
  • EarthAllowed: Allows vehicle to move over the earth.
  • StarsAllowed: Allows vehicle to move over the stars.
  • MaxSpeed: Maximum speed of the vehicle. “1” is the slowest speed.
  • DiagonalOffset: Distance in diagonal tiles from the real location of the vehicle and the graphical view location (basically this is the position a player is in when they enter the vehicle).
  • StartSound: sound index of the start engine sound ( 0 for none )
  • StopSound: sound index of the stop engine sound ( 0 for none )
  • EngineSound: sound index of the running engine sound ( 0 for none )
  • MaxResistance: How many hit this vehicle can accept when going into obstacles before being broken.
  • Size: The size of the vehicle: “0” for 1 tile, “1” for 3x3 tiles, “2” for 5x5 tiles, and so on…
  • AlternativeItemID: (0 for none) you can use another 8 slots to define an animation ( 2nd frame) when vehicle is moving (for example if you wanted the wheels to appear to move).

The new vehicle class can override functions when the player use on of the 4 special buttons:

    • F1
    • F2
    • F3
    • F4
There is also the gump that all vehicles inherit and it appears when a player enters the vehicle and closes when the players exits.

5 Test your vehicle

Aaah... now time to test your new vehicle!
Add your vehicle using the [add command.
The vehicle is lockable if you want to use keys.
Double-click on the vehicle to enter it: a gump appears and you can not move, until you start it.
There are 4 big arrows: Turn LEFT, Turn RIGHT, FORWARD, BACKWARD.
The big red button is the STOP button.
If you set CanFly, there are to small blue arrows: UP and DOWN.
The 4 small red button on the top left corners are the F1 to F4 special functions activators.
The bottom of the gump is the fuel gauge.
You can leave the vehicle while it is stopped by double-clicking on it.


6 File Downloads

These are all the files you need to follow this tutorial (3DS Max has a Trial download, as does Photoshop).

UOVehiclesOriginal.zip - This archive contains Alambik's original tutorial, along with all of his files.

UOVehicleScripts.zip - This archive contains all the scripts you need to copy into your Scripts->Customs folder.

FireSteam.zip - This archive contains all the graphics needed to add the Steam-powered fire engine to a shard, following this tutorial.

OctoNuker.zip - This archive contains all the graphics needed to add Alambik's original OctoNuker to a shard, following this tutorial.

Attached Files: