i guess you should put the LOS-condition before the Pick Closest-condition, otherwise you might pick nothing.
for next target: you could tag the currently targetet enemy in some way (e.g. set a private variable 'isTarget'); that way you don't have to constantly run the targetting procedure, but can simply pick him. for next/prev target, you probably want a mechanism to pick the next enemy clockwise/counterclockwise to the target (with the player as center). there are two things that will help you: the AngleDiff( a, b ) expression and the 'Is Angle Clockwise to...' condition. you will probably need to put the enemy object into two different families, too, which is a workaround sometimes needed for picking 2 objects of the same object type. this sounds confusing, so here's an example:
let's say the currently targetet enemy has a pv called 'isTarget' that is set to one. let's also say that the enemy object is member to the families 'RED' and 'BLUE'.
[ul] [li]pick 'Red' where 'isTarget' = 1[/li]
[/ul] - pick 'Blue' where 'isTarget' = 0
- For each 'Blue' (ordered) by
AngleDiff( Angle( player.X, player.Y, Red.X, Red.Y),
Angle( player.X, player.Y, Blue.X, Blue.Y)) (ascending)
- Is Angle Clockwise?
( Angle( player.X, player.Y, Red.X, Red.Y)) to
(Angle( player.X, player.Y, Blue.X, Blue.Y))
- Is Red('isTarget') Equal To 1?
-> this is your man!
-> Set Value Blue('isTarget') 1
-> Set Value Red('isTarget') 0
[/code:13yd4b4x]as you can see, we need the two families to pick the correct enemy objects without loosing track of the current target.
[h2]i hope this works[/h2]