PDA

View Full Version : d20_JPG & Wound/Vitality



Tenser
January 20th, 2009, 06:55
I've modified moon wizards d20_JPG ruleset to include the wound/vitality system from Unearthed Arcana. I have a penalty applied to the attack roll when wound points are damaged, but I'm having trouble with applying a penalty to the damage rolls.

Within the charsheet_templates.xml file, moon wizard created a template called "weapondamage" (which is used on the charsheet_combat.xml file within the windowclass "charsheet_weaponlistitem".

Within this template he has defined a function onDoubleClick

function onDoubleClick(x,y)
ChatManager.DoubleClickDieControl(getDice(), window.damagebonus.getValue(), window.name.getValue() .. " (Damage)", {pc = window.getDatabaseNode().getParent().getParent()}) ;
return true;
end

From within that function I'm trying to access a sheetnumber in the charsheet_combat.xml file called "meleewoundpenalty" which has a source of "attackbonus.woundpenalty". I've tried all kinds of ways to access the data so I can apply it to the damage roll on the doubleclick action and I've come up empty each time. Any ideas?

Oberoten
January 20th, 2009, 07:35
This is how I have bound all skills on my charactersheet :



<script>
function onDoubleClick()
local a, b, c, d

a = window.getDatabaseNode().getChild("skill.level").getValue()
c = window.windowlist.window.getDatabaseNode().getChil d("wfpen").getValue()
d = a + c
b = window.getDatabaseNode().getChild("skillname").getValue()

ChatManager.d10Check("d10", d, b .. " + Wounds/Fatigue " .. c );
return true;
end
</script>
¨

Where wfpen is the penalty for Wounds/Fatigue

- Obe

Tenser
January 21st, 2009, 01:48
Thanks Oberoten!

I spent hours trying different things, doing searches on the boards here and no luck. Your tip did the trick!

Although I'm new to XML, I can find my way around just about any program when all I'm doing it modifying it, but I need examples to work from and I couldn't find any examples of trying to access data using window.windowlist.window.

Now I have moon wizards d20_JPG up and running with a wounds/vitality system in place which calculates:
wound and vitality points on the PCs character sheets
fatigue penalties to attack and damage and AC if wounded
wound points for any NPC or monster added to the combat tracker
has places for 5 classes instead of 3
correctly calculates attacks if a 'rapid shot/flurry' checkbox is checked

I think I will add in the wound penalty to the appropriate skills next. My programming is ugly, but it works :)

Thanks again!