PDA

View Full Version : Applying Damage to Tracker from Chat Window...



Blackfoot
May 23rd, 2014, 00:31
I'm having an issue with damage in my Champions Ruleset. When I drag it from the Chat Window and drop it on the tracker it is losing some of the information that it generally has when rolled through targeting. What am I missing here? Where is that data stored and manipulated so I can have a look at why it's dropping part of the info.. or not getting to it for whatever reason... it doesn't seem to be coming back at quite the same place.

Trenloe
May 23rd, 2014, 00:53
You could check the message data (https://www.fantasygrounds.com/refdoc/Comm.xcp) and the drag data info (https://www.fantasygrounds.com/refdoc/dragdata.xcp).

If you're basing your ruleset on the 3.5e ruleset, then look at manager_actions_damage.lua - particularly onDamage (and the called notifyApplyDamage) function and then the OOB functionality that gets called which in turn calls applyDamage - this last function is the one that actually applies the damage, but you'll need to understand the process of putting together the data from the previous functions.

What function are you calling when you drop the damage from the chat window onto the combat tracker?

Blackfoot
May 23rd, 2014, 01:08
What function are you calling when you drop the damage from the chat window onto the combat tracker?
I assume whatever function 3.5 uses... I'm not really messing with that stuff... although I do have a bunch of tweaks in manager_action_damage.. I'll look at applyDamage and see if there is a step getting missed somehow.
The deal is that in Champions there are 2 types of damage... 'STUN' which is equal to the values rolled on the dice.. and 'BODY' which is calculated from those dice.. the 'STUN' is getting applied correctly when dragged from the chat window.. but the 'BODY' is getting lost... so I'm guessing it is missing the step to calculate it.. or maybe just keeping track of the total rolled.. or something. I want to look at the nuts and bolts of it.. hopefully figure out where it's going wrong.

Moon Wizard
May 23rd, 2014, 01:39
When dragging from chat window, you get the "type", the "total" and any text. All other data is not passed.

If you need to track something, put in roll text output. This is what 3.5E and 4E do. (ie range, damage type, blinded condition, incorporeal attack, etc)

Regards,
JPG

Blackfoot
May 23rd, 2014, 02:41
That was the impression I was getting... thank you for confirming it.

'result' isn't being stored then I take it?
I'll work it into the text somehow. Thanks.

Trenloe
May 23rd, 2014, 03:13
function applyDamage(rSource, rTarget, bSecret, sRollType, sDamage, nTotal)

The result of the damage can't be calculated until you drop it on something.

Blackfoot
May 23rd, 2014, 05:42
The 'result' is one of the items in the Roll. It is what is displayed on the actual die when it appears in the chat window.. it's not part of apply damage. We're talking about different things. :)
I'm going to try and make use of Moon Wizard's suggestion and pass more info into the text somehow. I guess it would be good to have it there anyway.

Trenloe
May 23rd, 2014, 06:40
We're talking about different things. :)
Oh, sorry! :o


I'm going to try and make use of Moon Wizard's suggestion and pass more info into the text somehow. I guess it would be good to have it there anyway.

In that case have a look at onDiceLanded(draginfo) in CoreRPG manager_actions.lua. You can use draginfo.getDescription() to get the description string and then draginfo.setDescription(description) to set the description with extra data if you want. https://www.fantasygrounds.com/refdoc/dragdata.xcp

Blackfoot
May 23rd, 2014, 06:45
Trying to avoid messing with the Actions Manager directly (so I can leave it in CoreRPG) I'm looking at adding something into either onDamage or onDamageRoll which are both functions that seem to deal with the results of the roll... but before the results are displayed.

Blackfoot
May 23rd, 2014, 17:59
I got it working!
Thanks for the help guys.