| Anonymous | Login | Signup for a new account | 2013-05-20 03:14 UTC | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Summary | My Account |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0006145 | opensim | [REGION] Scripting Engine | public | 2012-08-09 16:26 | 2012-08-23 23:24 | ||||
| Reporter | TBG Renfold | ||||||||
| Assigned To | justincc | ||||||||
| Priority | none | Severity | feature | Reproducibility | always | ||||
| Status | resolved | Resolution | fixed | ||||||
| Platform | OS | OS Version | |||||||
| Product Version | master (dev code) | ||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0006145: Patch to add osGetHealth. | ||||||||
| Description | Saw this post on OSGrid: http://forums.osgrid.org/viewtopic.php?f=5&t=4335 [^] And thought.... why not? Could be handy for inworld health meters etc that are scripted. All it is, is a slight adaption of osCreateDamage, without the "damage/teleport" part, returning the health float as an integer. If you looking for something that alerts a script when an avatar has died, this is not it! Your going to have to check for that in other ways. Usage: float health = osGetHealth(avatarKey); | ||||||||
| Steps To Reproduce | N/A | ||||||||
| Additional Information | Example usage: default { touch(integer t) { key agentID = llDetectedKey(0); osCauseDamage(agentID, 50); llSay(0, llKey2Name(agentID) + " has " + (string)osGetHealth(agentID) + "% health left."); } } Returns -1.000000 if the avatar is not found or Safe is switched off in the region. | ||||||||
| Tags | No tags attached. | ||||||||
| Git Revision or version number | 19417fca41e | ||||||||
| Run Mode | Grid (Multiple Regions per Sim) | ||||||||
| Physics Engine | ODE | ||||||||
| Environment | .NET / Windows32 | ||||||||
| Mono Version | Other | ||||||||
| Viewer | Phoenix Viewer 1.6.1 (169 | ||||||||
| Attached Files | |||||||||
Notes |
|
|
(0022008) TBG Renfold (reporter) 2012-08-09 17:13 edited on: 2012-08-09 17:13 |
Made bit of a mess with the patch upload, hopefully all sorted now. |
|
(0022009) SignpostMarv (reporter) 2012-08-09 18:00 |
I would hazard a guess that it should return the health even if damage in enabled- avatar health is tied to the avatar, not per-parcel, so you could speed it up by bypassing the land data check. |
|
(0022010) TBG Renfold (reporter) 2012-08-09 20:05 |
Removed land checking as suggested by SignpostMarv. Now whatever remaining health the avatar has is displayed (float). This will be 100% (100.000000) if no damage has occurred (as what the viewer should really be seeing anyway). Returns -1.000000 if the avatar is not found (as before). |
|
(0022011) SignpostMarv (reporter) 2012-08-10 08:42 |
I'm also curious as to the -1.0 for avatars not found; Could damage-causing functions & objects cause a discovered avatar to have a health less than zero ? |
|
(0022012) TBG Renfold (reporter) 2012-08-10 10:53 |
Well I have tried out dealing the avatar damage more than 100% (in small hits and one big hit over 1000%), I don't seem to be able to get the avatars health below 0.0, as soon as that is hit (or any value that would work out lower) the avatar is tp'd home and health reset to 100%. On the flip side, I have noticed that an avatars health can be pushed further that 100%, not sure if that is by design though. So in theory, -1.0 should be only returned when the avatars scene presence is not found. |
|
(0022427) justincc (administrator) 2012-08-23 23:15 |
Applied as git master 43fabae and a3cbda0, thanks TBG Renfold! |
|
(0022428) justincc (administrator) 2012-08-23 23:24 |
Could you add this to http://opensimulator.org/wiki/Category:OSSL_Functions [^] ? Thanks. |
|
(0022429) justincc (administrator) 2012-08-23 23:24 |
Will need to note that this is in master dev but will not be in 0.7.4 |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-08-09 16:26 | TBG Renfold | New Issue | |
| 2012-08-09 16:26 | TBG Renfold | File Added: 0001-Adds-osGetHealth.patch | |
| 2012-08-09 16:27 | TBG Renfold | File Added: 0001-Changes-osGetHealth-threat-level-from-Nuisance-to-No.patch | |
| 2012-08-09 16:38 | TBG Renfold | Additional Information Updated | View Revisions |
| 2012-08-09 16:39 | TBG Renfold | Additional Information Updated | View Revisions |
| 2012-08-09 16:43 | TBG Renfold | Status | new => patch included |
| 2012-08-09 17:03 | TBG Renfold | Description Updated | View Revisions |
| 2012-08-09 17:04 | TBG Renfold | File Deleted: 0001-Adds-osGetHealth.patch | |
| 2012-08-09 17:04 | TBG Renfold | File Deleted: 0001-Changes-osGetHealth-threat-level-from-Nuisance-to-No.patch | |
| 2012-08-09 17:04 | TBG Renfold | File Added: 0001-Adds-osGetHealth.patch | |
| 2012-08-09 17:13 | TBG Renfold | Note Added: 0022008 | |
| 2012-08-09 17:13 | TBG Renfold | Note Edited: 0022008 | View Revisions |
| 2012-08-09 17:56 | TBG Renfold | Additional Information Updated | View Revisions |
| 2012-08-09 18:00 | SignpostMarv | Note Added: 0022009 | |
| 2012-08-09 20:04 | TBG Renfold | File Added: 0001-Removed-land-checking-as-suggested-by-SignpostMarv.patch | |
| 2012-08-09 20:05 | TBG Renfold | Note Added: 0022010 | |
| 2012-08-10 00:31 | TBG Renfold | File Deleted: 0001-Removed-land-checking-as-suggested-by-SignpostMarv.patch | |
| 2012-08-10 00:31 | TBG Renfold | File Added: 0001-Removed-land-checking-as-suggested-by-SignpostMarv.patch | |
| 2012-08-10 08:42 | SignpostMarv | Note Added: 0022011 | |
| 2012-08-10 10:53 | TBG Renfold | Note Added: 0022012 | |
| 2012-08-18 11:32 | DMX04 | Issue cloned: 0006222 | |
| 2012-08-23 23:15 | justincc | Note Added: 0022427 | |
| 2012-08-23 23:15 | justincc | Status | patch included => resolved |
| 2012-08-23 23:15 | justincc | Resolution | open => fixed |
| 2012-08-23 23:15 | justincc | Assigned To | => justincc |
| 2012-08-23 23:24 | justincc | Note Added: 0022428 | |
| 2012-08-23 23:24 | justincc | Note Added: 0022429 | |
| Copyright © 2000 - 2012 MantisBT Group |