• 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!

Build 14 Capture Colonies mod

vaustein

Powder Monkey
This idea was previously brought up here: <a href="http://www.piratesahoy.com/forum/index.php?showtopic=7625&hl=capture%20colony&st=20" target="_blank">http://www.piratesahoy.com/forum/index.php...olony&st=20</a>

First things first, though <img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
Build 14 Alpha 6 is working fine. I've played up to the point of sneaking into Falaise d'Fleur to sink the ammunition supply vessel. Divided the plunder twice, several fine officers, slick battleship. <img src="style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" /> No bugs that I noticed.

Back to the topic, Build 13+ creates the entire Sid Meier's Pirates experience with a lush first-person 3D perspective. The only missing feature is capturing colonies after looting them, turning them over to a different European power. I'm not suggesting that they join NATHANIEL_NATION, just be convertible to the flag of a different nation. This can easily break the plot, but who cares? <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

I've been coding in C and C++ for a while now, both as a pro developer and a hobbyist. I'm rusty, without a doubt, but this cause is worth the effort. No promises, but I'll try to make this happen if it hasn't happened yet.

Could someone give me hints about
1) which source files to edit,
2) the best design, e.g. inserting a "Parley with Governor" dialog upon successful looting similar to the "parley with captain" upon successful ship boarding, and
3) where to insert the hooks to my code, e.g. where to stick the function calls that enable my feature. <img src="style_emoticons/<#EMO_DIR#>/type_1.gif" style="vertical-align:middle" emoid=":nk" border="0" alt="type_1.gif" />
Too bad Pieter's put out to sea <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

My development process would be to:
1) Study the existing code and get a feel for how things work
2) Post a spec describing exactly what will this feature will look like
3) Code it up and share it
Possibly a good candidiate for Pieter's idea about add-on features in separate folders?

Thoughts?
 
There is already limited "Capture Colony" feature in the Build: if you attack a fort from the landside and survive long enough to capture an "envoy" you MAY convince him to surrender the town to you.

The code for that is in program\CCCfunctions.c, in the ChangeTownNation function.

HTH, and much success for your modding <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
well, as long as you disable oxbay from being captured that way, it's fine with me.
 
I would go with the "parley with fort commander" option. That fits right in with the parley with captain mod, so it won't feel out-of-place. To write this mod, I would recommend to add this parley before the usual fort looting interface screen shows up. So you'll need to add some code in that function to load up the parley scene. You can then try to look at the code for the parley with captain mod to see how you can arrange the parley and look at CCC's ChangeTownNation and landside forts to find out how to change the nation. I think it would be great to have this functionality in the game. It is really a feature that should be in there, so thanks a lot for offering to work on this! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
My pleasure! One question before I spec this out: What do you mean by "landside fort" capture? Do you mean it is possible to capture a fort by attacking from land? SMP (Sid Meier's Pirates!) offered this feature, but I doubt that's advisable or even possible with PotC.
 
Feature Name: Change Nation of Plundered Colony

Goals:
- Enable a more SMP (Sid Meier's Pirates!) sort of experience by allowing a plundered colony to be handed over to a different nation.
- Maintain a familiar dialog tree-driven interface, e.g. the Parley with Defeated Ship Captain dialog of Build 12+.
- Encourage more ambitious privateering. For example, if the player has an English Letter of Marquee and captures a colony for England, the capture ought to be worth at least one promotion and many acres of land.

Non-goals:
- Preventing colony capture from breaking the main plot. If you hand Redmond to the French while working through the main campaign, you've created a doomed world. As the saying goes, "You broke it, you bought it."
- Building a pirate or NATHANIEL_NATION empire. Maybe for a future release but not the current one. You must give the colony to a European power; you cannot keep it for yourself or hand it to the Pirate faction.
- Recruiting officers. Enemy fort commanders are not available to serve as officers in the player's fleet.

==============================================================================
Design section
==============================================================================

Section 1: Enabling colony capture
-----------------------------------------------------------------------------------------------------------------------------
The flow of PotC enters this mod exactly when 1) a colony has been successfully plundered and 2) before the Plunder graphic (image of a sunset with icons for gold and goods) and the looting interface screen appear. As with ship capture, the action jumps to the player automatically running up to an enemy commander, but with the following differences:
1) The current map is a fort courtyard, not a ship deck.
2) The fort commander is clearly identifiable as belonging to the military of the owning nation.

Section 2: Colony Capture parley dialog tree
-----------------------------------------------------------------------------------------------------------------------------
This is intentionally similar to ship capture parley. Dialog strings are concept only. E is enemy commander, P is player, numbers label options among a list of dialog choices.
E1: What do you want?
P1: Just to loot the place (GOTO Plunder graphic and loot interface)
P2: This colony now belongs to another nation (GOTO E2)

E2: What? Which nation?
P1: England (GOTO ChangeColony(England); GOTO Plunder graphic and loot interface)
P2: France (GOTO ChangeColony(France); GOTO Plunder graphic and loot interface)
P3: Holland (etc.)
P4: Spain
P5: Portugal
P6: On second thought... (GOTO E1)

Section 3: Post-capture state
-----------------------------------------------------------------------------------------------------------------------------
The colony is vacant for some number of days as per regular plundering. If the colony has a governor, the new governor's character model and dialog tree reflect the new nation.

Section 4: Global defines
-----------------------------------------------------------------------------------------------------------------------------
// Number of surviving troops in player's attacking force in order to have the option to capture the colony. If 0, the mod is activated following any succesful plunder.
COLCAP_ARMY_SIZE_REQ = 0
// Reputation bonus for capturing a colony
COLCAP_NEWOWNER_FAME = 5
// Subtracted from reputation with the losing side for taking their colony
COLCAP_OLDOWNER_FAME = 10

