Jump to content


Photo

How to send a creature to the nearest enemy?


  • Please log in to reply
2 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 03 March 2018 - 07:02 PM

And today's challenge is, Send a Creature to the Nearest Enemy! This is a minion, so its script can be written any which way and it can have any desired effects equipped. But Teleport Field didn't work in this case, or perhaps the situation wasn't right. As for actions, JumpToObject and MoveToObject only take script names or other definite objects. I need this guy to jump to a nameless and random hostile.

 

And while I'm at this, why don't I get summoning location near caster with any allegiances settings in effect 67? The G3 guide says that 4 and 6 should spawn the creature at the location of the caster, but this minion appears by the target no matter what I choose.



#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 03 March 2018 - 08:00 PM

As for actions, JumpToObject and MoveToObject only take script names or other definite objects.

I do believe it's your local environment playing tricks again. MoveToObject(LastBlah()) is an AI cornerstone, and I bet JumpToObject behaves no differently.

NearestXXX() does have a small problem of ignoring non-visible objects, however, maybe that's the case?


Edited by GeN1e, 03 March 2018 - 08:02 PM.

Retired from modding.


#3 temnix

temnix
  • Member
  • 983 posts

Posted 04 March 2018 - 10:06 AM

My environment is fine. There was a problem because of script insertion, but now that's fixed. I'm not saying that MoveToObject(LastSeenBy...) and so on doesn't work, but only that generic AI values don't do it. No JumpToObject(Nearest([ENEMY])).