Well, a lot of LATs ask me for light effect scripts for their levels, and I was told to start making my scripts more public so here's my first code gallery post:
Colorful windmill, probably my favorite light effect:
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.maxlights = 30;
onTimeout();
this.t = 0.05;
}
function onTimeout() {
this.t = (this.t + 0.05) - int((this.t + 0.05) / 3) * 3;
for(temp.i = this.t; temp.i < this.maxlights; temp.i ++) {
showimg(500 + temp.i, "light3.png", x - sin(temp.i + temp.i) * (temp.i / 5), y - cos(temp.i + temp.i) * (temp.i / 5));
changeimgvis(500 + temp.i, 0);
changeimgzoom(500 + temp.i, 0.5 + (temp.i / 90));
changeimgcolors(500 + temp.i, cos(temp.i + temp.i), abs(cos(temp.i > 28.8 ? temp.i:280)), abs(sin(temp.i + temp.i)), 0.5);
}
setTimer(.05);
}
and someone asked for an "infinity" sign..
PHP Code:
//#CLIENTSIDE
function onCreated() {
for(temp.b = 0; temp.b <= 50; temp.b ++) {
showimg(200 + temp.b, "light3.png", x - 2 - sin(temp.b) * 10, y - 2 - arctan(sin(temp.b) * cos(temp.b)) * 10);
changeimgvis(200 + temp.b, 3);
changeimgcolors(200 + temp.b, (0.16 + ((this.x + this.y) ^ 1.5) / 1000) / 1.7, 0.25, 0.16 + ((this.x + this.y) ^ 1.5) / 1000, 0.9);
}
}
And an X-Box sign (for lulz):
PHP Code:
function onCreated() {
for(temp.b = 0, temp.c = 402; temp.b <= 50; temp.b ++, temp.c --) {
showimg(200 + temp.b, "light3.png", x - 2 - sin(temp.b) * 3, y - 2 - arctan(sin(temp.b) / cos(temp.c)) * 3);
changeimgvis(200 + temp.b, 3);
changeimgcolors(200 + temp.b, 0.2, 0.25, 0.1, 0.5);
}
}