View Full Version : Sending out Dice-results...
Oberoten
December 5th, 2014, 10:09
I am so close I can smell it...
I finally found how and where to integrate my wild-die mechanics from the old Ars Magica ruleset, BUT as it fires and shows the dice being rolled it still doesn't show my calculated result in the classic dice output message and add in the modifier-stack...
AKS, how do I trigger the final dice-roll message with my own dielist[nr].result inserted?
- Obe
Valarian
December 5th, 2014, 12:45
Sounds like you've got as far as I have.
dulux-oz
December 5th, 2014, 14:31
Sounds like you've got as far as I have.
Me too
Oberoten
December 5th, 2014, 17:05
I think the next place to look for me will be in the functions where you can basically send out a number when you give FG the /die 3 Xp line and it outputs it as "XP (3)" draggable.
- Obe
Moon Wizard
December 5th, 2014, 18:20
The dice table passed to the message functions (Comm.addChatMessage and chatwindow.Message) is detailed here (https://www.fantasygrounds.com/refdoc/Comm.xcp).
Basically, the dice value is a table. Within the table, you add one table for each "die". Within the "die" table, there should be a "type" field (string)("d4","d6",...) and a "result" field (actual result of die roll).
Regards,
JPG
Oberoten
December 6th, 2014, 22:18
Could you show me an example of a message?
Like
local msg = {}
local msg.type = {}
local msg.result = {}
msg.type{"d6"};
msg.result ={ 120};
msg.text = "Test";
Comm.deliverChatMessage(msg);
... but how do I add my absurd D6 result into the msg
Oberoten
December 6th, 2014, 22:32
*blepp*
OFc I figure it out a few moments after finishing that post..
local msg = {
text =" test"
dice = {
type={"d6"},
result={120}
}
}
Oberoten
December 6th, 2014, 23:26
Soo...
I placed my code such as it is now inside the onDiceLanded in manager_actions.lua ... how do I keep the original code from fiering? Return true or define the d10 as an action?
Moon Wizard
December 6th, 2014, 23:39
If you are building on CoreRPG, you could just register a handler in the ActionsManager, and output your result from the roll structure. There are lots of examples. Numenera and CoC are probably simplest example.
Otherwise, you would need to make sure you replace it with your version, and make sure there are no other calls to that script in the ruleset that aren't handled.
The drawback of replacing is that upgrades to that code will skip your ruleset.
Regards,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.