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

All that is important when you assign ch.location.group and ch.location.locator is that the group and locator names match those of a locator which exists where you want the character to be. This is why it is important to edit "InternalSettings.h", change "VISIBLE_LOCATORS" to 1, and visit the place so you can see the locators and their names, then take note of the one you want to use.

Among the group locator types are:
  • "goto" - nothing very special. Characters who are generated at random may wander onto one of these locators.
  • "reload" - these are usually at doors or on paths. Look at a location definition file such as "QuebradasCostillas.c" and find a block titled "Reload map". This will have several entries which define where you will go if you walk onto one of these "reload" locators.
  • "sit" - typically these locators are placed on chairs. Use LAi_SetSitType(ch); on any character who is being placed on one of these so that he is sitting down. LAi_SetHuberType(ch); also works and gives the sitting character a different set of movements more appropriate to a governor or official.
  • "candles" - normally used for candles, as you might expect. Some places also have some "candles" locators on seats - unlike "sit" locators, random visitors to a tavern will not be placed on "candles" locators.
  • "officers" - usually somewhere near a "reload" locator, these locators are where your officers will appear when you enter that area onto that "reload".
 
You need the locator for that place. Visit the place with "VISIBLE_LOCATORS" set to 1, look for a locator which is where you want your officer to be, then use it.

You don't need to bother about which group type does what. That only affects random characters generated and controlled by the game itself. Your character will do what you program him to do, regardless of group type. In my "Ardent" storyline, I've put characters on "reload", "officers" and "goto" locators for no reason other than they happened to be where I wanted to put the character.

The only important distinction is "sit" and "candles", and other types. If you put a character on a "sit" or "candles" locator, make sure he's sitting, otherwise he's going to look odd standing in the middle of a chair!
 
It's a single command. For example, LAi_SetOfficerType(characterFromID("Roronoa Zorro")); will set him to behave as an officer. He will follow you around.
 
Ok.
sorry but
And if the officer is a enemy should stay and attack me?

Edit: That is the Reason why i ask:
Enemy Charakter Bellamy should stay infornt of Chief House and Attack me!
And later my i add more Members of the Donquixote Doflamingo Famiele they
Should walk around in Bonaire Pirate Fort.
 
Last edited:
If he's going to attack you then he's not an officer. ;)

There are two ways to set up a fight that I know of. To make a single enemy attack just you:
Code:
           LAi_SetActorType(characterFromID("Bellamy"));
           LAi_ActorAttack(characterfromID("Bellamy"), PChar, "");
           PChar.quest.Bellamy_dead.win_condition.l1 = "NPC_Death";
           PChar.quest.Bellamy_dead.win_condition.l1.character = "Bellamy";
           PChar.quest.Bellamy_dead.win_condition = "Bellamy_dead";
Replace "Bellamy" with his ID, which is whatever you have in his ch.id line in "Story.c". The PChar.quest.Bellamy_dead lines are not necessary. They set up another quest case, titled "Bellamy_dead", which is where you can write what is to happen when you have killed him.

