Any way to detect how much Hold Breath is left?

Post » Mon Sep 12, 2011 7:16 am

When swimming under water, is there a script command to detect how much of the blue bar is left? (how close you are to drowning!)
User avatar
Ricky Rayner
 
Posts: 3339
Joined: Fri Jul 13, 2007 2:13 am

Post » Sun Sep 11, 2011 9:48 pm

When swimming under water, is there a script command to detect how much of the blue bar is left? (how close you are to drowning!)

Only thing I can think of is to time how long the bar takes to go down, and then run a timer script that's invalidated if you go out of water or cast a water breathing spell.
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Mon Sep 12, 2011 3:07 am

You can look it up directly from the xml.

The current breath left is stored in "breath_progress\breath_progress_ribbon\user1", so you can read its value with:

set breathLeft to GetMenuFloatValue "breath_progress\breath_progress_ribbon\user1" 1045

...which will give you a value from 0 (no breath left) to 100 (full breath). Note that the value doesn't update to 100 when above water, it only becomes 100 again as soon as you dive underwater.
User avatar
Gill Mackin
 
Posts: 3384
Joined: Sat Dec 16, 2006 9:58 pm

Post » Mon Sep 12, 2011 2:11 am

You can look it up directly from the xml.

The current breath left is stored in "breath_progress\breath_progress_ribbon\user1", so you can read its value with:

set breathLeft to GetMenuFloatValue "breath_progress\breath_progress_ribbon\user1" 1045

...which will give you a value from 0 (no breath left) to 100 (full breath). Note that the value doesn't update to 100 when above water, it only becomes 100 again as soon as you dive underwater.

Damn you and your XML witchcraft :laugh:
User avatar
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am


Return to IV - Oblivion