madman
August 29th, 2010, 19:26
so i added a temp hp field to the hp window in the character sheet.
it works fin, but i want to add the number in the temp hp field to the HP field.
as a pos or neg number so i used the source tag and op + tag to get the field to update. I did this with the temp bab and save fields i added and it works great. the hp field however will not do the same thing. STUCK and Seeing double, not sure what i am not seeing.
D20_JPG and Pathfinder ver 8 ext
<jpgnumberfield name="hp" source="hp.total">
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>23</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>wounds</next>
<prev>expneeded</prev>
</tabtarget>
<source>
<name>hptemp</name>
<op>+</op>
</source>
<script>
function onSourceUpdate()
onSourceChange()
setValue("hp" + calculateSources());
end
</script>
</jpgnumberfield>
<stringcontrol>
<anchored>
<to>hp</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Hit points</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<hitpointfield name="wounds" source="hp.wounds">
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>67</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>subdual</next>
<prev>hp</prev>
</tabtarget>
<script>
function onInit()
onValueChanged();
end
function onValueChanged()
local percent_wounded = 0;
if window.hp.getValue() > 0 then
percent_wounded = window.wounds.getValue() / window.hp.getValue();
end
if percent_wounded <= 0 then
setFont("sheetnumber");
elseif percent_wounded <= .33 then
setFont("charsheet_light");
elseif percent_wounded <= .66 then
setFont("charsheet_moderate");
elseif percent_wounded <= 1 then
setFont("charsheet_heavy");
else
setFont("charsheet_dead");
end
end
</script>
</hitpointfield>
<stringcontrol>
<anchored>
<to>wounds</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Wounds</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<hitpointfield name="nonlethal" source="hp.nonlethal">
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>112</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>appearance</next>
<prev>wounds</prev>
</tabtarget>
</hitpointfield>
<stringcontrol>
<anchored>
<to>nonlethal</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Nonlethal</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<numberfield name="temphp" source="hptemp">
<noreset />
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>154</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<hideonvalue >0</hideonvalue>
<droptypes>
<type>number</type>
</droptypes>
</numberfield>
<stringcontrol>
<anchored>
<to>temphp</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Temp HP</static>
<font>sheetlabelsmall</font>
</stringcontrol>
Any help as always would be great.
CHris
it works fin, but i want to add the number in the temp hp field to the HP field.
as a pos or neg number so i used the source tag and op + tag to get the field to update. I did this with the temp bab and save fields i added and it works great. the hp field however will not do the same thing. STUCK and Seeing double, not sure what i am not seeing.
D20_JPG and Pathfinder ver 8 ext
<jpgnumberfield name="hp" source="hp.total">
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>23</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>wounds</next>
<prev>expneeded</prev>
</tabtarget>
<source>
<name>hptemp</name>
<op>+</op>
</source>
<script>
function onSourceUpdate()
onSourceChange()
setValue("hp" + calculateSources());
end
</script>
</jpgnumberfield>
<stringcontrol>
<anchored>
<to>hp</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Hit points</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<hitpointfield name="wounds" source="hp.wounds">
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>67</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>subdual</next>
<prev>hp</prev>
</tabtarget>
<script>
function onInit()
onValueChanged();
end
function onValueChanged()
local percent_wounded = 0;
if window.hp.getValue() > 0 then
percent_wounded = window.wounds.getValue() / window.hp.getValue();
end
if percent_wounded <= 0 then
setFont("sheetnumber");
elseif percent_wounded <= .33 then
setFont("charsheet_light");
elseif percent_wounded <= .66 then
setFont("charsheet_moderate");
elseif percent_wounded <= 1 then
setFont("charsheet_heavy");
else
setFont("charsheet_dead");
end
end
</script>
</hitpointfield>
<stringcontrol>
<anchored>
<to>wounds</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Wounds</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<hitpointfield name="nonlethal" source="hp.nonlethal">
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>112</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>appearance</next>
<prev>wounds</prev>
</tabtarget>
</hitpointfield>
<stringcontrol>
<anchored>
<to>nonlethal</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Nonlethal</static>
<font>sheetlabelsmall</font>
</stringcontrol>
<numberfield name="temphp" source="hptemp">
<noreset />
<frame>
<name>bonus</name>
<offset>5,5,5,5</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,5,5,5</offset>
</keyeditframe>
<font>sheetnumber</font>
<stateframe>
<drophilight>
<name>sheetfocusplus</name>
<offset>5,5,5,5</offset>
</drophilight>
</stateframe>
<anchored>
<to>hpframe</to>
<position>insidetop</position>
<top>
<offset>154</offset>
</top>
<left>
<offset>18</offset>
</left>
<right>
<offset>-19</offset>
</right>
<size>
<height>22</height>
</size>
</anchored>
<hideonvalue >0</hideonvalue>
<droptypes>
<type>number</type>
</droptypes>
</numberfield>
<stringcontrol>
<anchored>
<to>temphp</to>
<position>aboveleft</position>
<offset>0,3</offset>
</anchored>
<static>Temp HP</static>
<font>sheetlabelsmall</font>
</stringcontrol>
Any help as always would be great.
CHris