Closed phylll closed 2 years ago
Roll20 chat buttons with parameters are possible, with brackets HTML-encoded:
[PRESS](!mmm do myFunction("foo",1))
Encapsulating entire script
or, perhaps more sensibly, customize
blocks is also possible. This code ...
[DEFEND](!mmm customize !mmm set cOwnID="Yorric MacRathgar" !mmm end customize %{MacroSheet|defense})
... produces this to be executed upon a click on the button:
!mmm customize
!mmm set cOwnID="Yorric MacRathgar"
!mmm end customize
%{MacroSheet|defense}
Selecting the right token and defense script, at least for the GM, is still more of a hassle than necessary. With MMM 1.26+, a more seamless experience should be possible in which attack scripts would end with notifying the target's player and offering a tailored selection of available (and permissible, in terms of Midgard rules) defense options already tied to the target token.
Better flow:
if there is only one weapon: generate config details, and call the attack processor (main combat script)(dynamically calling a script that uses@{target|...}
or?{...}
to collect user input does not work via !mmm chat: %{sheet|ability}`)if there are several weapons:output weapons selection menu to chat (which allows the player to call the attack processor for the weapon of choice), filtered -- in case of defense weapons -- by applicability since some defensive weapons work only against certain offensive weapon types.m3mgd_configCall_[weaponLabel]
(w/o the brackets,weaponLabel
can contain spaces!) and uses it for the script call; if that attribute does not exist, it asks the user & creates it.