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

Limiting ships to certain nations

i still don't feel much like braving the world of crashes, lag and unique gameplay issues, i'm afraid. <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />
 
Above suggestion of mine can be applied to Build 13 as well and should give no additional crashes. However, the Realistic Ship Purchase mod isn't actually in Build 13, so you wouldn't need a Letter of Marque for navy ships. You could apply it to Build 14 Alpha 6 as well, of course, which does have it. <img src="style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" />
 
i'm not too sure about that, actually. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /> i can remember seeing a toggle for it.
 
I made that mod for Build 14. Or did I put it in one of the Updates and forgot about it? Nah; I don't think so. <img src="style_emoticons/<#EMO_DIR#>/no.gif" style="vertical-align:middle" emoid=":no" border="0" alt="no.gif" />
 
See screenshot. One thing's for certain: this whole thing ain't working yet. Too bad. It was working before if we just used the .nation attribute, but the more advanced versions won't work yet. Looks like we still have some work to do. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
That's a possibility, yes. And then we can use the regular .nation attribute trick for ensuring certain ships are not used by other nations. Unfortunately that means a lot of work now and a lot of work when adding a new ship as well, because they have to be added to six files now. <img src="style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" />
 
It seems you will have some work during your voyage. <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
I most certainly hope I won't need to do everything myself! <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
 
I might have some very good news. I have now messed around with the code again and came up with this:
Code:
		// PB: Periods -->
if(iNation == ENGLAND  && CheckAttribute(rShip,"england")  && stf(rShip.england) *100 < rand(100))	continue; // && stf(rShip.england) *100 < rand(100)
if(iNation == HOLLAND  && CheckAttribute(rShip,"holland")  && stf(rShip.holland) *100 < rand(100))	continue; // && stf(rShip.holland) *100 < rand(100)
if(iNation == FRANCE   && CheckAttribute(rShip,"france")   && stf(rShip.france)  *100 < rand(100))	continue; // && stf(rShip.france)  *100 < rand(100)
if(iNation == SPAIN	&& CheckAttribute(rShip,"spain")	&& stf(rShip.spain)   *100 < rand(100))	continue; // && stf(rShip.spain)   *100 < rand(100)
if(iNation == PORTUGAL && CheckAttribute(rShip,"portugal") && stf(rShip.portugal)*100 < rand(100))	continue; // && stf(rShip.portugal)*100 < rand(100)
if(iNation == AMERICA  && CheckAttribute(rShip,"america")  && stf(rShip.america) *100 < rand(100))	continue; // && stf(rShip.america) *100 < rand(100)
if(iNation == PIRATE   && CheckAttribute(rShip,"pirate")   && stf(rShip.pirate)  *100 < rand(100))	continue; // && stf(rShip.pirate)  *100 < rand(100)

if(GetCurrentPeriod() == PERIOD_EARLY_EXPLORERS	  && CheckAttribute(rShip,"period0") && stf(rShip.period0)*100 < rand(100)) continue; // && stf(rShip.period.0)*100 < rand(100)
if(GetCurrentPeriod() == PERIOD_THE_SPANISH_MAIN	 && CheckAttribute(rShip,"period1") && stf(rShip.period1)*100 < rand(100)) continue; // && stf(rShip.period.1)*100 < rand(100)
if(GetCurrentPeriod() == PERIOD_GOLDEN_AGE_OF_PIRACY && CheckAttribute(rShip,"period2") && stf(rShip.period2)*100 < rand(100)) continue; // && stf(rShip.period.2)*100 < rand(100)
if(GetCurrentPeriod() == PERIOD_COLONIAL_POWERS	  && CheckAttribute(rShip,"period3") && stf(rShip.period3)*100 < rand(100)) continue; // && stf(rShip.period.3)*100 < rand(100)
if(GetCurrentPeriod() == PERIOD_REVOLUTIONS		  && CheckAttribute(rShip,"period4") && stf(rShip.period4)*100 < rand(100)) continue; // && stf(rShip.period.4)*100 < rand(100)
if(GetCurrentPeriod() == PERIOD_THE_CORSICAN		 && CheckAttribute(rShip,"period5") && stf(rShip.period5)*100 < rand(100)) continue; // && stf(rShip.period.5)*100 < rand(100)
// PB: Periods
So far I have seen nothing to suggest this doesn't work. The main difference with what we had before, is that I swapped the ">" signs with "<". This might also explain why I did see Dutch ships under other nations' flags, but never a Dutch ship under Dutch flag. With my latest code change, I have actually seen Dutch ships under Dutch flag and some of Petros' ships under Spanish flag as well. So far, so good. I'm holding out hope it actually WORKS now.
 
If the above works, this should work as well:
Code:
			if (iNation >= 0 && iNation < NATIONS_QUANTITY) {
string sNation = GetNationNameByType(iNation);
if (CheckAttribute(rShip, sNation) == true && stf(rShip.(sNation)) < FRAND(1.0)) continue;
}
string sPeriod = GetCurrentPeriod();
if (CheckAttribute(rShip, "period."+sPeriod) && stf(rShip.period.(sPeriod)) < FRAND(1.0)) continue;
If you have this mod in your game, please replace the code in PROGRAM\SEA_AI\AIFantom.c and PROGRAM\SHIPS\ships.c with the above and do some testing to see if it works. I had to make some changes in ships_init.c as well though, because some assignments were somewhat odd, including certain Manowars in the first period, but not the last and I also saw an English ship listed as Dutch-only. I suppose there's more things there that might be fine-tuned, but we can do that as time progresses. :doff
 
Can anybody confirm that no wrong-nation ships have been spotted lately?
Screwface should've fixed this, though this fix is not in the Alpha yet if I recall.
 
Just a thought about the Navy ships (or military ones). In the 17th Century, were there so many as in the game ? I have the feeling that all the ships of the universe are in the Caribbean. <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
Do you object to the number of ships or the type of the ships? I'm not sure how to change the number,
but the types can be easily modified by decreasing the chances for the ships in ships_init.c.
I do understand what you mean; there's a LOT of ships.

On the other hand, for gameplay purposes I do like having the colour-schemed ships so you can distinguish between nations.
But that's all period-dependent. There'll be pretty much none of that in Early Explorers and lots of it in The Corsican.
 
what I say is not about the number of ships <b>BUT</b> the number of military ships. Do you think in that time the nations could have so many military ships ?
 
In that case, find the military ships in ships_init.c and decrease the period values.
We could probably also use some different code for military ships to decrease the chance of them on the whole.
Not sure if everyone would like that though. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Must say that there are A LOT of warships. More than merchants. Not good for pirates <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
 
<!--quoteo(post=335495:date=Jul 6 2009, 03:02 PM:name=Pieter Boelen)--><div class='quotetop'>QUOTE (Pieter Boelen @ Jul 6 2009, 03:02 PM) <a href="index.php?act=findpost&pid=335495"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->In that case, find the military ships in ships_init.c and decrease the period values.
We could probably also use some different code for military ships to decrease the chance of them on the whole.
Not sure if everyone would like that though. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
As we already do for the relations between the nations. Why not use a different value for the military ships encounteers <b>ONLY</b> for my main quests.
 
Back
Top