• 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 not turnig with zero speed

Yomi

Landlubber
Hi,

is there mod or option to disable ship turning with 0.0 speed when lowered sails or complete demast? or at least lower it to almost nothing..

currently playing with GoF 1.2 + patch
 
Nope....and no ones working on 1.2 anymore... MK improved this in ERAs so they dont do that very much...but i still see it happen but very rare.....but I dont know what he didd to fix it...
 
nvm found AI ship turning code and changed it so if sail hp is 0 then ship stop spinning on spot
 
Awesome, you should post how you did it. I would like to also do that just I am too busy coding for HoO to dig into yet another game, lol.
 
tested it on GOF 2.0 works for enemy ships, didn't test it on officers, won't work for player ship

in AIShip.c

Code:
Ship_UpdateParameters()
...
//sail dmg check
    if( sti(rCharacter.Ship.SP) <=0 )
    {
        arCharShip.MaxSpeedY = 0.0;
    }
    else  
    {     
        // wind power
        float    fWindPower = Whr_GetWindSpeed() / WIND_NORMAL_POWER;  
        float    fWindDotShip = GetDotProduct(Whr_GetWindAngle(), stf(arCharShip.Ang.y));        // Wind.ay | Ship.ay
        // boal -->
        fShipSpeed = (fShipSpeed * fWindPower);  // boal ęđĺéńĺđńęŕ˙ ńęîđîńňü äî óěĺíüřĺíčé ďđč äŕííîě âĺňđĺ.
        arCharShip.MaxSpeedZ = fShipSpeed;
        //Log_info("1 = " + arCharShip.MaxSpeedZ);
        arCharShip.MaxSpeedZ = Sea_ApplyMaxSpeedZ(arCharShip, fWindDotShip); // ó÷ĺň ďŕđóńîâ â äđ ěĺńňĺ
        //Log_info("2 = " + arCharShip.MaxSpeedZ);
        // boal <--
        //  ďîäíčěĺě âűřĺ č çŕęýřčđóĺě float fShipTurnRate = FindShipTurnRate(rCharacter);
  
        float fMaxSpeedY = stf(rShip.TurnRate) / Sea_TurnRateMagicNumber(); //boal

        float fTRFromSailState = 1.0;
        switch (MakeInt(fSailState * 2.0))
        {
            case 0: fTRFromSailState = 0.00; break;
            case 1: fTRFromSailState = 1.0; break;
            case 2: fTRFromSailState = 0.68; break;
        }
        // boal çŕâčńčěîńňü îň ńęîđîńňč íŕ ěŕíĺâđ -->
        float    fTRFromSpeed = 1.0;
        float fCurrentSpeedZ = stf(rCharacter.Ship.Speed.z);
        if (iCharacterIndex == GetMainCharacterIndex())
        {
            if (MOD_SKILL_ENEMY_RATE > 2) // őŕë˙âŕ č ţíăŕ - ďîńëŕáëĺíčĺ)
            {
                if (iArcadeSails == 1)
                {
                   fTRFromSpeed = 1.0 - 0.5 * (1.0 - Clampf(fCurrentSpeedZ / fShipSpeed));
                }
                else
                {
                    fTRFromSpeed = 1.0 - 0.86 * (1.0 - Clampf(fCurrentSpeedZ / fShipSpeed));
                }
            }
        }
        else
        {
            if (iArcadeSails == 1)
            {
               fTRFromSpeed = 1.0 - (0.51 - MOD_SKILL_ENEMY_RATE*0.01) * (1.0 - Clampf(fCurrentSpeedZ / fShipSpeed));
            }
            else
            {
                fTRFromSpeed = 1.0 - (0.87 - MOD_SKILL_ENEMY_RATE*0.01) * (1.0 - Clampf(fCurrentSpeedZ / fShipSpeed));
            }
        }
        // boal çŕâčńčěîńňü îň ńęîđîńňč íŕ ěŕíĺâđ <--
        float fTRResult = fMaxSpeedY * fShipTurnRate * fTRFromSailState * fTRFromSpeed;
        // ===============
        // boal äŕëĺĺ ˙ âńĺ çŕęîěĺíňčë, ňę ěĺřŕëî đŕáîňŕňü ęîäó îň ńęîđîńňč, äŕ č âîîáůĺ ńîěíčňĺëüíî ýňî äë˙ ěŕíĺâđŕ.
        // VANO :: update fTRResult using rotate with wind direction
        //float fRotateSide = stf(arCharShip.speed.y);
        /*float fPrevWindDotShip = stf(arCharShip.WindDotShip);
        bool bShipTurnToWind = fWindDotShip >= fPrevWindDotShip;
        float fWindTurnMultiply = 1.0;
        if (bShipTurnToWind)
            { fWindTurnMultiply = Bring2Range(1.5, 1.0, 0.0, 1.0, abs(fWindDotShip)); }
        else
            { fWindTurnMultiply = Bring2Range(0.5, 1.0, 0.0, 1.0, abs(fWindDotShip)); }

        arCharShip.WindDotShip = fWindDotShip;
        //Trace("fWindTurnMultiply = " + fWindTurnMultiply);
        // ===============

        fTRResult = fWindTurnMultiply * Bring2Range(0.01, 1.0, 0.00001, 1.0, fTRResult);
        */
        fTRResult = Bring2Range(0.07, 0.95, 0.00001, 1.0, fTRResult);
        arCharShip.MaxSpeedY =    fTRResult;
    } 
...

this is what i added, whole part in else is original

Code:
Ship_UpdateParameters()
...
//sail dmg check
if( sti(rCharacter.Ship.SP) <=0 ) 
{
      arCharShip.MaxSpeedY = 0.0;
}
else
{
      original turn code
}
 
Last edited:
if u mean //sail dmg check then no, this is just my comment line, has nothing to do with the code... just forgot to add it in the second code.... :)

will edit it...

didn't know how much i should explain it.. :)

well in first code is the whole part of the method, should help you find it and give idea how it should look when done...

in the second is what i had to add / change to make it work, wanted to make it easy so u won't have to compare whole code...
just take the lines in second code and copy them in your AIship.c file so it looks like the first code
 
Last edited:
I know nothing of code. I just went and looked in both GOF2 and ERAS and could not find that line and I am not sure where to add it.
 
Back
Top