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

Information aboute The New Pirate Age - Update! [WIP]

A question about code for the Enemy's Group
Code did I need in the Nation file?
I will have two enemies Group:
* pirate Hunter Kuro <- the walk on the Lighthouse Bay and should Attacke automatically Pirates
* Dofflamigo Family <- they Familie Member are on different Places
There probably won't be any other pirates walking around at Lighthouse Bay, so the only pirates that Kuro will attack are you and your party. Unless there's anyone else around at Lighthouse Bay, it probably doesn't matter which group you pick. (@Pieter Boelen is probably going to recommend that you use LAI_GROUP_MONSTERS. ;))

The various members of DoFlamingo family will probably need to be in different groups depending on where they are. You can't, for example, make them all Spanish, because if one of them is in a Spanish town and you turn him hostile, other Spanish people will attack you as well. You might get away with making them all LAI_GROUP_MONSTERS, provided that random citizens and soldiers don't automatically attack monsters. Otherwise, if one of them is in a French town, make him Spanish; if one of them is in a Spanish town, make him English; and so on. The important thing is to put each family member in a group which is different from everyone else in the area in which he is standing, so that when he attacks you, nobody else joins in.
 
@Grey Roger
I plan to but the doflamingo Member 2 in the Pirate Fort at Palm Beach and 2 in the Smuggler Lair
There Pirates.

With Kuro are 3 ather Pirates.

I also need a help to put a character on ship on a see place(Devil Throne)...

But first I make the Pirate Hunter Group from Kuro and the Doflaminge Member.
 
Last edited:
@Grey Roger
I plan to but the doflamingo Member 2 in the Pirate Fort at Palm Beach and 2 in the Smuggler Lair
There Pirates.
When you fight these family members, do you want the guards in Pirate Fort or Smugglers Lair to join in? If yes, put the family members into group "QC_SOLDIERS". If you do not want the guards to join in, put the family members into pretty well anything else. Basically, if the family members are in a pirate group and they fight you while you're in a pirate location, everyone else will join in because they're already in the same pirate group.

I also need a help to put a character on ship on a see place(Devil Throne)...
Have a look at "PROGRAM\Storyline\Hornblower\quests\quests_reaction.c", specifically cases "French_Battle_Setup" and "French_patrol_setup". Both of these place an enemy ship ready to fight the player's ship.
 
@Grey Roger
What did you mean with that.
Have a look at "PROGRAM\Storyline\Hornblower\quests\quests_reaction.c", specifically cases "French_Battle_Setup" and"French_patrol_setup". Both of these place an enemy ship ready to fight the pl

Did you mean I should copy this change it to me plan or what?
 
Yes - copy it and change it to suit your own scene. That is what I did when I wrote the sea battle scenes in my "Ardent" storyline.

You could also look at "PROGRAM\Storyline\Ardent\quests\quests_reaction.c", case "payroll_ship_setup", and see how it is different from the "Hornblower" battles. That should give you some idea of what you need to change for your own story.
 
Is that correct

Case "At_War_with_Spain_Again":
AddPassenger(Pchar, characterFromID("Armando Salazar"), 0);
LAi_SetOfficerType(characterFromID("Armando Salazar"));
LAi_SetImmortal(characterFromID("Armando Salazar"), true);
SetCharacterRemovable(characterFromID("Armando Salazar"), false);

if(AUTO_SKILL_SYSTEM)
{
AddPartyExpChar(pchar, "Leadership", 1500);
AddPartyExpChar(pchar, "Sneak", 50);
}
else {AddPartyExp(pchar, 1500);}
Locations[FindLocation("Devil's Throat")].reload.l1.disable = 0;

Pchar.quest.French_Battle_Setup.win_condition.l1 = "location";
Pchar.quest.French_Battle_Setup.win_condition.l1.location = "Devil's Throat";
Pchar.quest.French_Battle_Setup.win_condition = "Spain_Battle_Setup";

