SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-25-14, 04:18 PM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by gap View Post
There are parts of your code I don't fully get.

Can you please express it in a numerical format (or just as pseudo-code)?
I read that function just fine and can follow exactly what it's doing

- checks to see if daytime
- if already nighttime then jump to end
- compare current available light (0.35) to start of nighttime value for player's unit (0.5)
- if current available light is greater than or equal to start of nighttime value for player's unit then jump to end
- subtract sunlight value - used to determine if nighttime (0.238) from start of nighttime value (0.5 - gets range) - result is 0.262
- if the result above is negative then jump to end
- subtract sunlight value - used to determine if nighttime (0.238) from current available sunlight (0.35) - result is 0.112
- if the result above is negative then clamp to 0.0
- divides 0.112 by 0.262 - result is 0.4275
- subtract 0.4275 from 1.0 thus getting % of range - result is 0.5725
- get nighttime multiplier (3.0) and add nighttime multiplier addition to it (1.0) - result is 4.0
- subtract 1.0 from 4.0 - this converts to 0 based - result is 3.0
- if the result above is negative then clamp to 0.0
- multiply 0.5725 by 3.0 - result is 1.7175
- add 1.0 to result above thus converting back to 1 based - result is 2.7175
- multiply minimum signal strength (0.1) by 2.7175 - result is 0.27175

0.27175 is new minimum signal strength
TheDarkWraith is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.