PDA

View Full Version : Substracting Protection



Tokuriku
March 25th, 2007, 01:24
Has somebody found a way to substract another field when doing a dropoperation.
I want the protection of the characters on the combat tracker to be substracted from the points I drag when this dragged number is dropped in the HP field.

Tokuriku
May 12th, 2007, 07:32
This is simply a bump to my question for FG2

Goblin-King
May 14th, 2007, 08:54
If you simply want to use a negative operation for a linked field, see the "linkednumber" template in common_templates.xml in the d20 ruleset. To subtract, specify <op>-</op> in the <source> entry for the field.

I'm not crystal clear on what you wish to accomplish exactly. If you want to alter the value in the field where the drag originated, you would be best defining a drag type of your own, and using setCustomData to pass the value you want subtracted to the target control, which could then use this to do the subtraction logic.

Tokuriku
May 14th, 2007, 10:37
I'll check the file thanks.
What I want to do is:
Take the damage roll from the chat box and drag it to the combat tracker.
Drag it to the HP field so that the damage is substracted from the current HP.
(I got this part down)
But I want the protection the character has to lower the damage receuved.
Example:
HP: 45
Protection:3
Damage: 10

10 damage - 3 protection = 7 actual damage.
45 hp - 7 actual damage = 38 left points in the combat tracker.

Now my biggest problem is how to say in LUA scrip to substract the protection the character has from the damages.
I can't seem to make the script understand wich field on the charsheet to place in the operation.
In the database, it is: combat.protection.value