Hi everyone!
I hope you can help me because this problem is driving me mad >.<
Ok so in the game there are enemies moving towards you with a constant speed. Once they are close to you I want to closes one to chang his model und move towards me.
Now I managed to reach the two required functions seperatly but never together...
Like this it constantly scans and creates a new entity for each frame... well at least they change their model and move towards me and everything works (apart from the freaky effect and waste of resources.
c_scan(my.x, my.pan, vector(45, 45, 1500), IGNORE_ME | SCAN_ENTS); // scan for any entities that are closer than xxx quants to this entity
if (you) // a target was detected?
{
if ((you == player))//, || (you.skill1 == 1234))// an entity that verifies the conditions was detected || skill??
{
set(my,PASSABLE|INVISIBLE); //make normal fish invisible and passable to save memory and keep entity pointer (ent_remove removes pointer))
ent_create("mdl_wuerfelfisch_attack.mdl",vector(my.x,my.y,my.z),move_attack_fish); //create new model with attack finction
}
}
Now if I use ent_morph when I get scanned I don't get a freaky effect, but I can't change the entities function using my.event = "attack function";
So the model simply changes, but won't move towards me...
I guess I somehow have to make the enemy only scan until he finds me and then start the new behaviour. Sadly I could not find any tutorials on this

Help me Game Studio Forum, you're my only hope!