Pchar.quest.Rally_the_crew.win_condition.l1 = "location";
Pchar.quest.Rally_the_crew.win_condition.l1.location = "Devil's Throat";
Pchar.quest.Rally_the_crew.win_condition = "Rally_the_crew";
Break ;
 
Let's see:
You seem to have copied, not "French_Battle_Setup", but "At_War_with_France_Again", which is what leads to "French_Battle_Setup". So:
Armando Salazar joins you as an officer and becomes immortal and unremovable - you can not unassign him.
You get some experience points.
The exit from "Devil's Throat" is unlocked. "Devil's Throat" is a beach and you can now walk from there to Port Royale.
When you arrive at "Devil's Throat", whether by landing there from sea or by walking there from Port Royale, case "Spain_Battle_Setup" will trigger. So will case "Rally_the_crew".

In "Hornblower", it is Sir Edward Pellew who joins you as an immortal, unremovable officer. This is necessary for the story - he's supposed to be your commanding officer and has just come aboard the ship. You get some experience points because you have just completed an earlier part of the story. Case "Rally_the_crew" does nothing except show a video in which Pellew makes a speech to the crew. (The storyline is based loosely on a TV series and contains several video clips from that series. This is one of them.)

What role does Armando Salazar play in your story? Does he need to join you as an officer shortly before your battle?

You can probably remove the whole part about "Rally_the_crew", as I suspect you do not have a scene in which either you or Salazar make a speech to the crew.

Do you want the battle to trigger after you have landed at "Devil's Throat" beach, or when you arrive at the sea near Jamaica island?
 
@Grey Roger
Ah ok then is this the right:

case "Spain_Battle_Setup":
SetCurrentTime(10.00, 0);
SetNextWeather("Blue Sky");
PlayStereoSound("OBJECTS\SHIPCHARGE\hurrah.wav");

Group_CreateGroup("Spain_Squadron");
Group_AddCharacter("Spain_Squadron", "Quest_frigate_captain");
Group_SetGroupCommander("Spain_Squadron", "Quest_frigate_captain");
Group_SetPursuitGroup("Spain Squadron", PLAYER_GROUP);
Group_SetTaskAttack("Spain_Squadron", PLAYER_GROUP, true);
Group_LockTask("Spain_Squadron");
Group_SetAddress("Spain_Squadron", "Devil's Throat", "Quest_ships", "Quest_Ship_12");
Sea_LoginGroupNow("Spain_Squadron");
characters[GetCharacterIndex("Quest_frigate_captain")].nosurrender = 2;
SetCharacterRelationBoth(GetCharacterIndex("Quest_frigate_captain"),GetMainCharacterIndex(),RELATION_ENEMY);
if(GetRMRelation(Pchar, PIRATE) > REL_WAR) SetRMRelation(Pchar, PIRATE, REL_WAR);
Character_SetAbordageEnable(characterFromID("Quest_frigate_captain"), false);

if(GetRMRelation(Pchar, FRANCE) > REL_WAR) SetRMRelation(Pchar, FRANCE, REL_WAR);
UpdateRelations();

Pchar.quest.FrenchShipDestroyed.win_condition.l1 = "NPC_death";
Pchar.quest.FrenchShipDestroyed.win_condition.l1.character = "Quest_frigate_captain";
Pchar.quest.FrenchShipDestroyed.win_condition = "FrenchShipDestroyed";
break;
 
The first thing that does is set the time to 10:00, the weather to clear, and plays a sound effect of the crew cheering.

You are creating a group called "Spain_Squadron" and assigning a character called "Quest_frigate_captain" to it. Do you have a character called "Quest_frigate_captain"? If not, who is supposed to be in command of the enemy ship?

'Group_SetPursuitGroup("Spain Squadron", PLAYER_GROUP);' will make the enemy ship spawn near you when you arrive at the island. If you would prefer the player to have to sail to a particular place to find the enemy ship, leave that line out.

