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

Sneaky Trader turns into a `mini-quest`

CatalinaThePirate

Unholy Terror,
Storm Modder
My Sneaky Trader mod that I've been working on - he sells four pieces of a map to a treasure; and it occurred to me that because there are four parts to this map, once you get the fourth piece you should be given a location where you can go to find this treasure... The new locations on FdF that Alan Smithee is working on sound really great. (Alan?) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

I don't have to use the new locations, of course - I suppose I could put it just about anywhere - that odd statue rock on Oxbay (Douwesen?) springs to mind as an interesting landmark, but <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" /> I dunno.

I'd also like to see if I can get this compass working for when you are on land... Does anyone know how we might do this? It could tie into the treasure hunt... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />

In any case, I'll need some kind of assistance in placing a location for a that can be unlocked only when certain requirements are met, because I don't know how that works. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

The keys he sells also might be modded into a `mini-quest`, as in, take these keys, they might open a door to something INTERESTING... Alan, I know you've got a lot of "interesting" mods going on... Might this fit somewhere in there? It would be great to coordinate a little more on this.

Just some musings and brainstorming... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" />
 
Well, let's drink to a new `mini-quest` then! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> I am really looking forward to hunting for hidden treasure with the `all-new` LAND compass, in a new location! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
If I can figure out how to do it! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

Having another <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> moment... Part of the conversation with the Sneaky Trader ends with you telling him you're going to call the guards or beat him up for being such a pest, and he says "Gotta go!" and runs away. It's a wonderfully comedic moment (I think), and I love it... However I've got a problem... He won't regenerate to the same spot when I return... I know I'll crack this - but if anyone has any suggestions, please let me know before I <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> either destroy my monitor or my <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> noggin. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />

ALSO... I have all his items and want to make them exclusive to him (or his cousins) alone... But I can't even get them to generate at all, much less for him... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> Anyone have any suggestions about how to make his items exclusive? THANKS! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
<!--`QuoteBegin-CatalinaThePirate`+--><div class='quotetop'>QUOTE(CatalinaThePirate)</div><div class='quotemain'><!--QuoteEBegin--> I know I'll crack this - but if anyone has any suggestions, please let me know before I <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> either destroy my monitor or my <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> noggin.   <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />  :rolleyes:  xD:  :gday[/quote]

Heh, Gee Catalina I could send you a hard hat. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> I don't want you hurting your head. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/ib012.gif" style="vertical-align:middle" emoid=":cry" border="0" alt="ib012.gif" />
 
Also a anti noggin shield fer yer monitor might aslo help <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Great to hear that Sneaky is growing into a miniquest, and sorry to hear that he causes trouble. But I am sure we can sort that out.

Could you post the codesection that contains Sneaky's stageexit? And I'll be back later with the code ot open and close doors.
 
