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

API Not working

I've added the API Scripts "Torch" and "5th Edition OGL by Roll20 Companion" and nothing at all has happened.  I've looked through these threads for over an hour and youtube videos are of no help. What is going on? I'm honestly debating on downgrading due to how confusing this whole thing is.
1576679348
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Can you describe a little better what you are doing that is not working? Those scripts supply you with the ability to do something, but neither one makes things happen on their own.
1576680492

Edited 1576680593
Understood on that end.  When attempting to program the macro according to the scripts that were provided for on the !Torch, it will randomly light up a token that it wasn't programmed to.  For instance: !snuff Holdir would act as !snuff Rosalie Seppa . I've double and triple checked and I have no idea why it isn't working right. And for some reason, Roll20 has slowed to almost a crawl
1576681231
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Gotcha. Unexpected behavior is different from no behavior at all. I just looked at the documentation for Torch, and it appears the !snuff Holdir shouldn't do anything at all. Unless the script has an undocumented feature, it says that it works off of token IDs, not names. This would be essential if a party of bandits all named "Bandit" only had one torch bearer, for instance. The command should be something like !snuff @{target|token_id} to snuff the torch of anyone you point at or  !snuff @{selected|token_id} for doing it for any token you have already selected at the time you run the command. Can you supply some of the macros you are using?
I see. So the only time I can run that command is when I have the token selected? So I wouldn't be able to make a macro to just select from the bar? !torch 40 20 yes Holdir  Holdir being the name of the token/character.
1576683808

Edited 1576683877
The Aaron
Roll20 Production Team
API Scripter
You could make a macro for specific tokens by finding their token id and then supplying it to the script: /w gm @{selected|token_id} -JK01234256sd2 !torch 40 20 yes -JK01234256sd2 Note: Token IDs are specific to a single instance of a Token.  Creating copies on the same or other pages will have a different Token ID. If you wanted to do the same sort of thing by name, you could use TokenMod: !token-mod --set light_radius|40 light_dimradius|20 light_otherplayers|on --ids @{Holdir|character_id} or !token-mod {{ --set light_radius|40 light_dimradius|20 light_otherplayers|on --ids @{Holdir|character_id} }} TokenMod supports using Character IDs, in which case it will change all Tokens that represent that Character.
Thank you Aaron and Keith for clarifying the scripts.  I really appreciate your support.
1576709081
The Aaron
Roll20 Production Team
API Scripter
No worries!
1576727340
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If you gave installed token-mod, here is a script that will create a dynamic lighting chat menu for you. It doesn't do the flicker effect of torch, but it does a whole lot more: /w gm &{template:npcaction} {{rname=Light & Vision}} {{description=[Snuff](!token-mod --set light_otherplayers|off light_radius|0 light_dimradius|0 light_angle|360) | [Sight](!token-mod --on showname light_hassight light_angle|360) | [Blind](!token-mod --off showname light_hassight light_angle|360) | [Spot](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_hassight|on light_angle|360) | [GM](!token-mod --set light_otherplayers|off light_hassight|off light_radius|5 light_dimradius|5 light_angle|360) [Moonlight](!token-mod --set light_otherplayers|on light_radius|15 light_dimradius|=-15 light_angle|360) | [Starlight](!token-mod --set light_otherplayers|on light_radius|7 light_dimradius|=-15 light_angle|360) | [Touch](!token-mod --set light_otherplayers|on light_radius|4 light_dimradius|=-5 light_angle|360) [Candle](!token-mod --set light_otherplayers|on light_radius|5 light_dimradius|0 light_angle|360) | [Lamp](!token-mod --set light_otherplayers|on light_radius|30 light_dimradius|15 light_angle|360) | [Torch](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) [Hooded Lantern](!token-mod --set light_otherplayers|on light_radius|60 light_dimradius|30 light_angle|360) | [Bullseye Lantern](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|90) [Darkvision](!token-mod --set light_otherplayers|off light_hassight|on light_radius|65 light_dimradius|=-5 light_angle|360) | [DV90](!token-mod --set light_otherplayers|off light_hassight|on light_radius|95 light_dimradius|=-5 light_angle|360) | [DV120](!token-mod --set light_otherplayers|off light_hassight|on light_radius|125 light_dimradius|=-5 light_angle|360) |  [*Light*](!token-mod --set light_otherplayers|on light_radius|40 light_dimradius|20 light_angle|360) | [*Daylight*](!token-mod --set light_otherplayers|on light_radius|120 light_dimradius|60 light_angle|360) | [*Faerie Fire*](!token-mod --set light_otherplayers|on light_radius|1 light_angle|3600 light_dimradius|0 statusmarkers|purple light_angle|360)}} Here is the output: Which if you use this trick , can be neatened up to look like this: Snuff - Removes all light and sight from a selected token Sight - Gives sight to a selected token, but does not cause them to emit light Blind -  Removes all sight from a selected token, but it can still emit light Spot -  Puts a spot of light around a character Good vision but very short range GM   - Puts a spot of light around a token that only the GM can see. Useful for highlighting a token on dark maps Moonlight -  Causes a token to shed a huge dim light, visible to all Good for outdoor at night. Tokens with darkvision see well short range, all tokens can see entire map dimly. Starlight - As Moonlight, but dimmer Touch   - Lets a character dimly see whatever is in touch range. Useful for simulating a character without darkvision. Candle | Lamp | Torch | Hooded Lantern | Bullseye Lantern - Apply these to a character or token to have them simulate the appropriate light. If it is a PC, make sure they have sight (The Sight button above will do this) Darkvision | DV90 | DV120 - Gives selected token Darkvision for 60, 90 or 120 ft. Light | Daylight | Faerie Fire - Simulates the light cast by one of these spells. Apply it to a token or character.