Author Topic: AttackedBy  (Read 1113 times)

Offline Symm

  • Planewalker
  • *****
  • Posts: 10
AttackedBy
« on: July 20, 2006, 08:32:01 AM »
Hi, After some research into the AttackedBy([ANYONE],DEFAULT) I came to the conclusion it only returns 'true' immediately after a target either hits or misses. Whilst this is OK if I want a script to react to an immediate attack, it doesn't let me script actions for when a char. is targetted by an enemy, and is running into attack the char.

Is there any other way to script a char. being targetted?

Similarly !AttackedBy([ANYONE],DEFAULT) returns 'true' most of the time, even if I'm being attacked. It only returns 'false' immediately after an enemy hit or miss. By then the script has already passed it as true.

This causes problems when I want to for example:-

See an enemy
and I'm not attacked
then
do condition x

Has anyone else experienced problems with AttackedBy?

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: AttackedBy
« Reply #1 on: July 20, 2006, 09:27:16 AM »
That's how it works, yes. There's no way to detect "the player ordered an attack on me". (This is reasonable in a sense: if you order an attack then change your mind, the creature might not turn hostile.)

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: AttackedBy
« Reply #2 on: July 20, 2006, 11:18:53 AM »
Sorry to hijack this thread, but what is the difference between
AttackedBy and HitBy?

HitBy will return true if there is actual damage, or when the to hit roll was successful?

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: AttackedBy
« Reply #3 on: July 20, 2006, 11:21:44 AM »
I'll go out on a limb and say that there is no difference. But I don't actually know.

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: AttackedBy
« Reply #4 on: July 20, 2006, 11:29:05 AM »
HitBy requires the hit roll to be successful, yes. It doesn't, I believe, require actual damage.

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: AttackedBy
« Reply #5 on: July 20, 2006, 12:18:23 PM »
hehe, in scripting, i more like trust Sim :)

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: AttackedBy
« Reply #6 on: July 20, 2006, 01:01:24 PM »
Quote from: SimDing0
HitBy requires the hit roll to be successful, yes. It doesn't, I believe, require actual damage.
Concur.

Quote from: Avenger_teambg
hehe, in scripting, i more like trust Sim :)
You should.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: