Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Creating Gui Elements

1389982677

Edited 1389982747
I am no coding expert, but I have started playing around with the API (and managed to make myself a few solid scripts that actually do something useful). And one of the issues I seem to be running into, is in order to get really complex behavior, I have to end up creating really long strings of characters that basically look like unix command-line. I'm fairly decent with that, but making custom macro-style things for use by my players, who are much less technically savvy (not stupid at all, they just don't work with code for a living), seems a bit difficult when they need to format inputs in very narrow ways to accomplish something. I'm curious if there is any way to create gui style elements to generate these commands. IE the user presses a macro button to force a single pop up to show up on the screen, that then has the X number of options they need to decide to use or not, and then a submit button when they are done. That could then generate the long string of barely readable API commands, that the scripts would key off of. The only command they would need to know would be something like "!gui attack" (which tells the system to create the specific UI Box i have defined elsewhere). I'm trying to reduce friction for players. Even basic macro set up for newer players can take some time.
1389984222
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
We have leverage record sheets... and CSS in handouts to do a bit of this... and token actions.... but currently there is no good way to make a GUI. I even played about with using a map... (token status to act a s check boxes and radio buttons) to do this. Hoping the new record sheets are able to be leveraged for this... One thing I think you really be good and go a long way: Whisper Direct command that supports hyperlinked API commands. That alone would be wicked powerful.
Just remember that you can create the macro for them and put it into their journal's abilities. Then check the option to show them as token actions and they will have their macro buttons automatically appear when they select their tokens. About the options to present them... the easier way so far is to ask them to input something (presenting them a default value) with the macro syntax. I usually give them one or two options max. I.E. ?{other bonus to hit|0} Of course in your script you have to check the value that they put in and maybe send a whisper to the GM showing it, just in case a goofy player put a 11 instead of a 1 ):P