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

dialog problem

Jack Rackham

ex train dispatcher
Quest Writer
Storm Modder
I want the normal dialog of person A to change after I have spoken to person B. That thing is working.

Now when I speak to person A the next time I want him to act normal again. What is the "reset" code?

Used the pchar.quest.main_line = something and if(pchar.quest.main etc etc ) to get the first thing to work.

This would be the normal situation of a bartender for instance, sometimes involved in a quest dialog sometimes not.
 
Perhaps you need a quest check in the dialog, and an if/else situation. Here is an example, taken from (respectively) estrella de alencar_dialog.c and Armand Delacroix_dialog.c - <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->  case "Second time":



     if(CheckCharacterItem(Pchar,"estrella_token"))

     {

   dialog.Text = "Oooh, Capitán " + PChar.name + "!  You are back!  Madre del Dios, is he all right?";

   if (CheckQuestAttribute("talk_to_armand", "talk"))

   {

       Link.l1 = "I found him well and healthy, Doña Estrella.";

       Link.l1.go = "report_node1";

   }

   else

   {

       Link.l2 = "I haven't found him yet, Señora.  But I will be leaving soon.";

       Link.l2.go = "exit";

   }

     }

     else

     {

     Dialog.text = "Wait. You are a sea capitán. Are you carrying a letter to be delivered here?";

   if(CheckCharacterItem(Pchar,"Letter_Reward"))

   {

       link.l1 = "Yes, I have a letter.";

       link.l1.go = "letter_yes";

   }

   else

   {

       link.l1 = "No, I'm sorry, señorita, I am not.";

       link.l1.go = "letter_no";

   }

     }

 break;<!--c2--></div><!--ec2--><span style='color:darkred'>if (CheckQuestAttribute("talk_to_armand", "talk"))</span> case "First time_1":
d.Text = RandSwear() + DLG_TEXT[2];
Link.l1 = DLG_TEXT[3];
Link.l1.go = "Story_first talk";
pchar.quest.talk_to_armand = "talk";
break;[/CODE]<span style='color:darkred'>pchar.quest.talk_to_armand = "talk";</span> and that should do it for you!

Hope this helps! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />

<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> Now I'm curious as to what you're working on! <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" />
 
Thanks Catalina, I´ll study this carefully. It was a very little variation of sounds at a start, now I´m trying to get at least something to happen as well. In some years or so...
 
