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

Need Help Black Pearl no smoke and no skeletons?

I followed your instructions and placed this line in the Artois Voysey entry in Officers.c:

character_SetCompanionEnemyEnable(characterFromID("Artois Voysey"), true);
That's not where you should add the line. Try putting it in "PROGRAM\QUESTS\quests_side.c", at case "Voysey_listed" (first time you hire him after saving him from Nigel Blythe) and at case "Voysey_listed_2" (second time you save him, from pirates outside Sao Jorge). Of course, that only works for Artois Voysey, not for any other officers.

I couldn't find such a line. Strange.
When you get the game fully reinstalled, check again. If you still can't find the line, upload your version of "PROGRAM\Dialog_func.c".

I placed the SetCompanionEnemyEnable line under the void CreateCharacters() line, so that it now looks like this:

...

But this didn't work. Maybe it should have been somewhere else?
You also need to change 'switch(0)' to 'switch(1)'. And that entire section is commented out so it won't do anything anyway. Remove the "/*" and "*/", so that it should now look like this:
Code:
    switch(1)                                // Case 1 = Various test and cheat codes
    {                                        // Case 2 = Location coordinate information
        case 1:                                // Case 3 = Automatic instant cheats in port
                                            // Case 4 = Instant teleport to Hendrick Vanderdecken

        // Give ship
        // ------------------
        /*    for (i = 0; i < COMPANION_MAX; i++) {
                limit = GetCompanionIndex(PChar, i);
                if (limit < 0) continue;
                ch = GetCharacter(limit);
                GiveShip2Character(ch,ch.ship.type,ch.ship.name,-1,ch.ship.stats.nation,true,true);
            }*/

As for reinstalling, I don't think you want to use "PCUninstall". When I want to re-install, I just delete the entire game folder, then install the stock game from scratch, then install the mod. For the stock game, I can simply install the original CD 1 to start the process. Or, having installed the stock game long ago, I made a copy of the whole game folder while it was still stock, before installing the mod. Now whenever I want to reinstall, I make another copy of that stock game folder copy, rename it, and install the mod onto this new copy.
 
That's not where you should add the line. Try putting it in "PROGRAM\QUESTS\quests_side.c", at case "Voysey_listed" (first time you hire him after saving him from Nigel Blythe) and at case "Voysey_listed_2" (second time you save him, from pirates outside Sao Jorge). Of course, that only works for Artois Voysey, not for any other officers.


When you get the game fully reinstalled, check again. If you still can't find the line, upload your version of "PROGRAM\Dialog_func.c".


You also need to change 'switch(0)' to 'switch(1)'. And that entire section is commented out so it won't do anything anyway. Remove the "/*" and "*/", so that it should now look like this:
Code:
    switch(1)                                // Case 1 = Various test and cheat codes
    {                                        // Case 2 = Location coordinate information
        case 1:                                // Case 3 = Automatic instant cheats in port
                                            // Case 4 = Instant teleport to Hendrick Vanderdecken

        // Give ship
        // ------------------
        /*    for (i = 0; i < COMPANION_MAX; i++) {
                limit = GetCompanionIndex(PChar, i);
                if (limit < 0) continue;
                ch = GetCharacter(limit);
                GiveShip2Character(ch,ch.ship.type,ch.ship.name,-1,ch.ship.stats.nation,true,true);
            }*/

As for reinstalling, I don't think you want to use "PCUninstall". When I want to re-install, I just delete the entire game folder, then install the stock game from scratch, then install the mod. For the stock game, I can simply install the original CD 1 to start the process. Or, having installed the stock game long ago, I made a copy of the whole game folder while it was still stock, before installing the mod. Now whenever I want to reinstall, I make another copy of that stock game folder copy, rename it, and install the mod onto this new copy.
Ah, I was wondering how I could play both games simultaneously. Thanks for the tip.

However, I tried editing the console.c as per your instructions, but my officer still wouldn't fire back. Here is the entry after editing:

void ExecuteConsole()
{
ref pchar = GetMainCharacter();
ref ch;
int i;
int limit;
// Case 0 = Enable reload (useful when you get stuck on boarding) + Set player type (if you cannot move anymore)
switch(1) // Case 1 = Various test and cheat codes
{ // Case 2 = Location coordinate information
case 1: // Case 3 = Automatic instant cheats in port
// Case 4 = Instant teleport to Hendrick Vanderdecken

// Give ship
// ------------------
for (i = 0; i < COMPANION_MAX; i++) {
limit = GetCompanionIndex(PChar, i);
if (limit < 0) continue;
ch = GetCharacter(limit);
character_SetCompanionEnemyEnable(ch, true);
GiveShip2Character(ch,ch.ship.type,ch.ship.name,-1,ch.ship.stats.nation,true,true);
 
Did you press F12 to run the console? If so, what happened? A message "Executed Console" should appear on the screen to indicate that it ran without any trouble. If you don't see such a message, have a look at "error.log". If there's a mistake in "console.c", then "error.log" should say where it is.
 
Presumably that's to go into "console.c", and will need 'int limit;' declared somewhere?
It's basically already in "console.c"; that's where I copied it from.
Just changed the last line to do something else.

But this didn't work. Maybe it should have been somewhere else?
Change 'switch(0)' to 'switch(1)' and remove the /* and */ around the relevant section of code.
Also, put // in front of GiveShip2Character to stop that from happening.

I apologise for commenting for the third time, but I'll try to do this once only.
It's okay. Don't worry 'bout it. :doff

Currently, it looks like I've done something to mess up the game, because now it crashes on startup.
Check error.log to see if there's any hints there.
 
It's basically already in "console.c"; that's where I copied it from.
Just changed the last line to do something else.


Change 'switch(0)' to 'switch(1)' and remove the /* and */ around the relevant section of code.
Also, put // in front of GiveShip2Character to stop that from happening.


It's okay. Don't worry 'bout it. :doff


Check error.log to see if there's any hints there.
Thanks, I got it worked out as per Grey Roger!

Now the thing I am looking to fix, is how to force ships to fight me without running away. The reason is I make duels of ships and want to see the fight to the end. I know it must be in Sea AI somewhere but I have zero knowledge of coding...

I can't for example fight Flying Dutchman from a first rate, because presumably its lower tier triggers it to flee.
 
Now the thing I am looking to fix, is how to force ships to fight me without running away. The reason is I make duels of ships and want to see the fight to the end. I know it must be in Sea AI somewhere but I have zero knowledge of coding...
Use that same trick you did for 'character_SetCompanionEnemyEnable(ch, true);' for this line instead:
Code:
ch.nosurrender = 2;
 
That won't stop them trying to run away, it just means they can't surrender. Davy Jones already has "nosurrender" set to 2 in "quests_side.c", case "Contact_NoLuck". Forcing him to run away is often the only way you can survive, given that Flying Dutchman has a base speed of 15.5, faster than most ships, and sails faster into the wind than with it.

Which means you want to go for the masts first. If you're in a 1st rate, perforating his sails and preferably dropping a mast or two means he can't run away. If you're in anything less, perforating his sails and preferably dropping a mast or two means you can run away.
 
That won't stop them trying to run away, it just means they can't surrender. Davy Jones already has "nosurrender" set to 2 in "quests_side.c", case "Contact_NoLuck". Forcing him to run away is often the only way you can survive, given that Flying Dutchman has a base speed of 15.5, faster than most ships, and sails faster into the wind than with it.

Which means you want to go for the masts first. If you're in a 1st rate, perforating his sails and preferably dropping a mast or two means he can't run away. If you're in anything less, perforating his sails and preferably dropping a mast or two means you can run away.
When I assign my officer the Dutchman and I the Dauntless/Victory, I'm unable to fight him (after hoisting another flag and thanks to the advice about making companions irritable), because immediately he turns and runs.

For example, I intend to roleplay as Nelson against Davy Jones. We know that Jones and his ship is supposed to be very formidable, capable of wrestling with ships even stronger than them. Perhaps even first rates, due to the ship's immense manuverability/speed coupled with the crew's century of experience.

However, currently this is not possible because whatever happens, Dutchman will run away from me if I have a Tier 2 or 1 ship. This is especially frustrating since the sea battle aspect, coupled with the super accurate ships, is what really draws me to this game...

I could try to demast him, but that would make the fight pretty one sided in my favour, which is not what I want.

I've tried assigning small ships Class 1 in ships.init to see if this line is what causes ships to run based on tier, but it doesn't seem to work. I tested it on the Interceptor, but enemy ships still chase me. So it's somewhwre else.

Perhaps a Group Lock Task quest code line might help?

This is for quests? Could there be a way to make it the default for all ships?
 
This is for quests? Could there be a way to make it the default for all ships?
Haven't tested it, but I'm thinking along these lines now:
Code:
            bool bCommander = false;
            Group_CreateGroup("enemies");
            for (i = 0; i < COMPANION_MAX; i++) {
                limit = GetCompanionIndex(PChar, i);
                if (limit < 0) continue;
                ch = GetCharacter(limit);
            //    GiveShip2Character(ch,ch.ship.type,ch.ship.name,-1,ch.ship.stats.nation,true,true);
           
           
                Group_AddCharacter("enemies", ch.id);
                if (!bCommander)
                {
                    Group_SetGroupCommander("enemies", ch.id);
                    bCommander = true;
                }
               
                character_SetCompanionEnemyEnable(ch, true);
                SeaAI_SetCompanionEnemy(ch);
                SetCharacterRelationBoth(limit,GetMainCharacterIndex(),RELATION_ENEMY);
                ch.nosurrender = 2;
            }

            Group_SetPursuitGroup("enemies", PLAYER_GROUP);
            Group_SetTaskAttack("enemies",  PLAYER_GROUP, true);
            Group_LockTask("enemies");
        //    Group_SetAddress("payroll_ship", "Cuba", "Quest_ships", "quest_ship_1");
        //    Sea_LoginGroupNow("payroll_ship");
       
            if (IsEntity(&BattleInterface))
            {
                RefreshFlags();
                RefreshBattleInterface(true); // TIH: refresh minimap colours if relation changed Aug27'06
            }

I could try to demast him, but that would make the fight pretty one sided in my favour, which is not what I want.
Isn't doing that a perfectly common and valid strategy for winning sea battles...?
 
Haven't tested it, but I'm thinking along these lines now:
Code:
            bool bCommander = false;
            Group_CreateGroup("enemies");
            for (i = 0; i < COMPANION_MAX; i++) {
                limit = GetCompanionIndex(PChar, i);
                if (limit < 0) continue;
                ch = GetCharacter(limit);
            //    GiveShip2Character(ch,ch.ship.type,ch.ship.name,-1,ch.ship.stats.nation,true,true);
        
        
                Group_AddCharacter("enemies", ch.id);
                if (!bCommander)
                {
                    Group_SetGroupCommander("enemies", ch.id);
                    bCommander = true;
                }
            
                character_SetCompanionEnemyEnable(ch, true);
                SeaAI_SetCompanionEnemy(ch);
                SetCharacterRelationBoth(limit,GetMainCharacterIndex(),RELATION_ENEMY);
                ch.nosurrender = 2;
            }

            Group_SetPursuitGroup("enemies", PLAYER_GROUP);
            Group_SetTaskAttack("enemies",  PLAYER_GROUP, true);
            Group_LockTask("enemies");
        //    Group_SetAddress("payroll_ship", "Cuba", "Quest_ships", "quest_ship_1");
        //    Sea_LoginGroupNow("payroll_ship");
    
            if (IsEntity(&BattleInterface))
            {
                RefreshFlags();
                RefreshBattleInterface(true); // TIH: refresh minimap colours if relation changed Aug27'06
            }


Isn't doing that a perfectly common and valid strategy for winning sea battles...?

Hmm...

Since we are at it, it looks like the only way to do this would simply be to create a quest.

As Grey Roger mentioned, it should be simpler to do this if I want a customised sea battle.

The problem is, I don't know how. But I guess it should be doable?

I've been dreaming of a battle simulator for this game for quite a while now. The idea is: you vs. an enemy team, with each team getting 1 to 4 ships.

You can set any ship for each teammate/enemy, and customise the skills/abilities of each captain from both teams in the quest/character file.

The battle should be triggered by, say, maybe talking to Oweyn McDorey (the Barbados shipyard guy).

How hard would this be? Is there an existing side quest that could simply be copypasted or something? I feel such a feature could be of interest not only to me, but to other players as well who are into customising sea battles/encounters.
 
How hard would this be? Is there an existing side quest that could simply be copypasted or something? I feel such a feature could be of interest not only to me, but to other players as well who are into customising sea battles/encounters.
There's no existing sidequest which does exactly what you want, but "Strange Things Going On in the Caribbean" does have a couple of sea battles. Have a look at "PROGRAM\QUESTS\quests_side.c", case "prepare_for_barkue", for how the battle in which you have to save Montanez from two Satanist ships is set up. Or look at "PROGRAM\Storyline\Hornblower\quests\quests_reaction.c", cases "At_War_with_France_Again" and "French_Battle_Setup", which is a battle very early in the story in which you're in a frigate, you have a 3rd rate ship of the line with you, and your job is to sink a French 3rd rate ship of the line. (There's a lot of stuff which you won't need, starting with everything to do with "Rally_the_crew" - that just plays a video clip taken from the "Hornblower" TV series.)

If you're planning to get into quest writing, you could do worse than play the "Hornblower" storyline. The quest code is relatively easy to follow. Play a bit, then save game, remember what has happened, and look at the quest code to see how it happened. The code for the "Assassin" and "Bartolomeu" storylines is also relatively easy to follow.
 
There's no existing sidequest which does exactly what you want, but "Strange Things Going On in the Caribbean" does have a couple of sea battles. Have a look at "PROGRAM\QUESTS\quests_side.c", case "prepare_for_barkue", for how the battle in which you have to save Montanez from two Satanist ships is set up. Or look at "PROGRAM\Storyline\Hornblower\quests\quests_reaction.c", cases "At_War_with_France_Again" and "French_Battle_Setup", which is a battle very early in the story in which you're in a frigate, you have a 3rd rate ship of the line with you, and your job is to sink a French 3rd rate ship of the line. (There's a lot of stuff which you won't need, starting with everything to do with "Rally_the_crew" - that just plays a video clip taken from the "Hornblower" TV series.)

If you're planning to get into quest writing, you could do worse than play the "Hornblower" storyline. The quest code is relatively easy to follow. Play a bit, then save game, remember what has happened, and look at the quest code to see how it happened. The code for the "Assassin" and "Bartolomeu" storylines is also relatively easy to follow.
case "shipfight":

Group_CreateGroup("Friends");
Group_AddCharacter("Friends", "FriendCaptain");
// boal -->
Group_SetAddress("Friends", "Oxbay", "Quest_ships", "Quest_ship_12");

// boal <--
Group_CreateGroup("Enemies");
Group_AddCharacter("Enemies", "EnemyCaptain1");
Group_AddCharacter("Enemies", "EnemyCaptain2");
Characters[GetCharacterIndex("EnemyCaptain1")].recognized = true;
Characters[GetCharacterIndex("EnemyCaptain2")].recognized = true;
// boal -->
LAi_SetHP(characterFromID("EnemyCaptain1"), 80.0, 80.0);
LAi_SetHP(characterFromID("EnemyCaptain2"), 80.0, 80.0);
SetCharacterRelation(GetCharacterIndex("FriendCaptain"),GetMainCharacterIndex(), RELATION_FRIEND);
SetCharacterRelation(GetCharacterIndex("EnemyCaptain1"),GetMainCharacterIndex(), RELATION_ENEMY);
// boal <--
Group_SetGroupCommander("Enemies", "EnemyCaptain1");
Group_SetPursuitGroup("Enemies", PLAYER_GROUP);
// boal -->
Group_SetAddress("Enemies", "Oxbay", "Quest_ships", "Quest_ship_12");
// boal <--

Here's a super rough "code" I tried to make by using the animist battle quest as a reference.

I haven't created characters "EnemyCaptain1/2" and "FriendCaptain" yet, I suppose creating entries for them in TempQuestCharacters or similar files will do?

Also, how do I actually trigger this quest to happen?
 
You probably don't need these lines:
Code:
LAi_SetHP(characterFromID("EnemyCaptain1"), 80.0, 80.0);
LAi_SetHP(characterFromID("EnemyCaptain2"), 80.0, 80.0);
Their HP should be set in their character definitions.

"TempQuestCharacters.c" is specific to a storyline. If you only want to be able to do this in FreePlay, for example, then you could put the character definitions in there, and you'd then need to trigger the quest only in FreePlay. Alternatively, put the characters into "PROGRAM\Characters\init\SideQuest.c", put the quest code into "PROGRAM\QUESTS\quests_side.c", and then the quest should work in any storyline.

How to trigger the quest - that depends, how do you want it to be triggered? By talking to someone? The code to trigger a quest case from within a dialog is:
Code:
AddDialogExitQuest("shipfight");
You'd still need to write dialog for someone, including that line at the end of the dialog, so that you can talk to the character to trigger the quest.

I still recommend playing "Hornblower", "Assassin" or "Bartolomeu", to see how quests work. That's how I learned - "Hornblower" was my modding training.
 
You probably don't need these lines:
Code:
LAi_SetHP(characterFromID("EnemyCaptain1"), 80.0, 80.0);
LAi_SetHP(characterFromID("EnemyCaptain2"), 80.0, 80.0);
Their HP should be set in their character definitions.

"TempQuestCharacters.c" is specific to a storyline. If you only want to be able to do this in FreePlay, for example, then you could put the character definitions in there, and you'd then need to trigger the quest only in FreePlay. Alternatively, put the characters into "PROGRAM\Characters\init\SideQuest.c", put the quest code into "PROGRAM\QUESTS\quests_side.c", and then the quest should work in any storyline.

How to trigger the quest - that depends, how do you want it to be triggered? By talking to someone? The code to trigger a quest case from within a dialog is:
Code:
AddDialogExitQuest("shipfight");
You'd still need to write dialog for someone, including that line at the end of the dialog, so that you can talk to the character to trigger the quest.

I still recommend playing "Hornblower", "Assassin" or "Bartolomeu", to see how quests work. That's how I learned - "Hornblower" was my modding training.

I managed to trigger 4 barques to appear at Cozumel after talking to Oweyn McDorey. I did this by following the Group Address in the Cozumel battle quest (the one vs. Silehard's fleet):

Group_SetAddress("EnemyGroup", "KhaelRoa", "Quest_ships", "Quest_Ship_4");

However, apparently the ships appear right next to mine, the moment I enter Cozumel on the map. They also don't appear in the line of battle formation that's standard for the game fleets.

Is there a code I could use to make them appear in front of the island instead of right beside me, and in a line formation?

What I intend to do is this: as soon as I leave tutorial deck, my ship is transported right to the back of Cozumel, with me at the head of a fleet of 4 - 3 of which are my officers. In front of the island is the enemy fleet of 4, in a line formation. But I need to find out the commands for this.
 

Attachments

  • Screenshot (1608).png
    Screenshot (1608).png
    1.2 MB · Views: 89
Last edited:
There are two reasons why an enemy group will appear right next to you. One is if the locator in the 'Group_SetAddress' line doesn't exist; but your 'Group_SetAddress' command seems to be the same as the one which places Silehard and the pirates in "Tales of a Sea Hawk", so that should be fine.

The other is this line:
Code:
Group_SetPursuitGroup("Enemies", PLAYER_GROUP);
Delete that line and see what happens.
 
There are two reasons why an enemy group will appear right next to you. One is if the locator in the 'Group_SetAddress' line doesn't exist; but your 'Group_SetAddress' command seems to be the same as the one which places Silehard and the pirates in "Tales of a Sea Hawk", so that should be fine.

The other is this line:
Code:
Group_SetPursuitGroup("Enemies", PLAYER_GROUP);
Delete that line and see what happens.
Thanks, seems to be working.
 
Back
Top