Jump to content

Getting enemies to approach and attack


temnix

Recommended Posts

I'm beachcombing here for a way to make enemies appear, head in the direction of the party and, upon seeing the PCs, attack. I know a couple of methods, and both require sicking the enemies on specific objects. This is to say, unless the party is in sight of the enemy, commands like ActionOverride("enemy",Attack([PC])) won't work. Walking towards the party to fight requires a target like Player1, which is how standard scripts are content to do it. The drawback of this is that on their way to Player1 enemies will silently ignore the rest of the party and summoned minions, who will, of course, take the chance to pound on them as they trot by. What is worse, enemies won't stop until they have rubbed right against Player1, and if he moves, they will follow him, even around the map. This happens when either an attack command is given or the creature is simply told to approach Player1 (more appropriate for spellcasters) with MoveToObject. "Approach" means "bump into," and they bump and obstruct each other as well. This action is practically uninterruptible, even without the NoInterrupt bit.

I've tried a different way: MoveToObjectOffset. This is a little better in that the enemy can be told to stop a ways from Player1, and then his fighting instincts will awaken. But there is no telling what offset coordinates to give. MoveToObjectOffset(Player1,[70.70]) makes the creature walk to a point a short distance to the right and below Player1, but if the monster happens to be coming from the upper left or another direction, he is going to go around Player1 to that point, and only there awaken, if he is still alive by then. What I'm looking for is some way to make an enemy head for Player1 and, upon seeing him or just at some range stop and draw. I could arrange for this in an individual creature's script easily, but this question is not about specially scripted creatures. I'm looking for a method that would work for all monsters, e.g.:

CreateCreatureObjectOffScreen("skelet"Player1,0,0,0)
ActionOverride("skelet",MoveToObject(Player1))
CreateCreatureObjectOffScreen("skelet",Player1,0,0,0)
ActionOverride("skelet",MoveToObject(Player1))
CreateCreatureObjectOffScreen("skelet",Player1,0,0,0)
ActionOverride("skelet",MoveToObject(Player1))

This sort of thing creates three skeletons in a seqence, each passing its script name "skelet" to the next, each ordered to go to Player1... ignoring everything... and cuddle in his brawny embrace. And they get there, but it's lousy. I want something better. Possibly AttackReevaluate(Player1,1), so that they stop right away? Magic-users and priests shouldn't spend any time on physical attacks, though, or come so close.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...