View Full Version : Can "Rolls" be accessed from LUA to ... roll?

May 13th, 2021, 06:09
I think I recall Damned saying that the only way to roll rolls was pressing the button. If so, that is fine - I will try creating my first non MC roll later ;). But I figured I'd check.

Basically, I will have a /swsave that get's it's target number programatically based on race/class/level and some situational factors. That's fine for when I want them to manually trigger it. But I already coded a /swspell that either says X casts y or it says that and rolls damage dice either static or level based. I figure I could add to that that it triggers a save roll on the target(s) but not sure if can work it to use the /swsave or if need to do my own non MC action for that.

If know of examples if it IS allowed, feel free to name em.

Moon Wizard
May 13th, 2021, 06:12
If you are using the CoreRPG roll actions system internally, then you can use ActionsManager.performAction with a nil for the draginfo parameter. (See 5E for many examples.)

If you want to access the API directly, and manage yourself; there is a Comm.throwDice API call.


May 13th, 2021, 13:30
Just have a look at the code that runs when the Roll button is clicked.