Jump to content

Combat 2.0 question


Recommended Posts

When an avatar receives damage, all attached scripts with an on_damage event will have their events triggered, so they can modify the damage.

After all on_damage events have finished, all attached scripts with a final_damage event will have their events triggered. Damage can't be modified in this event.

The same applies to objects, of course.

Edited by Wulfie Reanimator
  • Thanks 1
Link to comment
Share on other sites

17 hours ago, Wulfie Reanimator said:

When an avatar receives damage, all attached scripts with an on_damage event will have their events triggered, so they can modify the damage.

After all on_damage events have finished, all attached scripts with a final_damage event will have their events triggered. Damage can't be modified in this event.

The same applies to objects, of course.

Okay but im not seeing that, unless im missing something.

Im wearing an item that has the on_damage event setup inside, with a owner say to feed back the result.

I have another object that is using llDamage to do damage to me.

At no point does the on_damage register, it skips straight to final_damage.

  • Thanks 1
Link to comment
Share on other sites

13 minutes ago, ItHadToComeToThis said:

At no point does the on_damage register, it skips straight to final_damage.

At least you're getting ONE of the damage events to run! (Not that I'm trying..)

ETA: Interesting that "final_damage()" says:

This event is triggered after all on_damage events in all scripts and attachments have processed and damage has been applied to the avatar or distributed to all seated avatars.

So, you'd think the above means that you shouldn't have "final_damage()" without the possibility of "on_damage()".

Edited by Love Zhaoying
Link to comment
Share on other sites

13 minutes ago, Rolig Loon said:

Have you tried using a much simpler script that has only an on_damage event, to see whether it's actually a script issue or whether there's something odd about your parcel/region?

Thats the script that im wearing. It just has on_damage and then an owner say to return V:"+(string)value. Nothing fancy or complex, just something simply to see where on_damage actually kicks in.

The other object on the ground is just a touch_start with llDamge(etc etc)

Link to comment
Share on other sites

6 minutes ago, Love Zhaoying said:

At least you're getting ONE of the damage events to run! (Not that I'm trying..)

ETA: Interesting that "final_damage()" says:

This event is triggered after all on_damage events in all scripts and attachments have processed and damage has been applied to the avatar or distributed to all seated avatars.

So, you'd think the above means that you shouldn't have "final_damage()" without the possibility of "on_damage()".

That would make more sense.

Damage is done, if the on_damage is triggered then modify for X reason such as resistance, armour etc, then move to final damage and return results maybe. Unless im reading this wrong.

Link to comment
Share on other sites

1 minute ago, ItHadToComeToThis said:

That would make more sense.

Damage is done, if the on_damage is triggered then modify for X reason such as resistance, armour etc, then move to final damage and return results maybe. Unless im reading this wrong.

Did you try disabling final_damage() to see if on_damage() starts firing?

I bet you found a bug.

ETA: Sorry, I missed Rolig's question and your reply above.

Edited by Love Zhaoying
Link to comment
Share on other sites

4 minutes ago, ItHadToComeToThis said:

Thats the script that im wearing. It just has on_damage and then an owner say to return V:"+(string)value. Nothing fancy or complex, just something simply to see where on_damage actually kicks in.

Ah, I misinterpreted your OP to mean that you had both an on_damage and a final_damage event in the same script.  So, then, have you tried taking your scripted object to a different region?  I'm still fishing here, trying to be sure that it's the script and not something peculiar about the surroundings.

Edited by Rolig Loon
  • Thanks 1
Link to comment
Share on other sites

1 minute ago, Rolig Loon said:

Ah, I misinterpreted your OP to mean that you had both an on_damage and a final_damage event in the same script.  So, then, have you tried taking your scripted object to a different region.  I'm still fishing here, trying to be sure that it's the script and not something peculiar about the surroundings.

Good idea, who knows what works / doesn't work on which RC channels for the new Combat stuff?

Link to comment
Share on other sites

  • Lindens

There are some cases where `on_damage` does not fire. If I forgot to I should put the caveats on the wiki page.

  • If an avatar is sitting on an object or vehicle, and that object does damage directly to the sitter (llDamage) on_damage and final_damage events in the object will not fire. They both should fire in the targeted avatar's attachments.
  • If an attachment does damage to the avatar that it is attached to, on_damage events in attached items will not fire, just final_damage. 

This prevents a possible loop where llDamage may be called from on_damage triggering another on_damage.

 

  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Rider Linden said:

This prevents a possible loop where llDamage may be called from on_damage triggering another on_damage.

Restated, should this help prevent an object from damaging itself, while still allowing it to damage the attached avatar?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...