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

[Warning Geek Stuff Ahead] Prospective user/GM, questions about scripting and API robustness

Hi. I have been looking at Roll20 as a replacement for MapTool for running a GURPS campaign. The last time I ran GURPS on VTT I used MapTool (b70) and used a lot of scripting to speed up combat. This is very important to me, since although my players like combats, they like interaction more, and nothing stops a game dead in its tracks like shuffling through tables or doing a lot of head-math for every action, or taking hours for a fight with 4 mooks. I'd like to know how Roll20's API stacks up to MT for automation of standard calculations and condition tracking, and how much can one get away with with simple macro language. The things I found most useful that I haven't seen in other posts are: Determining range/speed modifiers based on how far the target moved in the previous turn and its current distance from the shooter (also requires tracking movement on previous turn) Storing currently held equipment and tracking ready/unready/draw/grip so I can later pull weapon statistics from the character token and apply it to combat rolling Autoresolving special powers, like a fright check requiring a contest between attacker and target, and subsequent results check on a table using the margin of success as a modifier (I wrote this specifically for the character that had the power; not a generic powers roll) Calculating shield damage on a successful block and tracking the damage on the player's shield Creating a library of weapons with standard characteristics so later on I can just say, "token X has weapon Y in its inventory" and having all variables pulled easily, which saves a lot of time arming mook NPCs as well as player characters (also includes unarmed maneuvers) Adding maneuvers to weapons so if a character learns a new way to hit a thing, I can add the modifiers dynamically Supporting arrays (allows all of the other nifty stuff to work). Note that MapTool didn't really support arrays; I had an invisible token on the field that had tons of variables stored to it in JSON blocks and had the other tokens call/write variables to it as if it was an array. It was necessary, since storing huge blocks of data on every token tended to blow up the Java VM. Yeah, seems extreme when I write it out, but I like keeping the simulationist aspect of the system in play without slowing down the narrative, if that makes sense. For context, some of my old scripts were posted on the old campaign blog: sample1 sample2 sample3 . I doubt I'll be able to recover most of them, since at this point MapTool barely opens without spitting out a Java error, so I'll be starting from scratch. I'm fine with giving up some of the truly absurd levels of automation, since I know Roll20 is not a game engine. I just want to make sessions smoother. Thanks for any insight.
1382173065
Gauss
Forum Champion
Moved to the API forum. :) - Gauss
resolving successes: use script roll comparisons - it does a brilliant job, though you might want to edit it to whisper you as the DM the results rather than the whole group. can use this script ( setting weapons ) to 'set' weapons/attacks/anything you like to generic use slots on each character sheet. needs to be modified for the system but easily doable. also, I have a gurps character sheet generator (not posted) but its not finished yet, I just add things to it as I go and realise I need more bits for it. I would recommend using commandtoken and commanddoors as well, they make using dynamic lighting very easy with doors (basically move a special token and it snaps back into place while simulating the door now being open - effects lighting layers and the map layer. autoresolving special powers is possible with macros, just need to write a macro using ?{selected|contested ability} linked to a character sheet and then use that ability while you (the dm) have the target selected. the library of weapons can be done using macros as well, just have it equip using the selected abilities to put the stats onto the character sheet using the equip script (once you've figured out what you want it to record and modify it). make one macro for each weapon and its easy to select token, click the relevant macro and have it change the stats to match those given by the macro.
Thanks; from what I can see on the equip weapon script it looks like you can assign new variable names to a token, which solves a bunch of problems. I'll poke about and see if I can build multivariable arrays.
1382215331

Edited 1382215538
Lithl
Pro
Sheet Author
API Scripter
All of those things are certainly achievable; some may even be functional without the API (such as the weapon library), although you'll need API to do all of them. While Roll20 isn't designed as a game engine, the API Sandbox can do almost anything you can accomplish in JavaScript -- there are a few limitations in order to protect the integrity and security of the VTT (and a few areas where the library needs expanding), but for the most part, you can go wild. While most games don't have a whole lot of automation flying around, you can certainly do it if you want. Heck, you could potentially create a bounded (or toroidial) Conway's Game of Life via the API. Actually, since the API can alter a page's dimensions, you could potentially make an un bounded Conway's Game, but the inability to generate new graphics via API could prove problematic, and shooting off a glider into an unbounded map might be dangerous to the campaign's stability. I can't say I've ever used MapTool, but you can certainly utilize arrays with the Roll20 API (I'm assuming you're talking about the data structure and not a feature of a specific game system). There's even a `state' object you can store information in which persists between game sessions.
Regarding arrays, what I'm looking at is dynamically assigning nested variables to objects. For instance, you have a library array called Weapons. In that array is an object called Broadsword, which has variables like Weight, SkillUsed, Value, etc., plus another object called Grips. A Grip may include an object called 1H, which includes variables like Reach, DamageMod, etc. Ideally, the GM creates new variable/object names at will, for instance a new weapon obect called "Sword of Munchkinism", with appropriate values, or a new variable called "RangeMod" if he realizes he forgot to make a sword throwable. If a character picks up a broadsword, the GM can click a macro that assigns a weapon/object to the player token, and then when the player uses it, weapon stats are read and assigned. I do like what I'm seeing, and think this can be achieved within the API framework with sone investigation.