I made a derivative script off AUM 63, Q&A re: triggers (I think) by George Pirvu and the triggers work real well but I need to place both a Load and Remove trigger entity next to each other or within their respective ranges.
Problem is they would then cancel each other out so I am thinking that if they had unique ID's and could compare which way the player was moving (either from or towards them) then the right trigger will activate when required.
How would I go about creating this?

Heres a working code example[EDIT]Just discovered that the script doesn't work but would still appreciate help )

Code:
 var tube_pos[3] = 0,0,0;//insert coords here
var Rswitch = 1;
var temp1;
define trigger_distance1, skill1;

action room1
{
while(player == null){wait(1);}
my.ambient = - 100;
my.TRANSLUCENT = on;
my.alpha = 0;
while (1)
{
if (vec_dist(player.x, my.x) < 200)
{

if(my.alpha < 100)
{
my.alpha += 10 * time_step;
}
if(my.alpha > 100)
{
my.alpha = 100;
}
}
else
{
if(my.alpha > 0)
{
my.alpha -= 10 * time_step;
}

}
wait (1);
}
}


action TRremove_room1()
{
// my.passable = on;
// my.invisible = on;
while (player == null) {wait (1);}
if (my.trigger_distance1 == 0)
{
my.trigger_distance1 = 200;
}
my.skill40 = 0;
while (1)
{
if (vec_dist (my.x, player.x) >= my.trigger_distance1)
{
my.skill40 = 1;

if(my.alpha <= 0)
{
my.alpha = 0;
sleep(1);
ent_remove(me);
Rswitch = 1;
}
else
{
if (vec_dist (my.x, player.x) < my.trigger_distance1)
{
my.skill40 = 0;
}

}
}
wait(1);
}

}

action TRload_room1
{
// my.passable = on;
// my.invisible = on;
while (player == null) {wait (1);}
if (my.trigger_distance1 == 0)
{
my.trigger_distance1 = 100;
}
my.skill40 = 0;
while (1)
{
if (vec_dist (my.x, player.x) < my.trigger_distance1)
{
my.skill40 = 1;

if(Rswitch == 1)
{
temp1.x = tube_pos[0];
temp1.y = tube_pos[1];
temp1.z = tube_pos[2];
ent_create (tubeAccS_wmb, temp1, room1);
Rswitch = 0;

}
else
{
if (vec_dist (my.x, player.x) > my.trigger_distance1)
{
my.skill40 = 0;
}

}
}
wait (1);
}
}



Last edited by Nems; 02/03/08 16:23.