• 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 How to edit wind speed?

Gundrios

Landlubber
Hi everyone. I would like to adjust the wind speed values for my game but I don't know what file and values I have to edit.

Can someone help me with this or direct me to a topic post that has already covered this topic?
 
I'd have to research it, but the wind speeds for each hour of the day are set up in one function. It might be easier to adjust wind speeds at the point where they are set by the game.

Exactly what do you want the wind speed to do? I can tell you what file to change and how to change it.

Hook
 
I'd have to research it, but the wind speeds for each hour of the day are set up in one function. It might be easier to adjust wind speeds at the point where they are set by the game.

Exactly what do you want the wind speed to do? I can tell you what file to change and how to change it.

Hook

Hi LarryHookins. I actually want to use the same wind speed values that you used in your "Hook's Mod" for Sea Dogs to Each His Own. I'd like to have the same values present in my Sea Dogs/Age of Pirates 2 City of Abandoned Ships, Gentlemen of Fortune Eras 2.8.2 mod
 
Everything you need is in weather/WhrWeather.c except for the three constants defined in hookmod_settings.h and you can copy the constants you prefer directly into the GetWeatherSpeed() function. The constants are in ALL_CAPS, just replace the name with the number. You could also copy the three constants to the top of the WhrWeather.c file and leave them in the code.

Add the GetWeatherSpeed() function at the bottom of the WhrWeather.c file, then replace the 2 lines that say:

fWeatherSpeed = stf(Weather.Wind.Speed);

with

fWeatherSpeed = GetWeatherSpeed();

in the CreateWeatherEnvironment() and Whr_WindChange() functions.

You will also need the MakeInRange() function.

The GetAverageWindSpeed() function is used to adjust ship speeds by class and wind speed. Smaller ships are slower than larger ships in high winds, and faster in low winds. This is useful for completeness but not essential, as the game uses a constant 8 knots for the average wind, and in TEHO at least, even this number is wrong; it should be 10. If you notice a difference, look at where GetAverageWindSpeed() is used and fix the code there. Let me know if you need help.

I don't have all the source code you're using, so I can't get more detailed than I have above. If you have problems, upload the WhrWeather.c file here, I'll make the changes, and you can download it. I won't be able to test it though, so give it a try yourself first.

As always, be SURE to make a copy of the WhrWeather.c file before doing any changes in case you have to revert.

Hook
 
Everything you need is in weather/WhrWeather.c except for the three constants defined in hookmod_settings.h and you can copy the constants you prefer directly into the GetWeatherSpeed() function. The constants are in ALL_CAPS, just replace the name with the number. You could also copy the three constants to the top of the WhrWeather.c file and leave them in the code.

Add the GetWeatherSpeed() function at the bottom of the WhrWeather.c file, then replace the 2 lines that say:

fWeatherSpeed = stf(Weather.Wind.Speed);

with

fWeatherSpeed = GetWeatherSpeed();

in the CreateWeatherEnvironment() and Whr_WindChange() functions.

You will also need the MakeInRange() function.

The GetAverageWindSpeed() function is used to adjust ship speeds by class and wind speed. Smaller ships are slower than larger ships in high winds, and faster in low winds. This is useful for completeness but not essential, as the game uses a constant 8 knots for the average wind, and in TEHO at least, even this number is wrong; it should be 10. If you notice a difference, look at where GetAverageWindSpeed() is used and fix the code there. Let me know if you need help.

I don't have all the source code you're using, so I can't get more detailed than I have above. If you have problems, upload the WhrWeather.c file here, I'll make the changes, and you can download it. I won't be able to test it though, so give it a try yourself first.

As always, be SURE to make a copy of the WhrWeather.c file before doing any changes in case you have to revert.

Hook

Thanks for the reply Hook.

I tried adding the functions you listed above but I'm not exactly sure what I'm doing. I changed the 2 lines that said fWeatherSpeed =stf(Weather.Wind.Speed) to fWeatherSpeed =stf(Weather.Wind.Speed) but I'm not exactly sure where I should add the MakeInRange() function.

I'll upload my WhrWeather.c file without any changes. If you can make the changes and allow me to download it and test it, that would be awesome.
 

Attachments

  • WhrWeather.c
    34.5 KB · Views: 200
I changed the 2 lines that said fWeatherSpeed =stf(Weather.Wind.Speed) to fWeatherSpeed =stf(Weather.Wind.Speed)

This wouldn't do anything. :D

Just needed to copy the two functions to the bottom of the file.

New file attached.

Hook
 

Attachments

  • WhrWeather.c
    36.6 KB · Views: 232
Back
Top