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

Can I get some pointers for API?

So I am completely new to the whole API scripting stuff.  I have looked up a couple of videos and have uploaded a few scripts that have been already made, but nothing is working in my game.  I am looking at starting what I hope is simple like ammo tracking and xp distribution.  The tutorials I have seen on youtube and have read on here have not helped me really much at all for a complete beginner.
1504458876

Edited 1504458925
vÍnce
Pro
Sheet Author
What game/sheet and scripts Cody?  The one-click API scripts available from your campaign game settings are the easiest way to start using scripts.  (you can manually copy/paste scripts as well, but they will not be automatically updated in the future) Choose your script from the list and "Add Script" at the bottom of the script's instructions. Follow the directions given to use the script in your game.
I am running a 5e game with the 5e OGL sheets.
Maybe I am doing something completely wrong but I tried the already loaded ones (a couple at least and all I am getting is an error.  Sorry with the total noob stuff, but I would really like to get this stuff working. For reference, the error message generated was: TypeError: Cannot read property 'Session XP' of undefined TypeError: Cannot read property 'Session XP' of undefined at recordXP (apiscript.js:881:38) at HandleInput (apiscript.js:1105:37) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:146:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1510:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489) at Zd.Ld.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:94:425) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:111:400 This was the error message that I got on the script page.  Have restarted the game, resaved the script and still nothing.  I really hope this has nothing to do with the other issues with roll20 that nobody can resolve....
1504465921
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, from that attribute, I'm guessing you're trying to use my EasyExperience Script?
I just went to settings->api settings->then chose various ones that seemed like they could be useful.  Nothing has worked thus far.
1504471364
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For EasyExperience, did you follow the directions for setting up the script before attempting to award xp?
As far as I read yes.  Save the script and then type in the instructions !xp etc right?
1504472365
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You also need to access the config menu (via !xp config) and setup the attributes that the script looks for to match you character sheet of choice. Can you also make sure that the script's character sheet got created properly? There should be a sheet called ExperienceThresholds in your archived characters folder at the bottom of the journal. I've never had it not create it, but something hinky is going on based on that error.
Alright got it for the experience.  Thank you!
1504478311
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
excellent. What other scripts are you trying to use?
Well I don't know if this is a script necessarily, but with the dynamic lighting I am trying to mess with it a bit so that I can just show an area without a token if possible.  Like I have a world map that I want to only show where they are and then have the rest blacked out until needed (hopefully that makes sense).  Is there a way to do this?
1504533270
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, for something like that, you're better off turning DL off, and using the fog of war. It's possible to do it with DL, but can be a pain.
Cody B. said: Well I don't know if this is a script necessarily, but with the dynamic lighting I am trying to mess with it a bit so that I can just show an area without a token if possible. &nbsp;Like I have a world map that I want to only show where they are and then have the rest blacked out until needed (hopefully that makes sense). &nbsp;Is there a way to do this? As Scott said, its doable using dynamic lightning but a bit of a hassle. A simpler way is to adopt the World Map Discovery Script by Stephen L. <a href="https://app.roll20.net/forum/post/2391505/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/2391505/slug%7D</a> I think its available under one-click API install.
The best practice is to make a dummy campaign, load scripts and mess about with them. Also The Aaron , scriptomancer level 20 is the best way to understand what is going on. Frankly I don't know why Roll 20 has not recruited him as an employee. I would have hired him years ago.
1504551028
Ziechael
Forum Champion
Sheet Author
API Scripter
There aren't enough platinum pieces to afford him I would presume lol
1504554488

Edited 1504554558
The Aaron
Pro
API Scripter
Ziechael said: There aren't enough platinum pieces to afford him I would presume lol Pretty much exactly. &nbsp;With 10 mouths to feed, I can't take a pay cut simply "for love of the game". &nbsp;(I have to supplement by go adventuring as it is!)