Log in

View Full Version : dragdata woes



OneSidedDie
February 27th, 2013, 22:30
I've been working on making improvements to the old Earthdawn rule set to incorporate new features in the current 4E rule set. I thought it may be easier just to add the Earthdawn elements to the 4E set instead of the other way around. I'm trying to get exploding dice (dice which roll it's highest value roll the same type again and add it's result to the total). As it stands now my dice do in fact explode but since you are unable to use dragdata.setDieList() in the onDiceLanded() function to manipulate the dice and their values I only am able to pass the latest dragdata along. The way the old system did it was to store each dice in a table in the CampaignRegistry and then call them when all the dice have finished exploding. Unfortunately you can't do that in 4E because it passes on the dragdata along to several other functions before getting to the final result.

I feel like I have two options:

1) Find every single instance that dragdata goes after onDiceLanded() and just put in my table instead.

2) Find some way to manipulate the dragdata information post landing then pass that along (or find a way to manufacture a dragdata result).

Number one seems very tedious, especially if there are multiple slots involved in the dragdata but it's the only way I think I can do it. Would anyone be able to offer suggestions?

Moon Wizard
February 28th, 2013, 02:07
I haven't tried building exploding dice within the 3.5E/4E action framework, so not sure how well it fits.

I fudged the vorpal and brutal effects in 4E by making the rolls in the code only (i.e. generating a random number), then just adding the results to the message output. See checkDie function in scripts/manager_action_damage.lua.

My first try would be to most likely identify rolls that qualify as exploding right in onDiceLanded before any further processing. Then, make a new roll with the new dice needed, and store the old dice + result values in the custom data object. Then, only move on to the rest of the code once the exploding portion is complete.

Regards,
JPG

OneSidedDie
February 28th, 2013, 02:15
Yep, that's exactly what I did. I'm trying to follow the path of the dragdata now and inserting my new dice table where appropriate.

One question I have is how often do you use multiple slots for dice and their relative uses.

Moon Wizard
February 28th, 2013, 02:19
In the 4E ruleset, I don't think I needed to use multiple slots at all, but it's been a while since I looked at it.

In the 3.5E ruleset, multiple slots were used to support "full attack" actions and "spell cast" actions (i.e. cast, attack roll, save, CL check). This allowed a single "action" to make multiple rolls.

Regards,
JPG

OneSidedDie
February 28th, 2013, 03:01
Yeah, it looks like it uses several instances of setSlot() and getSlot() in manager_action.lua, manager_action_effect.lua and modifierstack_base.lua. So I'll have to extract all of the data from the initial roll and reinsert it back when I pass on the data if I want to use whatever functions in your code require it. Guess I've got some work ahead of me. Thank you for the information Mr. Wizard. I appreciate the help.

OneSidedDie
February 28th, 2013, 04:05
Ok, yep. I now have exploding dice and option number one is exactly what it took. It will only work on single slot draginfo's for now but I'm sure I can get it to work with multi's with some more code. Thanks again!