PDA

View Full Version : Slash Handlers



deer_buster
September 22nd, 2019, 06:10
Since the /die command is no longer handled by the registerSlashHandler, what exactly is it doing on the back-end that equates to the processDie function call in CoreRPG? Is it checking option settings like REVL, etc.? Does it call ActionsManager.actionDirect? How can we override what it does? I mean we could probably register the slash handler for die again, but what would we lose in that instance?

Moon Wizard
September 22nd, 2019, 23:40
The /die command is handled by the ChatManager global script in CoreRPG ruleset.

Regards,
JPG

deer_buster
September 23rd, 2019, 03:13
The /die command is handled by the ChatManager global script in CoreRPG ruleset.

Regards,
JPG

Really? I must really be misunderstanding it then...also, the ActionsManager.ActionDirect doesn't get called in FGU but does in FGC...

if (Interface.getVersion() < 4) then Comm.registerSlashHandler("die", processDie); end

Moon Wizard
September 23rd, 2019, 08:14
Ah, sorry, we’re talking FGU now. Didn’t check the forum I was in before answering.

The /die command is built into the client in FGU. The input doesn’t go through ActionsManager/ChatManager scripts at all; and the result/output is handled by ActionsManager just like any other “dice” type returned in onDiceLanded.

I believe you can override the default slash handler if you want.

If there’s a specific question you’re getting at, let me know and if can answer better when I’m sitting at computer.

Regards,
JPG

deer_buster
September 23rd, 2019, 14:08
I'm just trying to figure out what settings (e.g. REVL, et.al.) it will honor and how one would, for example, provide another setting that it would need to follow. I'm not sure just quite yet what use case I have, but right now all it seems to do is perform a throwDice


Also, FGC /die does a lot of checks before it actually calls Comm.throwDice

Moon Wizard
September 23rd, 2019, 18:21
The reveal option application is controlled by ActionsManager script; which also handles the general roll output messages, including the default dice roll output (including 3D dice rolls and /die rolls). See onDiceLanded -> handleResolution -> resolveAction -> createActionMessage chain.

The /die handler in FGU is much more complex, since it handles dice expressions with the die modes, set modes and math operations.

Regards,
JPG