-
September 15th, 2013, 22:10 #1
- Join Date
- Jun 2013
- Location
- TX
- Posts
- 137
Error message when attempting to call ChatManager.throwDice
Working on getting the stuff I set up for live to work with 3.0, and I'm running into something I don't understand. This may be more of a Workshop type question, as I don't doubt that it is more of a problem with something I'm doing than with 3.0 itself.
I am set up so that if a skill is doubleclicked, this function is called:
Code:function onDoubleClick(x, y) window.rollDice(); end
Code:function rollDice() local desc = label.getValue(); ChatManager.throwDice("dice",{"d6"},0,desc); end
This worked fine in 2.9.4, but in 3.0 it elicits an error:
Script Error: [string "campaign/scripts/charsheet_skilllistitem.lu..."]:17: attempt to call field 'throwDice' (a nil value)
I'm working with the CoC ruleset over Core. ChatManager is defined in Core, and in there, throwDice() is as follows:
Code:function throwDice(type,dice,bonus,desc,customData) if control then control.throwDice(type,dice,bonus,desc,customData); end end
Thanks!
-
September 15th, 2013, 22:24 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
The Call of Cthulhu ruleset on v3.0 has been rewritten to layer on top of the CoreRPG ruleset in order to bring it up to parity with other rulesets. So, ChatManager.throwDice no longer exists in CoC in v3.0.
Regards,
JPG
-
September 16th, 2013, 03:06 #3
- Join Date
- Jun 2013
- Location
- TX
- Posts
- 137
Aha, thanks!
I found some code elsewhere in the ruleset and made a couple small changes. I confess don't entirely understand it, but it seems to work!
Code:function action(draginfo) local nodeWin = window.getDatabaseNode(); if nodeWin then local sSkill = window.label.getValue(); local nTotal = getValue(); local rActor = ActorManager.getActor("pc", nodeWin.getChild("...")); local sDesc = "[SKILL] " .. sSkill; local rRoll = { sType = "skill", sDesc = sDesc, aDice = {"d6"}, nMod = 0 }; 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
Last edited by cscase; September 16th, 2013 at 03:10.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks