|
Vi Shenley
Still Rezzing
Join date: 24 Oct 2006
Posts: 103
|
06-28-2008 02:28
For various LSL solutions, such as teleporter scripts, the avi is required to 'sit' on the prim, which can be accomplished in one click by changing the default action on touch to 'Sit'.
My question is, can the the default sit animation be also changed, so that it appears the avi is standing, or reclining, or any other anim, instead of the standard sit anim?
Vi
|
|
Tabliopa Underwood
Registered User
Join date: 6 Aug 2007
Posts: 719
|
06-28-2008 03:03
Yes. In the changed event. (Off the top of my head) state_entry() { llSitTarget(<0.0,0.0,0.6>, ZERO_ROTATION); } changed(integer change) { if ((change & CHANGED_LINK) && (llAvatarOnSitTarget() != NULL_KEY)) { llStopAnimation("sit"  ; llStartAnimation("stand"  ; // or whatever animation you prefer } }
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-28-2008 03:28
You need to have permissions though!! here is an example that replace "sit" by "stand". the rotation is for a sphere with upright Z axis (if I remember right) key sitter;
default { state_entry() { rotation ty = llEuler2Rot( <0.0,0.0,PI_BY_TWO> ); llSitTarget( <0.0, 0.0, 1.25> * ( ty ), ty ); }
changed(integer change) { if (change & CHANGED_LINK) { // if a link change occurs (sit or unsit) sitter = llAvatarOnSitTarget() ; if(sitter != NULL_KEY) llRequestPermissions(sitter , PERMISSION_TRIGGER_ANIMATION); } }
run_time_permissions(integer perm) { if ( perm & PERMISSION_TRIGGER_ANIMATION ) { llStartAnimation("stand"); llStopAnimation("sit"); llStopAnimation("sit_female"); llStopAnimation("sit_generic"); } } } Happy scripting
_____________________
From Studio Dora
|
|
Tabliopa Underwood
Registered User
Join date: 6 Aug 2007
Posts: 719
|
06-28-2008 03:54
^^ much better =)
|