• 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, frandSmall

xinerubtsp

Landlubber
Hello guys. Could anyone clarify for me, how this function exactly works?

I know it generates random numbers >> 0 ... _x (rand(32) / 32 * _x), but last part confused me. How do I calculate it?

After years of playing TEHO, I just curious what is the worst / the best stats for different types of ships. As I know, ship stats based on "base stat" and a bit random.

rRealShip.SpeedRate = stf(rRealShip.SpeedRate) + frandSmall(stf(rRealShip.SpeedRate) / 5.0) - stf(rRealShip.SpeedRate) / 10.0;

For example. Heavy frigate has 13.5 base speed. How can I calculate lowest and highest speed for heavy frigate I can find in sea? Thanks in advance.
 
'rand(32)' generates a random number between 0 and 32. Divide by 32, multiply by _x, and you get a random number between 0 and _x.

'frandSmall(stf(rRealShip.SpeedRate) / 5.0)' should generate a random number between 0 and 0.2 * base speed. That will have an average of 0.1 * base speed.

So 'frandSmall(stf(rRealShip.SpeedRate) / 5.0) - stf(rRealShip.SpeedRate) / 10.0' should be between -0.1 * base speed and +0.1 * base speed, with an average of 0.

Add that to the base speed, and the end result should be between 90% and 110% of the base speed. For that frigate, that would be between 12.15 and 14.85.
 
Thanks for the reply. But I saw quite a lot of HF with over 15 nodes speed. Is there another modifier? Or I'm just missing something?
 
I don't have SD:TEHO, so I can't say for certain. In the Build Mod for "Pirates of the Caribbean", there are modifiers for different nations, with several nations getting a 5% speed bonus and Pirates getting a 10% bonus. Ships can have upgrades, some of which improve speed. So, if a frigate was lucky with that 'frandSmall' and has the 5% nation modifier, or if it has an upgrade which boosts speed, it could easily end up with a speed of over 15.
 
Back
Top