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!
Quick links for Beyond New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
- Bug Tracker on Github
Quick links for Maelstrom
- Download the latest version of Maelstrom
- Download the latest version of ERAS II
- Download the latest version of New Horizons on Maelstrom
Quick links for PotC: New Horizons
- Download latest version
- Wiki
- FAQ
- Report bugs here
Thanks to YOUR votes, GOG.com now sells:
- Sea Dogs
- Sea Dogs: Caribbean Tales
- Sea Dogs: City of Abandoned Ships
Vote now to add Pirates of the Caribbean to the list!
Quick links for AoP2: Gentlemen of Fortune 2
- Downloads and info
- ModDB Profile
- Forums Archive
A Pirate Podcast with Interviews
Music, Comedy and all things Pirate!
- Episode Guide - About - Subscribe -
- Twitter - Facebook - iTunes - Android -
- Youtube - Fill the Coffers -
Huh, what? I am not aware of any such ships existing.I think these ships are used for the virtual smugglers which supply islands with smuggling goods.
That is, of course, exactly what happens:Probably a specific tier of ship was asked for a specific nation in a specific time which didn't exists.
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 3, Per = Colonial Powers, Nat = Pirate, Type = War
Indeed that looks concerning too. Should probably be a separate Bug Tracker entry.Personally I'm more concerned about the MISSING ITEM ID errors in the compile log and the error log with missing itemID's
@Grey Roger: Could you post your quests_common.c file, please? I'm specifically interested in an older version (based on the 28 July 2016 one).@Levis @Pieter Boelen in this case it is a Governors Quest ship , havent done the quest itself yet!
I rewrote the captain system but didn't touch the ship.... the ship is an input for my captain generation...@Grey Roger: Could you post your quests_common.c file, please? I'm specifically interested in an older version (based on the 28 July 2016 one).
@Levis: You completely rewrote the "Quest Captain" system as well, right?
void GenerateQuestShip(string character_id, int iNation) // KK
{
//Check if the character is an enemy
bool isEnemy = false;
if(character_id == "Quest pirate" ) isEnemy = true;
if(character_id == "Convoy pirate") isEnemy = true;
//Get the captain which is only half setup
ref rCaptain = characterFromID(character_id);
//Determine the nation of the ship etc
if(isEnemy) iNation = LotHostileNation(iNation);
else iNation = iNation;
//Extract the nation and fantomtype from it
string sFantomType = "war";
if( iNation >= NATIONS_QUANTITY) iNation = PIRATE;
if( iNation == PIRATE) sFantomType = "pirate";
//Determine the max and minclass of the ship
int maxclass, minclass, iShipType;
maxclass = GetShipMinClassForSkills(sti(rCaptain.skill.Leadership), sti(rCaptain.skill.Sailing)); // TODO: Change this so we determine it on something else
if(sti(rCaptain.nation) == PIRATE && maxclass < MAXPIRATECLASS) maxclass = MAXPIRATECLASS;
if(HasSubStr(character_id,"Coastal_Captain") && maxclass < MAXCOASTGUARDCLASS) maxclass = MAXCOASTGUARDCLASS;
if(GetCurrentPeriod() <= PERIOD_EARLY_EXPLORERS || GetCurrentPeriod() >= PERIOD_NAPOLEONIC)
{
if(iNation == HOLLAND && maxclass < 3) maxclass = 3;
if(iNation == PORTUGAL && maxclass < 3) maxclass = 3;
}
minclass = maxclass + 2;
if(minclass > 8) minclass = 8;
//Make the ship
iShipType = Force_GetShipType(maxclass, minclass, "War", iNation);
//Generate the captain
if(DEBUG_CAPTAIN_CREATION>1) Trace("CAPTAIN CREATION: In function GenerateQuestShip");
rCaptain = LAi_Create_Captain(rCaptain, sFantomType, iShipType, iNation); //Levis new function to create a captain
if(character_id == "Quest pirate") // PB: For Governor Quest Ships only
{
//NK edit trademoney
ref Shiptype = GetShipByType(iShipType);
aref arship; makearef(arship, rCaptain.ship);
ref pchar = GetMainCharacter();
float shipmult = 5.0 * sqrt(intRet(sti(Shiptype.CannonsQuantity),sti(Shiptype.CannonsQuantity),1) * sti(GetLocalShipAttrib(arship, Shiptype, "HP")) * stf(GetLocalShipAttrib(arship, Shiptype, "SpeedRate"))); // PRS3
float commult = 1.0 + makeint(CalcCharacterSkill(pchar, SKILL_COMMERCE))/20.0;
int iTradeMoney = makeint(sqrt(sti(rCaptain.rank)) * shipmult * commult/25)*25;
if(iTradeMoney < 100) iTradeMoney = 100;
pchar.quest.generate_kill_quest = "begin";
pchar.quest.generate_kill_quest.money = iTradeMoney;
pchar.quest.generate_kill_quest.town = GetCurrentTownID();//MAXIMUS
pchar.quest.generate_kill_quest.destination = Islands[GetCharacterCurrentIsland(Pchar)].id;
pchar.quest.generate_kill_quest.nation = iNation; // KK // MAXIMUS
pchar.quest.generate_kill_quest.shipname = rCaptain.Ship.Name;
}
}
if(sti(rCaptain.nation) == PIRATE && maxclass < MAXPIRATECLASS) maxclass = MAXPIRATECLASS;
TODO: Change this so we determine it on something else
rCaptain = LAi_Create_Captain(rCaptain, sFantomType, iShipType, iNation); //Levis new function to create a captain
Of course it is a quest character! It is only ever a quest character in that function.I see I forgot to add a check here to see if it's a quest character and if so skip the generation.
It it used for the following purposes:I have no idea where this function is used and hence i did it in this way to make sure I don't change any of the ship generation itself.
I did predict that would be the biggest issue, didn't I?because in encounters the ship is determined first based on other paramters (the parameters of the encounter) and the captain is based on that. So to have a good captain I take the ship which is generated and base the captain off that.
if(sti(rCaptain.nation) == PIRATE && maxclass < MAXPIRATECLASS) maxclass = MAXPIRATECLASS;
It's from the 28th July installer but is dated 16th July.@Grey Roger: Could you post your quests_common.c file, please? I'm specifically interested in an older version (based on the 28 July 2016 one).
Thanks very much! That's exactly what I needed.It's from the 28th July installer but is dated 16th July.
void GenerateQuestShip(string character_id, int iNation) // KK
{
bool isEnemy = false;
if(character_id == "Quest pirate" ) isEnemy = true;
if(character_id == "Convoy pirate") isEnemy = true;
InitQuestCaptain(character_id, iNation, isEnemy); // LDH 05Sep06 // KK
void InitQuestCaptain(string QuestCharacter, int iNation, bool isEnemy)
{
ref ch = CharacterFromID(QuestCharacter);
int idx = sti(ch.index);
int CharacterNation;
if(isEnemy) CharacterNation = LotHostileNation(iNation);
else CharacterNation = iNation;
DeleteAttribute(ch, "");
ch.id = QuestCharacter;
ch.index = idx;
You'd need to determine an appropriate Ship Tier for the encounter, without using its future captain.I will take a look at it today when I'm home and see if I can think up a solution. Till then I'm open for sugestions.
The first line is hard the rest isn't a problem...You'd need to determine an appropriate Ship Tier for the encounter, without using its future captain.
So instead of calculating the captain level based on the player level OR player ship tier, you have to determine a formula that returns the encounter ship tier instead.
Then you can generate the ship first and then make a brand new captain for that ship.
Hmmm I forgot to add a character_idx or something like that to the arguments.What are 'minlevel' and 'maxlevel' there?
Certainly a more reusable function would be good. But for the current 'GenerateQuestShip' functionality, I can't think why those inputs would be needed.
Maybe make a different function that is called FROM 'GenerateQuestShip' with those inputs and then it can be called from other place too.
On the other hand, is that not what 'Force_GetShipType' is for?
That is what 'Force_GetShipType' already does .min and max level will be used to determined the tier of the ship.
if you want a ship of a specific tier you just say for exampe 4 and 4 so it will always give 4. But if you want for example a pretty good ship but some randomization you could say for example between 3 and 1 so it could generated a tier 3,2 or 1 ship etc.
if(iNation == PIRATE && maxclass < MAXPIRATECLASS) maxclass = MAXPIRATECLASS;
if(GetCurrentPeriod() <= PERIOD_EARLY_EXPLORERS || GetCurrentPeriod() >= PERIOD_NAPOLEONIC)
{
if(iNation == HOLLAND && maxclass < 3) maxclass = 3;
if(iNation == PORTUGAL && maxclass < 3) maxclass = 3;
}