To set up a group fight, which will involve you, your officers, Bellamy and his associates:
Code:
           LAi_group_MoveCharacter(characterfromID("Bellamy"), "DOUWESEN_PIRATE_SOLDIERS");
           LAi_group_SetRelation("DOUWESEN_PIRATE_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
           LAi_group_FightGroups("DOUWESEN_PIRATE_SOLDIERS", LAI_GROUP_PLAYER, true);
           LAi_group_SetCheck("DOUWESEN_PIRATE_SOLDIERS", "Bellamy_dead");
Group "DOUWESEN_PIRATE_SOLDIERS" includes all the guards already set up in the Pirate Fort - they may as well be loyal to Donquixote Doflamingo as he's their boss, and can play the part of the Doflamingo family without you having to do anything else. Again, replace "Bellamy" with his ID. The LAi_group_SetCheck line is the one which sets up the quest case where you write what happens next.

If you don't want the regular Pirate Fort guards to join in, use a different group. You can look in "PROGRAM\NATIONS\nations.c" and find a section void InitGroups(), which sets up the various groups. So you could use LAi_group_MoveCharacter(characterfromID("Bellamy"), "CONCEICAO_SOLDIERS"); for example. That is the group containing the soldiers on La Grenade, nobody belonging to that group exists in the Pirate Fort, so nobody else will join in on Bellamy's side. You can then set up Bellamy's family, use the same command to put all of them into group "CONCEICAO_SOLDIERS", then the whole lot will fight you and your officers.

One thing you could do is, some time before the fight starts, have this line:
Code:
Locations[FindLocation("Pirate_Fort")].reload.l2.disable = 1;
That locks the door to the leader's house. Then:
Code:
case "Bellamy_dead":
    Locations[FindLocation("Pirate_Fort")].reload.l2.disable = 0;
break;
That unlocks the door. Because case "Bellamy_dead" is triggered when the fight ends, it means the door is only unlocked after you have defeated Bellamy (and the others, if you used the group fight code).
 
Actor attack does not trigger the regular "flashing danger icon and music", so the groups are often better.
I recommend against using the Conceicao group on another Island, as the status is remembered and you could be attacked then later on a Portuguese Island for no apparent reason.
There is some reset code in place to avoid that, but you should not rely on that.
It is also not good to create new groups if you don't need to, because they remain in memory after being used.
"Monsters" is a pretty good "generic enemy group".
 
Actor attack does not trigger the regular "flashing danger icon and music", so the groups are often better.
It depends on what you want to do. If you want a duel between your character and one enemy, with everyone else standing aside, then actor attack is the way to do it.
I recommend against using the Conceicao group on another Island, as the status is remembered and you could be attacked then later on a Portuguese Island for no apparent reason.
I don't think the status is remembered, otherwise if you really do need to fight a group of Portuguese soldiers for some story reason, you can never again safely go to Sao Jorge.

Anyway, I've seen this method used, and I've used it a couple of times in "Ardent". The best test is probably a scene in which you're a prisoner in your own cargo hold, someone kills one of two guards and releases you, then you have to kill the other guard. The guard fight is done with LAi_ActorAttack so that your assistant does not join in. But then there's a deck battle and all the enemies are assigned to group "FRANCE_SOLDIERS". When the fight is over, you teleport to Port au Prince, where the French soldiers do not suddenly attack you for no apparent reason. ;)

It has to clear the memory of that group being hostile when the fight is over. If it didn't, and you got into a fight with one of the standard groups, that group would potentially remain hostile later, which is not good if you intentionally want to fight a group of Portuguese soldiers at one point
It is also not good to create new groups if you don't need to, because they remain in memory after being used.
That's why I used "FRANCE_SOLDIERS". ;) On the other hand, if you create one group and then keep using it for your own quest enemies, it wouldn't do any harm. Let it stay in memory, you're going to be using it again anyway...
(Look at the quest code for "Assassin" and "Bartolomeu". You're trying to convince the wrong person about the danger of creating new groups. xD)
 
Oh nice Thanks.
Here the list what will be:
* Roronoa Zoro is sitting in the Pirate Tavern of Nevis - [done]
* Name is standing at the Charlestown Port and Waiting for a Ship -
* Lysop is walking in the Grand Cayman Town -
* Nico Robin walks on the Lighthouse Bay of Barbados -
* Sanji is staying in Santiago Tavern -
* Tony Chopper is walks in Santo Domingo Town -
* Franks stays near the Shipyard House -

The Enemys:
* Bellamy walks in front of Dutch Smuggler Home of Bonaire, and will attack me.
* Donquixote Doflamingo is sitting in Pirate Chief House of Bonaire

That is me plan
 
That should be easy enough. You certainly already know how to place the officers - set "VISIBLE_LOCATORS" to 1, visit the place, find the group and name of a locator where you want the character to be, then use that group and name in the character's definition in "Story.c".

For a character who will be sitting in a tavern, you already know LAi_SetSitType(ch); For someone who will stand and wait, you can use LAi_SetStayType(ch); And for someone who will walk around, LAi_SetCitizenType(ch); All those should allow you to walk up to the character and talk to him.
 
You can, yes. I've never been entirely sure whether "TempQuest.c" or "TempQuestEnemy.c" are even necessary. Back when I was starting out writing my "Ardent" story and knew even less about how stories worked, I noticed that other storyline folders had different files. Taking "Assassin" and "Bartolomeu" as examples, which both have "Story.c", "TempQuest.c" and "TempQuestEnemy.c", I created those three files for "Ardent", and then put characters into them the way I suggested. Important characters into "Story.c", less important hostile characters into "TempQuestEnemy.c", less important non-hostile characters into "TempQuest.c".

What is important is that Donquixote Doflamingo and Bellamy are both defined somewhere. Judging by character files I've seen in some other storyline folders, other people have been making up their own rules about who goes into which file, and I can't figure out what those rules are, so I made up my own. You can make up your own rules as well. ;)
 
It depends on what you want to do. If you want a duel between your character and one enemy, with everyone else standing aside, then actor attack is the way to do it.
I think ActorAttack was originally intended to have two actors fight each other. Even for a one-on-one fight, it is possible to use FightGroups.
But of course ActorAttack also serves that purpose quite well. :cheeky

