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 08-18-12, 12:01 AM   #11
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Here's how the whole CO2 thing is calculated:

Every frame update the timer value is incremented 100 @ TC1 (while using the debugger - frame update time is 0.1 when using debugger)
Once the timer value >= timer value for triggering (357100) then:

It gets the timer value for triggering (357100) and divides it by 1000.0
this results in 357.1 (this would be a value in seconds)


the game takes 48.0 and takes the reciprocal of it (1 / 48.0)
it then multiplies that value by 357.1 (seconds)
this result is the CO2 generation in that period of time (357.1 seconds)
it then divides that value by 3600.0 [total seconds in an hour] (we'll call this result1)

it then gets the current CO2 %
it compares current CO2 % to 0.9
if current CO2 % if after 0.9 it does some other calculations that results in a new current CO2 %

it then mutliplies result1 by a factor (1.0) <-- this is probably an ability
then adds current CO2 % to this result
then it ensures new CO2 % value is between 0.0 and 1.0 and stores the new CO2 % to memory

it then compares new current CO2 % to 0.75
if after 0.75 it does something (haven't triggered it yet)

it then compares new current CO2 % to 0.9
if after 0.9 it does something (haven't triggered it yet)

it then compares new current CO2 % to 0.99
if after 0.99 it does something (haven't triggered it yet but appears to be death scene)

So how do you want to revamp the CO2
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 08:17 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.