Dice Modifiers & Scripts

For all things Script related.

Moderator: anstett

Dice Modifiers & Scripts

Postby ssostac1 » Thu Jan 21, 2010 11:33 pm

Greetings Fellow Kloogers

Quick question. I need my script to be able to know and use what the player entered for a dice roll modifier in the dice panel. Any way to do that?

Thanks
Scott
ssostac1
 
Posts: 10
Joined: Sun Jun 15, 2008 7:35 pm

Re: Dice Modifiers & Scripts

Postby anstett » Fri Jan 22, 2010 7:02 am

What do you need to know would be the question I have.

When a roll is displayed in the chat log it shows all the modifiers to it. True it does not show what each modifier actually is but you can see that the roll has been modified.

BOB

who claims no knowledge of scripting
playing AD&D version 2 point mine

http://www.dragonslayers-society.org
anstett
Forum Admin
 
Posts: 1249
Joined: Fri Aug 01, 2003 1:53 pm
Location: South Florida

Re: Dice Modifiers & Scripts

Postby ssostac1 » Fri Jan 22, 2010 8:35 am

Hi Bob

I am trying to write an Alternity definition file, and in the Alternity system, rather than static modifiers such as +1, +2, etc., it uses extra dice for modifiers. A +1 modifier in Alternity is a d4, +2 is a d6, +3 is a d8 and so on. So I need to add up all the modifiers associated with a roll, then convert that modifier into a dice roll. I figured the best way to do that was in a script, and I can easily get all of the associated modifiers to any given roll via the definition file into a script, but I also need to get the modifier the player may enter on the fly using the dice panel, so I can determine the correct modifier die to use.

Hope that makes sense.

Scott
ssostac1
 
Posts: 10
Joined: Sun Jun 15, 2008 7:35 pm

Re: Dice Modifiers & Scripts

Postby GMJames » Sat Jan 23, 2010 8:58 am

In the kLoOge.Werks root directory you will find a folder called Scripting-docs that contains an HTML reference to all of the kLoOge.Werks classes. There is also a quick reference index-all.html file that provides a full listing.

I am not much of a script writer, but there does appear to be a set of getFieldModifier classes that appear to do what you desire.
User avatar
GMJames
KloOge Contributor
 
Posts: 1089
Joined: Sun Feb 22, 2004 7:59 pm
Location: Oklahoma

Re: Dice Modifiers & Scripts

Postby ssostac1 » Tue Jan 26, 2010 1:24 am

Well, I thought that might be the case too, but much to my dismay it isn't. The getFieldModifiers apparently only gets the modifiers listed using <modifier></modifier> in the definition file. I guess I will have to figure out some sort of work around using joptionpane or some other dialog box.

Maybe that can be a new feature come Klooge ver 3.3.3 if you are listening Kurris? 8)

In the meantime if anyone else has any ideas, I am all ears!

Scott
ssostac1
 
Posts: 10
Joined: Sun Jun 15, 2008 7:35 pm


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron