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

Included in Build New Fetch Quest for 3.3 Needs Testing

@Pieter Boelen here it is.
The fetch quest should be working again for the tailor and the shipyard now.
It's changed a little bit:
Most of the fetch quests will shop up in the town news but not all (1 in 5 chance) so its always good to check the shipyard owner and tailor.
They aren't posted in the questbook anymore due to limitations of the questbook, so when you accept them they are posted in the ships log (it will still give a notification).
You can have as many fetchquests active as you want. When you accept the quest the person will tell you the deadline, sometimes these can be very close other times they might be longer.
It's possible to get a fetch quest which you can't transport just yet, you might need to make room first or even get a second ship.
The amount they ask for is scaled by the difficulty and level of the player. Also the economy of the town will influence it. So expect rich towns to ask for more stuff then poor towns. But the rich towns will also pay more for it ofcourse (more gain).
The shipyard unlocks the second repair perk and the tailor unlocks the second trade perk
Completing the fetch quests gives you a reputation improvement

Some other changes:
- The convoy quests gives you a little reputation improvement
- Antigua now has all things as contrabad again

I might be able to add the blacksmith also later this week but can't make any promisis

I look forward to feedback on if you can actually make a profit with it, I think you can.

Oh and pieter the fetch.txt and rival.txt can be removed from the questbook directory in the resource folder

OH another btw, I added a logging variable for testing purposes. It's on for now so incase people have problems I can actually see what happens in theire compile.log.
For the final release this can be disabled or removed or tied to the overal logging.
 
Last edited:
I will try to change the convoy quest pay off tomorrow.
Also I will try to add something so when you have a patrol book you might get in trouble.

Oh and @Pieter Boelen I know the code of the fetch quest looks complicated and probally overcomplicated but again there is some pre-work in there and things so it's easy to tie in with the other idea's I have. I've rewritten this quest 3 times now. I hope it will stay to that :p.
 
Well the questbook can't handle multiple instances of the same quest.
So I tried to have 1 quest for all fetch quests but I use dynamic text and so when another fetch quest as added the other onces where changed to.
Maybe if I dive deeper into the questbook system I can figure out how this one works, but I'm afraid not because I will run into engine function quite soon, thats why I decided to try it this way.... It shows a notification above your character and it plays a sound and a logmessage is send to tell you the ships log is updated so people should see it :p.

Shop owners didn't have a fetchquest. It was only these two (as far as I know at least). Black smiths where in the code already in the past but never made the dialog files for them.

Shopowners will be included later with the economy overhault, altough they might function a bit different. Need to figure that out later.
 
Well the questbook can't handle multiple instances of the same quest.
The availability of a Fetch Quest would show up in the Tavern News and therefore the Ship's Log anyway.
But would it be an idea to to allow the player to only actually take a single Fetch Quest at a time?
Then you only have one and can use the Quest Book like normal, right?
 
Last edited:
I prefer it you can do multiple quests at once actually Thats Why i made this choise. But if others agree i can change it. But Please do some testing first to see How this works.
 
But Please do some testing first to see How this works.
I'll definitely do that! Hopefully other players will too.
Though of course the chance of that happening is larger AFTER I posted a new version.... :wp

Didn't mean to say you MUST change things before I even tried the current version anyway. That wouldn't be very fair. I was just being curious. ;)
 
Small bugfix to prevent a thing from happening.
 

Attachments

  • FETCH_QUEST_FILES_AND_FIXES_1_1.zip
    80.8 KB · Views: 109
there was a slight chance the generation of a fetch quest could fail. it would probally never happen but just to be sure.
 
I'm getting an error.log on Start New Game, so I added some extra error-checking in quests_common.c:
Code:
string getFetchQuestCargo(string type, ref ctown)
{
   aref cargos, cargo;
   if(CheckAttribute(ctown, "island"))
   {
     makearef(cargos,Islands[sti(ctown.island)].cargos); // <-- Error occurs on this line
     int cargonum = GetAttributesNum(cargos);
     for(int i=0;i<cargonum;i++)
     {
       cargo = GetAttributeN(cargos,i);
       if(type == "all")
       {
         if(cargo.assigned == "fetchquest" && cargo.town == ctown.id)
         {
           return GetAttributeName(cargo);
         }
       }
       else
       {
         if(cargo.assigned == "fetchquest" && cargo.requester == type && cargo.town == ctown.id)
         {
           return GetAttributeName(cargo);
         }
       }
     }
   }
   else
   {
     TraceAndLog("Missing island for " + ctown.name);
   }
   return "";
}
Compile.log then logs the following:
Code:
Missing island for Sir Richard
Missing island for Sir Richard
WHAT island is called "Sir Richard"???
I've been seeing the name of "Sir Richard Dutton" crop up randomly before, I think.
That time in the Save/Load interface. Proper bizarre!
 
