Jump to content

ghost avatar


Urzul
 Share

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

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

Recommended Posts

high enough velocity force applied will push an avatar through any surface.

i imagine you want a smooth drift-through effect though, not a ramming speed ghost.

with a bit of math & a raycast you might be able to subtly push the avatar through any wall by using a tightly controlled function to apply this large force, yet have normal speed appearance. i would try applying force to push the avatar along its approach vector and almost immediately stop (apply the reverse of your force vector or whatnot to kill velocity) the avatar before a raycast does checks to see if more pushes are required to complete pass through the wall. perhaps this would all be enclosed in a collision function.

initial results will tend to be unpredictable as this is a ballistic approach of brute force, the trick here would be tweaking your levels & timing to quickly & repeatedly balance large opposing forces creating a smooth movement.

just a guess, i've never tried to build such effect with an avatar before.

i welcome others to submit other options, there's likely a much superior method :catlol:

Link to comment
Share on other sites

Try this ...

//Walk Through Walls -- Rolig Loon -- February 2012stop_anim()     // Cancel all current active avatar animations{    integer list_pos = 0;    list Anims2stop = llGetAnimationList(llAvatarOnSitTarget());    integer list_length = (Anims2stop !=[]);    if(list_length > 0)    {        while(list_pos < list_length)        {            llStopAnimation(llList2String(Anims2stop, list_pos));            list_pos++;        }    }}string gWalk;string gStand;float gAvHeight;default{    state_entry()    {        llSetMemoryLimit(0x8000);        llSitTarget(<0.0,0.0,0.1>,ZERO_ROTATION);        gWalk = "CCfWalk02medium";              //Put your own favorite walk anim here        gStand = "*GA* Pretty Girl Stand V3";   //Put your own favorite stand anim here    }        changed(integer change)    {        if (change & CHANGED_LINK)        {            if (llAvatarOnSitTarget())            {                llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TAKE_CONTROLS |PERMISSION_TRIGGER_ANIMATION);            }            else            {                llSetAlpha(1.0,ALL_SIDES);                llSetTimerEvent(0.0);            }        }    }        run_time_permissions(integer perm)    {        if(PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION & perm)        {            llSetAlpha (0.0,ALL_SIDES);            llTakeControls(                            CONTROL_FWD |                            CONTROL_BACK |                            CONTROL_LEFT |                            CONTROL_RIGHT |                            CONTROL_ROT_LEFT |                            CONTROL_ROT_RIGHT |                            CONTROL_UP |                            CONTROL_DOWN |                            0, TRUE, FALSE);            stop_anim();            vector size = llGetAgentSize(llAvatarOnSitTarget());            gAvHeight = size.z;            llSetTimerEvent(1.0);        }    }        timer()  // Adjusts height above whatever is under the av    {        list results = llCastRay(llGetPos(), llGetPos() + <0.0,0.0,-2.5>, [RC_REJECT_TYPES, RC_REJECT_AGENTS|RC_REJECT_PHYSICAL, RC_MAX_HITS, 1] );        vector UnderMe = llList2Vector(results,1);        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_POSITION, <UnderMe.x, UnderMe.y, UnderMe.z + 0.40*gAvHeight>]);    }        control(key id, integer level, integer edge)    {        if(level & (~edge) & CONTROL_FWD)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.05,0.0,0.0>* llGetRot()]);            llStopAnimation(gStand);            llStartAnimation(gWalk);        }        if (level & (~edge) & CONTROL_BACK)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <-0.05,0.0,0.0>*llGetRot()]);            llStopAnimation(gStand);            llStartAnimation(gWalk);        }        if (level & (CONTROL_ROT_LEFT | CONTROL_LEFT))        {            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llEuler2Rot(<0.0,0.0,1.0>*DEG_TO_RAD)*llGetRootRotation()]);        }        if (level & (CONTROL_ROT_RIGHT | CONTROL_RIGHT))        {            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llEuler2Rot(<0.0,0.0,-1.0>*DEG_TO_RAD)*llGetRootRotation()]);        }        if (level & CONTROL_UP)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.0,0.0,0.05>*llGetRot()]);        }        if (level & CONTROL_DOWN)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.0,0.0,-0.05>*llGetRot()]);        }                    else if (~level & edge)        {            llStopAnimation(gWalk);            llStartAnimation(gStand);        }    }}

 If you want to fly, you'll have to make appropriate modifications, but this will let you walk through walls. You may want to add a camera control so that your cam position is always in the righth position behind you as you sit.