I don't think the status is remembered, otherwise if you really do need to fight a group of Portuguese soldiers for some story reason, you can never again safely go to Sao Jorge.
I can guarantee you that it IS remembered.
There just happens to also be some "reset" code in place to set many groups back to normal, which does include most citizen and soldier groups.
But that is technically a "hack" more than anything else; in an ideal situation, that (mod-added!) code should not need to be there.
All of that is hypothetical though, because that code IS in place and I don't imagine anyone is going to make any changes any time soon that would allow getting rid of it.

It has to clear the memory of that group being hostile when the fight is over. If it didn't, and you got into a fight with one of the standard groups, that group would potentially remain hostile later, which is not good if you intentionally want to fight a group of Portuguese soldiers at one point
Can't remember exactly where the relevant code is, but I know I've seen it many times. Might be LAi_monsters.c .

That's why I used "FRANCE_SOLDIERS". ;) On the other hand, if you create one group and then keep using it for your own quest enemies, it wouldn't do any harm. Let it stay in memory, you're going to be using it again anyway...
True and true. :yes

Look at the quest code for "Assassin" and "Bartolomeu". You're trying to convince the wrong person about the danger of creating new groups. xD
I'm just posting it for the sake of having it said. Not trying to convince anyone; just telling it how it is. :wp

You can, yes. I've never been entirely sure whether "TempQuest.c" or "TempQuestEnemy.c" are even necessary.
The game doesn't care in which file characters are defined.
Only reason for having multiple files is to categorize things more clearly for the developers.
So the only correct answer there is: Do it whichever way make sense to you! :onya
 
@Grey Roger: It is indeed this section in PROGRAM\Loc_ai\LAi_monsters.c that I was referring to:
Code:
    string relation = LAI_GROUP_NEUTRAL;

    if(CheckAttribute(Models[GetModelIndex(PChar.model)],"camouflage") && !ownDeckStarted())     // PB: Recode this to be a general mod
    {                                                                                            // PB: Used for Bartolomeu and Assassin storylines
        if (GetLocationNation(location) != PERSONAL_NATION) relation = LAI_GROUP_ENEMY;            // camouflagecloak makes you suspicious

        if(Whr_IsNight() && !CheckCharacterItem(PChar,"cursedcoin"))                            // camouflage works only at night
        {
            grdlook = 5;    // sight reduced if player camouflaged
            grdhear = 1;    // hearradius if player camouflaged
            ptrlook = 5;    // sight reduced if player camouflaged
            ptrhear = 1;    // hearradius if player camouflaged
            mnslook = 5;    // sight reduced if player camouflaged
            mnshear = 1;    // hearradius if player camouflaged
        }
    }
    else 
    {
        // resets relations to neutral upon locationloading, as originally intended for VC
// KK -->
        if (GetLocationNation(location) != PERSONAL_NATION)
        {
            // PB: For Bartolomeu -->
            if(CheckAttribute(location,"dangerous") && GetNationRelation2MainCharacter(GetLocationNation(location)) <= RELATION_ENEMY && rand(1) == 0) // KK
            {
                relation = LAI_GROUP_ENEMY;
            }
            else
            {
                relation = LAI_GROUP_NEUTRAL;
            }
            // PB: For Bartolomeu <--
        }
        else
            relation = LAI_GROUP_FRIEND;
// <-- KK
    }

    // ccc sneakmod sets grouprelation, sight and hearradius according to new disguise
    // for travellers, residents etc.
    LAi_group_SetRelation(LAI_DEFAULT_GROUP, LAI_GROUP_PLAYER, relation);
    LAi_group_SetLookRadius(LAI_DEFAULT_GROUP, mnslook);   
    LAi_group_SetHearRadius(LAI_DEFAULT_GROUP, mnshear);   

    // for all soldiers and citizens, based on NK RM mod, thanks :)
    for(int j = 0; j < NATIONS_QUANTITY; j++)
    {
        LAi_group_SetRelation(LAI_GROUP_GUARDS, LAI_GROUP_PLAYER, relation); // KK
        LAi_group_SetRelation(LAI_GROUP_PATROL, LAI_GROUP_PLAYER, relation); // KK
        LAi_group_SetRelation(GetSoldiersGroup(j), LAI_GROUP_PLAYER, relation);
        LAi_group_SetRelation(GetCitizensGroup(j), LAI_GROUP_PLAYER, relation);

        LAi_group_SetLookRadius(GetSoldiersGroup(j), grdlook);
        LAi_group_SetHearRadius(GetSoldiersGroup(j), grdhear);
        LAi_group_SetLookRadius(LAI_GROUP_GUARDS, grdlook); // KK
        LAi_group_SetHearRadius(LAI_GROUP_GUARDS, grdhear); // KK
        LAi_group_SetLookRadius(LAI_GROUP_PATROL, ptrlook); // KK
        LAi_group_SetHearRadius(LAI_GROUP_PATROL, ptrhear); // KK
    }

