Jump to content

Height and Weight of Avatar


You are about to reply to a thread that has been inactive for 4139 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

There are probably hundreds of scripts like that in SL.  You can either write one yourself with llGetAgentSize and llGetMass or you can visit freebie places around SL.  You can also try Marketplace or the Wanted section of the Commerce forums (http://community.secondlife.com/t5/Wanted/bd-p/Wanted).  If you are looking for someone to write a script for you, the best place to ask is in the Inworld Employment section of the Commerce Forums (http://community.secondlife.com/t5/Inworld-Employment/bd-p/InworldEmployment).  

Link to comment
Share on other sites

/*( v7-D Height Estimator )*/float cFLT_GUESS = 1.09; //-- 1.12 seems better for smaller avs, animations can affect thisvector cCOL_RED  = <1.0, 0.0, 0.0>;string uMeter2Feet( float vFltHgt ){    string vStrRtn;    integer vIntInches = llRound( vFltHgt * 39.3700787 );    if (vIntInches > 11){        vStrRtn += (string)(vIntInches / 12) + "ft. ";    }    vIntInches %= 12;    return vStrRtn + llList2String( ["even", ((string)vIntInches + "in.")], !!vIntInches );}uReset(){    vector vSizPrm = llGetScale();    llSetLinkPrimitiveParams( 3, [PRIM_TEXT, "Stand Here To Get\nYour Avatar Height", cCOL_RED, 1.0,                                  PRIM_SIZE, <vSizPrm.x, vSizPrm.y, 0.17>] );}default{    state_entry(){        uReset();    }        collision_start( integer vIntCld ){        if (llDetectedType( 0 ) & AGENT){            llSetTimerEvent( 0.0 );            vector vSizAgt = llGetAgentSize( llDetectedKey( 0 ) ) * cFLT_GUESS;            vector vSizPrm = llGetScale();            llSetLinkPrimitiveParams( 3, [PRIM_SIZE, <vSizPrm.x, vSizPrm.y, (vSizAgt.z * 2)>,                                          PRIM_TEXT, llDetectedName( 0 ) + "\n" +                                                     (string)((integer)(vSizAgt.z * 100.0)) + "cm\n" +                                                      uMeter2Feet( vSizAgt.z ), cCOL_RED, 1.0] );            llSetTimerEvent( 30.0 );        }    }        timer(){        uReset();    }}

 

 this is the height detector I use... it's only approximate because attachments like hair can make the results a little low, and there is a bug that only report the height to about the eyeball level, compensated by cFltGuess... so I included a part that shows the height detected visually (usually very close to normal and SL sized avatars, but reports upt to ~4inches low for child sized avatars and tinies) which you will be able to see...

construction:

root prim:

  1. box or cylinder
  2. color black + fullbright
  3. z-height 0.05m

second prim: (sits on the root)

  1. same shape/width/length/color as root
  2. z-height: 0.12m
  3. hollow: 95.0
  4. (this compensates for the physics engine causing the avatar to hover over prims they are standing on)

third prim: (sits on top of the second)

  1. same shape/width/length as previous
  2. color: medium grey
  3. transparency: 50
  4. slice: 0.5/1.0
  5. z-height: 0.17m

 

ETA:

I've posted this because there are two non-obvious tricks learned from experience and testing, adding in weight whould be easy to do, and this gives a good example of how to do it (for instance providing a weight conversion function so you can use both Imperial and Metric measures)

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
You are about to reply to a thread that has been inactive for 4139 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...