Table of Contents

Prerequisites
What it is
3D View
User Interface
Character Import
Ship Import
gm->VRML
VRML->gm
Start Game
Locators
Scenes
Make Locations File
2D View
Animations
Extras
Plugins

Prerequisites

The Program needs Microsoft .NET-Framework to run. Get it from here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=262d25e3-f589-4842-8157-034d1e7cf3a3&displaylang=en

 

What it is

NOTE: The tool has been tested with VRML output from Max - with VRML-files generated by Maya or any other program it might or might not work.  

3D View

For the 3D View Window to function you need DirectX installed (probably DirectX9). To see models textured you have to convert textures to tga format (with txconverter) and point the tool to the directory where those tga textures are located (enter the path into the Texture Directory textbox).

To navigate in 3DView:

Zooming resets all rotaions so things can't get messed up too much ;).

User Interface

Open files via the menu bar or toolbar and save them in a different format. Character import and binding is done via the Character Autoimport toolbar button or the commands in the Character menu.

On saving, "_x" is automatically appended to all filenames. If you don't want that, uncheck the Add _x to filename checkbox in the main window.

The other checkboxes and textboxes can usually be left at their default values, except in the following cases:

Character Import and Binding

This paragraph explains how to get a character made with a modeler program into the game.

IMPORTANT: If your model doesn't have any bones, it has to be saved with both arms streched out to the sides; NOT in the position the original game models are saved in. The program will then save your model in the position needed for the game.

Character with arms raised

For stock models converted to VRML and back binding is not necessary, because the bone numbers are retained on export (coded into texture coordinates). Such models can accordingly be converted without raising the arms.
Only if you want to bind the model anew (for example to a different skeleton) the raising of arms is necessary with stock models. This can be done via the Extras / Raise Arms menu command. That command works only for stock game models, and it must be done before editing the charater in a modeling program (Maya or Max). Before binding again, you must in this case use the Character / Unbind menu item to reset bone numbers.

If you make models from scratch or import from other sources, you have to raise arms manually in the modeling program. If after binding (putting the skeleton information in as explained below) the arms are very close to the body, raise them up a bit more.
Legs can be in the same position as the original ones, but make sure there's a little space between the left and the right leg.

To get a character model ready for the game, the following steps are necessary:

The menu command Auto Import / the corresponding toolbar button perform all these steps automatically. If on the other hand you wnat to skip certain steps or check intermediate results in Gm Viewer, you can perform the steps manually via the Character menu.

For Characters that are not symmetrical, it is bettter to skip the "Drop and center" step, because centering might not work correctly. Center the model in your modeler program, instead.

Results are best when the model matches the skeleton of the male characters in the game precisely (especially length of arms). Deviations result in bones bending where no joints are. Models with skirts (towngirls) will for that reason not work. To see if your model has the joints at the right position, use the show skeleton checkbox.

Character Skeleton as shown in the tool

Instead oft hat, you can check Make Bone Locators, import the model, save as gm and then open it in GM Viewer or Maya. The Model will have locators at all the joint positions. Don't forget to uncheck the checkbox before doing the actual export for the game.

Character with bone locators

Non- automatic resizing of Characters can be done via the Scene / Edit Scene menu.

When stock models or models made from stock models with the head switcher are exported to VRML, the bone numbers will be retained. That means such models can be edited in a modeler (such as Max or Maya) and then converted back to gm without losing animation information.

New parts that are added in the modeler (like, for example, a hat) get bone number 0 and can be bound afterwards with the tool's regular binding functionality - but again without the bone information that came from the stock models being lost. This means in particular that the animation of hands and fingers (which the tool can't do) can be retained from the stock models.

Even the deleting of parts in the modeler program will cause no problems.

Note: Because bone information is coded into texture coordinates (UV) you need to make sure VRML files are saved with at least six digits precision.

Hats

If Models have a large hat, theres has to be a little space left beween the hat and the upraised arms. It can sometimes happen that parts of the hat are recognized as part of an arm or vice versa. You can in this case correct the value in the Separate Hats field (a percentage 0-100). If after binding the corners of the hat are turned downwards, decrease the value, if parts of the arm stick out upwards, increase it.

Ship Import