// KK -->
    if (GetLocationNation(location) != PERSONAL_NATION) {
        LAi_group_SetRelation(LAI_GROUP_GUARDS, LAI_GROUP_MONSTERS, LAI_GROUP_NEUTRAL);
        LAi_group_SetRelation(LAI_GROUP_PATROL, LAI_GROUP_MONSTERS, LAI_GROUP_NEUTRAL);
    } else {
        LAi_group_SetRelation(LAI_GROUP_GUARDS, LAI_GROUP_MONSTERS, LAI_GROUP_ENEMY);
        LAi_group_SetRelation(LAI_GROUP_PATROL, LAI_GROUP_MONSTERS, LAI_GROUP_ENEMY);
        LAi_group_FightGroupsEx(LAI_GROUP_GUARDS, LAI_GROUP_MONSTERS, true, -1, -1, false, false);
        LAi_group_FightGroupsEx(LAI_GROUP_PATROL, LAI_GROUP_MONSTERS, true, -1, -1, false, false);
    }
// <-- KK
This gets executed every time a new location ashore is loaded.
If that weren't there, then soldiers would remain angry with you even after any location reload.
 
The Enemys:
* Bellamy walks in front of Dutch Smuggler Home of Bonaire, and will attack me.
* Donquixote Doflamingo is sitting in Pirate Chief House of Bonaire
If Donquixote Doflamingo starts by sitting, presumably on locator "sit1", then you'll have to make him stand up before he can fight. He also needs to be positioned to another locator because if he stands on "sit1", he'll be stuck in the chair, unable to move and fight. Here's how you could do that:
Code:
ChangeCharacterAddressGroup(characterfromID("Donquixote Doflamingo"), "Douwesen_Pirate_Residence", "goto", "goto1");
LAi_SetActorType(characterFromID("Donquixote Doflamingo"));
LAi_ActorAttack(characterfromID("Donquixote Doflamingo"), PChar, "");
PChar.quest.Donquixote_dead.win_condition.l1 = "NPC_Death";
PChar.quest.Donquixote_dead.win_condition.l1.character = "Donquixote Doflamingo";
PChar.quest.Donquixote_dead.win_condition = "Donquixote_dead";
Locator "goto1" is fairly close to "sit1". LAi_SetActorType will change the character from sitting to standing, and is needed before LAi_ActorAttack. Again, the PChar.quest.Donquixote_dead lines may not be necessary. If you want something to happen as a result of defeating Donquixote Doflamingo, include those lines, then whatever is supposed to happen will go into case "Donquixote_dead".

Also:
Looking at the file "PROGRAM\Storyline\NewPirateAge.c", you're having the player start off with a frigate Thousand Sunny. That frigate is perhaps too powerful for a starting ship. Besides, according to the Wikipedia article on "One Piece", Monkey D. Luffy starts with the smaller Going Merry, then later on that ship is sunk and he gets the Thousand Sunny. If you're writing this as a storyline then you can make that happen. Start off with the Going Merry and make it a smaller ship (perhaps the "BrigRoyal" type). Build up the story gradually and when you get to a suitable point, you can give the Thousand Sunny to the player.
 
Hello Guys! Thanks for your good Support.. :D All works fine.

But i have some 3 littel Question.
@Grey Roger and @Pieter Boelen
1. What do I have to do so that my officers do not have any abilities, but still keep their officer type?
For example: Character "Nami" has all navigator abilities. But I would like to have it none - or at least only one abilitie - but still a navigator remains.
2.) I can make it my character (which are in the open air) after the hunt not always run away just like the seated characters after the hiring me at the same time. Is it s.Dialog file, because I have always the same used which I for the seated Charakrer take, they always renamed.
3.) If I do not give at ch.location.group and ch.location.locator nothing but only at ch.location the place to give, because the Charkter simply so in the place then around?

For example, for Character Lysop (ch.location = "Grand_Cayman_town";) is he just running around in the Grand Cayman town?

@Grey Roger
About Donquixote Doflamingo!
The First Dialog starts in Douwesen_Pirate_Residence but the Duell will be oo the Palm Beach!

About the Ship: Yes i will check it up. - It was only for Test-
I think about to use the Fast Brig, but i must Check the Model Name:

CU
PK
 
Back
Top