To lock a reload you can define it that way in its definition section (follow the same format as the Oxbay lighthouse), and then unlock it with a quest_reaction.c command (again, see what the game does to unlock the lighthouse). I dunno of a way to make the presence of an item in your inventory unlock the door (some "check player attributes" command no doubt, though I've never explored that route myself), but the way I go about it is to trigger the unlock with a dialog exit quest, like when you recieve the key. If you're working with a graphical trader interface, though, I'm not sure. Some quality native to the item itself maybe, the way some items enhance your skills.

The new FdF locations, as I've got them planed now, lead, in part, to a deserted colony... (using the small collection of huts outside the mine entrance)... I have nothing at all planned for that area right now, so you could lock one of the huts for some important reason. Other new locations include some measure of jungle (could always jamp a new location in there, like a house or statue or other landmark in the middle of nowhere) and a sort of penal colony on a rock, offshore, a la Chapeau D'if.
 
<!--`QuoteBegin-alan_smithee`+--><div class='quotetop'>QUOTE(alan_smithee)</div><div class='quotemain'><!--QuoteEBegin-->I dunno of a way to make the presence of an item in your inventory unlock the door (some "check player attributes" command no doubt, though I've never explored that route myself), but the way I go about it is to trigger the unlock with a dialog exit quest, like when you recieve the key.[/quote]This is helpful, THANK YOU! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> And yes, it would be a check to see if you are carrying an item as the trigger to unlock the location. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

<!--`QuoteBegin-alan_smithee`+--><div class='quotetop'>QUOTE(alan_smithee)</div><div class='quotemain'><!--QuoteEBegin-->The new FdF locations, as I've got them planed now, lead, in part, to a deserted colony... [/quote]I like it! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> So far this is just in the veeeerrrrry early planning stages, but it can be developed as I go along. I'd really like to get that compass working (the one on the overhead sea map, only smaller) for land use, THAT would be really great!


<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />


<span style='color:darkred'><b>@ CCC - </b></span>here is the code you requested - I've actually worked it so he comes back, however it's only good ONCE. I need him to regenerate again and again; he should be there all the time, but if you chase him away he will regenerate only after you've spent the night, or left the island and come back after a night has passed.

From Sneaky Trader_dialog.c - <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->  case "exit_runaway":

     Dialog.Text = DLG_TEXT[34];

     Link.l1 = DLG_TEXT[35] + RandSwear();

     Link.l1.go = "exit2";

     LAi_SetActorType(NPchar);

     LAi_ActorRunToLocation(NPchar, "goto", "goto3", "none", "", "", "", 15.0);

     AddDialogExitQuest("story_sneaky_runaway");

 break;



 case "exit2":

//      NextDiag.CurrentNode = NextDiag.TempNode;

     NPChar.quest.meeting = NPC_Meeting;

     NextDiag.TempNode = "Second Time";

     DialogExit();

 break;<!--c2--></div><!--ec2-->And from quests_reaction.c - <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->  case "story_sneaky_runaway":

     LAi_QuestDelay("story_sneaky_runawayC", 100.5);

 break;



 case "story_sneaky_runaway2":

     pchar.quest.Story_sneaky_runawayC.win_condition.l1 = "location";

     pchar.quest.Story_sneaky_runawayC.win_condition.l1.location = "Conceicao_port";

     pchar.quest.Story_sneaky_runawayC.win_condition = "story_sneaky_runawayC";

 break;

 

 case "story_sneaky_runawayC":

     ChangeCharacterAddress(characterFromID("Sneaky Trader"), "Conceicao_port", "goto3");

     Characters[GetCharacterIndex("Sneaky Trader")].Dialog.CurrentNode = "Second Time";

 break;<!--c2--></div><!--ec2-->I had this split because there seems to be no way (at least to my knowledge, which is admittedly limited) to get each of these guys (one in each town) to reload to his separate character profile default location. (needs a separate "win condition" set for each reload location) Was testing this on Conceicao. I was really hoping for an elegeant, "small" code footprint solution - the less code the better, eh? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />

The way this works now, he will regenerate after a time, but you can only talk to him once more and after he regenerates again he won't talk to you. That's as far as I got yesterday before my mind snapped shut and I wasn't much good for anything further except perhaps an idle game of solitaire. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> I think my problem may be that I am <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" /> out of RUM <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" /> to oil up all those cogs and wheels in my rusty and sludgy old brainpan! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
Say, I wonder. Is it a `hard-wired` command that always associates merchants with "merchant" locators, or something you could edit and add your own definition for your own specific type of sneaky trader locators. 'fraid I dunno; I'm just eternally raising hypotheticals.
 
Well, I like it that my guys roam about like any normal citizen - I'm going to put a proximity finder on him so that when you walk near him he'll accost YOU - pester you - like the quintessential stereotype of the "annoying salesman" would. You can't get shed of him unless you either look at his goods, or tell him you're going to smack him or call the guards. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

It also makes it better when he runs off after you threaten him - that is sooooo funny!!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />

But you could place someone ANYWHERE there is a locator and have them stand still by giving them the "merchant" animation. They'll stand there and look like they're gesturing - telling you about their wares. I think you could put a citizen at a "merchant" locator but they would walk around instead of stay put if you assign to them a "citizen" animation.

I raise hypotheticals and other idle thoughts all the time - I HOPE that my questions create questions in others - those who might know more about this stuff than I do, I mean... If one small musing is the single droplet that starts off a waterfall, well, imagine... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="8)" border="0" alt="cool.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" />
 
I'll have a look at that code, Cat. Meanwhile, at another construction site...


Doorclosing and opening
----------------------------------

As Alan has said, doors, i.e. reloadlocators, can be closed like this example in the case "begining" in quests_reaction.c :


Locations[FindLocation("Oxbay_town")].reload.l55.disable = true;

It closes the cellarstair near the Oxbay shipyard which leads down to the "underworld" dungeon. For a simple example let's suppose that this door can be opened with a "magic" item you can buy from Gregor Samsa at Oxbay Port. Add a link to Gregor_Samsa dialog.c that leads to a case that opens the door, gives you the item and takes your money:



<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        link.l2.go = "exit";

// NK <--





     }



   // ccc>

   Link.l4 = "I've heard that you sell magic coins that open the stair to the underworld. I take one, here are 200 Gold";

   Link.l4.go = "dooropen";

   // ccc<



     Diag.TempNode = "first time";

 break;





 // ccc>

 case "dooropen":

     Locations[FindLocation("Oxbay_town")].reload.l55.disable = false;

   // opens basementdoor near shipyard

     GiveItem2Character(pchar, "coins");

   // the coins, just eyecandy

     AddMoneytoCharacter(Pchar, -200);

   // payment



     Diag.CurrentNode = Diag.TempNode;

     DialogExit();

 break;

 // ccc<





 case "mullet":<!--c2--></div><!--ec2-->


That's all. You've bought an item and the door is open now. That the item has actually no function at all isn't obvious to the player.
 
Treasurehunting
----------------------

As for buried treasures, one possibility would be to assign a certain locator as treasurespot. Let's bury a treasure in the sand at Oxbay port, at "goto4". Gregor will again serve as guineapig and reveal its location.
Insert another link and another case into the section we have just added to Gregor Samsa_dialog.c

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    // ccc>

   Link.l4 = "I've heard that you sell magic coins that open the stair to the underworld. I take one, here are 200 Gold";

   Link.l4.go = "dooropen";



   Link.l5 = "I've heard that you sell treasureguides.";    // link to treasure

   Link.l5.go = "treasure";

   // ccc<



     Diag.TempNode = "first time";

 break;





 // ccc>

 case "treasure":

     AddMoneytoCharacter(Pchar, -200);    // payment

     Pchar.trlocation = "Oxbay_port";    // stores treasurelocator

     Pchar.trlocator = "goto4";  // stores treasurelocator

     Pchar.trsum = 10000;      // stores treasureamount

     dialog.text = "Of course. Here is one for 200 gold.";

     link.l1 = "Thanks. What does it say? 'Dig in the middle between the pier and the stair to the gate at Oxbay Port.'";

     link.l1.go = "exit";

 break;



 case "dooropen":

     Locations[FindLocation("Oxbay_town")].reload.l55.disable = false;

   // opens basementdoor near shipyard

     GiveItem2Character(pchar, "coins");

   // the coins, just eyecandy

     AddMoneytoCharacter(Pchar, -200);

   // payment



     Diag.CurrentNode = Diag.TempNode;

     DialogExit();

 break;

 // ccc<<!--c2--></div><!--ec2-->


The commands "Pchar.trlocation = "Oxbay_port"; " and "Pchar.trlocator = "goto4"; " add attributes, kind of notepads or tags, to the playercharacter "pchar". The tag "trlocation" contains the name of the location where the treasure shall be hidden, "trlocator" the locatorname, the exact spot where it is buried, and "trsum" the amount of gold.
That dialog is of course only a simple example. You can also add the treasureinfotags with a questfile.

The file characterscharacters_events.c contains the function chrCharacterEntryToLocator() . This runs whenever a character steps on a locator and checks if any function shall be performed, like reloading or boxopening.

We just need to insert a section there that checks if the player steps on a locator we have tagged as treasurespot. In that case you'll get the gold and a screenmessage:


<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void chrCharacterEntryToLocator()

{

    aref loc = GetEventData();    

    ....

    int result;



// ccc treasurespots

    if(CheckAttribute(chr, "trlocation") )    // if the character has treasureinfo

    {

 if(mc.location == mc.trlocation && locator == mc.trlocator)

     // and steps on the treasurelocator

 {

     PlaySound("interfacenew_level.wav");

     Log_SetStringToLog("You've found " + mc.trsum + " Gold " );

     AddMoneytoCharacter(mc, sti(mc.trsum) );

   // gives you the moneyamount from the trsum tag

     DeleteAttribute(mc, "trlocation");    // deletes the treasureinfo...

     DeleteAttribute(mc, "trlocator");    // so that you can find it..

     DeleteAttribute(mc, "trsum");  // .. only once

 }

    }

// ccc treasurespots end<!--c2--></div><!--ec2-->

You can repeat this over and over again, with any locator and random sums, so that Sneaky could become a neverending tresurequest generator. If you want that I could post that as well, or send you the files.

Maybe one could make the digging and finding a bit more timeconsuming or dramatic by a questscene, animation or movie. But probably you know more about that than I <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Now I wanna know what "Case Mullet" is...

And how do you define "trs" as a treasure command? Any arbitrary `self-defined` command will work, or do you need to pin it down somewhere? I see similiar functions in the gambling dialogs (I'd still like to know if other games could be made, like blackjack) and blacksmiths... they seem to define their own unique function, but I don't understand how it works.

Also, with locators activating when you step on them... every time I try and set a "character wincondition locator" in quest_reactions, it doesn't work. What I'm thinking of specifically that I need to do is make someone talk to you when you're near enough; a proximity command, maybe, like the sneaky trader, only I just need it to work the first time.

---

also... did I mention those three sad women on Douwesen whose babies were eaten by dingoes or stolen or something, are placed on "merchant" locators? Thats why they offer you the finest French wares whenever you walk by them...
 
Thank you, CCC! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> I love the idea of the "neverending" treasure generator... That code would be very cool. You can post it here so everyone will learn what to do.

I, alas, do not know how to do ingame movies... That would be great if I could. We used to have someone here who did them, but he has sailed out of this archipelago... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />

<span style='color:darkred'><b>@ Alan,</b></span> look at the quest_reaction.c file where Hawk encounters Rheims for the first time in Silehard's office. That should give you what you need.

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->      ChangeCharacterAddress(characterFromID("Raoul Rheims"), "Redmond_residence", "goto1");

 

     //Çàâåäåíèå êâåñòà íà âñòðå÷ó ñ Ðåéìñîì â ðåçèäåíöèè ãóáåðíàòîðà è óõîä Ðåéìñà

     Pchar.quest.Story_First_Meeting_with_Rheims.win_condition.l1 = "location";

     Pchar.quest.Story_First_Meeting_with_Rheims.win_condition.l1.location = "redmond_residence";

     Pchar.quest.Story_First_Meeting_with_Rheims.win_condition = "Story_First_Meeting_with_Rheims";



     //çàâåäåíèå êâåñòà íà äèàëîã ñî ñòðàæíèêîì

     pchar.quest.first_time_to_redmond_townhall.win_condition.l1 = "locator";

     pchar.quest.first_time_to_redmond_townhall.win_condition.l1.location = "Redmond_town_01";

     pchar.quest.first_time_to_redmond_townhall.win_condition.l1.locator_group = "goto";

     pchar.quest.first_time_to_redmond_townhall.win_condition.l1.locator = "goto10";

     pchar.quest.first_time_to_redmond_townhall.win_condition = "first_time_to_redmond_townhall_complete";



     Locations[FindLocation("Redmond_town_01")].locators_radius.goto.goto10 = 2.0;<!--c2--></div><!--ec2-->And then this -

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->  case "Story_First_Meeting_with_Rheims":

     pchar.quest.first_time_to_redmond_townhall.over = "yes";

     LAi_SetActorType(Pchar);

     LAi_SetActorType(characterFromID("Raoul Rheims"));

     //Âûñòàâëåíèå Ðåéìñó íóæíîé íîäû

     Characters[GetCharacterIndex("Raoul Rheims")].Dialog.CurrentNode = "First_meeting";

     LAi_ActorFollow(pchar, characterFromID("Raoul Rheims"), "", 1.0);

     LAi_ActorFollow(characterFromID("Raoul Rheims"), pchar, "Story_First_Meeting_with_Rheims_2", 1.0);

 break;

 

 case "Story_First_Meeting_with_Rheims_2":

     //----------------Ðåéìñ ïîäõîäèò è ïðîñèò åãî ïðîïóñòèòü!

     LAi_ActorWaitDialog(Pchar, characterFromID("Raoul Rheims"));

     LAi_ActorDialog(characterFromID("Raoul Rheims"), Pchar, "", 5.0, 0);

 break;



 case "Rheims_away_from_residence":

     Locations[FindLocation("Redmond_Residence")].reload.l1.disable = 0;

     //----------------Îòïðàâëÿåì èãðîêà â ñîñåäíèé ëîêàòîð, ÷òîáû îí íå ìåøàë Ðåéìñó âûéòè

     LAi_ActorGoToLocator(PChar, "goto", "goto7", "", 4.0);

     //----------------Îòïðàâëÿåì Ðåéìñà â ëîêàòîð

     LAi_ActorGoToLocator(CharacterFromID("Raoul Rheims"), "Reload", "reload1", "Story_Rheims_leaves", 2.0);

 break;



 case "Story_Rheims_leaves":

     //------------Ðåéìñ òåëåïîðòèðóåòñÿ â íèêóäà

     ChangeCharacterAddress(characterFromID("Raoul Rheims"), "None", "");

     LAi_SetPlayerType(pchar);

 break;<!--c2--></div><!--ec2--> HTH! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
I don't know much about questscenes, so i can only guess why Sneaky won't talk anymore, but he is being set to LAI_actorType before the runaway command, and maybe you must reset him to his original AI type, e.g.
LAi_SetCitizenType(NPChar);
when he shall reappear.


As for performing one quest for multiple traders on several islands, the code for the survival mod at the end of Seadogs.c might help you. There I had to deal with multiple taverngirls on several islands. They are being selected like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->      string islandID;

     int jopa;

     jopa = GetCharacterCurrentIsland(mc);

     IslandID = Islands[jopa].id;



 switch(IslandID)

 {

     case "FalaiseDeFleur":

     loc = "Falaise_de_fleur_Tavern_upstairs";

     chr = characterFromID("Falaise_de_fleur_officiant");

     break;



     case "Redmond":

     loc = "Redmond_Tavern_upstairs";

     chr = characterFromID("Redmond_officiant");

     break;



     case "Conceicao":

     ......

 }<!--c2--></div><!--ec2-->

If you insert for chr the trader for the current island, and for loc the location where he shall reappear, you could put such a selection at the beginning of your questcases like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->case "story_sneaky_runawayC":



     string islandID;

     int jopa;

     jopa = GetCharacterCurrentIsland(pchar);

     IslandID = Islands[jopa].id;



 switch(IslandID)

 {

     case "Conceicao":

     loc = "Conceicao_port";

     chr = characterFromID("SneakyTrader");

     break;



     case "Douwesen":

     ..... similar cases with the traders for other islands

 }



ChangeCharacterAddress(chr, loc, "goto3");

chr.Dialog.CurrentNode = "Second Time";

break;<!--c2--></div><!--ec2-->
You could use the quest then for every trader on every island.
 
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--> 
Now I wanna know what "Case Mullet" is...  <!--QuoteEnd--></div><!--QuoteEEnd-->
Part of the original file by Verruckt. As the name says he has a wonderfully weird humour. Too bad that he isn't around anymore.
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--> 
And how do you define "trs" as a treasure command?  <!--QuoteEnd--></div><!--QuoteEEnd-->
If you mean "trlocation" & "trsum" etc. , that are attributes, and those are simply defined: objectvariable.atrributename = "some text". Nathan explained attributes to me about a year ago, and it's well worth digging up those old posts cause attributes are most helpful.

In short, an attribute is a subvariable affixed to an object. For example in an init file like this

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    makeref(ch,Characters[0]);  //Blaze Devlin

    //ch.perks.list.InstantBoarding = true;

    ch.name  = "Nathaniel";

    ch.lastname = "Hawk";

    ch.id  = "Blaze";

    ch.nation    = ENGLAND;

    ch.model    = "towngirl1"

    ch.activity_begin = "0";

    ch.activity_end = "24";

    ch.sex = "woman"

     ch.model.animation     = "towngirl";<!--c2--></div><!--ec2-->

Attributes like .name are affixed to the object "ch", which in this case happens to be the playercharacter. He carries those attributes with him like tags pinned to his hat, and at any time you can let the program have a look if he carries a certain tag with him.
In my exampledialog above the attributes .trlocator etc are pinned to the hat of pchar (again a variablename for the playercharacter)
The codesection

if(CheckAttribute(chr, "trlocation") ) // if the character has treasureinfo
{
if(mc.location == mc.trlocation && locator == mc.trlocator)

checks if a character stepping on a locator has those attributes affixed, and if those happen to match the locator he is just stepping on.

Note that those attributes are affixed to different objectvariables, depending on which codesection you are in. The objectvariable is usually defnied on top of a codesection, like makeref(ch,Characters[0]);//Blaze Devlin . So...

Pchar.trlocation has as object the playercharacter ( ref PChar = GetMainCharacter()<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

CheckAttribute(chr, "trlocation") checks the object chr, which is the character stepping on the locator ( aref chr = GetEventData(); )

mc.trlocation again has as object again the player ( ref mc = GetMainCharacter(); )

<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec--> 
Also, with locators activating when you step on them... every time I try and set a "character wincondition locator" in quest_reactions, it doesn't work. What I'm thinking of specifically that I need to do is make someone talk to you when you're near enough; a proximity command, maybe, like the sneaky trader, only I just need it to work the first time.  <!--QuoteEnd--></div><!--QuoteEEnd-->
I think Cat's proposal is what you need, but for proximity checks, this section by NK runs if you press the "T" key. It yields the nearest visible character and some of his data
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->      int res = LAi_FindNearestVisCharacter(PChar, 20);  // 20 is the searchradius

     ref findCh;

     if(res != -1)

     {

   findCh = GetCharacter(res);

   Log_SetStringToLog("You see " + findCh.name + " " + findCh.lastname + " Fencing " + findCh.skill.Fencing );

     ......<!--c2--></div><!--ec2-->
 
Thanks, CCC, I really appreciate that help. Haven't much time to look at it now, but I've got it for when I do... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> It should fix things a bit.

Oh, and I knew about that Actor/Citizen switch, forgot to mention that I'd fixed it in a subsequent edit but the game seemed to think it was an error! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/urgh.gif" style="vertical-align:middle" emoid=":urgh" border="0" alt="urgh.gif" />
 
The code! All the code! Arrrrgggh!!!
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
How sad is it that I haven't written a line of C or C++ in nearly 10 years, and I can still follow this stuff? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

I'm really looking forward to this mod. It looks great!! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
I sure hope I can get him to do what I want him to do, LOL! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
Back
Top