Posted By: Blade280891
Apply to all entities with certain action - 05/15/09 22:08
How can i apply transparancy to all entites with a set action ?
It is based on a variable which changes
Posted By: Quad
Re: Apply to all entities with certain action - 05/15/09 22:15
one certain action or diffrent actions?
Posted By: Quad
Re: Apply to all entities with certain action - 05/15/09 22:48
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;
}
Posted By: MrGuest
Re: Apply to all entities with certain action - 05/16/09 10:52
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*
Posted By: MrGuest
Re: Apply to all entities with certain action - 05/16/09 10:54
or write each of their handles into an array at the start of their action