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 .
×
May your rolls be chill this holiday season!
Create a free account

[Scriptlet] Fade

1762560232

Edited 1765497404
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The code for this is in One Click. This is a little standalone scriptlet that does one thing. It fades images in and out by incrementally changing their opacity. The controls are simple: Commands !fade --in|<seconds>   !fade --out|<seconds>   !fade --in --all   !fade --out --all   <seconds> = optional fade time (default 1 second).   --all = affects all graphics on the current page.   Examples:   !fade --out           Fade selected to 0% over 1s   !fade --in|3          Fade selected to 100% over 3s   !fade --in|3 --all    Fade in all graphics on page over 3s   Graphics fade over 20 opacity increments but you can edit this in the code if you want it smoother.   All affected graphics update simultaneously.   Demo:
1762571833
Gold
Forum Champion
Nice little visual. Why not go ahead and enter the One-Click for greater findability in the long run?
1762618610
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Probably a good idea. I might leave it here for a week or so to gather any feedback, first.
1762624306
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Example: Nick O just fixed an issue that kept it from working with SelectManager. Thanks, Nick!
Having trouble. api gives me error but I cant see what`s wrong !fade --out {&select cursedAltar*, +layer=map} receving this error (From Fade): You must specify --in or --out.
1764432723
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It looks like you are using Selectmanager. I think we’ll need timmaugh’s input. Checking
1764437641
timmaugh
Forum Champion
API Scripter
Ozzy said: Having trouble. api gives me error but I cant see what`s wrong !fade --out {&select cursedAltar*, +layer=map} receving this error (From Fade): You must specify --in or --out. Hey, Ozzy... That syntax looks correct to select all of the cursedAltars on the map layer. I think what you have going on is that there is a space before the {&select} tag. The space is being interpreted as part of the name of the previous argument, which means it's not finding the "out" argument, it's finding the "out " argument.  If that's the problem, Keith should be able to fix it in the fade script, but we might have to wait until after the holiday weekend. For now, you can test it and let us know by removing that space and running the command again. If it works, then we've pinpointed the source of the problem.
Having the same or a similar problem as ozzy.  !fade —in {&select rock*}          (From Fade): You must specify --in or --out. !fade —in{&select rock*} (From Fade): You must specify --in or --out. !fade —in|1 {&select rock*} (From Fade): You must specify --in or --out. !fade —in|1{&select rock*} (From Fade): You must specify --in or --out. Tried it with and without the space as per Timmaugh's reply to Ozzy. Tried the fade time adjustment based off of Nick O's video comment suggestion. I'm pretty stumped. Any help would be greatly appreciated. 
1764811609
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Lord Rahl! I am not able to duplicate this behavior. Here is an example, using Secret Agent Perry the Platypus. Two copies, one selected, one not. Have you used the latest version of the code above, or is there a better test I could run?
Unless it has changed today within the last few hours, Yes i used the latest version. I have also tried completely deleting and reinstalling both it and the metascripttoolbox. !fade --in|1 {&select rock*} just gave me the " (From Fade): No graphics selected. Use --all to affect the entire page." when I had nothing selected. I tried recreating your experiment with only one of the tokens selected and the other not. If I do that, the one selected will fade in but not the other hidden ones. If I get rid of the pipe and second specification in any configuration it says " (From Fade): You must specify --in or --out." 
1764818675
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Weird. I'm not sure what the issue could be. My video showed on Perry selected, but I also tried it with both and neither, and was unable to generate an error message. I'll check with timmaugh. There might be a Zero Frame setting that needs tweaking or something for SelectManager . As a double check: This is a Jumpgate game running on the Experimental server? Not sure what difference that might make, but it was my testing environment.
1764819132
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
OK, I did a compare on my local copy and found a few discrepancies from the posted copy. I was certain they were in agreement, but I probably did a double switch on myself. I have updated the top post with my local copy, which seems to be working. Give that a shot, and sorry for any frustration.
1764821049
timmaugh
Forum Champion
API Scripter
If keith's new code doesn't fix it, there are some steps to try that can help us narrow down what might be going wrong. (If necessary, I don't mind jumping into someone's game to investigate... but let's see if it has to come to that.) The simplest test is just to m odify your command line to add the {&log} tag to the end of it: !fade --in {&select Actual Cannibal*} {&log} That will output what happens during each metascript during each cycle of the metascript loop, and it will show the message that is eventually released from the loop -- which is what the fade script will see. You can post a screenshot, here, of what you see. We're looking for SelectManager to have a green dot, then we want to look at the Outro section to see the command line.
This is not a legacy game. from what I can see they don't have the jumpgate tag on them any more? the old ones just say legacy correct? I have updated my script and am getting the same result. If i do it without specifying the time frame nothing happens (any selected or not). If i specify the time frame and i have  a token selected then the selected token will fade in but not the others.   
I do also have token mod installed to allow for the status markers macros that Nick O showed on <a href="https://www.youtube.com/watch?v=plAljQG3ovE" rel="nofollow">https://www.youtube.com/watch?v=plAljQG3ovE</a> &nbsp;. I can see that in his video showing how to integrate both fade and metascript that he still has it (token mod)installed, But that is the only other thing i can think of that could be a variable here.&nbsp;
1764907005
timmaugh
Forum Champion
API Scripter
Yeah, TokenMod shouldn't be impacting this. Would it be possible to invite both Keith and I to your game, then GM us when we get there? Not that we'll be in at the same time, but either of us might get a chance to look.
Done, anything you two can figure out would be greatly appreciated. I really like the idea of this working. Thanks for all the help you've already given me.&nbsp;
1765033347
timmaugh
Forum Champion
API Scripter
I think we got this sorted. For those having this issue and watching for a solution, Keith should be able to get the code in the original post updated at some point. If you need this interaction to work before he gets a chance to post the update, you can REMOVE the Fade script, then add it again. The problem occurs if Fade, as currently constructed, is installed before the Metascript Toolbox. Having it installed *after* the Toolbox allows things to function as you would expect. (After the Fade code is updated, this requirement will not matter, but this can get you up and running if you have a pending game!) For those who really want to get down in the weeds... ...script execution is typically a matter of the order of installation. First installed = first processed when a command comes through. Metascripts, however, can be installed *after* normal scripts and yet still process *before* those normal scripts because of a quirk of how the sandbox handles things. In this case, Fade happens to be constructed as a metascript, meaning that if it is installed before the Toolbox, we're back to the order of installation determining the order of execution. Once Keith can change Fade to be a "standard" script, the order will no longer matter, and this Toolbox+Fade interaction will work properly no matter the order.
1765055818
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hey Lord Rahl, I have updated the code in your game with suggestions from Timmaugh and from Nick Olivo. It's cleaner and better now, but I think I may have found the reason for the initial problems you were having. Here are your macros: Lord Rahl said: !fade —in {&amp;select rock*} &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; (From Fade): You must specify --in or --out. !fade —in{&amp;select rock*} (From Fade): You must specify --in or --out. !fade —in|1 {&amp;select rock*} (From Fade): You must specify --in or --out. !fade —in|1{&amp;select rock*} (From Fade): You must specify --in or --out. My guess is that you have some sort of autocorrect going on that replaces -- with&nbsp;—. In all macros, a double hyphen has been replaced with an em dash. I discovered this while testing, since I was using your macros verbatim and only changing the name to match my test tokens. Please check to see if your macros work correctly now, and if you have no issues, I will post the new code in-thread.
It's all fixed now. Thanks again to both of you for giving me your time! I'm so excited to be able to integrate this into my games. Your help is greatly appreciated. Great mods and now they're playing in perfect harmony. Happy Holidays everybody!
1765073761
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Excellent. Thank you to Timmaugh and Nick Olivo for their help and suggestions, and think you Lord Rahl for making me look harder at the script to make it better. The code in the top post has been updated. I will try to get this into the next One Click merge.
Morning guys, I had the exact same issue as Lord Rahl so have been following this post with interest and after removing and re-adding the Fade script as suggested by Timmaugh, that did the trick! Thanks both and a very neat script Keith!
1765147265
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The code has been submitted to the One-Click repo. I'll remove the in-line code above once it has merged.
1765497436
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The code has been merged. This script may now be loaded via One Click install.