• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Solved Making Town Capture Boarding Locators

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
This information, originally posted here, should help in sorting out the capture town problems we're having at the moment:

Making boarding locators in towns.

First, make sure that logging is enabled (check PROGRAM\engine.ini file for settings):
Code:
full_screen = 0
...
tracefilesoff = 0
[script]
debuginfo = 1
codefiles = 0
runtimelog = 1
(the full_screen is 0 because we'll have to do Alt+Tab).

Essentially, someone has to check every location listed in the towns entries in PROGRAM\Towns\InitTowns.c (look for the lines starting with ctown.boarding.l*).
Check where the model of that location is (you can find the file names in PROGRAM\Locations\init\<island>.c, at the end of the Locations[n].models.always.locators lines for each location listed in InitTowns.c), go to that folder and edit the file with boarding locators (look in RESOURCE\MODELS\Locations\Town_<name>\, and you will find the relevant files ending in _lb.gm) with Inez Dias' TOOL.
(If the *_lb.gm file doesn't exist, you can create it by copying the original *_l.gm.)
Then, the "reload", "goto" and "rld" locators can be deleted from the *_lb.gm file, with the exception of one temporary locator, which would need to be renamed to loc and be a type of rld.
You also need to generate a text file of the locators (go to Locators->Write to File in Tool).

Check PROGRAM\Console.c for this line:
Code:
//DoQuestReloadToLocation("Oxbay_Port", "reload", "reload1" ,"");
Change "Oxbay_port" with the ID of the desired location (see PROGRAM\Towns\InitTowns.c), remove the "//" from the beginning of the line, and save the file.
Now, start the game and load either a new game or save game, and press F12 to execute the code. When executed, the player character should be teleported to the desired location. The character should be able to walk freely there.
(*) When the character reaches a point which would be good to place a friendly soldier (on the player's side), use Alt + Tab to temporarily exit the game and open console.c.
Towards the top of the file, change switch(0) to switch(1), and then find this line:
Code:
//trace("rld,loc,"+xx+",0,"+y+","+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
Remove the "//" from the beginning of the line; then find this line:
Code:
trace("rld,aloc,"+xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
This time, add "//" to the beginning. Finally, save the file.
Now, go back into the game and press F12 again. On the screen, the string "Player and enemy locator generated." should appear, and in PROGRAM\compile.log, a line starting with "rld,loc" should appear.
The locator coordinates are compatible with text output from Tool; loc is for player soldiers. After producing some amount of positions (less than 16 for a side; it would be, say 14 for a side for most of locations), use Alt + Tab to open console.c again. Find the two lines from above, undo the changes you made (i.e. add or remove "//" from the lines), and save the file.
After making those changes, repeat steps from (*), but this time for enemy soldiers. If in port, friendly soldiers were put on a pier and/or near the sea, the enemies should be on the other side, closer to the entrance to the town. The amount of enemy locators should be equal to that of friendly locators. After this, you can exit the game normally. Now, compile.log should be edited: sequential integer numbers should be added starting from 0 after each loc and aloc. For example:
Code:
rld,loc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,loc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
...
rld,loc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,aloc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,aloc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
...
rld,aloc,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
into:
Code:
rld,loc0,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,loc1,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
...
rld,locn,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,aloc0,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
rld,aloc1,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
...
rld,alocn,1,0,1,1,0,1,0,1,0,0,1.000,1.000,1.000,1,0,0,0,0,0,0,0,0,
Then all those lines should be copied to locators file we saved in Tool earlier; line starting with
Code:
rld,loc,...
as well as any earlier lines with "rld,loc1,...", "rld,loc2,...", ... and "rld,aloc1,...", "rld,aloc2,...", ... should be deleted now. After saving that file, open Tool again, load proper *_lb.gm file, use option Locators->Read from File and save in gm format - file *_lb_x.gm should appear in a folder with model. Before proceeding to a next location PROGRAM\console.c should be reseted to starting form. After making locations you can upload that *_lb_x.gm files on ftp so I could use them.

Note 28/12/2012: post edited by Armada to fix formatting errors from the old forum.
 
Last edited:
<!--quoteo(post=266230:date=Jul 3 2008, 12:53 PM:name=Thomas the Terror)--><div class='quotetop'>QUOTE (Thomas the Terror @ Jul 3 2008, 12:53 PM) <a href="index.php?act=findpost&pid=266230"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I have got Douwens town+port Conceicao town+port Greenford (stockgame) town+port and Oxbay town+port ready. And I am doing it for an hour or so. Not that hard actually and time consuming.<!--QuoteEnd--></div><!--QuoteEEnd-->
 
It appears that the Greenford port one isn't correct and new ones will need to be made for all the AoP locations.
That makes for the following list:
- Greenford (Bridgetown) Port
- Tortuga Port
- Guadeloupe Port
- Guadeloupe/Eleuthera Plantation
- Charlestown Port
- Governor's Harbour Port (Eleuthera)
- Alice Town Port (Eleuthera)

Hopefully somebody can work on this. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
Doesn't surprise me. So we need them locator files to be made!
 
<!--quoteo(post=319152:date=May 12 2009, 07:50 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ May 12 2009, 07:50 AM) <a href="index.php?act=findpost&pid=319152"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Doesn't surprise me. So we need them locator files to be made!<!--QuoteEnd--></div><!--QuoteEEnd-->

Can I use version 14 9.5A to do this? I'm going to go through your instructions tonight to see if I hit any walls...

EDIT: I can't remember what island I had attacked but the town area placed all soilders in one spot in the air on a side of a building, I'll put pictures of it later...

EDIT: Man i think I need something a little more visual for this, just so I know I'm in the right place.
 
You certainly can use Build 14 Alpha 9.5; I'd actually recommend that, because it's got all latest locations included.
What do you mean by "something a little more visual"? <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Well, as much as I can learn things just by reading text, I'm more of a visual learner. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" /> If you had a few shots of you doing the locations on your desktop it would help me out, so I can see what I should be looking for. I'm just confused with the TOOL and Locations thing...

I attached Something like I'm talking about using the "Prnt Scrn" button like so: (Attached Sample pic)
 

Attachments

  • Sample.jpg
    Sample.jpg
    187.6 KB · Views: 470
Do you understand what "locators" are? If not, open PROGRAM\InternalSettings.h and set VISIBLE_LOCATORS to 1 at the bottom of the file.
If you now walk around in the game, you'll notice see-through spheres all over the various locations.
These spots can be doors (reload locators) or random item locators or "place character here"-locators (goto).
What you'd need to do is add more of those kinds of locators for the town and port locations where the player and enemy boarding crew can be generated upon a Colony Capture fight.

As described above, you'd use the console to find the coodinates for these locators.
Then you'd use Ines Diaz' TOOL for actually putting these coordinates in a file that the game will be able to use for boardings.

What exactly are you having trouble with at the moment?
At the moment I am not near my game, so can't make any pictures.
 
LOL! basicly I hit a road block and you just opened a new door for me! I didn't know about:
set VISIBLE_LOCATORS to 1

Let me check it out I'll be back...
 
I was going to try to figure out what's going on with Bridgetown, but I'm lost before I even get started.

Looking here,

<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>Storyline\standard\quests\quests_reaction.c:

2459 Islands[FindIsland("Oxbay")].reload.l6.go = "Fake_Greenford_fort"; // KK
...
2485 Pchar.quest.Story_FightingInGreenfordPort.win_condition.l1.location = "Fake_Greenford_port";
...
2494 Islands[FindIsland("Oxbay")].reload.l2.go = "Fake_Greenford_port";
...
2498 Locations[FindLocation("Fake_Greenford_port")].vcskip = true; // NK
2499 Locations[FindLocation("Fake_Greenford_town")].vcskip = true; // NK
...
2548 Pchar.quest.Story_FightingInGreenfordTown.win_condition.l1.location = "Fake_Greenford_town";
...
2555 Locations[FindLocation("Fake_Greenford_port")].reload.l2.name = "reload4";
2556 Locations[FindLocation("Fake_Greenford_port")].reload.l2.go = "Fake_Greenford_town";
2557 Locations[FindLocation("Fake_Greenford_port")].reload.l2.emerge = "reload1";
...
2562 ChangeCharacterAddressGroup(characterFromID("Danielle"), "Fake_Greenford_town", "reload", "reload26");
</div>

there's all these references to Fake_Greenford_port and town.

These are just Greenford town & port, but with different locators? If so, where are they? The only locators I can find for these are GrPort_lb.gm and GrTown_lb.gm.

As I mentioned in the bugtracker thread, Fake_Greenford_Port has five locators but I can't see where it's getting them from.

I'm confused.
 
Fake_Greenford_port is probably defined in the QuestLocations init file in the standard storyline folder.
The locator file used should also be defined there.
 
Also post if you've got some specific questions. <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
<!--quoteo(post=319479:date=May 13 2009, 08:39 AM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ May 13 2009, 08:39 AM) <a href="index.php?act=findpost&pid=319479"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Fake_Greenford_port is probably defined in the QuestLocations init file in the standard storyline folder.
The locator file used should also be defined there.<!--QuoteEnd--></div><!--QuoteEEnd-->

Thanks. I had a fundamental misunderstanding of how things worked, but I think I'm back on track now. You can definitely expect that I'll be asking more stupid questions <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> .
 
You'd be welcome to. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
The locators aren't ending up where I expect them to end up. Some are being stacked on top of each other, and the z-axis is off on other ones.

Not sure what I'm doing wrong. Back to the drawing board...

Greenford_Port.jpg
 
I went and took a look at the original B14A9.5 GrPort_lb.gm and it turns out that all the locators are actually there, they're just underground.

There might be a problem with console.c:

32 //trace("rld,aloc,"+xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");

I think it's supposed to be:

32 //trace("rld,aloc,"+xx+",0,"+y+","+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");

Anyway, Greenford_Town has the same problem. All the boarders and defenders are underground.
 
Shoot, in my case they were on top of a building, (greenbay port). If you fix it let me test it...
 
Very strange; Thomas the Terror used that system to make the already existing boarding locators and at least some of those work right.
But then he also made the Greenford ones and those don't work. Very weird. <img src="style_emoticons/<#EMO_DIR#>/wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" />

Where are those towngirls in your screenshot coming from? Are they your officers?
 
Back
Top