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

[WIP] Limit special ship type to certain country

modernknight1

That sounds very historically accurate yes, and I know you have an eye and the sources for these things. In my present game in GOF 1.1 I see some dfferences already in gameplay, what types of ships I encounter, a lot less Pearls and Dutchman's, but still there's the strange mixing of mid to late 17th century ships with mid 18th, and the Spanish using Dutch ships, Brits and Dutch with caravels and heavy galleon's.

So more historical accuracy is very welcomed, and you don't have to go crazy, take your time. I never played Sea Dogs or POTC, just a bit of AOP 1 and now AOP 2, but looking at the vanilla game and comparing with the mods, combined and GOF, well the game as goten better and better, you guys remind me of the mod community at Total War games, always plenty of stuff happening.

Navegador
 
[...]
Next question: The way this introduces what ships you encounter is based on what rank you are. I think I could bring more variety if I introduced an additional rank order. So do you think I could substitute this line: "if (Rank >= 11 && Rank <= 20)" with two seperate new lines "if(Rank>=11 && Rank<=15)" add my ships strings and then another "if(Rank>16 && Rank<=20)" with different new ships strings. More work I know, but it would add more variety and we have a lot of ships.
[...]

Some thinking....

Subranking too much can make the game dull. Hitting an enemy fleet only to find there is a big lass waiting for you is part of the fun. And defeating her (if possible) is part of the reward.

If we are going to subrank as close as five ranks maybe some extra randomness is needed to assure some out of range ships will pop now and then.

- o -

On other take (and I think you know it way better than me) even military convoyes was not "so plain", usually mixing different rates (and not only for tactical necessity but for disponibility of ships too). And for scorting convoyes, to the best of my knowledge, they were a very mixed assembly, with ships of varied kinds. But you are the expert here and I bend to your opinion.

Cheers.
buho (A).
 
OK, Sorry for the delay. I've broken something. It's not working at all now. Engine won't even launch. Maybe I got too complex with this. I'm gonna play with it one more day and if I can't fix it, I'll have you guys take a look at it and see if you can find what I did wrong. Either way tomorrow night.

MK
 
OK, I'm done with this. This is a simplified version and I still can't get it to work.

Jonathan, Pieter, Buho, Can you please take a look at this and see if you see something wrong. Feel free to take it apart anyway you wish. HELP!!!!

http://www.gamefront.com/files/20590265/AIFantom.c

MK
 
OK, I'm done with this. This is a simplified version and I still can't get it to work.

Jonathan, Pieter, Buho, Can you please take a look at this and see if you see something wrong. Feel free to take it apart anyway you wish. HELP!!!!

http://www.gamefront.com/files/20590265/AIFantom.c

MK

Aye aye, Sir!

Cheers.
buho (A).

NOTE: MK, check the modders area.
 
Any luck guys? I'm dying to know what I did wrong. It must be bad because no one has commented. I thought it was just something simple I'd missed. Drat! :modding

MK
 
Any luck guys? I'm dying to know what I did wrong. It must be bad because no one has commented. I thought it was just something simple I'd missed. Drat! :modding

MK

hi ho, i did'nt read C in a while, but at first glace why have you out commented <case "War"> in the last function? I would expect that the engine couldnt find the case therefor. And there is no "else" part in the case function.
BTW if my brabbling didnt make sense, feel free to ignore it. :rolleyes:

As i can't del this post. Really ignore it. complete nonsense from me. :shrug Not my day
 
Any luck guys? I'm dying to know what I did wrong. It must be bad because no one has commented. I thought it was just something simple I'd missed. Drat! :modding

MK

Hi MK,

Buho had already had a look at this and answered you in the Modders forum.

I had a look myself at the file you posted there and it worked fine. Actually, the file there is identical to the base COAS version (minus some cannon stuff) did you post the correct file?
 
I'm an idiot. I guess it was late and I was tired and posted the stock file. Sorry to waste your time guys.

Please have a look at this one: http://www.gamefront.com/files/20600245/AIFantom.c

MK
 
OK, Been out of town working.

I'm back and finished one version that is working OK. However, I don't like the variety from only the RandFromThreeDight.

So I made this one with RandFromFiveDight strings

Questions:

