Thread: Dice Roll problem
-
April 7th, 2015, 17:43 #11
I'm not sure what you're trying to say here.
window.<control_name> is a way of getting access to the control named whatever you put in <control_name> within the current window environment. You can do it a number of different ways. Have the rollDice code in the <windowclass><script> section - which I think is where you have it at the moment, in which case you will need specific references to the controls which might need window.<control_name> to get to them.
If your strikeranktot control is in a different windowclass then you'll need additional window/control references to be able to reach it.
First step - try using window.strikeranktot.getValue() in your current rollDice function.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 7th, 2015, 17:43 #12Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
April 7th, 2015, 18:54 #13
Ok I can get it to work without errors with the following script:
Code:function rollDice() local desc = name.getValue().." ("..strikeranktot.getValue()..")"; ChatManager.throwDice("dice",{"d10"},0,desc); end
Attachment 9535
I want to add the Strink Rank Total to the dice roll. It finds the SRT fine for the desc, but every time I try to access it in order to add it to the die total it return s a nil value on global or it doesn't like the character such as when I put in the window.strikeranktot.getValue. I would also like a sting that says Initiative after the character's name. but when I tried to add it the thing kicked it back as no good. Thank you for all of your help, you are amazing.
-
April 10th, 2015, 14:34 #14
Which ruleset is this for? Is this based upon CoreRPG?
Make sure the numberfield tag for strikeranktot is <numberfield name = ... not <Numberfield name = ... as per your post above. Then add this version of rollDice to the script block attached to the window class that contains the strikeanktot numberfield:
Code:function rollDice() sStrikerAnkTot = strikeranktot.getValue(); sDesc = name.getValue() .. " (".. sStrikerAnkTot .. ")"; ChatManager.throwDice("dice",{"d10"},tonumber(sStrikerAnkTot),desc); end
FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
April 12th, 2015, 08:44 #15
-
April 12th, 2015, 17:50 #16
- Join Date
- Apr 2011
- Posts
- 2,253
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks