- Messages
- 1,468
- Country

Why not do it the other way around and simply increase a variable?
That way, you won't have to worry about initializing a "supply remaining" variable after every loading of the aircraft.
You, of course, also need to animate the supply indicator gauge the wrong way around, but that's easily doable.
The code berlow uses a tried and trusted variation of a timer to increase a variable every 10 seconds. After 30 Minutes (6*10*30), the pilot will be dead due to oxygen deprivation.
Code:(P:ABSOLUTE TIME, seconds) (L:START TIME, seconds) - 10 > if{ (P:ABSOLUTE TIME, seconds) (>L:START TIME, seconds) (L:Oxygen Supply, number) ++ (>L:Oxygen Supply, number) } (L:Oxygen Supply, number) 180 > (L:Pilot Dead, bool) ! and if{ 1 (>L:Pilot Dead, bool) }
H This is my take on the same
Code:
<!-- Oxygen Mask donned -->
<Element>
<Select>
<Value>(L:OxyFlow,number) 0 > (L:Don_Mask,number) 1 == and (L:crew_level,number) 2 > and
if{ 2 (>L:Sound_mask,enum) } els{ 0 (>L:Sound_mask,enum) }</Value>
</Select>
</Element>
<!-- Oxygen Mask not Pulled in time -->
<Element>
<Select>
<Value>(L:blackout,number) 0 == (L:oxygen mask not pulled,number) 0 > and (L:Don_Mask,number) 0 == and (L:emergency,bool) 1 == and
if{ (L:oxygen mask not pulled,number) (P:local time, seconds) >
if{ 280 (>K:PANEL_ID_OPEN) } els{ 1 (>L:blackout,number) 11025 (>K:PANEL_ID_OPEN) 1 (>K:SOUND_OFF) } }</Value>
</Select>
</Element>
<!-- Hypoxia settings-->
<Element>
<Select>
<Value>(L:Cabin_Alt_Ind, number) 27000 > (L:Cabin_Alt_Ind, number) 30000 < and (L:Oxy_Charged,bool) 1 == and
(L:oxygen mask not pulled,number) 0 == and
if{ 1 (>L:emergency,bool) (P:local time,seconds) 180 + (>L:oxygen mask not pulled,number) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(L:Cabin_Alt_Ind, number) 30000 > (L:Cabin_Alt_Ind, number) 35000 < and (L:Oxy_Charged,bool) 1 == and
(L:oxygen mask not pulled,number) 0 == and
if{ 1 (>L:emergency,bool) (P:local time,seconds) 90 + (>L:oxygen mask not pulled,number) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(L:Cabin_Alt_Ind, number) 35000 > (L:Cabin_Alt_Ind, number) 40000 < and (L:Oxy_Charged,bool) 1 == and
(L:oxygen mask not pulled,number) 0 == and
if{ 1 (>L:emergency,bool) (P:local time,seconds) 30 + (>L:oxygen mask not pulled,number) }</Value>
</Select>
</Element>
<Element>
<Select>
<Value>(L:Cabin_Alt_Ind, number) 40000 > (L:Oxy_Charged,bool) 1 == and (L:oxygen mask not pulled,number) 0 == and
if{ 1 (>L:emergency,bool) (P:local time,seconds) 12 + (>L:oxygen mask not pulled,number) }</Value>
</Select>
</Element>
<!-- Hypoxia recovery-->
<Element>
<Select>
<Value>(L:blackout,number) 1 == (L:emergency,bool) 1 == and (L:Cabin_Alt_Ind, number) 15000 < and
if{ 0 (>L:blackout,number) 0 (>L:emergency,bool) 1 (>K:SOUND_ON) 11025 (>K:PANEL_ID_CLOSE) }</Value>
</Select>
</Element>
Interestingly the sim sprung a surprise on me the other day. I pulled back too hard on the stick and the screen went black. Obviously a Gloc event. I was wondering if that could be artificially triggered.

