ItHadToComeToThis Posted September 4 Share Posted September 4 So, the on_damage event. How do i trigger it? I have tried to throw damage at myself and nothing happens. The final_damage works fine, but how do i trigger on_damage? 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 4 Share Posted September 4 According to the wiki, "This event is triggered when damage has been inflicted on an avatar or task in the world but before damage has been applied or distributed," so it may be a matter of timing in your script. Take a look at Rider's example script at https://wiki.secondlife.com/wiki/On_damage#Examples 1 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted September 4 Share Posted September 4 (edited) 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 September 4 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
ItHadToComeToThis Posted September 5 Author Share Posted September 5 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. 1 Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 5 Share Posted September 5 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? Link to comment Share on other sites More sharing options...
Love Zhaoying Posted September 5 Share Posted September 5 Can one do damage to one's self? Or, does that require fanciness (for landmines, grenades, etc.)? Link to comment Share on other sites More sharing options...
Love Zhaoying Posted September 5 Share Posted September 5 (edited) 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 September 5 by Love Zhaoying Link to comment Share on other sites More sharing options...
ItHadToComeToThis Posted September 5 Author Share Posted September 5 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 More sharing options...
ItHadToComeToThis Posted September 5 Author Share Posted September 5 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 More sharing options...
Love Zhaoying Posted September 5 Share Posted September 5 (edited) 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 September 5 by Love Zhaoying Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 5 Share Posted September 5 (edited) 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 September 5 by Rolig Loon 1 Link to comment Share on other sites More sharing options...
Love Zhaoying Posted September 5 Share Posted September 5 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 More sharing options...
Wulfie Reanimator Posted September 5 Share Posted September 5 (edited) Looks like it's a bug. The combat features were released on 2024-07-22.10048683488. The next sim version (2024-08-13.10378541509) has a fix related to on_damage. Edited September 5 by Wulfie Reanimator 1 Link to comment Share on other sites More sharing options...
Love Zhaoying Posted September 5 Share Posted September 5 4 minutes ago, Wulfie Reanimator said: Looks like it's a bug. The combat features were released on 2024-07-22.10048683488. The next sim version (2024-08-13.10378541509) has a fix related to on_damage. I hope searching release notes is easier than searching Canny / Feedback!! Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted September 5 Share Posted September 5 10 minutes ago, Love Zhaoying said: I hope searching release notes is easier than searching Canny / Feedback!! Those versions are the most recent versions, so they were the first links in the sidebar. 😋 1 Link to comment Share on other sites More sharing options...
Lindens Rider Linden Posted September 9 Lindens Share Posted September 9 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. 1 Link to comment Share on other sites More sharing options...
Love Zhaoying Posted September 9 Share Posted September 9 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now