'Group_SetAddress("Spain_Squadron", "Devil's Throat", "Quest_ships", "Quest_Ship_12");' will not work. Ship groups have to be placed on sea locations, but Devil's Throat is a land location - it's a beach. Try:
Code:
Group_SetAddress("Spain_Squadron", "Redmond", "Quest_ships", "Quest_Ship_12");
instead. I don't know where "Quest_Ship_12" is, but if the 'Group_SetPursuitGroup' line is still present then it won't matter because the enemy will appear near you as soon as you approach Jamaica. One way to have the battle at Devil's Throat would be to require the player to land at Devil's Throat, and then have case "Spain_Battle_Setup" trigger when you next put to sea. So, when you go to sea, you're at Devil's Throat and the enemy ship spawns next to you - that is how I triggered case "payroll_ship_setup" in the "Ardent" storyline.

'characters[GetCharacterIndex("Quest_frigate_captain")].nosurrender = 2;' means the enemy will not surrender. If you want the enemy ship to be able to surrender the way some enemies do in normal battles, you can leave this line out.

'Character_SetAbordageEnable(characterFromID("Quest_frigate_captain"), false);' means you can not board the enemy ship and it can not board you. This is needed in "Hornblower" because the enemy ship is much larger than yours and if you get close enough, it will board you and you will probably not live long. If you want to be able to board the enemy ship, leave this line out.
 
@Grey Roger

Pleace can You check me quests_reaction.c if it is right!

Some Help Info:
First i use this Idee One way to have the battle at Devil's Throat would be to require the player to land at Devil's Throat, and then have case "Spain_Battle_Setup" trigger when you next put to sea. So, when you go to sea, you're at Devil's Throat and the enemy ship spawns next to you - that is how I triggered case "payroll_ship_setup" in the "Ardent" storyline.

2. Salazar is hidding on Redmond_Shore_01 ond gotolocator13 and his Ship is on Ships_other_8

Thanks
 

Attachments

  • quests_reaction.c
    3 KB · Views: 85
case "Start": still refers to quest book "Beginning". Does that still do anything? I originally suggested it as an example of how to use a questbook. You may want to write your own questbooks, such as one which tells the player where to find Salazar.

case "Officier": where is this triggered? It deletes the 'vcskip' attributes at a lot of places - have you set 'vcskip' at any of those places in some other file?

After case "Officier" is this:
Code:
       case
           Pchar.quest.Join_the_ship_crew.win_condition.l1 = "location";
           PChar.quest.Join_the_ship_crew.win_condition.l1.character = Pchar.id;
           Pchar.quest.Join_the_ship_crew.win_condition.l1.location = "Alice_tavern";
           Pchar.quest.Join_the_ship_crew.win_condition = "Join_the_ship_crew";
           SetCompanionIndex(PChar, -1, GetCharacterIndex("Trafalgar D. Water Law"));
           Pchar.quest.Join_the_ship_crew.win_condition.l1 = "location";
           PChar.quest.Join_the_ship_crew.win_condition.l1.character = Pchar.id;
           Pchar.quest.Join_the_ship_crew.win_condition.l1.location = "Turks_Tavern";
           SetCompanionIndex(PChar, -1, GetCharacterIndex("Red-Hair Shanks"));

       break;
I would not expect the game to work with that. The word "case" is not valid without a name. Also, you have two sets of 'Pchar.quest.Join_the_ship_crew.win_condition', so the second block will replace the first - case "Join_the_ship_crew" will trigger when you enter Turks Island tavern, not when you enter Alice Town tavern. Or rather, it won't trigger, because you have not defined case "Join_the_ship_crew".

My guess is that you are probably getting an error message saying that the game can not load "quests_reaction.c", and "error.log" probably has a message about at least one of these problems.

I suggest that all the "Pchar.quest" lines be moved into case "Start". They will then happen right away when you start the game. Change the first group to 'PChar.quest.Trafalgar_joins', like this:
Code:
           Pchar.quest.Trafalgar_joins.win_condition.l1 = "location";
           PChar.quest.Trafalgar_joins.win_condition.l1.character = Pchar.id;
           Pchar.quest.Trafalgar_joins.win_condition.l1.location = "Alice_tavern";
           Pchar.quest.Trafalgar_joins.win_condition = "Trafalgar_joins";