For ship import check the Ship/Item/Location checkbox. That sets the  u4 value to 0 and unchecks the Reverse Normals checkBox,  as is usually required for ships. On unchecking ship, those values are reset to their defaults.  

To work in the game with sails etc., ship models need a set of locators. The Easiest way to put those in is by loading a model from the game and saving its locators to a text file (via the locators menu). Then  load your new model and import the locators form that text file (again via the locators menu). The view  /  locators menu allows you to edit the locators for the purposes of the new ship (see Locators).

NOTE:

Ships have some extra information in them that other models don't. For VRML models that information is generated by the tool, but not correctly - which results in the computer beeping once when loading such a model at sea. About further consequences I'm not sure. The tool will prompt you for an existing model to copy the missing data from. If you just cancel that dialog, the data will be generated.

Walk Files

The path crew members walk on a ship is defined by the ...walk.c file in the PROGRAM\SEA_AI\walk subdirectory of your game installation folder. The first set of numbers in this file determines a set of points, the second their animation types and the third the connections bewteen them..

To make editing those points easier they can now (via the Walk Files  / Read Walk File menu) be shown in the tool's 2DView. You can also see the connections between points, so you can easily visualize where characters walk. If you have the ship model loaded, you'll also see its bounding box for orientation.

The points can be moved around with the mouse. Double-clicking a point opens a dialog box where you can edit a point's coordinates (including y) and its type. Type 0 is an ordinary walking point, type 1 a point for loading a cannon, 2 and 3 I don't know, 5, 4 and 6 are successive levels of climbing the vants.

With the slider on the right in the top portion of the 2D window the whole window can be made transparent, so you can view the model in GmViewer in the background. However this makes everything very slow.

For Maya users, the points can be transformed into a set of locators via a menu item in the 2D View. Those locators are automatically added to the currently loaded model (make sure you have a backup copy). After editing the locators in Maya the tool can generate the points section of the walk file in text format. This can then with a text editor be inserted into an existing walkfile.

gm->VRML

When importing the vrml model into Max, make sure to add the directory with the textures to the list of locations where Max will look for textures. Textures have to be in tga format (use txconverter for that). Many models use the texture shadow.tga which the game setup does not put into the RESOURCE\Textures direcory but into the INTERFACES subdirectory. So you have to add that to the list of texture locations for Max, too.

VRML->gm

When exporting VRML from Max, make sure you coose vrml97, not vrml 1.0. Select polygon type "triangles" and deactivate the checkbox "bitmap url-prefix".