Do all strings need to have five? (I left the pirate strings initially at three to see how they would behave.

Where do I need to change three to five in the utilities?

This file does not work I suspect because the utilities changes that need to be made.

Anyway, if you could give me your opinions Jonathan and Buho, I would appreciate it. Very busy now, so if you could make the utilities changes, that would be nice too.

Here's the new file: http://www.gamefront.com/files/20669848/AIFantom.c

I am still making fine edits to the ships init, so when the mod is done it will be all three files (Ships init, AIFantom, and utilities)

Here's the utils: http://www.gamefront.com/files/20670002/utils.c

I'm guessing you can only have a three or five switch not both. Can we???

MK
 
Quick glance:

Code:
int RandFromThreeDight(int _Num1, int _Num2, int _Num3)
{
switch (rand(2))
{
case 0: return _Num1; break;
case 1: return _Num2; break;
case 2: return _Num3; break;
}
} // {*} BUHO <------------ HERE - Add the brace.


int RandFromFiveDight(int _Num1, int _Num2, int _Num3, int _Num4, int _Num5)
{
switch (rand(4))
{
case 0: return _Num1; break;
case 1: return _Num2; break;
case 2: return _Num3; break;                                                 
case 3: return _Num4; break;
case 4: return _Num5; break;
}
} // {*} BUHO <------------ HERE - Add the brace.

Can you check and tell me if it works now? Your files are GOF 1.2 and my game is GOF 1.1.

[...]
Questions:

Do all strings need to have five? (I left the pirate strings initially at three to see how they would behave.

Where do I need to change three to five in the utilities?

I'm guessing you can only have a three or five switch not both. Can we???
[...]

Not sure about what you want, MK. Can you elaborate it some more?

Cheers.
buho (A).
 
Thanks Buho,

I had already found the missing brace.

It still doesn't work. So what I want is both RandFromThreeDight - AND - RandFromFiveDight

Say I want to have lower level trade ships with strings of five possibilities for the game to choose from, but with higher level warships, I only want three.

So on the file I'm writing now the pirates are restricted to three, but all other ships five.

I am just going to change everything to three I guess so we can at least get it into 1.2

I just think five makes for way more variety.

I am at a loss why the game doesn't like my five lines.

MK
 
Give me a couple hours, will try to check your files. The point is that without clear error messages (and the environment have basically none :c) it is difficult to know when the code is not loading due to a programming error or due to a compatibility issue.

Now, on your functions: why you can't call the RandFromThree sometimes and the RandFromFive some other times?

You have both, why you can't use one or the other as you see fit?

Cheers.
buho (A).
 
Ok, I have both loading.

AIFantom have some constant issues, may be errors or may be compatibility issues, I can't say because you ships.h is different than mine. And there are and a couple of sintactical errors too.

CONSTANTS

SHIP_BARK_L -> I have SHIP_BARQUE_L in my ships.h (warning: you have TWO of them)
BERMSLOOP -> I have SHIP_BERMSLOOP in my ships.h
BATAVIA2 -> I have SHIP_BATAVIA2 in my ships.h

ERRORS

Code:
// case "trade":
// Scroll right and check the end of the ENGLAND line <----
if (Rank > 26)
{
if (Nation == SPAIN) ShipType = RandFromFiveDight (SHIP_GALEON_H, SHIP_POSEIDON, SHIP_WARSHIP, SHIP_NEPTUNE, SHIP_FR_SUPERIORWARSHIP1);
if (Nation == HOLLAND) ShipType = RandFromFiveDight(SHIP_DUTCHSHIP, SHIP_SEVENPROVINCIEN, SHIP_DUTCHLINESHIP, SHIP_NEPTUNE, SHIP_LINK);
if (Nation == ENGLAND) ShipType = RandFromFiveDight(SHIP_MORDAUNT, SHIP_SHARK, SHIP_BELLONA, SHIP_SIRIUS1, SHIP_INDIAMAN);_  //// <---------- HERE, underscore
if (Nation == FRANCE) ShipType = RandFromFiveDight(SHIP_LA_LICORNE, SHIP_INDIAMAN, SHIP_POSEIDON, SHIP_FR_SUPERIORWARSHIP1, SHIP_WARSHIP);
}

Code:
// case "pirate":
if (Rank > 24)
{
ShipType = RandFromThreeDight(SHIP_BLACKPEARL, SHIP_NIGHTMARE, SHIP_CURSEDDUTCHMAN);
} // <--------- HERE, missing bracket
break;


I have a doubt about this last line, MK: it is not going to generate Pearls and Dutchmans galore?

Cheers.
buho (A).

LATER: Why is the "#include "scripts\seaspeak.c" //Philippe" in utils.c? It is not needed, apparently.
 
Thanks for taking a look Buho. :onya

Are they working for you?

Good catch on the two Heavy Bark and the missing bracket. I will fix. :onya

I don't know why I can't use a switch for three or five at the same time. I was just asking if someone knows of any reason why I can't. :shrug

Just trying to get the game to run with the new code. :modding

We will figure it out!

MK
 
You are actually using both, the excerpts of code I posted to mark the errors show it: just by chance one of the excerpts use RandFromFive and the other RandFromThree.

And there is no reason for it not being possible; you have both functions defined, you can call the one you want from where you want.

Cheers.
buho (A).

NOTE: The most difficult error to find was the underscore, probably I looked two hundred times to the line without seeing it, the constants where only tedious and the bracket very easy ;).
 
OK, I fixed everything you found buho and I found some additional spacing errors as well.

It still doesn't work.

I am hoping Jonathan will take a look.

Would you like me to upload my latest AIFantom and UTILS files with the fixes, or should we just give up. I just can't see anything else wrong. Why won't it work :modding

I don't think people are very interested in this anyway. Probably just me.

MK
 
Upload AIFantom.c, utils.c and ships.h (I need the ships constants), I'll take a look.

Cheers.
buho (A).
 
Back
Top