path_set() is used to attach an entity to a path that has already been created in WED, so it won't help you here.
To make an enemy follow a player, you'll need to create some artificial intelligence. The simplest way to accomplish this is to create a state machine, like this:
function state_wait()
{
// wait!
}
function state_hunt()
{
// hunt!
}
function state_attack()
{
// attack!
}
function state_die()
{
// die!
}
action enemy_act()
{
my.state = 1; // start in wait mode.
while( my )
{
switch( my.state ) // change my behavior based on my.state
{
case 1: state_wait(); break;
case 2: state_hunt(); break;
case 3: state_attack(); break;
case 4: state_die(); break;
}
wait(1);
}
}
As you can see, by simply changing my.state in enemy_act I can completely change the behavior of the enemy. When the individual states are programmed to change the entity's behavior based on certain criteria, this whole system becomes a state machine.
Obviously you'll need to fill out the various states I've set up here, or create some new ones to fulfill your needs. I persoanlly suggest you set up your state machine like this:
State wait: stand still. Look for the player with c_scan and/or c_trace. If he is found, my.state = 2. If my health <= 0, my.state = 4.
State hunt: move towards the player. Check to see if he is in range to be attacked. If he is, my.state = 3. If my health <= 0, my.state = 4.
State attack: wait a second. shoot at the player. Switch back to state 3. If my health <= 0, my.state = 4.
State die: play die animation, then disappear.