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

Discussion Dead Man's Chest Storyline

This is the full function, in "LAi_actor.c":
Code:
void LAi_ActorAttack(aref chr, aref enemy, string quest)
{
   if(LAi_type_actor_Error(chr, true)) return;
   chr.chr_ai.type.state = "attack";
   chr.chr_ai.type.quest = quest;
   LAi_tmpl_SetFight(chr, enemy);
   chr.chr_ai.type.lock = "1";
}
 
Correction - it is in "LAi_actor.c", specifically in 'LAi_type_actor_Init' (which does nothing with the attribute except clears it), and 'LAi_type_actor_TemplateComplite', which reads it into local variable "quest", clears the attribute, and ends up with 'if(quest != "") CompleteQuestName(quest);'. I haven't been able to trace how 'LAi_ActorAttack' gets to 'LAi_type_actor_TemplateComplite'.
 
Correction - it is in "LAi_actor.c", specifically in 'LAi_type_actor_Init' (which does nothing with the attribute except clears it), and 'LAi_type_actor_TemplateComplite', which reads it into local variable "quest", clears the attribute, and ends up with 'if(quest != "") CompleteQuestName(quest);'. I haven't been able to trace how 'LAi_ActorAttack' gets to 'LAi_type_actor_TemplateComplite'.
What happens if you search in all open files for "TemplateComplite"?
 
Yes, I ask who wrote it:facepalm
And in any case a small problem has arisen:
Mercer no longer appears.
This is the code I put in TempQuests

Code:
 ch.old.name = "Mercer";
    ch.old.lastname = " ";
    ch.name     = TranslateString("","Mercer");
    ch.lastname     = TranslateString(""," ");
    ch.id        = "Mercer";
    ch.model    = "Corsair2_J"; // PB
    ch.sex = "man";
    ch.sound_type = "seaman";
    GiveItem2Character(ch, "blade4");
    ch.equip.blade = "blade4";
    ch.location    = "Redmond_Port";
    ch.location.group = "officers";
    ch.location.locator = "sea_1_2";
    ch.Dialog.Filename = "Mercer_Dialog.c";
    ch.greeting = "Gr_John Clifford Brin";
    ch.rank     = 10;
    ch.nation = ENGLAND;
    ch.reputation = "80";
    ch.experience = "10";
    ch.skill.Leadership = "8";
    ch.skill.Fencing = "8";
    ch.skill.Sailing = "5";
    ch.skill.Accuracy = "3";
    ch.skill.Cannons = "5";
    ch.skill.Grappling = "4";
    ch.skill.Repair = "1";
    ch.skill.Defence = "5";
    ch.skill.Commerce = "9";
    ch.skill.Sneak = "1";
    ch.money = "10000";
    LAi_SetHP(ch, 280.0, 280.0);
    ch.greeting = "Gr_Pirate";
    AddGameCharacter(n, ch);
 
I found the error: this code does not seem to make my character look like this:
Code:
SetCurrentTime(23.00, 0);
SetNextWeather("Moon Night");
 
Mercer only appears during the day. You've set the time to 23:00 at night. Mercer is in bed. xD

Add this somewhere in his definition:
Code:
LAi_SetLoginTime(ch, 0.0, 24.0);
That makes him appear at any time.
 
Another small question:
Me and my crew:
Code:
ChangeCharacterAddressGroup(characterfromID("William Turner"),"Aruba_shore", "goto", "goto13");
            ChangeCharacterAddressGroup(characterfromID("Slave5"), "Redmond_town_01", "goto", "goto09");
            ChangeCharacterAddressGroup(characterfromID("Black Sam"), "Redmond_town_01", "goto", "citizen07");
                                                      ChangeCharacterAddressGroup(characterfromID("Black Bart"), "Redmond_town_01", "goto", "goto10");
            ChangeCharacterAddressGroup(characterfromID("Charles Vane"), "Redmond_town_01", "goto", "goto11");
                                                      ChangeCharacterAddressGroup(characterfromID("Edward Low"),"Redmond_town_01", "goto", "locator13");
            ChangeCharacterAddressGroup(characterfromID("John Quelch"),"Redmond_town_01", "goto", "goto14");
                          ChangeCharacterAddressGroup(characterfromID("Stede Bonnet"), "Redmond_town_01", "goto", "goto15");
            ChangeCharacterAddressGroup(characterfromID("Walter Kennedy"), "Redmond_town_01", "goto", "goto17");
            LAi_SetActorType(characterFromID("William Turner"));
                                                      LAi_SetActorType(characterFromID("Slave5"));
            LAi_SetActorType(characterFromID("Black Sam"));
                                                      LAi_SetActorType(characterFromID("Black Bart"));
                                                      LAi_SetActorType(characterFromID("Charles Vane"));
            LAi_SetActorType(characterFromID("Edward Low"));
                                                      LAi_SetActorType(characterFromID("John Quelch"));
            LAi_SetActorType(characterFromID("Stede Bonnet"));
                                                      LAi_SetActorType(characterFromID("Walter Kennedy"));
We should attack the soldiers. Only the soldiers attack them alone, or else the soldiers attack me alone. My crew is still standing.
I tried using this code:
Code:
sld = LAi_CreateFantomCharacterExOtAt(false, OFFIC_TYPE_GUARD,"isIndian","","", 10, true, 1.0, "mummy", "goto", "go16");
            sld.name = "Tezcacoatl";
            sld.lastname = "";
            LAi_group_MoveCharacter
So, how do I make the soldiers attack my crew?
 