Well there are great tutorials in the <a href="http://robotsdontbleed.com/wacko/wakka.php?wakka=POTCwiki" target="_blank">PotC Modding Wiki,</a> and if you get stuck, just ask, I'm sure someone here will be most happy to help! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
Yes thanks, I`ve found two parts of dialog tutorials by CCC, There´s a lot to study and learn. This hobby is growing in all directions:
I need the C++ knowledge and a lot of of new programs and the ability to handle them. I will come back with questions yes. //Jack Rackham
 
What is used in PotC is not necessarily C++, check out this link for further info:

<a href="http://forum.piratesahoy.net/ftopic318.php" target="_blank">http://forum.piratesahoy.net/ftopic318.php</a> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" />
 
Yes I´ve seen that one too. For the moment I´ve lost myself somewhere in the sounds.
 
Best thing to remember is to have fun. <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" /> This modding stuff can become exasperating... Which is why I made this little guy <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> and called him "Modding"!!! <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#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> indeed, but once you´ve started, you can´t finish.
 
Yep, it's an addiction. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.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" />
 
Yup. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

And Jack, if you get stuck, feel free to post your code and we'll see what we can, err, see. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
Thanks NathanKell, I can see no other way.

Don´t understand the switch rand function at all. Yes I´ve checked in "keywords" too.

Just want 1 of 3 things to happen (randomly).

Tried a lot of variations by copying code from other files. The result is allways the same. The game plays 1, 2 or 3 of the sounds at the same time!

Ex:
switch(rand(2))
{
case 0:
PlaySound("sound1");
break;
case 1:
PlaySound("sound2");
break;
case 2:
PlaySound("sound3");
break;
}
the adresses to the soundfiles are OK and all this is happening "inside" an
float .....{ }
 
Doesn't appear to be anything wrong with your code, Jack... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

Can you post the whole function? Maybe it's looping somehow?
 
Inez Dias, tried that one too...
They´re still shouting together 1, 2 or 3 of them.

The code, it´s in AICannon:

// calculate delay before fire
float Cannon_GetFireTime()
{
//gunner´s shout Jack Rackham
int i = rand(2);
switch(i)

{
case 0:
PlaySound("`OBJECTSSHIPCHARGECannonReload-000`.wav");
break;

case 1:
PlaySound("`OBJECTSSHIPCHARGECannonReload-001`.wav");
break;

case 2:
PlaySound("`OBJECTSSHIPCHARGECannonReload-002`.wav");
break;
}



aref aCharacter = GetEventData();

float fCannonSkill = stf(aCharacter.TmpSkill.Cannons);
float fFireTime = 1.3 - fCannonSkill;
fFireTime = fFireTime * Bring2RangeNoCheck(3.0, 1.0, 0.0, 1.0, stf(aCharacter.Ship.Crew.MinRatio));
fFireTime = frnd() * fFireTime * 6.0;
if(bArcadeMode) { fFireTime = fFireTime * ARCADE_MULT_CANNONS; } // NK
return fFireTime;
}

it´s in here because I got it to work here, (one shout per broadside)
I don´t go via sound_alias, that´s a a very strange file...
 
Is it possible that this runs for EVERY cannon of a broadside? Which you wouldn't realize if all cry the same shout, but with differrent soundfiles you get a dissonant chorus? Just a guess, though...

I gather that you add some decent sounds to the fighting crew? Great idea, would make the ships much more lively. I actually miss some commands etc., I couldn't even find a decent "FIRE!" command soundfile.
 
CCC. No I don´t think so. When I first added this shout it was a single shout without the possibility of variation and then "he" shouts only once per broadside. One shout per cannon I got when putting this line inside the next block Fire_Cannon. I think one shout may be ok. Could need this rand function further on.
 
Again, I don't see why it wouldn't work...now, if you didn't have the "break;" statements that'd not stop the switch statement playing more than one...but you _do_ have them.

Weird. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/huhh.gif" style="vertical-align:middle" emoid=":eek:k" border="0" alt="huhh.gif" />
 
Thanks for your helpful attitude. I see now that even if you go for only 1 shout, the real problem is that the gunners of other ships yells too. And they do it very loud, like they were on MY ship.

Maybe the code would be Play3DSound("gunner_shout", fx fy, fz);
Something like the "raise sail" shout in AIShips.

This line seems to need some sort of definition of fx fy fz and more and all this put inside "float Cannon_GetFireTime()".

That is far beyond what I can do. (for the moment)
 
'Appy to 'elp! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />

Ah, yes. If you want to hear everyone say it, go that route*; if you only want pchar's ship to play, put the switch after the GetEventData() lines, and then begin it with
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->if(sti(aCharacter.index) == GetMainCharacterIndex())

{

//put switch block here

}<!--c2--></div><!--ec2-->
And it will only play for the player.

*If you want it to play for all, do:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->    float fX, fY, fZ;

    fX = 0; fY = 0; fZ = 0;

    if(CheckAttribute(aCharacter,"Ship.pos.x")) fX=stf(aCharacter.Ship.pos.x);

    if(CheckAttribute(aCharacter,"Ship.pos.y")) fY=stf(aCharacter.Ship.pos.y);

    if(CheckAttribute(aCharacter,"Ship.pos.z")) fZ=stf(aCharacter.Ship.pos.z);

    switch()

    {

    // put switch statement here, use Play3DSound("soundname", fX, fY, fZ);

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