Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   seteffect (https://forums.graalonline.com/forums/showthread.php?t=71341)

pig132 01-09-2007 10:13 PM

seteffect
 
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).

PHP Code:

//Serverside 
function onCreated() {
  
setimg("some_white_image_thatyou_made.png");
  
dontblock();
}
//#CLIENTSIDE
function onCreated() {
  
drawaslight();
  
this.red 0this.green 0this.blue .5this.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

PHP Code:


//#CLIENTSIDE
function onPlayerEnters() {
  
this.red 0this.green 0this.blue .5this.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.ht});
  
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:

PHP Code:

//#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.ht});
  
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.


All times are GMT +2. The time now is 10:30 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.