-
Remarks:
Entity.skill1..entity.skill20 are used for entering default properties in WED. Entity.skill21..entity.skill50 are used by the template scripts, except for entity.skill41..Entity.skill44, which are used for shaders. Entity.skill51..entity.skill100 are free for the user.
-manual
- Yoou can search in the manual for a patrol-example, search for "path_scan", there is a example of patroling, if you work in WED with paths, you can use this way of patroling:
// move along a path loop
// uses _FORCE, _MOVEMODE
action patrol_path()
{
// attach entity to nearest path
result = path_scan(me,my.x,my.pan,vector(360,180,1000));
if (result == 0) { return; } // no path found
// find first waypoint
var node = 1; // start at first node
path_nodepos(my,node,my._TARGET_X);
while (my._MOVEMODE)
{
// find direction
result = vec_to_angle(angle,vec_diff(temp,my._TARGET_X,my.x));
// near target? Find next waypoint of the path
if (result < 25) {
node = path_nextnode(my,node,1);
path_nodepos(my,node,my._TARGET_X);
}
// turn and walk towards target
actor_turnto(angle.PAN);
actor_moveahead(MY._FORCE);
wait(1);
}
}
- If the enemy checks, if something touching him, you can set entity.enable_entity = on
my.ENABLE_ENTITY = ON; // make entity sensitive for entity collision
my.event = bounce_event;
and in the function bounce_event, the other entity is called by "you", so you can check
define our_hero, 1;
function bounce_event()
{
if(you.skill22=our_hero)
{
//attack
}
}
I dont test it, it's just theory, but I hope, it helps =)