PDA

View Full Version : seteffect


pig132
01-09-2007, 10:13 PM
Is it possible to have seteffect for just one area of a level? Like, for seteffect over a house..that part a color, the rest of the level be normal?

Falcor
01-10-2007, 12:15 AM
No, But you could simulate it with a big white image, and color it accordingly. Then use transparency mode (mode = 1 I believe).


//Serverside
function onCreated() {
setimg("some_white_image_thatyou_made.png");
dontblock();
}
//#CLIENTSIDE
function onCreated() {
drawaslight();
this.red = 0; this.green = 0; this.blue = .5; this.alpha = .5;
setcoloreffect(this.red,this.green,this.blue,this. alpha);
seteffectmode(1);
}


Could also be done with showpoly too, might even be more flexible



//#CLIENTSIDE
function onPlayerEnters() {
this.red = 0; this.green = 0; this.blue = .5; this.alpha = .5;
this.wd = 10; //How many tiles wide?
this.ht = 10; //How many tiles long?
showpoly(200,{this.x,this.y,this.x+this.wd,this.y, this.x+this.wd,this.y+this.ht,this.x,this.y+this.h t});
changeimgvis(200,3);
changeimgcolors(200,this.red,this.green.this.blue, this.alpha);
changeimgmode(200,1);
}

napo_p2p
01-10-2007, 12:22 AM
The showpoly would be the best way.

pig132
01-10-2007, 12:44 AM
Yeah, i tried it.. But when i try setting the alpha it stays set to .99 (pure white).

Angel_Light
01-10-2007, 12:47 AM
have you messed with seteffectmode()?

pig132
01-10-2007, 12:51 AM
No, i kept everything the same but this.alpha

Falcor
01-11-2007, 12:13 AM
Try this alternate code, it seems to work better for some reason:


//#CLIENTSIDE
function onPlayerEnters() {
this.red = 0;
this.green = 0;
this.blue = .5;
this.alpha = .5;
this.wd = 10; //How many tiles wide?
this.ht = 10; //How many tiles long?
showpoly(200,{this.x,this.y,this.x+this.wd,this.y, this.x+this.wd,this.y+this.ht,this.x,this.y+this.h t});
with(findimg(200)) {
red = thiso.red;
green = thiso.green;
blue = thiso.blue;
alpha = thiso.alpha;
layer = 3;
mode = 1;
}
}

Admins
01-12-2007, 02:33 PM
The seteffect thing is now just a fullscreen-showpoly with mode 3.

Update: fixed the description on the wiki.