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

Re-enabling colony limiters

Red_Jack

Landlubber
Ahoy agin lads!

I have been tryin ta find the changes what were done to allow all shipyards ta sell every class o' ship, an so far I am a fish out'a water.

Near as I can figure, it be a limitin of the shipyard somehow, found in /program/interface/shipyard.c what calls to that new colony information. Now I ain't no programer nor do I claim ta be, but I figure it be more of an omitted sequence as opposed ta one what be disabled.

Here in shipyard.c I finds this string;

bool IsEnableBuyShipForCharacter()
{
int iPcharShip = sti(pchar.ship.type);
int iOurTactic = GetSummonSkillFromName(pchar, SKILL_TACTIC);
int iMaxSquadronSize = GetCompanionQuantity(pchar);
if(iPcharShip != SHIP_NOTUSED)
{
iPcharShip = sti(RealShips[iPcharShip].basetype);
if(ShipsTypes[iPcharShip].name == "WarTartane" && refPassenger.id == pchar.id)
{
iMaxSquadronSize = iMaxSquadronSize - 1;
}
}
if(iOurTactic / 2 <= iMaxSquadronSize)
{
return false;
}
return true;
}

bool IsEnableBuyShip()
{
int myMoney = GetMyMoney();
int price = GetBuyPrice(iShipStoreListIndex + 1);
int iship = sti(refCharacter.ship.type);

int iOurTactic = GetSummonSkillFromName(pchar, SKILL_TACTIC);
int iMaxSquadronSize = GetCompanionQuantity(pchar);

if(iship != SHIP_NOTUSED)
{
if(sti(RealShips[iship].basetype) != SHIP_WAR_TARTANE)
{
if(iOurTactic / 2 <= iMaxSquadronSize)
{
return false;
}
}
}

if(!CheckAttribute(refCharacter, "quest.officerprice") && refCharacter.id != pchar.id)
{
return false;
}
string sPos = FindPosForShip(iShipStoreListIndex);
if(CheckAttribute(arShipList, sPos + ".buyed"))
{
if(sti(arShipList.(sPos).buyed) == 1)
{
return false;
}
}

if(CheckAttribute(arShipList, sPos + ".notforsale"))
{
if(sti(arShipList.(sPos).notforsale) == 1)
{
return false;
}
}

if (price > myMoney)
{
return false;
}
/*if (price <= myMoney)
{
if(iship == SHIP_NOTUSED)
{
return true;
}
if(CheckAttribute(RealShips[iship], "basetype"))
{
if(sti(RealShips[iship].basetype) == SHIP_WAR_TARTANE)
{
return true;
}
}
}*/


return true;
}

So I figures, this be allowin ships ta be sold based on a few functions. Skill in Tactics, available coin etc, yet there be no call to colony info. So I put this out to me fellow seadogs. If'n ye kin figure this mess out give us a holler.

Cheers lads! <img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

RJ
 
Well, I've been planning on investigating that, RJ. But what with me helping test the PotC build mod, working on my new models and generally making an ass of myself, I've just not gotten to it yet.

I'm still hoping Cyberops will put in an appearance and give us a hint on what to change to make the shipyards act like they used to.

If I find anything out, I'll let you know, good sir.

Cap'n Drow
 
Open scripts/utils/

Look for the following text.

void CalculateShipForShipYard(aref chr)
{
if(CheckAttribute(chr, "shipyard"))
{
return;
}

int iTest_ship;
int iBeginPoint, iEndPoint;
int iStep;
int iNation
string sStep;

DeleteAttribute(chr, "shipyard");

iTest_ship = rand(1);
chr.shipyard.ship1 = SHIP_TARTANE;

iStep = 2;
iNation = chr.nation;

string sLocation = pchar.location;
sLocation = Locations[FindLocation(sLocation)].fastreload;

int iShipYardLevel = sti(colonies[FindColony(sLocation)].shipyard);

if (iShipYardLevel == 1)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 2)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 3)
{
iEndPoint = SHIP_Brig_rn;
}

if (iShipYardLevel == 4)
{
iEndPoint = SHIP_Brig_rn;
}

//trace("isl"+ iEndPoint);

int m = 2;
for (int i = SHIP_TARTANE; i <= SHIP_Brig_rn; i++)
{
iTest_ship = GenerateShip(i, 1);
sStep = "ship" + m;
chr.shipyard.(sStep) = iTest_ship;
if(i > iEndPoint)
{
chr.shipyard.(sStep).notforsale = 1;
}
m = m + 1;
}

change the end points of the shipyard levels there change brig_rn for the ship you want the maximum ship for that shipyard level.
 
Thanks for the reply, Cyberops. That was very cool of you.

Just curious, I've been trying to add ships into the list in the proper order, according to class size. Is there an actual problem with that?

Usually what happens is my desired new ship suddenly becomes the bottom of the ship list. Is that due to something in a .dll somewhere that I've just not figured out, or is there additional code in another file I've just not found yet?

Cap'n Drow
 
Three cheers for th' Cap'n! <img src="style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" /> <img src="style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" /> <img src="style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" />

Much obliged by yer reply Cyberops, thank ye kindly.

Be there a manner ta also limit building access agin?

Regards

RJ
 
Back
Top