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

Quest about ship

Capitan Blood

Landlubber
ok, next trouble...

i need:
near island XXX(this is it id) hold two ship, third - my companion. two ship attack my companion, but don't attack me...
my code:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Group_CreateGroup("G1");
Group_AddCharacter("G1", "ConvoyEnemy1");
Group_AddCharacter("G1", "ConvoyEnemy2");
Group_SetGroupCommander("G1", "ConvoyEnemy1");

Group_CreateGroup("G2");
Group_AddCharacter("G2", "Pes1");
     
Group_SetTaskAttack("G1", "G2");
Group_SetTaskAttack("G2", "G1");

Group_SetAddress("G1", Characters[GetMainCharacterIndex()].location, "Quest_ships", "Quest_ship_12");
Group_SetAddress("G2", Characters[GetMainCharacterIndex()].location, "Quest_ships", "Quest_ship_11");

Group_LockTask("G1");
Group_LockTask("G2");

UpdateRelations();<!--c2--></div><!--ec2-->

and what i see?
i see - only my companio, but when i reload to port - oo... all 4 ship - my, companion, and two enemy... when i reload back(to see) - again - my and companion ship...
where is bag?
 
Rather than creating a second group for your side, just use PLAYER_GROUP.
Because the way you have it set up there, there's nothing that's adding _the player_ to group G2, just the character "Pes1".
If you want the character "Pes1" to not be in the player group but be in G2, and G1 to attack both G2 and player, then you also need:
Group_SetTaskAttack("G1", PLAYER_GROUP);
Group_SetTaskAttack(PLAYER_GROUP, "G1");

However, you should also set the character relations, just to be sure.
SetCharacterRelationBoth(GetMainCharacterIndex(), GetCharacterIndex("Pes1"), RELATION_FRIEND);
SetCharacterRelationBoth(GetCharacterIndex("ConvoyEnemy1"), GetCharacterIndex("Pes1"), RELATION_ENEMY);
SetCharacterRelationBoth(GetMainCharacterIndex(), GetCharacterIndex("ConvoyEnemy1"), RELATION_ENEMY);


Also, rather than
Characters[GetMainCharacterIndex()].location
You should explicitly pass "XXX" or whatever the island ID is.
Because the questcase may not necessarily run when the player is at sea, so you can't rely on .location
 
Back
Top