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

WIP Peter Blood Storyline from City of Abandoned Ships

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
At the request of @DH27 and the approval of @Joruba (from BlackMark Studios),
@Myth is currently working on implementing the Peter Blood Storyline from CoAS into New Horizons.
Of course this'll take some doing; and all sorts of questions arise in the process...

And so the first question, which I'm not sure on how to answer...:
How do you handle an NPC standing still, but auto-initiating dialog when the player approaches?
@Bartolomeu o Portugues, @Jack Rackham, @Grey Roger, @Sebrian, has this come up anywhere in your stories?

Apparently this from LAi_Stay.c is what CoAS uses:
Code:
        for(int i = 0; i < num; i++)
        {
            idx = sti(chrFindNearCharacters[i].index);
            if(LAi_group_IsEnemy(chr, &Characters[idx])) break;
                if (CheckAttribute(chr, "talker") && idx == GetMainCharacterIndex() && LAi_Character_CanDialog(chr, pchar))
            {
                LAi_tmpl_SetDialog(chr, pchar, -1.0);
                DeleteAttribute(chr, "talker");
                return;
            }
            if (CheckAttribute(chr, "talker") && idx == GetMainCharacterIndex() && !LAi_Character_CanDialog(chr, pchar))
            {
                trace ("диалог невозможен");
                return;
            }
        }
 
Something like this should work:

Code:
case "run_to_cave_locators":
            Locations[FindLocation("roa_Cave_fake")].locators_radius.goto.Goto10 = 5.0;
            pchar.quest.run_to_cave_locators2.win_condition.l1 = "locator";
            pchar.quest.run_to_cave_locators2.win_condition.l1.location = "roa_Cave_fake";
            pchar.quest.run_to_cave_locators2.win_condition.l1.locator_group = "goto";
            pchar.quest.run_to_cave_locators2.win_condition.l1.locator = "Goto10";
            pchar.quest.run_to_cave_locators2.win_condition = "run_to_cave_locators2";


        break;

        case "run_to_cave_locators2":
           LAi_SetActorType(characterFromID("Cannibal_j"));
            LAi_ActorDialog(characterFromID("Cannibal_j"), pchar, "", -1, 0);
        break;

When player runs into a locator we make npc start the convo, might not be the best way to do it :fiddle
 
Yes, I have used a locator for the player to reach and the dialog starts. I've had no trouble with that.
Thanks!
Makes sense to me.

Buuut...
We now have a NEW METHOD!
Set ch.talker = 10; with LAi_citizen or LAi_stay (new; attached!) and the character will initiate dialog with you when you approach.
No need for additional locators.
 

Attachments

  • LAi_stay.c
    3.4 KB · Views: 14
Thanks!
Makes sense to me.

Buuut...
We now have a NEW METHOD!
Set ch.talker = 10; with LAi_citizen or LAi_stay (new; attached!) and the character will initiate dialog with you when you approach.
No need for additional locators.
I've certainly used locators in the past. If this works, though, then it can be another useful tool for storywriters. Have you tested it to make sure it has no unwanted side-effects?
 
i think it no have bad think. attribute works only 1 time, for every use need add again. in my version Program work great. i more will add by me in future...
 
I've certainly used locators in the past. If this works, though, then it can be another useful tool for storywriters. Have you tested it to make sure it has no unwanted side-effects?
If characters don't have the attribute, none of the new code will be triggered.
This already works in CoAS and was used there throughout the main quest.

What I don't know is if it works for LAi_Citizen also.
The code was already there and I haven't changed it.
But I haven't tried it either.
 
i stuck again.

case "Blood9":
LAi_SetPlayerType(PChar);
n = Locations[FindLocation("Estate")];
locations[n].box1 = Items_MakeTime(0, 0, 1, 2003);
locations[n].box1.items.blade2 = 1;
locations[n].box1.items.pistol1 = 1;
locations[n].box1.items.key_pitt = 1;
if (ENABLE_AMMOMOD)
{
locations[n].box1.items.gunpowder = 12;
locations[n].box1.items.pistolbullets = 12;
}
DoQuestReloadToLocation("Estate", "reload", "reload2", "Blood10");
break;

But in the box only rand item. Not my item.
 
Code:
n = Locations[FindLocation("Estate")];
That's not right. 'n' is presumably an integer because you're using it as an index to 'locations' in the next line:
Code:
locations[n].box1 = Items_MakeTime(0, 0, 1, 2003);
Try this:
Code:
n = FindLocation("Estate");
 
Back
Top