Thread: Keep Highest/Drop Lowest ?
-
November 26th, 2014, 20:30 #21
See the supported types in the dragdata entry - 2nd paragraph here: https://www.fantasygrounds.com/refdoc/dragdata.xcp
The not-so-quick-fix would be to write an onDrop() handler on the target control/s to get the correct data out of your custom dragdata object - this is a lot of work and would require messing around with base ruleset templates/definitions for a controls. It's much better to simply change the resulting chat message type to "dice" so that any control in the ruleset that can accept a number from a dice dragdata object will be able to accept it. And the result of your rolld code is a set of dice anyway, so this makes sense...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!
-
November 26th, 2014, 21:42 #22
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
I agree, that is a lot more work than would fit this extension. Thank you again for the help. I plan on putting together an updated version of this extension file and posting a release in the main forums some time later this evening. I am sure this is a bit of functionality that will find good use amongst the community.
-
November 27th, 2014, 17:39 #23
Will this work with the current version of Castles & Crusades?
"I am a Canadian, free to speak without fear, free to worship in my own way, free to stand for what I think right, free to oppose what I believe wrong, or free to choose those who shall govern my country. This heritage of freedom I pledge to uphold for myself and all mankind."
- John Diefenbaker
RIP Canada, February 21, 2022
-
November 27th, 2014, 18:15 #24
Yeah it will. Get the latest extension from here: https://www.fantasygrounds.com/forum...west-Extension and add Castles and Crusades as a ruleset to extension.xml.
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!
-
November 27th, 2014, 22:20 #25
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
I just updated the download file on my website to include "Castles and Crusades" in the ruleset list, but since I don't own this ruleset myself I cannot confirm for sure that this will work. I certainly can't see why it wouldn't, but it is the first one included I myself didn't test on my machine. Other than that, the only other change is a minor type-o correction.
-
November 27th, 2014, 22:25 #26
Hi DMFirmy - I just tested with C&C and it works there also.
-
November 27th, 2014, 22:26 #27
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
@damned: Thanks a ton!
-
November 28th, 2014, 02:03 #28
DMFirmy - what is the code that makes your Dice Result draggable?
I have a need to be able to drag some dice rolls for my Maelstrom ruleset.
I can drag your Dice Result into the target field ok - but my particular rolls dont drag.
-
November 28th, 2014, 03:15 #29
- Join Date
- Sep 2014
- Location
- Michigan
- Posts
- 65
-
November 28th, 2014, 04:04 #30
hes kinda helpful isnt he...
I/we might need him again to point me in teh right direction....
My campaign\template_char.xml contains:
Code:<!-- PC Init Roll --> <template name="number_pcinitroll"> <basicnumber> <tooltip><text>Initiative. Double Click to Roll. 2d10+Speed. Highest Initiative Acts First.</text></tooltip> <rollable /> <anchored width="40" height="20" offset="0,100"> </anchored> </basicnumber> </template> <!-- END Init Roll -->
Code:<number_pcinitroll name="pcinit" source="char.init"> <anchored to="initframe" position="insidetopleft" offset="85,17" /> <script> function action(draginfo) local nodeWin = window.getDatabaseNode(); if nodeWin then local rActor = ActorManager.getActor("pc", window.getDatabaseNode()); Debug.console("rActor:"); Debug.console(rActor); Debug.console("end rActor!"); local nSpeed = window.Speed.getValue(); Debug.console("nSpeed:" .. nSpeed .. "!"); Debug.console(nSpeed); local nPenalty = window.penalty.getValue(); Debug.console("nPenalty:" .. nPenalty .. "!"); Debug.console(nPenalty); local nTotal = getValue(); local sDesc = "[INIT 2d10 + Speed - Armour Penalty] result "; local rRoll = { sType = "init", sDesc = sDesc, aDice = {"d10","d10"}, nMod = nSpeed-nPenalty }; ActionsManager.performAction(draginfo, rActor, rRoll); end return true; end function onDragStart(button, x, y, draginfo) return action(draginfo); end function onDoubleClick(x,y) return action(); end </script> </number_pcinitroll> <number_charabilitytemp name="Speed" source="abilities.speed.temp"> <anchored to="initframe" position="right" offset="100"/> </number_charabilitytemp> <number_armourpenalty name="penalty" source="ac.totals.penalty" />
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks