I am using vb.NET part of VS.NET, and no matter how many times i check to see if targetanimal is nothing ( targetanimal being animalstate of the current target ) i always seem to get OrganismNotVisibleException, and my creature ends up attacking nothing or eating nothing until it dies.
anyone know how i can check if the org is visible ( reliably ) and also i seem to find that i get out of range exception too, even though i use withineatingrange(targetanimal) etc... i have had to change to distanceto(taretanimal) <= 10 in order to make it more reliable,
thanks in advance

i am wondering...
Bác Ba Phi
target = (AnimalState) LookFor(target); //Try using this in your LoadEvent
target will remain your target's AnimalState if it's visible (dead or alive). If doing that doesn't solve your problem try improving a little more your AttackCompletedEvent like this:
target = (AnimalState) LookFor(target); //Translate to VB.NET, place it here, just to be sure
if(!target.IsAlive) //if target is dead
if(WithinEatingRange(target)) //if target is within eating range
BeginEating(target);
else
//move to dead target for eating
else//target is alive
//since you just attacked in this turn, you must wait for the next turn to attack again
//here you may want to move toward your target in case he is escaping
//be sure to check you are WithinAttackingRange(target) before you attempt to attack
end if
I hope this helps. If not, please let us know to help you a little more.
Ivan Ivanyuk
Try
FindAnimal(organism)
organismVisilbe=True
Catch exc As Exception
organismVisible=False
End Try
I'm a beginner, so i'm not EXACTLY sure if it will work. Good luck!
Rick Schummer
Dubloth
Lam Chan
if not target.Isalive then
see if you can eat it ( ie is it visible ) if not findnewtarget
else
attack
end if
Hawk390
hope this helps.
Vivek Dalvi-MSFT