![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
|
|
Thread Tools | Display Modes |
08-18-12, 12:01 AM
|
#11 |
|
Black Magic
![]() |
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
|
|
|
|
|
