| Scripting introduction | Beginner Lessons | Advanced Lessons | Conclusion |
What else can I do?
If you take a
look at “xpblues lesson 7” you will see some of the things that scripting can
do.
Scripts used
for it, lesson7.zip.
I added a clock
button. When clicked it shows a patch that I outlined and then moves the patch
along with the buttons to the right. When they get to the right it triggers
some fake animation using buttons that show up slowly.
Eventually the
cclock button shows on top of this. It then fades the clock button the same way
our original button does. It even uses the same scripts from earlier to do the
fade.
I tied the
slide of the other buttons to the position of the patch. At first I tried
moving them independently. This caused dancing buttons that would sometimes
fall off the edge of the window (oops). Using the patch as the point for moving
the other buttons did cause another issue. I was only able to move the patch
and two other buttons since I ran out of T variables. The system icon button
simply hides instead.
Going the other
direction caused some problems since I needed to do the animation first before
moving the buttons.
I used a script
tied to button 1. I got away with this since the script doesn’t have BUTNO in
it. I may have written a few extra scripts I didn’t need to make this work, but
it works and that is the whole point.
(Since I did
this section I figured out a way to move more buttons on the patch. That is for
you to figure out or you can e-mail me. ;)
Some of the
other things you can do is; have buttons pulse on mouseover, change the position
of the titlebar text, make the titlebar text 3D, change the borders, and more.
Why doesn’t this *&%#@$ script
work!?!?!
1) Check to
make sure that the syntax is correct. I highly suggest that you print out the
scripting.htm and check each command to make sure they are correct. I tend to
use SET incorrectly.
2) Are you
using the correct variables? For example; using a TEMP variable with an IF
command is not allowed.
3) Did you
use all caps all the time? Check and make sure.
4) Print
out your script. With long scripts is can be hard to tell what each section
does and if you have duplicated a section accidentally.
5) Check
what buttons use what scripts and what scripts are set in the presets.
6) Reload
your skin to make sure the changes you made worked.
7) “It
works, but only in one direction.” Check to make sure that when you set TEMP
you are not using the same number twice.
8) Don’t
have buttons on top of each other until you are sure the script is working
correctly. This can help identify where the problem is. If top button is not be
doing what it is supposed to do and the bottom button is doing it right, you
wouldn’t know it if they are stacked on top of each other.
9) Put an
alpha change for a button at the top of the script. If it takes place you know
the script is at least getting called. You can then move it down a section at a
time till you find the problem section.
Congratulations! You made it to the end of this tutorial. It became
much larger then I first expected. Hopefully you are now ready to make scripts
of your own. Also feel free to use the scripts from this and the skin. Just
don’t rip off my graphics ;-).
If you would like to learn more about scripting take a look at the
scripting.htm in the English folder under Skin Studio and also look at
GreenReaper’s “Docking Station” skin for a great example of pulsing buttons.
If you have questions or find errors please contact me,
Special thanks to Laurence Parry and Kris Kwilas for all their help
and patience.