There is only one single reference to "Sir Richard" anywhere in the game files and it is here in PROGRAM\Periods.c:
Code:
  period.Towns.Alice.gov.name = "Sir Richard";
   period.Towns.Alice.gov.lastname = "Dutton";
It is the fake name for the Alica Town governor in the Golden Age of Piracy time period.
To make this even stranger, I tested by starting the Assassin storyline, which is set in The Spanish Main.
So that code should make absolutely NO difference whatsoever!!! :shock
 
Two more mysteries:

1. I was frequently seeing "Can't create class NP character" or something like that in error.log a few days ago.
Can't seem to trigger it today, though.

2. Probably completely unrelated, but ever since at least Build 14 Beta 2.1(!) we have had several of these lines in PROGRAM\NK.c:
Code:
SetCompanionIndex(pchar, -1, GetCharacterIndex(ch.id)));
I recently changed that to:
Code:
SetCompanionIndex(pchar, -1, GetCharacterIndex(ch.id));
Note how that original version had one ")" too much!
How did the game manage to work so well with that error in there? Should that not trigger a compile error!?!?

And here are some DumpAttributes on the 'towns' that have their island missing:
Code:
-----------------------------
Missing island for Sir Richard
old =
  name = Sir Richard
  lastname = Dutton
  middlename = Martínez
name = Sir Richard
lastname = Dutton
-----------------------------
Missing island for Sir Richard
old =
  name = Sir Richard
  lastname = Dutton
  middlename = Martínez
name = Sir Richard
lastname = Dutton
-----------------------------
As you can see, those are NOT TOWNS! They aren't even full characters. They have no ID of any kind. WHA!?!? :shock

The phrase "Martínez" is only ever used for the Santiago and Marigot governor middle names, again in The Golden Age of Piracy just before Sir Richard Dutton is named.
 
Removing the offending lines just moves the problem around instead of preventing it:
Code:
-----------------------------
Missing island for Sir John
old =
  name = Sir John
  lastname = Witham
  middlename = Simonszoon
name = Sir John
lastname = Witham
-----------------------------
Missing island for Sir John
old =
  name = Sir John
  lastname = Witham
  middlename = Simonszoon
name = Sir John
lastname = Witham
-----------------------------
Somehow I am not entirely surprised at that one. That is still the now-last .gov data from Periods.c .
Is this what they mean with a "memory leak"? Data showing up in spots where it simply doesn't belong?
 
Now tried to return all the following files to their Beta 3.2 state:
NK.c
Periods.c
Reinit.c
Entire Characters folder
INTERFACE\select_storyline.c

The problem remains.

I think perhaps I need to do a full check between Beta 3.2 and the Beta 3.3 WIP to figure this one out.
YIKES! That is no fun at all. :modding
 
I normally test in jean latiffe and there I dont get the errors, its only in assassin as far as I can tell. So I guess in that storyline somekind of weird town is made.
Adding this line should prevent the error.
Good catch.

@Pieter Boelen try it with jean latife also

Btw I noticed I haven't added any experience gain to both this quest so I will add that now
 
Yep, you're right. No such errors on Jean Lafitte. Perhaps the error is in the storyline files then. Let me try something....
 
STILL happens even with the Beta 2.1(!) Assassin storyline folder. That folder is so outdated that quests_reaction.c bugs out, but the error STILL occurs.
 
Here is a new version already which has the check included and adds experience when you finish the quest.
 

Attachments

  • FETCH_QUEST_FILES_AND_FIXES_1_2.zip
    81 KB · Views: 105
I don't think we WANT to have that check. Sure, it doesn't trigger an error.log anymore, but something is still wrong somewhere.
REALLY don't like this. Who knows where this crazy stuff is going to be cropping up next? :modding

ITEMS folder has also pretty much been ruled out, since I restored that to Beta 2.1 state (but with your new functions included to allow the game to run).

Edit: SEA_AI and Loc_ai also ruled out. What the ***!?!?
 
I think the problem originates here:
Code:
// Levis: Fetch Quest New -->
    ref ctown = GetTownFromID(GetTownIDFromGroup(_refStore.group));
    string cargoid = getFetchQuestCargo("all",ctown);

So it's in one of the stores I guess.
 
Back
Top