Section 5: Testability
-----------------------------------------------------------------------------------------------------------------------------
The following procedure may suffice to test this feature.
1) Add a feature entry point near the beginning of the campaign, e.g. while talking with the First Mate during the tutorial.
2) Select a victim colony.
3) Traverse the dialog tree.
4) Dismiss the Plunder graphic and looting interface.
5) Dump the victim colony's ownership to a text file.
 
<!--quoteo(post=186492:date=Mar 28 2007, 04:40 AM:name=vaustein)--><div class='quotetop'>QUOTE(vaustein @ Mar 28 2007, 04:40 AM) [snapback]186492[/snapback]</div><div class='quotemain'><!--quotec-->
My pleasure! One question before I spec this out: What do you mean by "landside fort" capture? Do you mean it is possible to capture a fort by attacking from land? <!--QuoteEnd--></div><!--QuoteEEnd-->
Yes, it is. (You see, the Build offers more features than most people imagine <img src="style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> ) Though not all forts have a landside gate, you'll find them only on the "new" islands and in the new "suburbs" of Oxbay and Greenford.

The dialog in which you can demand the handover of the town to a certain nation is in dialogs\Enc_fort_dialog.c , in the case "capture". The structure is similar to your proposal, so the code might be useful for you <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
you are probably missing the fact that forts are fairly easy to capture. the rewards you get from a nation should not be too big.
 
@CouchcaptainCharles: How do I enable the "landside capture" feature? I didn't see anything about it in the buildsettings.h for B14a6.

@MorganTerror: Fairly easy to capture? What do you think is the minimum-sized ship I need to capture a fort? I don't even try to plunder a colony unless I have a battleship, but maybe it's easier than I think.
 
well, ok, they're not easy, but if you have manowar, you can basically just keep endlessly looting forts. getting a manowar doesn't take that much time, so it could become very easy to rise in rank when you have one and there would be a large reward.
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->@CouchcaptainCharles: How do I enable the "landside capture" feature? I didn't see anything about it in the buildsettings.h for B14a6.<!--QuoteEnd--></div><!--QuoteEEnd-->It is an "always on" feature. You just need to find the entrance to the fort to be able to do this. For example: In Oxbay, walk through the port and the original stock game town until you get to the Falaise de Fleur-like part. Turn right before leaving town and follow the path. It will lead you up to the fort. When you enter the fort, there are many soldiers there for you to fight. Occasionally you will encounter some high-ranking officials with whom you can parley.
 
Well, I've budgeted my time. Based on work-related demands, I'll sit down and do this either this coming Saturday (3/31) or next Saturday (4/7) and post my progress at that time. Believe it or not, recreational coding is a hobby of mine. With a little luck and skill, I'll have something ready for a wider test!

An unlikely worst case is that my skills will be overwhelmed by the challenge and I'll make no progress. Not bloody likely, but I'll be honest about it either way <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />
 
Okay, time to be honest. I assumed there was a developer document describing the code, e.g. function calls, structures, etc. Starting with zero knowledge of how everything is laid out, it would take more time than I have to figure this out. Compounding the problem is testability - how would I verify the feature without restarting the game and successfully raiding the fort?

Without more guidance, I can't invest the time to do this right. Could someone with deeper understanding of where dialogs are loaded from, the common functions around the battle and dialog interfaces, etc. be able to implement the spec?
 
I learned what I know of the PotC code simply by messing around with it. Unfortunately there isn't much documentation on how to mod the game, so there's nly two ways to learn: Try yourself or ask others. Please don't give up just yet. Just ask questions about how everything works here and I'm sure people will help you.

What do you mean with "where dialogs are loaded from"? The files are in PROGRAM\DIALOGS, of course, but I suppose that isn't the answer to your question.

Basically, the interfaces can be found in PROGRAM\INTERFACES, dialogs in PROGRAM\DIALOGS, quest cases in PROGRAM\QUESTS, etc.

The fort fight scene is basically a ship boarding that looks like it is a fort. So you can find the code for the fight itself in PROGRAM\Loc_ai\Lai_boarding.c. Search the file for code having to do with forts. There seems to be some code having to do with the fort capture: The function LaunchFortCapture(). I think that is the function that loads the fort capture screen, so you want to insert your code before this line.

What I usually do when I don't know where to find some code is this: I try to locate some code I DO know where to find that applies to what I want to modify. Then I let Windows search for the function call. That's how I found the above LaunchFortCapture() function.
 
<!--quoteo(post=186816:date=Mar 30 2007, 11:32 PM:name=vaustein)--><div class='quotetop'>QUOTE(vaustein @ Mar 30 2007, 11:32 PM) [snapback]186816[/snapback]</div><div class='quotemain'><!--quotec-->Without more guidance, I can't invest the time to do this right. Could someone with deeper understanding of where dialogs are loaded from, the common functions around the battle and dialog interfaces, etc. be able to implement the spec?<!--QuoteEnd--></div><!--QuoteEEnd-->

Dialogs are in two parts:
Program\Dialogs will give you the program for the dialog

Program\dialogs\english will give you the actual verbage operated on by the program

both have the individual characters names listed.

If you look at one or two I think you will get the gist of it.

Hope that helps.
 
I think that when you raid a fort, you should after fighting in the fort, continue to fight in the town, and end in the governors mansion (just like captains cabin.)
 
That might be nice, but let's not get carried away. Vaustein is already having difficulties doing what he originally wanted to do. Let's not make it more complicated... <img src="style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" />
 
Back
Top