The "New Horizons" mod for the 2003 Pirates of the Caribbean game by Akella is a continuation of the famous Build mod series. Developed as Pirates of the Caribbean Build 14, "New Horizons" continues where Build 13 left off, adding more new content than ever before.

Report article RSS Feed Location Remodeling with Inez Tool

By means of Inez Diaz tool for converting GM models you -yes, YOU- can easily change models by removing and/or adding model components. That way you -yes, YOU- can create landlocations and islands that look completely different from the stock ones.

Posted by Pieter_Boelen on Sep 28th, 2007
Intermediate Props Modelling.

[page=Introduction]
By means of Inez Diaz fabulous tool for converting GM models you -yes, YOU- can easily change models by removing and/or adding model components. That way you -yes, YOU- can create landlocations and islands that look completely different from the stock ones. See picture:
Tutorial Image

No prior modeling knowledge is required. You need, however, patience and stamina, and you must be willing and able to learn from tutorials and forumthreads, and by trial and error.

- CouchcaptainCharles, Apr 18 2007

[page=Prerequisits]
Download from Pieter's site:
- Inez Tool
- the GM viewer, which allows you to view and check existing and new models, and tells you which textures a model needs
- and the TX converter -which converts the PotC TX textures into TGA textures that the Tool needs.(If a model appears white in the tool you don't have its texture converted)

I also recommend that you download my "Meshes4InezTool", "TxTextures4newModels" and "TgaTextures4InezTool" from the PiratesAhoy Files FTP, which will give you A LOT more modelcomponents.

Make yourself familiar with those programs by means of the helpfiles and the threads on www.piratesahoy.com/forum. This tutorial does not deal with that basic info again but starts with location changing right away.

And don't forget the basic rule for all modding:

MAKE A BACKUP COPY OF EVERY FILE BEFORE YOU CHANGE IT !!!!

Second rule:
Enable error logging, and check the logfiles after each testplaying(even if it SEEMS that everything works). The system.log will tell you if anything regarding models and textures is wrong. Often a bug is caused by misplaced or misnamed files, an error easily made, but also easily fixed if you are being told about it.

[page=How to change a locationmodel with "Edit scene"]
As a simple first example let's change the Oxbay lighthousebay into a bare cliff with a small wooden fort.

-Make a copy of the "Resource\models\locations\outside\Mayak" folder

-Give it some NEW name, e.g. "Resource\models\locations\outside\Mayak_NEW"
From now on we work ONLY in the new folder, so that we leave the original files safe alone!

-Start the Tool.

-On the right margin check the option "ship, item, location"

-Click on "Load Gm"

-Go to the location model directory and doubleclick the locatorfile, in our example "locations\outside\Mayak_new\mayak.gm"

-Click on "Scene" / "Edit scene"

Tutorial Image

-The second window from left is the list of modelcomponents that your scene already has. Click on the + in front of "Original" and its components will be displayed. Click on "Poly surface 36" and then the big "Delete" button, and the lighthouse will disappear. Deleting "Poly surface 1534" will remove the trees.

-To the left is a list of models which you can add to your scene/locationmodel. Doubleclick on e.g. house01_x and a house will be added. Though it doesn't show up yet.

-In the second window house01 has now been added. Click on it and you can move and resize this modelcomponent with the interface right of this list:

-above "move to position" are the positioncoords x, y, z of your chosen modelcomponent. Change those coords, e.g. to 2/18,8/-7 , click "move to position" and the modelcomponent will be moved there.

-you can also move a modelcomponent by shifting the three scale levers below

-the scale lever to the right resizes the modelcomponent

-"delete" -you'll guess it- deletes the chosen modelcomponent

-Click on one of the "-axis" buttons and the modelcomponent will rotate 45 degrees
That way you can place a house on the cliff and some "fence" stockades around it to create a fort.
(The tool comes with only few modelcomponents, but you can download or create more; see section "Additional Modelcomponents" below)

-Finally click "Save as GM" in the MAIN window of the tool
For safety reasons this new location modelfile is being stored with the appendix "_X" as "mayak_X.gm". So if you messed up anything you still have the old "mayak.gm" as backup.

-Once you are content with the new locationmodel (use the GM Viewer to check your progress) name the final version "mayak.gm"

[page=Assigning new models to locations]
The point of changing a location model is of course that new locations will look different from the stock locations. There is one "new" location that uses the Oxbay lighthouse model that we just changed: "Turtle Bay.", with the location.id "Turks_Lighthouse". Thanks to our new "Cliff fort" Turtle bay won't look like Oxbay lighthouse anymore.

We assign our new model to a Turks location in the program\locations\init\Turks.c file. Open it with notepad, find this section:
CODE:
// -------------------------------------------------
Locations[n].filespath.models = "locations\outside\Mayak";

Locations[n].id = "Turks_Lighthouse";
Locations[n].name = "Old lighthouse";
locations[n].id.label = "Turtle Bay."; // KK

Simply tell the program to use the files from our new folder by changing the first line to
CODE:
Locations[n].filespath.models = "locations\outside\Mayak_NEW";

That's the only NECESSARY change. As we have only changed the foldername and left all FILEnames as before the remainder of the init code will still match.
You CAN of course change other data of the location, like loadingscreen etc.
If you want to do that -or make a new location for that changed model- have a look at the Location Cloning tutorial at the PotC modding WIKI.

Your new model will now be used for the "Turks_Lighthouse" after you started a new game. (Those locations\init files run only then)

( if you want to activate the new model immediately you can use the program\console.c file: open it and insert this line below the first bracket:
CODE:
{
Locations[FindLocation("Turks_Lighthouse")].filespath.models = "locations\outside\Mayak_NEW";

[page=Problems]
Your new model already works in the game, so you can go there and play in it. You will, however, notice that everything looks unaturally bright. We will fix that soon by making new lighting files.(see below)

EDIT APR23: Even with lighting files it seems that the Tool actually actually swallows some lighting data. If you store a changed modelfile it has a smaller filesize than the original, and there are e.g. no shadows.
So whenever possible one should work with superimposed models.(see below)

You may also be able to walk through walls if you placed them in walkable areas(in PotC the walkable area is not limited by the models but by a seperate "Patch" file, those in the model folders with a .ptc suffix). You can prevent that by carefully placing your new models within the original walkpatch, or you can edit the walkpatch with Inez Tool(menu "Scene","Patch").

Another oddity is that the 3rd person camera will sometimes disappear in walls. I have no real solution for that yet, but several workarounds:
-Easiest "workaround": simply ignore this oddity. After all, it doesn't affect the gameplay. Walls are transparent from the backside, so your view will hardly be hampered. Or play in First Person View

-again, clever selection of the basic model, and careful placement of your new models will help.
Choose a location where walls are not close to streets and paths, so that the camera will rarely get into them. Place your new models recessed as well.

-or do not change the basic model itself but make an ADDITIONAL one superimposed on it. The camera collision detection of the original model will be preserved then.
That means of course that you can't delete any original modelparts. All you can do is to cover them under superimposed models.

[page=Superimposed models]
Many locations consist of several superimposed models, which you can see if you open open our \Mayak_New folder in the GM viewer: Apart from the basic buildings cum landscape model there are models for jungle background screens, the seabed, windows and lamps(unlighted ones for daytime, lighted for night), and a cart with goods for sugglers, which appears only if you have a date with them.

So why not make another additional model with our Cliff fort?

- Open the new "mayak.gm" model that we have made before with the Tool

- Delete all original modelcomponents and leave only the houses and fences you have added

- Save that .gm files and rename it, e.g. "mayak_add1.gm"

- (in this tutorial example you should now copy the STOCK mayak.gm from the \mayak folder into \Mayak_New. This step is uneccessary if you leave an stock model unchanged right away)

- Open our locations\init\Turks.c file

- in the "Turks_Lighthouse" section add this line:
CODE:
Locations[n].models.always.add2 = "mayak_add1";

This will make the additional model appear within the stock model (after starting a new game. Or use the console.c immediate change again)

[page=Lighting files]
Lighting files (those with the .col ending) shade the colours of the textures, so that models look darker during evening and night. Without those files models will always appear unnaturally bright. (Buildingsetmodels have that deficiency. Unfortunately we can't make lightingfiles for them cause technically they are item models)

But for changed location, island or fort models you can and should make lighting files.
EDIT APR23: Even with lighting files it seems that the Tool actually actually swallows some lighting data. If you store a changed modelfile it has a smaller filesize than the original, and there are e.g. no shadows.

You must stick to certain filename rules:
the name consists of the name of the model that shall be lighted, followed by a timeperiod suffix. E.g. for the mayak.gm model lighting files must have names like mayak_DAY1.COL or mayak_EVENING2.COL.

There are always eight .col files for each lighted model:
_DAY1.COL , _DAY2.COL , _DAY3.COL
_EVENING1.COL , _EVENING2.COL , _EVENING3.COL
MORNING1.COL and NIGHT1.COL

-Open the model that needs lighting in the tool

-Click "Scene", "Edit Scene"

-Click "Light", "Make .COL file", "With fixed color"

-Enter the filename, click "save"

-In the palletmenu click "Define Color"

-Select a shade of grey from the bar at the far right:
I recommend grey with "brightness" 83 for all "DAY" files, 42 for all "EVENING" and "MORNING", and 17 for "NIGHT"

-Click "Add color"

-Click on your new color

-Click "OK"

Repeat that till you have the eight new .col files in the modelfolder.

You CAN if you want mix shades of red or yellow for sunset/sunrise glows. Feel free to experiment with the colors.

[page=Shadow Textures]
For proper lighting of the floor areas you need shadow textures. You find those in the Resource\textures\lighting\ folder.
That has four subfolders for different light situations: "day", "evening", "mn", "storm".
In each of that subfolders is a directorytree with a folder for EVERY location, containing one shadow.tga texturefile each.
The directorypath to that folder must match the one that we assigned before as Locations[n].filespath.models in the locations\init file. (in our cliff fort example "locations\outside\Mayak_NEW" )

So

- go into the \lighting\day\locations\outside\ folder

- copy the "Mayak" folder

- rename that copy "Mayak_NEW"

- repeat that for the "\evening\", "\mn\" and "\storm\" folders

[page=Foam Files]
Foam files create the waterfoam where the sealevel meets the edge of the model. This line is also the line of collision detection for ships "against" islands. If you change a port, beach or island location the foamfiles may not match anymore, and you may get system.log entries like

Island: vBoxCenter not equal, foam error: resource\foam\locations\town_Conceicao\port\Conceicao_port.ini

Usually that doesn't affect the game, but if you want to make a new foam file:

-find the outdated foamfiles in the resource\foam folder

-delete (or move or rename) the outdated foamfiles

-start the game and try to enter your location

-the game will freeze for some time, but it will continue after that (at least on stable computers). During that freeze the program creates a new foamfile along the edges of the model (kudos to Akella for that amazing feature)

If you changed the filespath.models attribute of a location the program will also have to create new foamfiles. So be patient if the first-time loading of a new location takes some time.

[page=Additional model components]
Unfortunately the Tool comes with only two simple housemodels and the fence for outside locations.

I uploaded a bunch of meshes for Inez' Tool on the Potc Pirates Ahoy FTP: Buildings from AOP provided by Maximus, 17th century fortifications by Captain Caceres, prominent buildings I cut out of existing locations, some forest models and some basic components like stoneblocks, planks, poles... and a gibbet with an executed pirate on display(a common 17th century sight)
If you copy those into the "meshes" folder of the Tool you'll have a lot of possibilities to change the look of locations for good.

[page=What are meshes good for?]
Inez' tool contains some simple models in the modding\tool\meshes folder. By means of the "Edit Scene" feature you can add those models to existing PotC models and change their looks, or create entirely new combinations.
The meshes that are included in the tool are mostly furniture for interior locations. I uploaded a set of 60 new models on the PotC FTP. With the new set of meshes you can also work on new outside locations and islands and create your own game world.

[page=How to create your own meshes]
You can NOT use existing PotC models as meshes. If you try to combine two PotC models with "Edit Scene" the tool will refuse to save them. I'm no modeler, but I assume that each model contains certain "rootdata" that must be unique.
But there is a simple way how to delete those data: if you want to use a certain .gm model as mesh open it with the tool and save it as vrml model. Then open that vrml model and save it as .gm again. Then put the result of that double conversion into the tool\meshes folder. The next time you start the Tool program your mesh will be available in the "Edit Scene" interface.

Most PotC models consist of several components. If you want to use only certain components as mesh...

-Start the Tool. On the right margin check the option "ship, item, location"

-Click on "Load Gm"

-Go to the model directory and doubleclick the modelfile that contains what shall become a mesh

-Click on "Scene" / "Edit scene"

-The second window is the list of modelcomponents that your scene already has. Click on the + in front of "Original" and its components will be displayed. Click on the components that you want to delete and then the big "Delete" button.

-When only the component that shall become a mesh is left save it as vrml model.

-Open that vrml model and save it as .gm again.

-Put the result of that double conversion into the tool\meshes folder. The next time you start the Tool program your mesh will be available in the "Edit Scene" interface.

You can also create meshes by combining several modelcomponents, but each component can be used only once. If you use the same component more than once the Tool refuses to save that to VRLM.

[page=Retexturing]
Retexturing a location can do a lot to change it's character and appearance, as Swindler has shown with his excellent retexturing of Santo Domingo: that the formerly dark brickbuildings are now whitewashed adds a lot of Spanish atmosphere.

Retexturing characters or ships requires artistic talent and graphics knowledge (see Duke Suraknar's great tutorial in the WIKI), but swapping the texture of some wall with another kind of stone is rather simple: it can be easily done with the TGA converter and a Hex editor. (see Pieter's tool page)

Changing a modelfile with a Hex editor leaves the camera collision and lighting files intact. (Unlike the Tool)

Here is another example: Port au Prince town used the Conceicao town model. FAIK 17th century PaP was a rather simple, provisional settlement, so walls of timber and boulders would be more appropriate. Also the magnificient townhall is a bit out of place (the 14th century Gothic architecture is absurd anyway). Retexturing can change that. See screenshot:
Tutorial Image

-Open your model (e.g. contown.gm for Port au Prince town) in the GM viewer. There is a list which textures this model uses.

-Often the name of the texture or a look into the TGA converter already identifies the texture you want to swap. If not, seperate the modelpart you want to retexture with the Tool and look THAT up in the GM viewer.
(e.g. wall_list_fra_01 textures the halftimbered balconies of the townhall)

- Open the .gm modelfile with a Hexeditor. Use the search function to find the texture name in the "plain" language field.

-Now replace that texturename with another one. That new texturename MUST HAVE EXACTLY THE SAME LENGTH AS THE OLD ONE!

-save the .gm modelfile under a new name. That will show the new texture.

So far, so easy. But how to find a matching texture with a matching texturename? Easy as well.

-Look through the .tga.tx files in the PotC resource\textures folder with the TGA viewer. Some have only one "colour" (shipfloor.tga.tx)
-If such one suits you, copy it, give the copy a name that has the same length as the texture-to-be-replaced, and enter that new name in the Hexeditor.
(e.g. replacing wall_list_fra_01 changes the halftimbered balconies into wooden ones)

If you have to deal with a texturefile that contains several textures it gets a bit more complicated. For example "wall_list_spa01" contains different plaster surfaces for the Conceicao houses, and also pavement stones. To replace only the walls some cut-and-paste is required:

-copy "wall_list_spa_01.tga.tx", rename the copy e.g. "wall_list_spa_wd.tga.tx"

-use the TGA converter to convert "wall_list_spa_wd.tga.tx" into "wall_list_spa_wd.tga"

-open "wall_list_spa_wd.tga" with some program that can edit TGA files. (even something like IrfanView is sufficient for our purposes)

-cut and paste textures of your liking over the plasterwall sections (see screenshot below)

-save the changed .tga file and convert it back into .tga.tx so that the game can use it

The following screenshot shows the original wall_list_spa_01, the changed wall_list_spa_wd, and the respective Hexeditor entries below.

Tutorial Image

[page=Deleting Buildings by means of transparent textures]
If you give some modelcomponent a transparent texture it virtually disappears from the model. Sounds like useless variete magic, but has a great advantage over removing models "properly" with the tool:
it leaves the camera collision and lighting files intact.

Assign a copy of the "waterfall" texture to a modelpart to let it vanish.

[page=Language of the shopsigns]
Portuguese shopsigns would look a bit odd in French Port au Prince, so those get retextured as well. The signs have "national" texturefiles like "Portugal_signs.tga.tx" or "Fra_signs". We can't simply swap them as complete files, cause the shape of the sign models doesn't match. But cutting the French words out of "Fra_signs" and pasting them into a copy of "Portugal_signs.tga.tx" creates appropriate signs for a French town.

[page=Changing Reload locators]
If you want a townmodel to appear different from the stock town you could also change the main doors, so that you see the location from a different perspective if you enter it.

The "Location Cloning" tutorial in the POTC WIKI explains how you reassign reload locators.

As example let's hide a treasurechest among the boxes on the landing stage of Oxbay port.

First you need the position coordinates of the spot where your new locator shall be. You can determine that by inserting three lines of code into the console.c file (right below the first "{" bracket ):

float x,y,z;
GetCharacterPos(GetMainCharacter(), &x, &y, &z);
Logit("My coords: " + x+" "+y+" "+z );

(If you use the buildingset you already have this in console.c)
If you now press the F12 key during the game the x,y and z coords of the playerposition will be displayed. So walk to the spot where you want to create a locator, press F12 and note the values (approximately, one decimalpoint is enough)

In front of the boxes on the landing stage you get something like 15.5, 2.1 and 66.0 .

The second thing you need to know is the name of the locator file. You'll find that in the location definitions in program\locations\init. E.g. in the Oxbay.c file you'll find in the "Oxbay_port" section the lines

Locations[n].filespath.models = "locations\town_Oxbay\port";

and

Locations[n].models.always.locators = "OXport_l";

Which means the locatorfile named "OXport_l" is in the directory resource\models\locations\town_Oxbay\port .

Now you can start Inez' fabulous Tool(takes some moments to load, don't get impatient).

-On the right margin check the option "ship, item, location"

-Click on "Load Gm"

-Go to the location model directory and doubleclick the locatorfile

-Wait a moment, then click

-"View"

-"Locators". A new window opens.

-In that window click on "locators" or the + in front, and the list of locators appears

Let's have a look at one of those lines. The first field is the name of the individual locator, so it must be unique. I recommend that you use the locatorgroup followed by the first number that has not yet being used, e.g. reload5 or box2

The second field contains the locatorgroup (reload, goto, monster, box..). This determines the function of your locator, so if you add one you must enter the correct type here.

The next three fields are the x,y,z coords of the locatorposition. Enter the three values you have noted.

All the following fields determine the facingdirection of a character or item that is loaded on that locator. The bad news is that I can't tell you exactly what all those values mean (maybe some of our modellers can?) The good news is that you can't do much wrong if you just use (aproximately) the values of a similar locator. The worst thing that can happen then is that your avatar faces to the wrong location after a reload. For boxlocators facingdirection doesn't matter anyway.
Now back to our new boxlocator:

- in the last line click on the first empty field behind the * to open new fields for your entries. Then enter..

-"box2" for name
-"box" for group
-"15,5" for x
-"2,1" for y
-"66,0" for z

-Fill up the remainder of the line with the same values that "box1" has

-Once you have filled the line click "Apply changes" twice(just to make sure)

-Finally click "Save as GM" in the MAIN window of the tool

For safety reasons this new locator file is being stored with the appendix "_X" as "OXport_l_X". So if you messed up anything you still have the old "OXport_l" as backup. I recommend that you now rename that one "OXport_l_backup", and the new "OXport_l_X" to "OXport_l". This one will now be used AFTER you start a new game, and the boxes and barrels are a tresurechest then.

If you get errormessages try to continue, or start the whole process again.

Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Pirates of the Caribbean Icon
Platform
Windows
Contact
Send Message
Official Page
Piratesahoy.net
Release Date
Released Oct 6, 2013
Mod Watch
Track this mod
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Mods
Related Games
Pirates of the Caribbean
Pirates of the Caribbean Single Player Role Playing
Related Groups
PiratesAhoy! Community
PiratesAhoy! Community Developer & Publisher with 60 members