Define the character in one of your files in "PROGRAM\Storyline\NewPirateAge\Characters". In his definition, include lines like this:
Code:
ch.Ship.Name = "Naughty Ship";
ch.Ship.Type = "BlackPearl";
ch.Ship.Stopped = true;
ch.skipRM = true;
ch.Ship.Name can be whatever you like, that's the ship's name.
ch.Ship.Type will be copied from one of the
refShip.Name lines in "PROGRAM\Ships\Ships_init.c".
I'm not sure how important
ch.Ship.Stopped = true; is; I've seen it in similar definitions in other storylines, so I've used it in mine as well.
ch.skipRM = true; means you will not be penalised for sinking the ship. Normally if you sink a ship, the nation which owns that ship gets upset and so do any nations allied to it. This line prevents that, so if the ship is a pirate, attacking it won't upset your status with the rest of the pirates. If you want the pirates (or whichever nation owns the ship) to take notice, leave that line out.
So now the character has a ship. You need to put it somewhere. First look at "PROGRAM\ISLANDS\Islands_init.c", find the town or beach you want to use, and find the locator corresponding to it. For example, suppose you want to put the ship somewhere near Port Royale. That's on Jamaica - but remember, the game refers to both Port Royale and island Jamaica as "Redmond". So, in "Islands_init.c", we find a block which starts:
Code:
rIsland.id = "Redmond";
rIsland.model = "redmond";
And part way down that block:
Code:
rIsland.reload.l1.label = "#stown_name# Port"; // KK
rIsland.reload.l1.name = "reload_2";
rIsland.reload.l1.go = "REDMOND_PORT";
rIsland.reload.l1.emerge = "sea_1";
rIsland.reload.l1.radius = 600.0;
rIsland.reload.l1.pic = 7;
rIsland.reload.l1.tex = "t1";
rIsland.reload.l1.goto_enable = false; // Screwface: Disable Sail-To
So "Redmond Port", alias Port Royale, is at locator "reload_2". Now use TOOL, set it to look at "RESOURCE\MODELS\Islands\Redmond.gm", then examine its locators. Find "reload_2" and look at its co-ordinates. Then find another locator with co-ordinates somewhere near it. That locator is where you want to put Barbossa. (I needed an encounter near Port Royale in my own storyline and found "quest_ship_13" was close enough.)
To set up the encounter:
Code:
Group_CreateGroup("Enemy_fleet");
Group_AddCharacter("Enemy_fleet", "Barbossa");
Group_SetGroupCommander("Enemy_fleet", "Barbossa");
Group_SetTaskAttack("Enemy_fleet", PLAYER_GROUP, true);
Group_LockTask("Enemy_fleet");
Group_SetAddress("Enemy_fleet", "Redmond", "quest_ships", "quest_ship_13");
Group_SetPursuitGroup("Enemy_fleet", PLAYER_GROUP); // Optional
characters[GetCharacterIndex("Barbossa")].nosurrender = 2; // Optional
Character_SetAbordageEnable(characterFromID("Barbossa"), false); // Optional
PChar.quest.Jamaica_battle_over.win_condition.l1 = "NPC_death";
Pchar.quest.Jamaica_battle_over.win_condition.l1.character = "Barbossa";
pchar.quest.Jamaica_battle_over.win_condition.l2 = "SeaEnter";
Pchar.quest.Jamaica_battle_over.win_condition = "Jamaica_battle_over";
You need to create a group, even if it's just one ship. I'm not 100% sure what all the lines do; I've played other storylines and side quests, noted where they have sea battles, and copied their code.
You can call the group whatever you like, so long as you use the same name for this whole encounter and don't use it again for another group elsewhere in your story.
The
Group_SetAddress line is where you put in the group and locator names you found by using TOOL on the island of your choice.
The
PChar.quest.Jamaica_battle_over lines set up the next quest case, which will happen when you have defeated Barbossa. You can rename them from "Jamaica_battle_over" to whatever you like.
The
Group_SetPursuitGroup line is optional. If that line is there, the enemy ship will appear right next to you, regardless of where you put it in the
Group_SetAddress line. (It will do that anyway if you give a locator which does not exist.) If you want the enemy ship to stay where you put it, leave this line out. (And make sure you got the locator right! I know this from personal experience...)
The
characters[GetCharacterIndex("Barbossa")].nosurrender = 2; line is also optional. It means the enemy ship will not surrender, no matter how badly damaged or how low its crew morale falls.
Character_SetAbordageEnable(characterFromID("Barbossa"), false); is optional. It means you can not board the enemy ship. If you've ever played the "Elizabeth Shaw" sidequest and wondered why you can never board and capture the
Flying Dutchman, this is why.