PDA

View Full Version : How would I go about....



Debinani
May 13th, 2009, 18:11
I'm working on a basic Paranoia XP ruleset and I just about have the character sheet done. I'd like to do something like what the Traveller extension does (which is what I used as a starting point) - which is to allow the user to click on a stat or skill and have a die roll automatically made on their behalf.
So I have the code to throw some dice via scripting - so I have that covered.
What I'd like to see happen is the following:

User double-clicks a skill
1D20 is rolled.
The difference between the roll and the clicked skill is calculated and displayed in the chat window. For example: "Bob rolls Hacking and succeeds by 7 points."


I'd also like to further extend that on the weapons list for attack rolls, where we take the difference, divide it by a number associated with the weapon, and compare that to an array of damage results.

So does anyone have some pointers on how I should go about piecing this together? Should I use custom dice or just do it all with script on the numberboxes?

Foen
May 13th, 2009, 19:15
Hi Debinari

I think you need to implement this in a couple of places:

- when the skill/ability is double-clicked, you need to create some custom info to pass to the dice-roller; then
- when the dice hit the chat window, it calls a handler called onDiceLanded, where you retrieve the custom info and display the results in the chat box.

I think the JPG d20 and 4E rulesets use this method (although I'm not familiar with either).

Foen

Valarian
May 13th, 2009, 19:53
The Traveller extension uses the diceCheck and dieCheck functions in the script file chatdice.lua. These are called from the onDoubleClick functions in the required stat or skill. That's points 1 and 2 covered - but for what you want you'll have to replicate the functions in chatdice.lua and give the dice type a different name.

For the other (point 3), you'll need a registered dice handler to be able to use it in an extension. Look at the 3.5e full attack handler for inspiration and let us know how you get on.

Hope you like the Traveller extension, I'm hoping to add in NPCs and combat tracker stuff in to it at some point. I'm currently working on doing extensions for Corporation and for Dragon Warriors.

Debinani
May 13th, 2009, 21:30
Yeah, I found the full attack handler after I made this post - that certainly looks to be the way to fly.
Thanks guys! When I get the char sheet done I'll get it up on the wiki - I know there've been a number of posters here looking for Paranoia.
Maybe one day I'll do a combat tracker, etc. - thogh Paranoia isn't my group's primary game, so who knows if I'll ever feel the need. :P