PDA

View Full Version : Another problem i can not solve



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() &gt; 0 then
percent_wounded = window.wounds.getValue() / window.hp.getValue();
end
if percent_wounded &lt;= 0 then
setFont("sheetnumber");
elseif percent_wounded &lt;= .33 then
setFont("charsheet_light");
elseif percent_wounded &lt;= .66 then
setFont("charsheet_moderate");
elseif percent_wounded &lt;= 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

Moon Wizard
August 31st, 2010, 19:41
I'm not quite sure that it makes sense to add the temporary hp to the total hp, since it is a completely different type of value and some abilities are triggered based on actual hit points versus temporary hit points. My suggestion would be to keep them separate as they are in the 4E ruleset.

If you still want to combine them, I would recommend using the modifiernumber template, and setting the modifier value as the temporary hit point field. In this scenario, the value would be added to the field, but a small circular bubble would be displayed in the upper right corner with the modifier being applied (i.e. the temporary hit points).

Regards,
JPG

madman
September 1st, 2010, 06:24
the reason i wanted temp hp. the campaign we are playing in has alot of neg levels. and in pathfinder the neg level gives -5 to total hp not wounds.

And again thank you

Chris

madman
September 1st, 2010, 14:39
i changed it to a modifiernumber and added the
<modifierfield>hptemp</modifierfield>
and when i scroll the temp hp field the bubble shows up.

but i cant seem to add a number to the hit point field for it to modify.

<modifiernumber 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>
<modifierfield>hptemp</modifierfield>
<script>
function onValueChanged()
window.wounds.onValueChanged();
end

</script>
</modifiernumber>


<hitpointfield 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>
</hitpointfield>



What am i missing

Chris

Moon Wizard
September 1st, 2010, 15:36
How are you trying to adjust the modifier? Can you walk me through the steps?

Because the hit point field is editable, there will be no way to modify the temporary modifier number other than opening the character sheet and changing the temphp field.

It's a fairly complex problem to have a field that is editable, and modifiers can be applied on the fly, without losing information.

Perhaps you would be better off implementing a current HP field which is read only, that is adjusted by editing other fields (max HP, negative levels, etc.)

Cheers,
JPG

madman
September 2nd, 2010, 02:21
ok, so i have added a field to the hp window at the bottom under nonlethal(temp HP)

i want to add a value to the temp Hp field and have the HP field modified(in the box or bubble makes no diff) but i want the hp field in the CT and whatnot to update to that value.

so i click the temp hp field and scroll the mouse and it changes the hp field, but i can not add a number to the HP field in any way that ends up other than equal to the temp field with the mod bubble at the same value.
I end up with three fields and the same values.

took a screen shot

Chris