I don't see any soldiers defined there, and the 'LAi_group_MoveCharacter' line in the second piece of quoted code is incomplete. But as an example, here's how I set up a fight in my "Ardent" storyline:
Code:
           sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m2, "goto", "goto1");
           LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
           GiveSoldierWeapon(sld, FRANCE);
           sld.id = "soldier1";
           sld.nation = FRANCE;
           SetRandomNameToCharacter(sld);
           sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m3, "goto", "goto5");
           LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
           GiveSoldierWeapon(sld, FRANCE);
           sld.id = "soldier2";
           sld.nation = FRANCE;
           SetRandomNameToCharacter(sld);
           sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m4, "goto", "goto3");
           LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
           GiveSoldierWeapon(sld, FRANCE);
           sld.id = "soldier3";
           sld.nation = FRANCE;
           SetRandomNameToCharacter(sld);
           sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m5, "goto", "goto9");
           LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
           GiveSoldierWeapon(sld, FRANCE);
           sld.id = "soldier4";
           sld.nation = FRANCE;
           SetRandomNameToCharacter(sld);
           LAi_group_SetRelation("FRANCE_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
           LAi_group_FightGroups("FRANCE_SOLDIERS", LAI_GROUP_PLAYER, true);
           LAi_group_SetCheck("FRANCE_SOLDIERS", "mona_attack_beach_fight_won");
Four groups of lines define four fantom characters as French soldiers, name them, and put them in group "FRANCE_SOLDIERS". The final three lines make them fight you, and the 'LAi_group_SetCheck' line triggers the next quest case ("mona_attack_beach_fight_won") when the battle ends.
 
Four groups of lines define four fantom characters as French soldiers, name them
Isn't 'SetRandomNameToCharacter' superfluous there?
Or does 'LAi_CreateFantomCharacter' not take into account the correct nationality?
 
It assumes the nationality of the current location:
Code:
   int nat = GetLocationNation(loadedLocation);   
   if(nat >= 0)
   {
       chr.nation = nat;
   }else{
       chr.nation = PIRATE; //GetMainCharacter().nation;
   }
   //name
   SetRandomNameToCharacter(chr);
So the 'SetRandomNameToCharacter' might be redundant here as, at this point in the story, Isla Mona is supposed to be French. I probably copied the whole fantom generating block from somewhere else where that might not be the case, and as this is supposed to be an example for reference, I may as well leave it in. If you try to spawn French soldiers in an English port, for example, 'LAi_CreateFantomCharacter' will probably get their names wrong.
 
I don't see any soldiers defined there, and the 'LAi_group_MoveCharacter' line in the second piece of quoted code is incomplete. But as an example, here's how I set up a fight in my "Ardent" storyline:
Code:
sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m2, "goto", "goto1");
LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
GiveSoldierWeapon(sld, FRANCE);
sld.id = "soldier1";
sld.nation = FRANCE;
SetRandomNameToCharacter(sld);
sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m3, "goto", "goto5");
LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
GiveSoldierWeapon(sld, FRANCE);
sld.id = "soldier2";
sld.nation = FRANCE;
SetRandomNameToCharacter(sld);
sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m4, "goto", "goto3");
LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
GiveSoldierWeapon(sld, FRANCE);
sld.id = "soldier3";
sld.nation = FRANCE;
SetRandomNameToCharacter(sld);
sld = LAi_CreateFantomCharacter(false, 1, true, true, 0.25, Nations[FRANCE].fantomModel.m5, "goto", "goto9");
LAi_group_MoveCharacter(sld, "FRANCE_SOLDIERS");
GiveSoldierWeapon(sld, FRANCE);
sld.id = "soldier4";
sld.nation = FRANCE;
SetRandomNameToCharacter(sld);
LAi_group_SetRelation("FRANCE_SOLDIERS", LAI_GROUP_PLAYER, LAI_GROUP_ENEMY);
LAi_group_FightGroups("FRANCE_SOLDIERS", LAI_GROUP_PLAYER, true);
LAi_group_SetCheck("FRANCE_SOLDIERS", "mona_attack_beach_fight_won");
Four groups of lines define four fantom characters as French soldiers, name them, and put them in group "FRANCE_SOLDIERS". The final three lines make them fight you, and the 'LAi_group_SetCheck' line triggers the next quest case ("mona_attack_beach_fight_won") when the battle ends.
I've tried your method, but they just attack me.:facepalm
 
They should also attack your officers - that is, anyone who is part of your active party, whose icon shows up at the bottom of the screen next to your own.

You can put other characters into your group like this:
Code:
LAi_group_MoveCharacter(characterFromID("Slave5"), LAI_GROUP_PLAYER);
I'm guessing that "Slave5", "Black Sam", "Charles Vane" etc. are supposed to be your crew. A line like that for each of them will put them into your group, so the enemy group should regard them the same way they regard you and your officers. You may also need this for each of the crew:
Code:
LAi_SetWarriorType(characterFromID("Slave5"));
Otherwise the enemy may attack them and they may not fight back.
 
I did as you say:
Code:
LAi_group_MoveCharacter(characterFromID("Slave5"), LAI_GROUP_PLAYER);
LAi_SetWarriorType(characterFromID("Slave5"));
This for every one of my men.
But the soldiers still attack me. Only my crew, from the point where they are, move and reach other points.
This last, needs to fight them for first provided that they fight...
They should also attack your officers
I haven't any official at this time
 
@Grey Roger I succeeded. I removed the lines:
Code:
LAi_SetWarriorType(characterFromID("Slave5"));
They probably did not allow my men to fight
But thanks for the rest:onya
 
Back
Top