|
Apply to all entities with certain action
#266090
05/15/09 22:08
05/15/09 22:08
|
Joined: Jan 2008
Posts: 1,580
Blade280891
OP
Serious User
|
OP
Serious User
Joined: Jan 2008
Posts: 1,580
|
How can i apply transparancy to all entites with a set action ?
It is based on a variable which changes
My Avatar Randomness V2"Someone get me to the doctor, and someone call the nurse And someone buy me roses, and someone burned the church"
|
|
|
Re: Apply to all entities with certain action
[Re: Quad]
#266093
05/15/09 22:15
05/15/09 22:15
|
Joined: Jan 2008
Posts: 1,580
Blade280891
OP
Serious User
|
OP
Serious User
Joined: Jan 2008
Posts: 1,580
|
My Avatar Randomness V2"Someone get me to the doctor, and someone call the nurse And someone buy me roses, and someone burned the church"
|
|
|
Re: Apply to all entities with certain action
[Re: Blade280891]
#266097
05/15/09 22:48
05/15/09 22:48
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
ok then add this global var:
var transparency_var = 50;//this is the alpha variable. var transparent_bool = 1;//this is the on/off switch, i you set it to 0,no transparency, anything else = transparent
and in the while loop of action ad these: if(transparent_bool==0) reset(my,TRANSLUCENT); else{ set(my,TRANSLUCENT); my.alpha = transparency_var; }
3333333333
|
|
|
Re: Apply to all entities with certain action
[Re: Quad]
#266156
05/16/09 10:52
05/16/09 10:52
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
or give everything a different type so have #define _type skill1
#define actors 1
#define bushes 2
#define water 3
//etc... then in the action for each have action act_actor(){
my._type = actors;
} then everytime you need to change it call function alpha_actors()
{
you = ent_next(NULL);
while(you){
if(your._type == actors){
set(you,TRANSLUCENT); // make entity invisible
}
you = ent_next(you); // get next entity
}
} hope this helps *code untested*
|
|
|
|