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

Need Help

Luke159

Buccaneer
Storm Modder
Hi guy's i want to increase the radius of which a fort can fire, now i believe this is the code i need but i can't make heads or tails of it. Can you explain what it is and how to best edit this code to increase the range of the forts range.

Code:
float Cannon_GetFireHeight()
{
aref aCharacter = GetEventData();
aref aEnemy = GetEventData();

ref rBallType = GetGoodByType(sti(aCharacter.Ship.Cannons.Charge.Type));
ref rEnemyShip = GetRealShip(sti(aEnemy.Ship.Type));

string sBallName = rBallType.Name;

float Y,DY;
Y = stf(rEnemyShip.Height.(sBallName).Y);
DY = stf(rEnemyShip.Height.(sBallName).DY);

// charge/ship depend
// boal new goals -->
//return (Y + (frnd()-0.5) * DY * 2);
// ââåäåì ëîãèêó è ó÷åò îò ðàññòîÿíèÿ. òàêæå ó÷åò ÷òî, áîìáû òÿæåëåå ÿäåð
float dist = Ship_GetDistance2D(aCharacter, aEnemy);
// Y- âûñîòû ïðèöåëà, çàäàíà äëÿ áîðòà îò òèïà êîðàáëÿ ïðîòèâíèêà 1-3 äëÿ ÿäåð 10-20 äëÿ êíèïïåðåé 2-4 êàðòå÷ DY - äèñïåðñèÿ
// Áóäåì èñõîäèòü èç ïîäîáèÿ òðåóãîëüíèêîâ è òîãî, ÷òî âûñîòà ïîäîáðàíà Àêåëëîé íà ñåðåäèíó ðàäèóðà âûñòðåëà
ref	rCannon = GetCannonByType(sti(aCharacter.Ship.Cannons.Type));
if (sBallName == "Bombs" || sBallName == "Grapes")
{
Y = Y + 0.6;
}
if (sti(aEnemy.Ship.Type) == SHIP_FORT)
{
Y = 40;
DY = 16;
}
float RY = abs(Y * (dist / ( stf(rCannon.FireRange) / 2)) + (frnd()-0.5) * DY / 4));
if (RY < 0.8)
{
RY = 0.8;
}
if (RY > 55)
{
RY = 55;
}
return RY;
// boal <--
}
 
Well as far as i know the canons determine the range. And forts have special cannons. I think in CM3 they have the highest possible caliber. I believe its 92 but not sure.

So change that. They are to big to mount on ships anyhow.
 
LOL, i know it was me who changed the forts gun's to 92Ibs lol.

Anyway, the forts have there own field of view which mean's they will not open fire (no matter if in range of there cannon's) till the ship(s) are within the forts field of view. I have a good feeling about the above code but i'm not fully sure if that is what i'm looking for.
 
Heh and here i was hoping for a simple solution with just editing the canon range :s
 
I know, nothing is ever that simple though is it. I know its something easy, just a value that needs changing but i'm only guessing the above code changes the forts field of view. I could be completely wrong but it just sounds like it for that. Hopefully someone will come along and either point me in the right direction or tell me what the code above does.
 
Back
Top