Then add the following quest case:
Code:
       case "Trafalgar_joins":
           SetCompanionIndex(PChar, -1, GetCharacterIndex("Trafalgar D. Water Law"));
       break;
So, when you enter Alice Town tavern, Trafalgar D. Water Law's ship joins your fleet.

Change the second group to 'PChar.quest.Red-Hair_joins' and add a similar quest case "Red-Hair_joins".
 
Case "payroll_ship_setup" should work, although:
Code:
           pchar.quest.payroll_ship_taken.win_condition.l1 = "Armando Salazar";
           pchar.quest.payroll_ship_taken.win_condition.l1.character = "Armando Salazar";
           pchar.quest.payroll_ship_taken.win_condition.l2 = "SeaEnter";
           pchar.quest.payroll_ship_taken.win_condition = "payroll_ship_taken";
           pchar.quest.payroll_ship_taken1.win_condition.l1 = "NPC_Death";
           pchar.quest.payroll_ship_taken1.win_condition.l1.character = "Armando Salazar";
           pchar.quest.payroll_ship_taken1.win_condition.l2 = "SeaEnter";
           pchar.quest.payroll_ship_taken1.win_condition = "payroll_ship_taken";
The first line there will not work. 'pchar.quest.payroll_ship_taken.win_condition.l1' defines what sort of condition is to be triggered. A character name such as "Armando Salazar" is not a condition! There are a whole lot of valid conditions, but among the most common are "location" (triggered when you go to that place, e.g. "Alice_Tavern"; "locator" (triggered when you move to a specific spot, e.g. "goto12"; and "NPC_Death" (triggered when someone has been killed, e.g. "Armando Salazar". Delete the first four lines. Keep 'pchar.quest.payroll_ship_taken1.win_condition.l1 = "NPC_Death";' and everything after it. That will trigger case "payroll_ship_taken" when you have defeated Armando Salazar's ship.

And then you need to write case "payroll_ship_taken", which will be what you want to happen after Salazar is beaten.

You could also change the quest names from "payroll_ship_taken" to something else. That is presumably copied from the code in the "Ardent" storyline, where the quest cases are called "payroll_ship_setup" and "payroll_ship_taken" because the ship is carrying a payroll which you, as a pirate, are going to steal. You could change them to something more suited to your story.
 
When I make changes to the game I always have to test it in game.
Do a few changes and test. Over and over again. That's the procedure.

Eventually you get messages in the the 3 logfiles, messages top left corner and/or crashes.
 
Ok thanks.

First about Trafalgar and redhair shanks they are no officer he they join with there Ships to me.

And about Salazar maybe I need a Dialog when the dialogue is finish Salazar is o. His Ship and attak Player Ship when. Pleaser is on the Ship.
 
Last edited:
Ok thanks.

First about Trafalgar and redhair shanks they are no officer he they join with there Ships to me.
That is correct. The line 'SetCompanionIndex(PChar, -1, GetCharacterIndex("Trafalgar D. Water Law"));' assigns Trafalgar's ship to your fleet. Is that not what you wanted?

And about Salazar maybe I need a Dialog when the dialogue is finish Salazar is o. His Ship and attak Player Ship when. Pleaser is on the Ship.
That would work. If you have placed Salazar on the beach of Devil's Throat ("Redmond_Shore_01") then you can walk up to him and talk to him. In "Salazar_dialog.c", or whatever you have called his dialog file name, the line AddDialogExitQuest("payroll_ship_setup"); will activate quest case "payroll_ship_setup" when the dialog finishes. (If you change "payroll_ship_setup" and other other "payroll_ship" to more suitable names for your story, change that 'AddDialogExitQuest' line to match.) The end result should be that you go to Devil's Throat, talk to Salazar, then go to sea and fight his ship.
 
Back
Top