• 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

Levis

Find(Rum) = false;
Staff member
Administrator
Creative Support
Programmer
Storm Modder
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.

Most recent version:
-included in build mod-
 
Last edited:
Got it! Will have a look at it as soon as I can; hopefully tomorrow.

Here is a example of a timer on a quest:
Code:
      pchar.quest.generate_trade_quest.win_condition.l1 = "Timer";
       pchar.quest.generate_trade_quest.win_condition.l1.date.day = GetAddingDataDay(0, 1, 0);
       pchar.quest.generate_trade_quest.win_condition.l1.date.month = GetAddingDataMonth(0, 1, 0);
       pchar.quest.generate_trade_quest.win_condition.l1.date.year = GetAddingDataYear(0, 1, 0);
       pchar.quest.generate_trade_quest.win_condition = "generate_trade_quest";
Then that quest case makes the mission fail after one month:
Code:
    case "generate_trade_quest":
       if (pchar.quest.generate_trade_quest_progress == "begin")
       {
         pchar.quest.generate_trade_quest_progress = "failed";
         Log_SetStringToLog(QUEST_MESSAGE2);
         AddQuestRecord("trade", 2);
       }
     break;
 
Hmm then I probally did something wrong. I tried that before .....

Will look at it again tomorrow.

Please let me know what you think of it. I think it could add to the game. altough it needs some balancing.
Oh and it will only give you the quest at the shipyard if you have enough cargo room to transport at least 500 pieces of sandals.

search for "int min = 500;"on row 356 in quests_common.c to chance this amount in case you want to try this but you dont have a ship large enough yet.
 
Last edited:
search for "int min = 500;"on row 356 in quests_common.c to chance this amount in case you want to try this but you dont have a ship large enough yet.
That's what we've got the console for: I'll just get a bigger boat.
Jaws-You-re-Gonna-Need-a-Bigger-Boat-jaws-9385126-700-513.jpg
 
Just tested this; seems to be working! :cheers
This does add a bit more variety to the random stuff you can do in the game; that's always good.

One thing I am afraid of though is that it still gets boring fairly quick; random quests usually do. :facepalm

BTW: That is a LOT of gold the guy is offering me for his Sandal! :shock
 
I will add more to it ;). For example you will encounter a rival while doing the jobs when you are at a higher level. So you need to be quick or he will beat you (unless you blow him out of the waters ofcourse :dance).
Also I'm trying to add more kind of jobs so it's not that boring. But its mostly to get people who are in a free to play game to go to certain spots.

And yes he is offering you a lot of gold, but keep in mind you need to buy the sandals yourself (unless you can find your rival and take over his ship and stuff, or find a merchant ship who has it). He asks you to gather about 75 till 95 percent of you cargohull full of sandals so thats quite a offer ;).
 
Well, sounds all pretty good to me! I especially like the ideal of rivals.
That is something I'm missing with regular convoy quests: often times, literally NOTHING happens. :facepalm

Are there any specific things you need to know how to do at the moment?
I saw several TODO notes here and there.

Oh.... I did get this error.log entry:
Code:
RUNTIME ERROR - file: dialogs\Olyver Littlejohn_dialog.c; line: 85
missed attribute: work2
 
I think for now I know everything. Will post a updated version later today. And I will look into the error. Altough I cannot see where it is comming from.
 
The relevant code does indeed look identical to the regular convoy quests.
I can't remember if those also generate a similar error the first time it is called. They might do, based on that code.

This should prevent the log entry:
Code:
if (!CheckQuestAttribute("fetch_quest_progress", "search") && GetAttribute(npchar, "work2") != lastspeak_date)