The u4 value only affects conversion from vrml to gm. It MUST be 4 for characters. For the original models that aren't characters it's usually zero, but conversion to gm also works if you leave it at 4. (At least in gm viewer, I haven't tested those ingame). Probably a value of 4 for non-character models only wastes space. Models with a value of 4 in the u4 field also get locators for camera, saber, gun etc.

VRML reading is quite slow, so be patient.

When import is complete, the tool will prompt you for an existing file to copy "collision information" from. This should usually be ignored (choose Cancel), except for ships (see Ship Import). Not sure this has really anything to do with collision.

Menu View/Details shows a treeview that should reflect the structure of the original vrml file. Transform, Shape and Material nodes will be correctly handled - anything else might not.

Textures must be converted to tga.tx and copied to the appropriate directory. VRML files without texture information can be converted and viewed in the tool or in GmViewer, but they will not work ingame. The tool will insert "Texture missing .tga" for the texture, but supplying a texture by that name is not enough, the VRML file needs to have texture coordinates.

Start Game

The Start Game menu command and button are meant for the testing of characters. The currently loaded model will be copied into the file main_x.gm in the game directory and the game then started. The script files will not be altered so as not to interfere with your own mods. For character testing to work, you have to change the script files manually to make the main charcter model main_x, in  whatever  way your mods do that. For the unmodded stock game, it will suffice in characters_init.c (localized version) to change the lines

ch.id = "Blaze"; 
ch.nation = ENGLAND; 
ch.model = "blaze";  

in characters_int.c to

ch.id = "Blaze"; 
ch.nation = ENGLAND; 
ch.model = "main_x"; 
 
Use the Start Game command only when you have loaded a character model!

Locators

After loading a model, its locators can be viewed (numerically) and edited via the View / Locators menu. Even new Locators can be added this way.

For each locator there are two text strings (only one of which is shown in GM Viewer), then three single values (X, Y, Z) for the locator position, and again three single values of each of the tree axes, so the locator can have an orientation. The orientation is important for the saber and gun locators, for example, because it will determine the weapons' orientation. In case of doubt, set the axes to (1, 0, 0), (0, 1 ,0) and (0, 0, 1)  - that is XX to1, XY and XZ to 0, YY to 1, YX and YZ to 0, ZZ to 1 and ZX and ZY to 0.

With the Apply Changes button the changes are copied into the current model - if the model is then saved, so are the new locators. Alternatively Locators can be separately saved into a text file via the Locators menu. Those saved locators can afterwards be loaded back into the same or an other model. Of course you can also hand-edit the text file in a text editor or create it with an external program.

Locators can also be viewed in the character patch.

Scenes

The commands in the  Scenes menu allow you to create new empty rooms and to put furniture into a room (this works for new as well as existing rooms).

The Make new room command creates a very simple room (a box with a brick texture and a door which is a box with a wood texture) and displays it in the 3D window. Maybe you have to move backwards a little (by holding the right mouse button down and pulling the mouse towards yourself)  in order to view it in full.

New Room

Editing scenes

The  Edit Scene  menu item displays a second window where you can  add new meshes to the scene ot position, rotate and resize the single meshes that together make up the model. It can be used with an existing location that was previously loaded or with a  new room that was created via the Make new room command (or with any other model loaded).

Decorate Room Controls

Of course these controls can also be used for models with only one mesh. That way a model can be rotated (which is not too useful), resized (which is very useful) or translated (not advised for single-mesh models because if translated the model will not be centered in its own coordinate system).

Resizing animations

Whe a character model has been loaded before opening the scene editing window, the Scale animation also checkbox will be checked. If the model is now scaled, the sekeleton (and the model's locators) will be scaled with it. This will not affect the original skeleton in man.an - you have to separately save the .an file via the Save Animation button. You then get a file my.an in the game's resource \ animation directory which needs to be appropriately set up in the POTC script to be used with the model (see below). Save the resized model via the Save as gm button in the main window ( _x is appended to the filename).

The two buttons Woman/youth size and Child size (not in the above picture) rescale to standard sizes, so all characters with that size can use the same animation (.an file).

To rigg up your new animation on POTC script you have to do the following:

Adding meshes

To add a mesh to the current scene, double-click it in the left listbox. Most of the objects that come with the tool have been cut out from models in the original game. The fence was provided by Alan Smithee.

If you add your own models to the Meshes directory they will also show up in the list.

Move, resize or delete a mesh

To move, resize or delete a mesh select it in the treeview and use the sliders/buttons.

Making .COL files

.col files are used by the game for lighting. Lacking a better option, the tool enables you to make simple .colfiles with just one color, so you can at least make the overall appearaence of  a room darker or give it a certain shade.

You find this in the menu Light of the 2D View. To use it you need to load the location model for which you want to create a col file for first. You will then be prompted for a filename to save the new col file to. After that you can select a color. All vertices will be colored with this color. Usually you would select a shade of grey (black will make the room fully dark).

Make Locations File

For new locations to be used in the game, there has to be some initialization code. This code can be put into a file in a subdirectory named mods in the Program/Locations/Iinit folder. If you use the Post Build 12 modpack, those files will be automatically loaded and processed.  

The Make Locations File menu item in the Scene menu lets you create such a file which initializes all the locations in a given directory (the scene subfolder in the Resource/Models/Locations/ folder).

It will also convert all character patches(if present) in that folder and its subfolders from .gm to .ptc file format.

All you have to do is put all the gm files for the location (geometry, locators etc.) into subfolders of that folder and then select the menu item.  

Each Island should have its own Directory with subdirectories for the towns.

Note that for a folder with many locations this is a lengthy process and will take some time, during which the program will not be responding. 

2D View

The menuitem View/2D in the main window display a 2D Window. If a model is loaded, its size will be shown as a rectangle. This windows also serves to create rooms from polygons, edit the character patch or make ...walk.c files for ships.

Creating rooms from polygons

In 2D View, use the Line button in the toolbar to make a polygon which can later be extruded to a room. Make points by clicking into the 2D view. When you're done, click the Line toolbar button again.

If you work from an existing floor plan you can load it as background image via the corresponding menu item.

Use the Polygon / Extrude menu item to create the room and switch to 3D View to see it.

For large rooms the texture will probably need to be tiled, which can be done via the Edit Scene window.

NOTE:

If you add the points for the polygon in clokwise order the room will be visible form the outside, if you add them in counterclockwise order it will be visible from the inside.

Making Doors and Windows

The Door and Window menu items cut out "fake" doors and windows form the walls: they're not really open, but just recede a little bit from the rest of the wall. You should apply a window or door texture to those parts via the "Edit Scene" window. Note that as soon as a wall has a door or window, that wall can also be separately textured.

There is no "undo" function for doors and windowsyet, however each wall can only have one window or door, so if something goes wrong just make a new window/door and the old one will disappear.

Editing the character patch

The menuitem Scene / Patch / Read character patch in the main window shows a dialog box to select a character patch file (.ptc). The Patch will be shown in 2D View. The Points in the patch can be dragged around with the mouse.

The menuitem Scene / Patch / Create new character patch in the main window creates a rectangluar patch which can then be edited in 2D View.

If a model is loaded before creating a new patch, the default values for the patch size are matched to the size of the model. For each loaded mesh a box with the same size will be shown with the patch for ease of editing.

Double-Click on a point to create a hole in the patch.

Locators

If before displaying a patch a model defining locators for a location (_l.gm) has been loaded, the file selection dialog box will not be shown, but the .ptc file for the location will be opened. The program in this case also shows the locators, which can then be freely positioned. Double-clicking a locator shows some of its properties in another dialog box.

Via the menu and toolbar of the patch editing window you can add new locators.

Animations

Use the View / Animation Data menu item to to open the animation editor window. (For this a character model hasto be loaded first.). Select the frame you want to edit with the long slider in the middle. To select a joint (bone) by clicking on one of the radio buttons in the skeleton picture on the right. You can now rotate this joint with the three slider at the top. If you want to move a bone that doesn't have a radio button, enter its number in the textbox on the upper left. For the bone numbers see the picture in the Character Import section. When you're satisfied with all bones' positions for that frame, klick the Animation / Make Keyframe menu item. You don't have to do this for all frames, the program interpolates between keyframes.

Animation maker window

The complete animation can be saved via the Animation / Save menu item. You get a file in your game's the Resource / animation directory with the same name as the animation you started with (that was selected in the main window), with an _x appended to the filename.

Swapping gender

The Translate bone numbers menu item in the naimation window allows you to put the male skeleton into a female character derived from Danielle (so she can sit) or the female skeleton into a male character. Male characters have before to be resized to female size via the Scene Editing window (in Main window, choose Scene /Edit Scene). This will also create a new animation my.an in the game's animation directory. That file will be needed for the following process, so make sure it's there. (Even if it's a female character you want to put the male animation into, you need first to resize a male character to female size to get the my.an file).

The models with the changed skeleton then needs to be saved. In the process a new .an file is created: man_woman.an for male models with female skeleton and woman_man.an for female models with male skeletons. These should then show up in the Main window's animation combobox. Select the appropriate one and then reload the model with the new skeleton to test it. For use in game you also have to rig up the new .an files via a corresponding .ani file and the script code.

Also make sure you copy the locators from Danielle into the resized male model (again in Main window: Locators / Write to File and Locators /Read from File.

Extras

In the Extras menu you find the commands for

Dividing a model up into separate meshes

Select a model which will then be separated into smaller parts (it's supposed to extract the submeshes, but most of the time it gets much smaller parts, such as polygons). For performance reasons the model will not be shown in the 3D Window.

Save the result as vrml (gm is not yet working) and use a modeler program to cut out the elements you want and glue them back together.

This facilitates the cutting out of submeshes such as furniture from a location model.

Raising the coordinates of an inside location by a fixed amount

Stock game inside locations usually have their floor below zero (water level). However character models cannot be loaded to locator position that are below zero. As that prevents bed locators (see Making Locators from a script-generated tracefile) to work, this menu item lets you raise all coordinates by a fixed amount.

It shows a file selection dialog, where you have to select an inside location model. The coordinates for this model, all its locators, its windows, its background skybox and its character patch will be raised by the given amount.

Of course this has other uses besides bed locators (e.g. location flooding).

Plugins

NK

This plugin provides a rudimentary user interface for Nathan Kell's UV tool.

From the original help file of that program:

NathanKell (nathankell@piratesahoy.net)

DESCRIPTION: This program will allow you to merge the bone numbers that were baked into the UV coordinates of a WRL file on export from The Tool into a second WRL file you specify with edited UVs. If you have not edited the UVs since exporting the WRL from The Tool, running this program is not necessary. However, if your 3d suite does *not* support UV coordinates with six decimal places, you will need to run this program and give it The Tool's original WRL and your modified WRL.

USAGE: Place in same folder as WRLs. Go to a command prompt there. Type: Bonemerge FileWithCorrectBoneNumbers[.wrl] FileToAddThemTo[.wrl] [FilenameForMergedData.[wrl]] [-d] [-h]

NOTE: The first two wrl files must have the same number of vertices in the same order. You need not append .wrl to each filename. If desired, you may explicitly specify the name of the file to write to; if not, the filename will be FileToAddThemTo_b.wrl

FileWithCorrectBoneNumbers.wrl: This file must have the correct six-digit UVs. The XYZ positions of the vertices need not be the same as when it was exported from The Tool, though.

FileToAddThemTo.wrl: This file has the edited UVs. It must have the same number and order of vertices as the first file.

FilenameForMergedData.wrl: If specified, the program will write to this file. Otherwise it will write to FileToAddThemTo_b.wrl

-d: Debug mode. Will output to debug.log the states of the reading and writing operations, and the bone numbers of the vertices (if found).

-h: Help mode. This.

BIG NOTE: This will only do the merging for the FIRST object/material group in your WRL file. So make sure that, when you export to WRL in your 3D package, all geometry is part of the same object and it all uses the same texture.

However command line options will not be used when invoked from the plugin. For better control start the program BoneMerge.exe (in the Plugins directory) from the command line.

Utilities

Making Locators from a script-generated tracefile

Nathan Kell created some console code to write locator coordinates into compile.log from ingame (originally to make bed locators for Chouch Captain Charles' sneaking mod). This plugin parses compile.log and inserts the locators into the corresponding location models. 

For this to work, the location's coordinates have to be raised, usually by an amount of 1.0 (see Raising the coordinates of an inside location by a fixed amount). Do this before making the locators.

To write the locators into the log file, you should have something like the following in console.c (originally by Nathan Kell, faults by me):

#include "SDK\LocatorWrite.c"

//...

void ExecuteConsole()
{
  ref pchar = GetMainCharacter();
  ref ch;
  int i;

  //... 
  string model = "modelname_l";

  pchar.vcskip = true;
  if(findloadedlocation() == -1) return;
  ref loc = &Locations[FindLoadedLocation()];
  if(loc.models.always.locators == model)
  {
    DoLocWrite(1.0, 0.5, 5, true);
    /*
    ref fch1 = LAi_CreateFantomCharacter(false, 0, true, false,
    false, "man2", "goto","upfrombed");
    ref fch = LAi_CreateFantomCharacter(false, 0, true, false,
    false, "man1", "reload", "onbed");
    LAi_SetActorTypeNoGroup(fch);
    LAi_ActorSetLayMode(fch);
    */ 
  } 
  else
  {
    ReloadToLocModel(model);
  }
}

The function DoLocWrite should in recent build or modpack versions be in SDK\LocatorWrite.c.

Edit the code in  console.c so that the line

string model = "modelname_l";

points to the location model you want to make locators for. Start the game, then hit F12. Your character is teleported to the location. Now place your character before the bed and hit F12 again. A message will inform you that if the bed'shead is to your left you need to turn around (without changing position). After doing so, if needed, hit F12 again.

You can then edit console.c again to point it to a different model and teleport again with F12.

When you're done, process compile.log with the plugin in the Extras / Utilities / Locatormaker / readLocators menu.  

To test, comment out the DoLocWrite line and uncomment the block below, then leave the location and hit F12 once more.