Page 1 of 1

[DN 5.1] Help: Healing Surge

Posted: Fri Aug 26, 2011 5:09 pm
by Jaxom
Anyone have the code and instructions to get a healing surge bar working with the DN Character Sheet v5-1.

I have the bar created as "SurgeBar" within the campaign properties and is two colors to show the bar adjust as the healing surges are used.

I figure that a Macro needs to be added to the "Health" section of Lib:Execute and that the Macro needs to do the following to the appropriate Properites... I'm hoping someone can help me figure out how the code should be written to get the bar to adjust correctly as healing surges are used by the character.

DNA_HealingSurgeRemaining/DNA_HealingSurgeTotal

Thanks,

Re: [DN 5.1] Help: Healing Surge

Posted: Fri Aug 26, 2011 8:13 pm
by Jaxom
Using some code for health bars that was created by Darakonis, I was able to apply it to making a healing surge bar and then just needed to add the following line...

Code: Select all

<!-- Surge bar-->
[H, macro("[email protected]:Execute"): ""]

To the macros SurgeRecord & RestRecord

For those that might want the code, which I'm sure could be written better, for fun I thought I might make a few different colors later...

Code: Select all

<!--Surge bar-->
[H: setBarVisible("SurgeBar",0)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.6): bar.SurgeBar = (DNA_HealingSurgeRemaining/DNA_HealingSurgeTotal)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.4): setBarVisible("SurgeBar",0)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.8): bar.SurgeBar = (DNA_HealingSurgeRemaining/DNA_HealingSurgeTotal)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.6): setBarVisible("SurgeBar",0)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.4): bar.SurgeBar = (DNA_HealingSurgeRemaining/DNA_HealingSurgeTotal)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.2): setBarVisible("SurgeBar",0)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal > 0.8): bar.SurgeBar = (DNA_HealingSurgeRemaining/DNA_HealingSurgeTotal)]
[H, if(DNA_HealingSurgeRemaining / DNA_HealingSurgeTotal <= 0.2): setBarVisible("SurgeBar",0)]
<!--The following turns off the bars for NPCs. Delete these lines if you want NPCs to display surge bars-->
[H, if(isNPC()==1): setBarVisible("SurgeBar",0)]
[H, if(isNPC()==1): setBarVisible("SurgeBar",0)]
[H, if(isNPC()==1): setBarVisible("SurgeBar",0)]
[H, if(isNPC()==1): setBarVisible("SurgeBar",0)]
[H, if(isNPC()==1): setBarVisible("SurgeBar",0)]