I'm also surprised this works:
Code:
if (chance==1 && pchar.quest.fetch_quest.amount>0){
Recommend to replace with:
Code:
if (chance==1 && sti(pchar.quest.fetch_quest.amount)>0){
Character attributes are always stored as strings and I've seen weird things happen at times when they're not converted to int values properly.

Sometimes, for example, in the F2>Ship display, the character money used to show RIDICULOUSLY high because of that.
But only sometimes. Never did figure out why it wasn't consistent though.
 
I think I fixed those error. Also added timeouts so the mission wont go on forever. But you will only notice untill you talk to someone. For example try gettings the quest (so you know to go to the shipyard) and wait a day. Then talk to some citizens. They might give you some info. You could also go to the shipyard ofcourse and see what he has to say.
Also when you try to do a fetch quest and it takes you more that 15 days (this will become variable later on) there is a chance your rival beat you to it. You will find out when you try to deliver the goods.

The mod now works in oxbay (spleightown) and grand cayman. I will now try to add a tailor to it.

Also the mod now actually removes the cargo from your ship when you deliver it (forgot to do that :p).
And it checks the amount of cargo you deliver right now.

Please test again and let me know if there are any problems.
I also updated that verion at the first post.
 
Downloaded and installed in my game now. Not sure when I might get round to testing it though.
I'll be fairly busy over the next week and the week after, I won't be here. I'll make sure to include your work in an update before that time though. :yes

Also, it just occurred to me, your "rival" idea reminds me of something Bartolomeu o Portugues wants to add into the game,
namely rival pirates you may encounter randomly during your game, who will roam the Caribbean as well and gain notoriety.
Bit similar to what Sid Meier's Pirates! has. He has been considering that, but don't think he's started on it yet.
Thought you might be interested though. :cheeky
 
NP. I will just go on and expand it. Need to add more randomisation etc and add the tailor etc. But if you find any problems just let me know and I can fix them always.
I think my rival will be different from the one in bartolemeu's quest. I still need to find out how to do it exactly, but it will be a bit like the ship hunting quest from the gouvenor. Only he will have the goods you need, so if you choose to get him you can get the goods for free. But before that you need to find out where he is. And you need to do that before he is done ofcourse ;).

Thanks for including it. I will just release new version here when I finished them. I wont add all the towns yet untill I got the system better. Because I have to add the dialogs for the tavern and shipyard owner manually now and it is different for each of them. So I first want to try to get that process easier (probally by doing some includes etc). So I can add things more easily to it. I might even go as far as change the way the tavern owner work by putting everything from the tavern in 1 giant dialog file which just reads in which tavern you are.
 
I think my rival will be different from the one in bartolemeu's quest. I still need to find out how to do it exactly
I was just thinking that your figuring out and Bartolomeu's figuring out might work well together at some point. :wp

but it will be a bit like the ship hunting quest from the gouvenor. Only he will have the goods you need, so if you choose to get him you can get the goods for free. But before that you need to find out where he is. And you need to do that before he is done ofcourse ;).
I like it! I did rewrite the code for quest ship generation fairly recently, so you might be able to use the GenerateQuestShip function.
I have it set up for warships only though, so that would need changing a bit for a trade rival instead.

Thanks for including it. I will just release new version here when I finished them. I wont add all the towns yet untill I got the system better. Because I have to add the dialogs for the tavern and shipyard owner manually now and it is different for each of them. So I first want to try to get that process easier (probally by doing some includes etc). So I can add things more easily to it. I might even go as far as change the way the tavern owner work by putting everything from the tavern in 1 giant dialog file which just reads in which tavern you are.
Some shared dialog stuff definitely sounds interesting; would again save copies of the files, which is indeed quite annoying.
I wonder if we could figure out to put sections of dialog in an external function or something.
 
I was just thinking that your figuring out and Bartolomeu's figuring out might work well together at some point. :wp

I like it! I did rewrite the code for quest ship generation fairly recently, so you might be able to use the GenerateQuestShip function.
I have it set up for warships only though, so that would need changing a bit for a trade rival instead.

I saw the function already and I think I can use it yes.
Some shared dialog stuff definitely sounds interesting; would again save copies of the files, which is indeed quite annoying.
I wonder if we could figure out to put sections of dialog in an external function or something.

Thats what I want to try. At least I want to try to include another dialog.h file so I dont have to add them there and I can keep the same indices everywhere instead of manually changing them. And maybe I would also be able to add cases etc. but I need to try. when I know I will let you know.
 
I think I know a easy way to add stuff to a dialog.
If we add the "case default" we can add the extra cases here.
In the default case you call a function which you can put in another file. You add the parameter from the switch to it as attribute so it can continue looking for it there.
I haven't tried it yet. But I tought I'd share the idea already in case someone thinks of something even better.
Still trying to figure out where the dialog.h file is loaded so I can see if I can easily add one there.
 
There's some code to automatically load the .h file with the same name as the .c file.
But this is what was in use before:
Code:
#include "DIALOGS\Cayman Citizen_dialog.h"
You could add a line like that to the top of the file. Then instead of calling it DLG_TEXT, perhaps call it TAVERN_TEXT .
Then I expect you'll be able to refer to that from any tavern dialog file.
 
I think that is the easiest way indeed. I was looking at the automatic version and was thinking to add something to the character_init so if that value is for example "tavern" it searches for tavern.h etc . I will look into it and probally release it as an other mod and use it in this mod also.
 
You might want to keep all your changes in the same archive when you release them.
I always end up WinMerging them anyway.
 
Nice I made it work :).
I can add whatever dialogs cases to a character with one easy piece of code.
Then I only need to include 1 simple option. And maybe I'll be able to do that one also easier. Let's see.
 
Almost got it.
But I'm getting a COMPILE ERROR
"duplicate label: default"
I can't find any default case in the dialog files. Does anyone know if it is defined somewhere else?
 
Back
Top