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

Error with token-mod and delay script

November 17 (4 years ago)
ThiagoR
Sheet Author

I don't know if it's a syntax error but I can't get the token-mod to send the selected token to the gm layer when I use it in conjunction with delay, follow the commands used:

!delay 1 --!cfx burst-acid @{target|destino|token_id} @{target|destino|character_id}
!delay 2 --!sfx song:explo2 action:play unique:true volume:20
!delay 3 --!token-mod --ids @{selected|token_id} --set layer|gmlayer


Does anyone know how to fix?


November 17 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Do you have Players can IDS turned on for TokenMod?  By default, TokenMod treats the API user as unprivileged, like a regular user. 

November 17 (4 years ago)
ThiagoR
Sheet Author

I am testing only with my GM profile I have not tested with players yet, I was unaware of this token-mod pattern.

November 17 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Run:

!token-mod --config players-can-ids

once, that will probably fix it.

November 17 (4 years ago)
ThiagoR
Sheet Author

It worked! Thank you! My games will be better thanks to you!

November 17 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

HAHAHA, no problem. =D

November 21 (4 years ago)
ThiagoR
Sheet Author

Hey Aaron, could you help me again? My son's little space mouse needs to use his stealth and for that I would like to apply a fx effect, a sound and leave the token opaque, I am using the token-mod to exchange the current token for an opaque one (the opaque token is in my library), the code works except for the opaque token that doesn't appear. If I remove the! Delay from the mod token line then the opaque token appears but in a different order (it becomes opaque before the fx effect and the sound).

Ah I used !token-mod --config players-can-ids

!delay 1 --!sfx song:furtividade action:play unique:true volume:20
!delay 2 --!cfx burn-death @{selected|token_id}  @{selected|token_id}  
!delay 2 --!token-mod --ids --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/179847516/DGmGZaHIg7_z2mWkjKJ9_g/max.png?1605988681
November 22 (4 years ago)

Edited November 22 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

You need to pass the token id after --ids:

!delay 1 --!sfx song:furtividade action:play unique:true volume:20
!delay 2 --!cfx burn-death @{selected|token_id}  @{selected|token_id}  
!delay 2 --!token-mod --ids @{selected|token_id} --set imgsrc|https://s3.amazonaws.com/files.d20.io/images/179847516/DGmGZaHIg7_z2mWkjKJ9_g/max.png?1605988681

Hi, I'm gonna catch a ride on this post and.. 
I'm trying to do the same, but
a) can't find the !delay api anywhere,
b) it doesnt work.

I've been around google for hours now,
but couldn't make work.

working - 

/fx explotion_2 @{selected|token_id}
!token-mod --ids -MQGkGig-1OlLmsLah6U --ignore-selected --set layer|objects

Not working - 

/fx explotion_2 @{selected|token_id}
!delay 2 --!token-mod --ids -MQGkGig-1OlLmsLah6U --ignore-selected --set layer|objects

Any ideas? help? please?.. 

So, Obviously, 2 seconds after I've post my question,
I've found the answer.

Steps (Hoping it might help others newbs..)
1 - The !delay API is not in the library. its in here -Link- , by this guy named MyRoll20Stuffs
and you need to create a "new API", and copy-paste it.

2 - AFTER you "create" the API, you need to change the token permissions to "On",
by using !token-mod --config players-can-ids

afterwards, it worked like a charm.
Now when I click my Mind Flayer, (as if having one is not enough),
My players get a flash of a full-map-size-picture of it's face, to the face!!

P.s.
Thanks to The Aaron.


January 05 (4 years ago)
The Aaron
Roll20 Production Team
API Scripter

Ah, great! =D  Let us know if you run into any other issues.