EDIT:  Added a llCastRay component in a timer event, so that the object keeps your feet on the ground (or whatever you are on) while you walk.  It helps you look natural if you are walking up stairs or on uneven ground.  Could be a little dicey in a skybox, though.   :smileytongue:

Link to comment
Share on other sites

it work but i want to use it as a hud in a switch on off

so it look like this:

vector color = <1.0, 1.0, 3.0>;default{    state_entry()    {           llSetColor(<0.5, 0.0, 0.0>,ALL_SIDES);//change the face's color     }       touch_start(integer total_number)    {        state off;    }}state off{    state_entry()    {           llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TAKE_CONTROLS |PERMISSION_TRIGGER_ANIMATION);        llSetColor(<0.0, 0.0, 0.5>,ALL_SIDES);//change the face's color    }    run_time_permissions(integer perm)    {        if(PERMISSION_TAKE_CONTROLS|PERMISSION_TRIGGER_ANIMATION & perm)        {            llTakeControls(                            CONTROL_FWD |                            CONTROL_BACK |                            CONTROL_LEFT |                            CONTROL_RIGHT |                            CONTROL_ROT_LEFT |                            CONTROL_ROT_RIGHT |                            CONTROL_UP |                            CONTROL_DOWN |                            0, TRUE, FALSE);        }    }    touch_start(integer total_number)    {        state default ;    }     control(key id, integer level, integer edge)    {        if(level & (~edge) & CONTROL_FWD)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.05,0.0,0.0>* llGetRot()]);              }        if (level & (~edge) & CONTROL_BACK)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <-0.05,0.0,0.0>*llGetRot()]);        }        if (level & (CONTROL_ROT_LEFT | CONTROL_LEFT))        {            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llEuler2Rot(<0.0,0.0,1.0>*DEG_TO_RAD)*llGetRootRotation()]);        }        if (level & (CONTROL_ROT_RIGHT | CONTROL_RIGHT))        {            llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ROTATION,llEuler2Rot(<0.0,0.0,-1.0>*DEG_TO_RAD)*llGetRootRotation()]);        }        if (level & CONTROL_UP)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.0,0.0,0.05>*llGetRot()]);        }        if (level & CONTROL_DOWN)        {            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_POSITION,llGetPos() + <0.0,0.0,-0.05>*llGetRot()]);        }                }}

 

 but it does not work i make a mistake it sayd :Unable to find specified agent to request permissions.

Link to comment
Share on other sites

No, my method works perfectly.  Making it into a HUD is impossible.  :smileywink:

Some of the third party viewers (Firestorm, for example)  have a feature that lets you make your av phantom. As they explain, however, "When the phantom feature is enabled, the actual avatar mesh becomes phantom, but the bounding box does not. This is why phantom avatars cannot move.  ... Avatars in phantom mode will not be able to move by the usual means (e.g. arrow keys). However, double-click teleport can be utilized to move without disabling Phantom."  This is why you can't do exactly what you want to do. 

The method I suggested, though, fakes a way around the problem.  When you sit on an object, your av becomes a link in the object's linkset, and you can move the entire linkset.   That's the way "sit" teleporters work, for example.  My little script senses that you are part of a moveable linkset, and lets you take control of it with your arrow keys.  It also activates your chosen "walk" animation when you move forward or backward, and it stops it when you let up on the arrow keys.  You are not really walking (any more than you are "really" walking at any time in SL), but it gives the appearance that you are.  Because the linkset becomes phantom when you do this, it has the extra side effect of making it possible for you to appear to walk through walls.

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...