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

Needs Testing Relation agent dialog revised

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
@Grey Roger: While we're at it, shouldn't "RelationAgent_dialog.c" have an option also for Sweden?
I've had a look at this. The lack of Sweden isn't the main problem - in fact, it might not be a problem as such. There's a much more serious problem:
Code:
               if(GetRMRelation(PChar, FRANCE) < REL_AMNESTY) // RM
               {
                   Link.l5 = DLG_TEXT[15];
                   Link.l5.go = "France";
               }
               if (CheckGuestNation(GUEST1_NATION, AMERICA))
               {
                   if(GetRMRelation(PChar, AMERICA) < REL_AMNESTY) // RM
                   {
                       Link.l5 = DLG_TEXT[15];
                       Link.l5.go = "America";
                   }
               }
Someone presumably copied the code for France into the part for America and forgot to change the "Link" lines, and the result is that you can try to buy an amnesty from France and actually buy an amnesty from America instead. I've corrected it to:
Code:
               if (CheckGuestNation(GUEST1_NATION, AMERICA) || CheckGuestNation(GUEST1_NATION, SWEDEN))
               {
                   if(SWEDEN_ALLOWED || GetCurrentPeriod() >= PERIOD_REVOLUTIONS) // Before "Revolutions", GUEST1_NATION may be Sweden.  "Revolutions" or "Napoleonic", it's America
                   {
                       if(GetRMRelation(PChar, GUEST1_NATION) < REL_AMNESTY) // RM
                       {
//                           Link.l5 = DLG_TEXT[15];
//                           Link.l5.go = "America";
                           Link.l6 = XI_ConvertString(GetNationNameByType(GUEST1_NATION)) + ".";
                           Link.l6.go = "America";
                       }
                   }
               }
As well as checking for Sweden/America by period plus the "SWEDEN_ALLOWED" toggle, and changing the "Link" lines, I've changed your answer from a line in "RelationAgent_dialog.h" to a function call so that you get a period correct nation name - the same correction is in all other parts of the dialog code.

Also, in the code which does the buying of amnesty:
Code:
       case "America":
           iNation = GetNationTypeByID(Dialog.CurrentNode);
           sNation = iNation;
           Pchar.quest.Relations.nation = iNation;
Why make things complicated? If the dialog is at case "America", it's because you chose America. Or Sweden - they're both nation 6 and I can't be bothered to rename the dialog case. :p So instead:
Code:
       case "America":
           iNation = GUEST1_NATION;
           sNation = iNation;
           Pchar.quest.Relations.nation = iNation;
Again, I've done this for all nations.

Download the file, put it in "PROGRAM\DIALOGS", then start a FreePlay game as a pirate, either in one of the later periods or with Sweden enabled. Go to the Pirate Settlement tavern and see what happens when you talk to the agent...
 

Attachments

  • RelationAgent_dialog.c
    8.8 KB · Views: 131
I've had a look at this.
Oooh; nice!
That should do the trick.

Maybe consider renaming case "America" to case "GuestNation1"?
Technically shouldn't matter one bit; but at least then it doesn't have a potentially confusing inaccuracy in there.
For the exactly zero people who would ever look at that in the future. :rofl
 
Back
Top